import type { JsonSymbolDialogAction, JsonSymbolMcdocCustomDynamicEventAdditions, } from 'sandstone/arguments/generated/_json/dispatcher.ts' import type { JsonRegistry } from 'sandstone/arguments/generated/_json/registry.ts' import type { JsonRootNBT } from 'sandstone/arguments/nbt.ts' import type { NamespacedString, NonEmptyString } from 'sandstone' export type JsonClickAction = NonNullable<({ [S in Extract, string>]?: ({ type: S, } & (S extends keyof JsonSymbolDialogAction ? JsonSymbolDialogAction[S] : JsonRootNBT)) }[Extract])> export type JsonDynamicCustomAction = 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 JsonSymbolMcdocCustomDynamicEventAdditions ? JsonSymbolMcdocCustomDynamicEventAdditions[S] : JsonSymbolMcdocCustomDynamicEventAdditions<'%unknown'>), } }[Extract])> export type JsonDynamicRunCommand = { /** * 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, }