Type Alias Shape<D, G, E, _S>
Shape<D, G, E, _S>: { $schema?: Schema<D, ["$schema"]>; initial: IsPlainObject<_S> extends false ? "Error: States must be a plain object." : [keyof _S] extends [never] ? "Error: No states defined." : IsStringLiteral<keyof _S> extends false ? "Error: States have no literal string value." : keyof _S; on?: On<D, ["on"], G>; states: IsPlainObject<_S> extends false ? "Error: States must be a plain object." : [keyof _S] extends [never] ? { [NEVER]?: never; } : IsStringLiteral<keyof _S> extends false ? "Error: State values must be literal strings." : { readonly [V in keyof _S]: V extends ReservedKeyword ? `Error: State value '${V}' is reserved.` : Definition.State<D, ["states", V], G, E> }; } & ("context" extends keyof Get<D, ["$schema"]> ? { context: Context<D>; } : { context?: Context<D>; }) Type Parameters
- D
- G extends string
- E extends string
- _S = Get<D, ["states"]>
Type declaration
Optional
Readonly
$schema?: Schema<D, ["$schema"]>
Readonly
initial: IsPlainObject<_S> extends false
? "Error: States must be a plain object."
: [keyof _S] extends [never]
? "Error: No states defined."
: IsStringLiteral<keyof _S> extends false
? "Error: States have no literal string value."
: keyof _S
Optional
Readonly
on?: On<D, ["on"], G>
Readonly
states: IsPlainObject<_S> extends false
? "Error: States must be a plain object."
: [keyof _S] extends [never]
? {
[NEVER]?: never;
}
: IsStringLiteral<keyof _S> extends false
? "Error: State values must be literal strings."
: {
readonly [V in keyof _S]: V extends ReservedKeyword
? `Error: State value '${V}' is reserved.`
: Definition.State<D, ["states", V], G, E>
}
The type of state machine definition.