@fnlb-project/shared 1.4.0 → 1.4.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/dist/commands/index.d.ts +9 -9
- package/dist/types/index.d.ts +20 -7
- package/package.json +1 -1
package/dist/commands/index.d.ts
CHANGED
|
@@ -8,37 +8,37 @@ declare enum CommandParamType {
|
|
|
8
8
|
RequiredNumericParam = 4,
|
|
9
9
|
OptionalNumericParam = 5
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface ICommandBaseParam {
|
|
12
12
|
id: string;
|
|
13
13
|
type: CommandParamType;
|
|
14
14
|
description?: string;
|
|
15
15
|
examples?: string[];
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface ICommandNormalParam extends ICommandBaseParam {
|
|
18
18
|
type: CommandParamType.RequiredParam | CommandParamType.OptionalParam;
|
|
19
19
|
name: string;
|
|
20
20
|
extended: boolean;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface ICommandSelectParam extends ICommandBaseParam {
|
|
23
23
|
type: CommandParamType.RequiredSelect | CommandParamType.OptionalSelect;
|
|
24
|
-
options:
|
|
24
|
+
options: ICommandSelectParamOptions[];
|
|
25
25
|
}
|
|
26
|
-
export interface
|
|
26
|
+
export interface ICommandSelectParamOptions {
|
|
27
27
|
id: string;
|
|
28
28
|
name: string;
|
|
29
29
|
}
|
|
30
|
-
export interface
|
|
30
|
+
export interface ICommandNumericParam extends ICommandBaseParam {
|
|
31
31
|
type: CommandParamType.RequiredNumericParam | CommandParamType.OptionalNumericParam;
|
|
32
32
|
name: string;
|
|
33
33
|
}
|
|
34
|
-
export type CommandParam =
|
|
34
|
+
export type CommandParam = ICommandNormalParam | ICommandSelectParam | ICommandNumericParam;
|
|
35
35
|
export declare class CommandUsageClient {
|
|
36
36
|
params: CommandParam[];
|
|
37
37
|
constructor(params?: CommandParam[]);
|
|
38
38
|
addParam(id: string, name: string, extended?: boolean, description?: string, examples?: string[]): this;
|
|
39
39
|
addOptionalParam(id: string, name: string, extended?: boolean, description?: string, examples?: string[]): this;
|
|
40
|
-
addSelect(id: string, options:
|
|
41
|
-
addOptionalSelect(id: string, options:
|
|
40
|
+
addSelect(id: string, options: ICommandSelectParamOptions[], description?: string, examples?: string[]): this;
|
|
41
|
+
addOptionalSelect(id: string, options: ICommandSelectParamOptions[], description?: string, examples?: string[]): this;
|
|
42
42
|
addNumericParam(id: string, name: string, description?: string, examples?: string[]): this;
|
|
43
43
|
addNumericOptionalParam(id: string, name: string, description?: string, examples?: string[]): this;
|
|
44
44
|
getUsage(): string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -330,30 +330,43 @@ export interface IDBCategory {
|
|
|
330
330
|
}
|
|
331
331
|
export interface ICategory extends IDBCategory {
|
|
332
332
|
}
|
|
333
|
-
export interface
|
|
333
|
+
export interface ICommandBaseParam {
|
|
334
334
|
id: string;
|
|
335
335
|
type: CommandParamType;
|
|
336
336
|
description?: string;
|
|
337
337
|
examples?: string[];
|
|
338
338
|
}
|
|
339
|
-
export interface
|
|
339
|
+
export interface ICommandNormalParam extends ICommandBaseParam {
|
|
340
340
|
type: CommandParamType.RequiredParam | CommandParamType.OptionalParam;
|
|
341
341
|
name: string;
|
|
342
342
|
extended: boolean;
|
|
343
343
|
}
|
|
344
|
-
export interface
|
|
344
|
+
export interface ICommandSelectParam extends ICommandBaseParam {
|
|
345
345
|
type: CommandParamType.RequiredSelect | CommandParamType.OptionalSelect;
|
|
346
|
-
options:
|
|
346
|
+
options: ICommandSelectParamOptions[];
|
|
347
347
|
}
|
|
348
|
-
export interface
|
|
348
|
+
export interface ICommandSelectParamOptions {
|
|
349
349
|
id: string;
|
|
350
350
|
name: string;
|
|
351
351
|
}
|
|
352
|
-
export interface
|
|
352
|
+
export interface ICommandNumericParam extends ICommandBaseParam {
|
|
353
353
|
type: CommandParamType.RequiredNumericParam | CommandParamType.OptionalNumericParam;
|
|
354
354
|
name: string;
|
|
355
355
|
}
|
|
356
|
-
export type CommandParam =
|
|
356
|
+
export type CommandParam = ICommandNormalParam | ICommandSelectParam | ICommandNumericParam;
|
|
357
|
+
export interface ISerializedCommand {
|
|
358
|
+
id: string;
|
|
359
|
+
config: {
|
|
360
|
+
name: string;
|
|
361
|
+
alias: string[];
|
|
362
|
+
usage: CommandParam[];
|
|
363
|
+
isHidden?: boolean;
|
|
364
|
+
description: string;
|
|
365
|
+
onlyLeader?: boolean;
|
|
366
|
+
onlyPrivate?: boolean;
|
|
367
|
+
onlyPartyMembers?: boolean;
|
|
368
|
+
};
|
|
369
|
+
}
|
|
357
370
|
export interface IBaseError {
|
|
358
371
|
message: string;
|
|
359
372
|
errorCode: ErrorCodes;
|