@wq2/brigadier-ts 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/Command.d.ts +2 -2
- package/dist/CommandDispatcher.d.ts +1 -1
- package/dist/CommandDispatcher.js +231 -357
- package/dist/ParseResults.d.ts +1 -1
- package/dist/ParseResults.js +9 -10
- package/dist/StringReader.d.ts +1 -1
- package/dist/StringReader.js +75 -77
- package/dist/arguments/ArgumentType.d.ts +1 -1
- package/dist/arguments/ArgumentType.js +9 -8
- package/dist/arguments/BoolArgumentType.d.ts +5 -1
- package/dist/arguments/BoolArgumentType.js +9 -27
- package/dist/arguments/FloatArgumentType.d.ts +1 -1
- package/dist/arguments/FloatArgumentType.js +11 -30
- package/dist/arguments/IntegerArgumentType.d.ts +1 -1
- package/dist/arguments/IntegerArgumentType.js +11 -30
- package/dist/arguments/LongArgumentType.d.ts +3 -3
- package/dist/arguments/LongArgumentType.js +13 -32
- package/dist/arguments/NumberArgumentType.d.ts +2 -2
- package/dist/arguments/NumberArgumentType.js +15 -33
- package/dist/arguments/StringArgumentType.d.ts +1 -1
- package/dist/arguments/StringArgumentType.js +11 -29
- package/dist/builder/ArgumentBuilder.d.ts +1 -1
- package/dist/builder/ArgumentBuilder.js +31 -71
- package/dist/builder/LiteralArgumentBuilder.js +14 -33
- package/dist/builder/RequiredArgumentBuilder.d.ts +1 -1
- package/dist/builder/RequiredArgumentBuilder.js +18 -37
- package/dist/context/CommandContext.d.ts +1 -1
- package/dist/context/CommandContext.js +31 -32
- package/dist/context/CommandContextBuilder.d.ts +1 -1
- package/dist/context/CommandContextBuilder.js +47 -50
- package/dist/context/ParsedArgument.js +8 -9
- package/dist/context/ParsedCommandNode.d.ts +1 -1
- package/dist/context/ParsedCommandNode.js +7 -8
- package/dist/context/StringRange.js +17 -18
- package/dist/context/SuggestionContext.d.ts +1 -1
- package/dist/context/SuggestionContext.js +3 -4
- package/dist/exceptions/CommandErrorType.d.ts +3 -3
- package/dist/exceptions/CommandErrorType.js +10 -19
- package/dist/exceptions/CommandSyntaxError.js +36 -54
- package/dist/suggestion/Suggestion.d.ts +1 -1
- package/dist/suggestion/Suggestion.js +16 -17
- package/dist/suggestion/Suggestions.d.ts +1 -1
- package/dist/suggestion/Suggestions.js +28 -30
- package/dist/suggestion/SuggestionsBuilder.d.ts +1 -1
- package/dist/suggestion/SuggestionsBuilder.js +22 -23
- package/dist/tree/ArgumentCommandNode.d.ts +1 -1
- package/dist/tree/ArgumentCommandNode.js +22 -40
- package/dist/tree/CommandNode.d.ts +1 -1
- package/dist/tree/CommandNode.js +28 -29
- package/dist/tree/LiteralCommandNode.d.ts +1 -1
- package/dist/tree/LiteralCommandNode.js +28 -41
- package/dist/tree/RootCommandNode.d.ts +1 -1
- package/dist/tree/RootCommandNode.js +17 -69
- package/jest.config.js +5 -5
- package/package.json +32 -32
- package/src/Command.ts +2 -2
- package/src/CommandDispatcher.ts +397 -295
- package/src/ParseResults.ts +26 -22
- package/src/StringReader.ts +212 -193
- package/src/arguments/ArgumentType.ts +13 -8
- package/src/arguments/BoolArgumentType.ts +22 -21
- package/src/arguments/FloatArgumentType.ts +13 -14
- package/src/arguments/IntegerArgumentType.ts +13 -14
- package/src/arguments/LongArgumentType.ts +16 -17
- package/src/arguments/NumberArgumentType.ts +48 -38
- package/src/arguments/StringArgumentType.ts +26 -26
- package/src/builder/ArgumentBuilder.ts +80 -75
- package/src/builder/LiteralArgumentBuilder.ts +31 -21
- package/src/builder/RequiredArgumentBuilder.ts +42 -32
- package/src/context/CommandContext.ts +99 -76
- package/src/context/CommandContextBuilder.ts +169 -143
- package/src/context/ParsedArgument.ts +13 -13
- package/src/context/ParsedCommandNode.ts +14 -14
- package/src/context/StringRange.ts +26 -26
- package/src/context/SuggestionContext.ts +7 -7
- package/src/exceptions/CommandErrorType.ts +20 -13
- package/src/exceptions/CommandSyntaxError.ts +78 -37
- package/src/index.ts +30 -30
- package/src/suggestion/Suggestion.ts +46 -46
- package/src/suggestion/Suggestions.ts +59 -57
- package/src/suggestion/SuggestionsBuilder.ts +59 -57
- package/src/tree/ArgumentCommandNode.ts +51 -40
- package/src/tree/CommandNode.ts +96 -87
- package/src/tree/LiteralCommandNode.ts +78 -57
- package/src/tree/RootCommandNode.ts +33 -23
- package/test/Arguments.test.ts +47 -33
- package/test/CommandDispatcher.test.ts +18 -22
- package/test/StringReader.test.ts +47 -47
- package/tsconfig.json +9 -14
package/src/index.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
export * from "./Command"
|
|
2
|
-
export * from "./Predicate"
|
|
3
|
-
export * from "./context/StringRange"
|
|
4
|
-
export * from "./exceptions/CommandErrorType"
|
|
5
|
-
export * from "./exceptions/CommandSyntaxError"
|
|
6
|
-
export * from "./StringReader"
|
|
7
|
-
export * from "./suggestion/Suggestion"
|
|
8
|
-
export * from "./suggestion/Suggestions"
|
|
9
|
-
export * from "./suggestion/SuggestionsBuilder"
|
|
10
|
-
export * from "./tree/CommandNode"
|
|
11
|
-
export * from "./tree/LiteralCommandNode"
|
|
12
|
-
export * from "./tree/ArgumentCommandNode"
|
|
13
|
-
export * from "./tree/RootCommandNode"
|
|
14
|
-
export * from "./arguments/ArgumentType"
|
|
15
|
-
export * from "./arguments/NumberArgumentType"
|
|
16
|
-
export * from "./arguments/FloatArgumentType"
|
|
17
|
-
export * from "./arguments/IntegerArgumentType"
|
|
18
|
-
export * from "./arguments/LongArgumentType"
|
|
19
|
-
export * from "./arguments/BoolArgumentType"
|
|
20
|
-
export * from "./arguments/StringArgumentType"
|
|
21
|
-
export * from "./builder/ArgumentBuilder"
|
|
22
|
-
export * from "./builder/LiteralArgumentBuilder"
|
|
23
|
-
export * from "./builder/RequiredArgumentBuilder"
|
|
24
|
-
export * from "./context/ParsedArgument"
|
|
25
|
-
export * from "./context/ParsedCommandNode"
|
|
26
|
-
export * from "./context/CommandContext"
|
|
27
|
-
export * from "./context/CommandContextBuilder"
|
|
28
|
-
export * from "./context/SuggestionContext"
|
|
29
|
-
export * from "./ParseResults"
|
|
30
|
-
export * from "./CommandDispatcher"
|
|
1
|
+
export * from "./Command";
|
|
2
|
+
export * from "./Predicate";
|
|
3
|
+
export * from "./context/StringRange";
|
|
4
|
+
export * from "./exceptions/CommandErrorType";
|
|
5
|
+
export * from "./exceptions/CommandSyntaxError";
|
|
6
|
+
export * from "./StringReader";
|
|
7
|
+
export * from "./suggestion/Suggestion";
|
|
8
|
+
export * from "./suggestion/Suggestions";
|
|
9
|
+
export * from "./suggestion/SuggestionsBuilder";
|
|
10
|
+
export * from "./tree/CommandNode";
|
|
11
|
+
export * from "./tree/LiteralCommandNode";
|
|
12
|
+
export * from "./tree/ArgumentCommandNode";
|
|
13
|
+
export * from "./tree/RootCommandNode";
|
|
14
|
+
export * from "./arguments/ArgumentType";
|
|
15
|
+
export * from "./arguments/NumberArgumentType";
|
|
16
|
+
export * from "./arguments/FloatArgumentType";
|
|
17
|
+
export * from "./arguments/IntegerArgumentType";
|
|
18
|
+
export * from "./arguments/LongArgumentType";
|
|
19
|
+
export * from "./arguments/BoolArgumentType";
|
|
20
|
+
export * from "./arguments/StringArgumentType";
|
|
21
|
+
export * from "./builder/ArgumentBuilder";
|
|
22
|
+
export * from "./builder/LiteralArgumentBuilder";
|
|
23
|
+
export * from "./builder/RequiredArgumentBuilder";
|
|
24
|
+
export * from "./context/ParsedArgument";
|
|
25
|
+
export * from "./context/ParsedCommandNode";
|
|
26
|
+
export * from "./context/CommandContext";
|
|
27
|
+
export * from "./context/CommandContextBuilder";
|
|
28
|
+
export * from "./context/SuggestionContext";
|
|
29
|
+
export * from "./ParseResults";
|
|
30
|
+
export * from "./CommandDispatcher";
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { StringRange } from "..";
|
|
1
|
+
import type { StringRange } from "..";
|
|
2
2
|
|
|
3
3
|
export class Suggestion {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
private range: StringRange;
|
|
5
|
+
private text: string;
|
|
6
|
+
private tooltip: string;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
constructor(range: StringRange, text: string, tooltip?: string) {
|
|
9
|
+
this.range = range;
|
|
10
|
+
this.text = text;
|
|
11
|
+
this.tooltip = tooltip;
|
|
12
|
+
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
getRange() {
|
|
15
|
+
return this.range;
|
|
16
|
+
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
getText() {
|
|
19
|
+
return this.text;
|
|
20
|
+
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
getTooltip() {
|
|
23
|
+
return this.tooltip;
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
apply(input: string): string {
|
|
27
|
+
if (this.range.getStart() === 0 && this.range.getEnd() === input.length) {
|
|
28
|
+
return this.text;
|
|
29
|
+
}
|
|
30
|
+
let result = "";
|
|
31
|
+
if (this.range.getStart() > 0) {
|
|
32
|
+
result += input.substring(0, this.range.getStart());
|
|
33
|
+
}
|
|
34
|
+
result += this.text;
|
|
35
|
+
if (this.range.getEnd() < input.length) {
|
|
36
|
+
result += input.substring(this.range.getEnd());
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
expand(command: string, range: StringRange): Suggestion {
|
|
42
|
+
if (range === this.range) {
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
let result = "";
|
|
46
|
+
if (range.getStart() < this.range.getStart()) {
|
|
47
|
+
result += command.substring(range.getStart(), this.range.getStart());
|
|
48
|
+
}
|
|
49
|
+
result += this.text;
|
|
50
|
+
if (range.getEnd() > this.range.getEnd()) {
|
|
51
|
+
result += command.substring(this.range.getEnd(), range.getEnd());
|
|
52
|
+
}
|
|
53
|
+
return new Suggestion(range, result, this.tooltip);
|
|
54
|
+
}
|
|
55
55
|
}
|
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
import { StringRange, Suggestion } from "..";
|
|
1
|
+
import { StringRange, type Suggestion } from "..";
|
|
2
2
|
|
|
3
3
|
export class Suggestions {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
4
|
+
static EMPTY = new Suggestions(StringRange.at(0), []);
|
|
5
|
+
|
|
6
|
+
private range: StringRange;
|
|
7
|
+
private suggestions: Suggestion[];
|
|
8
|
+
|
|
9
|
+
constructor(range: StringRange, suggestions: Suggestion[]) {
|
|
10
|
+
this.range = range;
|
|
11
|
+
this.suggestions = suggestions;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getRange(): StringRange {
|
|
15
|
+
return this.range;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
getList(): Suggestion[] {
|
|
19
|
+
return this.suggestions;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
isEmpty(): boolean {
|
|
23
|
+
return this.suggestions.length === 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static empty(): Promise<Suggestions> {
|
|
27
|
+
return Promise.resolve(Suggestions.EMPTY);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static merge(command: string, input: Suggestions[]): Suggestions {
|
|
31
|
+
if (input.length === 0) {
|
|
32
|
+
return Suggestions.EMPTY;
|
|
33
|
+
} else if (input.length === 1) {
|
|
34
|
+
return input[0];
|
|
35
|
+
}
|
|
36
|
+
const texts = new Set<Suggestion>();
|
|
37
|
+
for (const suggestions of input) {
|
|
38
|
+
suggestions.getList().forEach((s) => {
|
|
39
|
+
texts.add(s);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return Suggestions.create(command, Array.from(texts));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static create(command: string, suggestions: Suggestion[]): Suggestions {
|
|
46
|
+
if (suggestions.length === 0) {
|
|
47
|
+
return Suggestions.EMPTY;
|
|
48
|
+
}
|
|
49
|
+
let start = Infinity;
|
|
50
|
+
let end = -Infinity;
|
|
51
|
+
for (const suggestion of suggestions) {
|
|
52
|
+
start = Math.min(suggestion.getRange().getStart(), start);
|
|
53
|
+
end = Math.max(suggestion.getRange().getEnd(), end);
|
|
54
|
+
}
|
|
55
|
+
const range = new StringRange(start, end);
|
|
56
|
+
const texts = [];
|
|
57
|
+
for (const suggestion of suggestions) {
|
|
58
|
+
texts.push(suggestion.expand(command, range));
|
|
59
|
+
}
|
|
60
|
+
return new Suggestions(range, texts.sort());
|
|
61
|
+
}
|
|
60
62
|
}
|
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Suggestion,
|
|
3
|
-
Suggestions,
|
|
4
|
-
StringRange
|
|
5
|
-
} from "..";
|
|
1
|
+
import { Suggestion, Suggestions, StringRange } from "..";
|
|
6
2
|
|
|
7
3
|
export class SuggestionsBuilder {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
4
|
+
private input: string;
|
|
5
|
+
private start: number;
|
|
6
|
+
private remaining: string;
|
|
7
|
+
private result: Suggestion[];
|
|
8
|
+
|
|
9
|
+
constructor(input: string, start: number) {
|
|
10
|
+
this.input = input;
|
|
11
|
+
this.start = start;
|
|
12
|
+
this.remaining = input.substring(start);
|
|
13
|
+
this.result = [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
getInput(): string {
|
|
17
|
+
return this.input;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
getStart(): number {
|
|
21
|
+
return this.start;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getRemaining(): string {
|
|
25
|
+
return this.remaining;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
build(): Suggestions {
|
|
29
|
+
return Suggestions.create(this.input, this.result);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
buildPromise(): Promise<Suggestions> {
|
|
33
|
+
return Promise.resolve(this.build());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
suggest(text: string, tooltip?: string): SuggestionsBuilder {
|
|
37
|
+
if (text === this.remaining) {
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
this.result.push(
|
|
41
|
+
new Suggestion(
|
|
42
|
+
new StringRange(this.start, this.input.length),
|
|
43
|
+
text,
|
|
44
|
+
tooltip,
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
add(other: SuggestionsBuilder): SuggestionsBuilder {
|
|
51
|
+
this.result.concat(other.result);
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
createOffset(start: number): SuggestionsBuilder {
|
|
56
|
+
return new SuggestionsBuilder(this.input, start);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
restart(): SuggestionsBuilder {
|
|
60
|
+
return new SuggestionsBuilder(this.input, this.start);
|
|
61
|
+
}
|
|
60
62
|
}
|
|
@@ -1,48 +1,59 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from
|
|
2
|
+
type ArgumentType,
|
|
3
|
+
CommandNode,
|
|
4
|
+
type StringReader,
|
|
5
|
+
type Command,
|
|
6
|
+
type CommandContext,
|
|
7
|
+
type CommandContextBuilder,
|
|
8
|
+
type Predicate,
|
|
9
|
+
type RedirectModifier,
|
|
10
|
+
ParsedArgument,
|
|
11
|
+
type Suggestions,
|
|
12
|
+
type SuggestionsBuilder,
|
|
13
|
+
} from "..";
|
|
14
14
|
|
|
15
15
|
export class ArgumentCommandNode<S, T> extends CommandNode<S> {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
name: string;
|
|
17
|
+
type: ArgumentType<T>;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
constructor(
|
|
20
|
+
name: string,
|
|
21
|
+
type: ArgumentType<T>,
|
|
22
|
+
command: Command<S>,
|
|
23
|
+
requirement: Predicate<S>,
|
|
24
|
+
redirect: CommandNode<S>,
|
|
25
|
+
modifier: RedirectModifier<S>,
|
|
26
|
+
forks: boolean,
|
|
27
|
+
) {
|
|
28
|
+
super(command, requirement, redirect, modifier, forks);
|
|
29
|
+
this.name = name;
|
|
30
|
+
this.type = type;
|
|
31
|
+
}
|
|
24
32
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
getType(): ArgumentType<T> {
|
|
34
|
+
return this.type;
|
|
35
|
+
}
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
getName(): string {
|
|
38
|
-
return this.name;
|
|
39
|
-
}
|
|
37
|
+
parse(reader: StringReader, contextBuilder: CommandContextBuilder<S>): void {
|
|
38
|
+
const start = reader.getCursor();
|
|
39
|
+
const result = this.type.parse(reader);
|
|
40
|
+
const parsed = new ParsedArgument<T>(start, reader.getCursor(), result);
|
|
41
|
+
contextBuilder.withArgument(this.name, parsed);
|
|
42
|
+
contextBuilder.withNode(this, parsed.getRange());
|
|
43
|
+
}
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
getName(): string {
|
|
46
|
+
return this.name;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
getUsageText(): string {
|
|
50
|
+
return `<${this.name}>`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
listSuggestions(
|
|
54
|
+
context: CommandContext<S>,
|
|
55
|
+
builder: SuggestionsBuilder,
|
|
56
|
+
): Promise<Suggestions> {
|
|
57
|
+
return this.type.listSuggestions(context, builder);
|
|
58
|
+
}
|
|
48
59
|
}
|