import type { SymbolDialogAction, SymbolMcdocCustomDynamicEventAdditions, } from 'sandstone/arguments/generated/dispatcher.ts' import type { Registry } from 'sandstone/arguments/generated/registry.ts' import type { RootNBT } from 'sandstone/arguments/nbt.ts' import type { NamespacedString, NonEmptyString } from 'sandstone' export type ClickAction = NonNullable<({ [S in Extract, string>]?: ({ type: S, } & (S extends keyof SymbolDialogAction ? SymbolDialogAction[S] : RootNBT)) }[Extract])> export type DynamicCustomAction = NonNullable<({ [S in Extract, string>]?: { /** * ID of a custom action. * Has no functionality on vanilla servers. */ id: S, /** * Static fields added in addition to the fields generated by input. */ additions?: (S extends keyof SymbolMcdocCustomDynamicEventAdditions ? SymbolMcdocCustomDynamicEventAdditions[S] : SymbolMcdocCustomDynamicEventAdditions<'%unknown'>), } }[Extract])> export type DynamicRunCommand = { /** * A macro template to be interpred as a command. * Special characters (including both `'` and `"`) from text input will be escaped to fit in SNBT literal. */ template: NonEmptyString, }