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
- type SubCommands<A> = A extends DeepReadonly<{
76
- type: Discord.ApplicationCommandOptionType.SUB_COMMAND;
77
- options?: Discord.ApplicationCommandOption[];
78
- }> ? A : A extends DeepReadonly<{
79
- options: Discord.ApplicationCommandOption[];
80
- }> ? SubCommands<A["options"][number]> : never;
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 DeepReadonly<{
120
- options: Discord.ApplicationCommandOption[];
121
- }> ? Extract<A["options"][number], Option<A["options"][number]> & T> : never;
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.2",
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": "4250ee61326a05b5636ccc3f8ae3b8291dcc1033"
45
+ "gitHead": "f460601adea7e99020e181a54a86ead162a06705"
46
46
  }