dfx 0.21.2 → 0.21.3
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.
|
@@ -72,12 +72,17 @@ export interface CommandHelper<A> {
|
|
|
72
72
|
] ? E : never, Discord.InteractionResponse>;
|
|
73
73
|
}
|
|
74
74
|
type CommandHandlerFn<R, E, A> = (i: CommandHelper<A>) => Effect.Effect<R, E, Discord.InteractionResponse>;
|
|
75
|
-
|
|
76
|
-
type:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
interface CommandOption {
|
|
76
|
+
readonly type: any;
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly options?: ReadonlyArray<CommandOption>;
|
|
79
|
+
}
|
|
80
|
+
type SubCommands<A> = A extends {
|
|
81
|
+
readonly type: Discord.ApplicationCommandOptionType.SUB_COMMAND;
|
|
82
|
+
readonly options?: ReadonlyArray<CommandOption>;
|
|
83
|
+
} ? A : A extends {
|
|
84
|
+
readonly options: ReadonlyArray<CommandOption>;
|
|
85
|
+
} ? SubCommands<A["options"][number]> : never;
|
|
81
86
|
type SubCommandNames<A> = Option<SubCommands<A>>["name"];
|
|
82
87
|
type CommandOptionType = Exclude<Discord.ApplicationCommandOptionType, Discord.ApplicationCommandOptionType.SUB_COMMAND | Discord.ApplicationCommandOptionType.SUB_COMMAND_GROUP>;
|
|
83
88
|
type CommandOptions<A> = OptionsWithLiteral<A, {
|
|
@@ -116,7 +121,7 @@ type StringLiteral<T> = T extends string ? string extends T ? never : T : never;
|
|
|
116
121
|
type Option<A> = A extends {
|
|
117
122
|
readonly name: infer N;
|
|
118
123
|
} ? N extends StringLiteral<N> ? A : never : never;
|
|
119
|
-
type OptionsWithLiteral<A, T> = A extends
|
|
120
|
-
options:
|
|
121
|
-
}
|
|
124
|
+
type OptionsWithLiteral<A, T> = A extends {
|
|
125
|
+
readonly options: ReadonlyArray<CommandOption>;
|
|
126
|
+
} ? Extract<A["options"][number], Option<A["options"][number]> & T> : never;
|
|
122
127
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"ws": "^8.11.0"
|
|
43
43
|
},
|
|
44
44
|
"sideEffects": false,
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "f460601adea7e99020e181a54a86ead162a06705"
|
|
46
46
|
}
|