@player-ui/types 0.15.0 → 0.15.1--canary.802.31569

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/types/src/index.ts"],"sourcesContent":["/**\n * An asset is the smallest unit of user interaction in a player view\n */\nexport interface Asset<T extends string = string> {\n /** Each asset requires a unique id per view */\n id: string;\n\n /** The asset type determines the semantics of how a user interacts with a page */\n type: T;\n\n [key: string]: unknown;\n}\n/**\n * An asset that contains a Binding.\n */\nexport interface AssetBinding extends Asset {\n /** A binding that points to somewhere in the data model */\n binding: Binding;\n}\n\n/** A single case statement to use in a switch */\nexport interface SwitchCase<T extends Asset = Asset> {\n /** The Asset to use if this case is applicable */\n asset: T;\n\n /** An expression to execute to determine if this case applies */\n case: Expression | true;\n}\n\n/** A switch can replace an asset with the applicable case on first render */\nexport type Switch<T extends Asset = Asset> = SwitchCase<T>[];\n\n/** An object that contains an asset */\nexport type AssetWrapper<T extends Asset = Asset> = {\n /** An asset instance */\n asset: T;\n\n [key: string]: unknown;\n};\n\nexport type AssetWrapperOrSwitch<T extends Asset = Asset> =\n | (AssetWrapper<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n dynamicSwitch?: never;\n\n /** The staticSwitch property can't exist at the same time as 'asset' */\n staticSwitch?: never;\n })\n | (StaticSwitch<T> & {\n /** The staticSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The staticSwitch property can't exist at the same time as 'dynamicSwitch' */\n dynamicSwitch?: never;\n })\n | (DynamicSwitch<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The dynamicSwitch property can't exist at the same time as 'staticSwitch' */\n staticSwitch?: never;\n });\n\nexport type AssetSwitch<T extends Asset = Asset> =\n | StaticSwitch<T>\n | DynamicSwitch<T>;\n\nexport interface StaticSwitch<T extends Asset = Asset> {\n /** A static switch only evaluates the applicable base on first render of the view */\n staticSwitch: Switch<T>;\n}\n\nexport interface DynamicSwitch<T extends Asset = Asset> {\n /** A dynamic switch re-evaluates the applicable case as data changes */\n dynamicSwitch: Switch<T>;\n}\n\n/**\n * Expressions are a specialized way of executing code.\n * If the expression is a composite, the last expression executed is the return value\n */\nexport type Expression = string | string[];\nexport type ExpressionRef = `@[${string}]@`;\n\n/**\n * Bindings describe locations in the data model.\n */\nexport type Binding = string;\nexport type BindingRef = `{{${Binding}}}`;\n\n/**\n * The data-model is the location that all user data is stored\n */\nexport type DataModel = Record<any, unknown>;\n\n/** The navigation section of the flow describes a State Machine for the user. */\nexport type Navigation = {\n /** The name of the Flow to begin on */\n BEGIN: string;\n} & Record<string, string | NavigationFlow>;\n\n/** An object with an expression in it */\nexport interface ExpressionObject {\n /** The expression to run */\n exp?: Expression;\n}\n\n/** A state machine in the navigation */\nexport interface NavigationFlow {\n /** The first state to kick off the state machine */\n startState: string;\n\n /** An optional expression to run when this Flow starts */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run when this Flow ends */\n onEnd?: Expression | ExpressionObject;\n\n [key: string]:\n | undefined\n | string\n | Expression\n | ExpressionObject\n | NavigationFlowState;\n}\n\nexport type NavigationFlowTransition = Record<string, string>;\n\ninterface CommentBase {\n /** Add comments that will not be processing, but are useful for code explanation */\n _comment?: string;\n}\n\n/** The base representation of a state within a Flow */\nexport interface NavigationBaseState<T extends string> extends CommentBase {\n /** A property to determine the type of state this is */\n state_type: T;\n\n /** An optional expression to run when this view renders */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run before view transition */\n onEnd?: Expression | ExpressionObject;\n\n /**\n * TS gets really confused with both the ActionState and the onStart state both declaring the `exp` property\n * So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'\n */\n exp?: T extends \"ACTION\" | \"ASYNC_ACTION\" ? Expression : never;\n}\n\n/** A generic state that can transition to another state */\nexport interface NavigationFlowTransitionableState<T extends string>\n extends NavigationBaseState<T> {\n /** A mapping of transition-name to FlowState name */\n transitions: NavigationFlowTransition;\n}\n\n/** A state representing a view */\nexport interface NavigationFlowViewState\n extends NavigationFlowTransitionableState<\"VIEW\"> {\n /** An id corresponding to a view from the 'views' array */\n ref: string;\n\n /** View meta-properties */\n attributes?: {\n [key: string]: any;\n };\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/**\n * An END state of the flow.\n */\nexport interface NavigationFlowEndState extends NavigationBaseState<\"END\"> {\n /**\n * A description of _how_ the flow ended.\n * If this is a flow started from another flow, the outcome determines the flow transition\n */\n outcome: string;\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowActionState\n extends NavigationFlowTransitionableState<\"ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowAsyncActionState\n extends NavigationFlowTransitionableState<\"ASYNC_ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n\n /** Whether the expression(s) should be awaited before transitioning */\n await: boolean;\n}\n\n/**\n * External Flow states represent states in the FSM that can't be resolved internally in Player.\n * The flow will wait for the embedded application to manage moving to the next state via a transition\n */\nexport interface NavigationFlowExternalState\n extends NavigationFlowTransitionableState<\"EXTERNAL\"> {\n /** A reference for this external state */\n ref: string;\n /** Any additional properties are forwarded as options */\n [key: string]: unknown;\n}\n\nexport interface NavigationFlowFlowState\n extends NavigationFlowTransitionableState<\"FLOW\"> {\n /** A reference to a FLOW id state to run */\n ref: string;\n}\n\nexport type NavigationFlowState =\n | NavigationFlowViewState\n | NavigationFlowEndState\n | NavigationFlowFlowState\n | NavigationFlowActionState\n | NavigationFlowAsyncActionState\n | NavigationFlowExternalState;\n\n/** The data at the end of a flow */\nexport interface FlowResult {\n /** The outcome describes _how_ the flow ended (forwards, backwards, etc) */\n endState: NavigationFlowEndState;\n\n /** The serialized data-model */\n data?: any;\n}\n\n/** Any object that contains 1 or more templates */\nexport interface Templatable {\n /** A list of templates to process for this node */\n template?: Template[];\n}\n\n/** A template describes a mapping from a data array -> array of objects */\nexport interface Template<ValueType = unknown, Key extends string = string> {\n /** A pointer to the data-model containing an array of elements to map over */\n data: Binding;\n\n /**\n * The template to iterate over using each value in the supplied template data.\n * Any reference to _index_ is replaced with the current iteration index.\n */\n value: ValueType;\n\n /** should the template be recomputed when data changes */\n dynamic?: boolean;\n\n /**\n * A property on the parent object to store the new map under.\n * If it already exists, values are appended to the end.\n */\n output: Key;\n\n /** Specifies the template placement in relation to existing elements*/\n placement?: \"prepend\" | \"append\";\n}\n\n/**\n * The Schema organizes all content related to Data and it's types\n */\nexport declare namespace Schema {\n /** The authored schema object in the JSON payload */\n export interface Schema {\n /** The ROOT object is the top level object to use */\n ROOT: Node;\n\n /** Any additional keys are properties of the ROOT object */\n [key: string]: Node;\n }\n\n /** A Node describes a specific object in the tree */\n export interface Node {\n /** Each property describes a property of the object */\n [key: string]: DataTypes;\n }\n\n export type DataTypes = DataType | RecordType | ArrayType;\n\n /** Each prop in the object can have a specific DataType */\n export interface DataType<T = unknown> {\n /** The reference of the base type to use */\n type: string;\n\n /**\n * Any additional validations that are associated with this property\n * These will add to any base validations associated with the \"type\"\n */\n validation?: Validation.Reference[];\n\n /**\n * A reference to a specific data format to use.\n * If none is specified, will fallback to that of the base type\n */\n format?: Formatting.Reference;\n\n /**\n * A default value for this property.\n * Any reads for this property will result in this default value being written to the model.\n */\n default?: T;\n\n /** Any additional options */\n [key: string]: unknown;\n }\n /** Determines if the Datatype is a record object */\n export interface RecordType extends DataType {\n /** boolean to define if its a record */\n isRecord: boolean;\n\n /** This property is mutually exclusive with RecordType and can not be used with ArrayType */\n isArray?: never;\n }\n\n /** Determines if the DataType is an Array Object */\n export interface ArrayType extends DataType {\n /** boolean to define if its an array */\n isArray: boolean;\n\n /** This property is mutually exclusive with ArrayType and can not be used with RecordType */\n isRecord?: never;\n }\n}\n\n/** Namespace to wrap up core functionality to be used by the Language Service */\nexport declare namespace Language {\n /**\n * Helper to compliment `Schema.DataType` to provide a way to export a reference to a data type instead of the whole object\n */\n export interface DataTypeRef {\n /** Name of the type in Player Core */\n type: string;\n }\n}\n\n/** A spot for formatting */\nexport declare namespace Formatting {\n /** A reference to a specific formatter */\n export interface Reference {\n /** The name of the formatter (and de-formatter) to use */\n type: string;\n\n /** Any additional properties will be passed as options to the formatter function */\n [key: string]: unknown;\n }\n}\n\n/** A space for all thing validation */\nexport declare namespace Validation {\n /**\n * How serious are you about this error?\n * Warning validations are reserved for errors that could be ignored by the user without consequence\n * Errors must be fixed before proceeding\n */\n export type Severity = \"error\" | \"warning\";\n\n /**\n * When to _first_ start caring about a validation of a data-val.\n *\n * load - only check once the first time the binding appears on screen\n * change - check anytime the data changes\n * navigation - check once the user attempts to navigate away from a view\n */\n export type Trigger = \"navigation\" | \"change\" | \"load\";\n\n /**\n * Where the error/warning should be displayed.\n * - `field` is the default display target. This renders the error/warning directly underneath the field.\n * - `section` is used to display a message at a parent node that is designated as a \"section\"\n * - `page` a special section used to display a message at the top of the page.\n */\n export type DisplayTarget = \"page\" | \"section\" | \"field\";\n\n /** A reference to a validation object */\n export interface Reference {\n /**\n * The name of the referenced validation type\n * This will be used to lookup the proper handler\n */\n type: string;\n\n /** An optional means of overriding the default message if the validation is triggered */\n message?: string;\n\n /** An optional means of overriding the default severity of the validation if triggered */\n severity?: Severity;\n\n /** When to run this particular validation */\n trigger?: Trigger;\n\n /**\n * Each validation is passed the value of the data to run it's validation against.\n * By default, this is the value stored in the data-model (deformatted).\n * In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option\n */\n dataTarget?: \"formatted\" | \"deformatted\";\n\n /** Where the error should be displayed */\n displayTarget?: DisplayTarget;\n\n /**\n * If the validation blocks navigation\n * true/false - always/never block navigation\n * once - only block navigation if the validation has not been triggered before\n *\n * @default - true for errors, 'once' for warnings\n */\n blocking?: boolean | \"once\";\n\n /** Additional props to send down to a Validator */\n [key: string]: unknown;\n }\n\n export interface CrossfieldReference extends Reference {\n /** The binding to associate this validation with */\n ref?: Binding;\n\n /** Cross-field references and validation must run against the default (deformatted) value */\n dataTarget?: never;\n }\n}\n\nexport type View<T extends Asset = Asset> = unknown extends T[\"validation\"]\n ? T & {\n /** Each view can optionally supply a list of validations to run against a particular view */\n validation?: Array<Validation.CrossfieldReference>;\n }\n : T;\n\n/**\n * The JSON payload for running Player\n */\nexport interface Flow<T extends Asset = Asset> {\n /** A unique identifier for the flow */\n id: string;\n\n /** A list of views (each with an ID) that can be shown to a user */\n views?: Array<View<T>>;\n\n /**\n * The schema for the supplied (or referenced data).\n * This is used for validation, formatting, etc\n */\n schema?: Schema.Schema;\n\n /** Any initial data that the flow can use */\n data?: DataModel;\n\n /** A state machine to drive a user through the experience */\n navigation: Navigation;\n\n /** Other keys can be present. We just don't know what they are */\n [key: string]: unknown;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/types/src/index.ts"],"sourcesContent":["/**\n * An asset is the smallest unit of user interaction in a player view\n */\nexport interface Asset<T extends string = string> {\n /** Each asset requires a unique id per view */\n id: string;\n\n /** The asset type determines the semantics of how a user interacts with a page */\n type: T;\n\n [key: string]: unknown;\n}\n/**\n * An asset that contains a Binding.\n */\nexport interface AssetBinding extends Asset {\n /** A binding that points to somewhere in the data model */\n binding: Binding;\n}\n\n/** A single case statement to use in a switch */\nexport interface SwitchCase<T extends Asset = Asset> {\n /** The Asset to use if this case is applicable */\n asset: T;\n\n /** An expression to execute to determine if this case applies */\n case: Expression | true;\n}\n\n/** A switch can replace an asset with the applicable case on first render */\nexport type Switch<T extends Asset = Asset> = SwitchCase<T>[];\n\n/** An object that contains an asset */\nexport type AssetWrapper<T extends Asset = Asset> = {\n /** An asset instance */\n asset: T;\n\n [key: string]: unknown;\n};\n\nexport type AssetWrapperOrSwitch<T extends Asset = Asset> =\n | (AssetWrapper<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n dynamicSwitch?: never;\n\n /** The staticSwitch property can't exist at the same time as 'asset' */\n staticSwitch?: never;\n })\n | (StaticSwitch<T> & {\n /** The staticSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The staticSwitch property can't exist at the same time as 'dynamicSwitch' */\n dynamicSwitch?: never;\n })\n | (DynamicSwitch<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The dynamicSwitch property can't exist at the same time as 'staticSwitch' */\n staticSwitch?: never;\n });\n\nexport type AssetSwitch<T extends Asset = Asset> =\n | StaticSwitch<T>\n | DynamicSwitch<T>;\n\nexport interface StaticSwitch<T extends Asset = Asset> {\n /** A static switch only evaluates the applicable base on first render of the view */\n staticSwitch: Switch<T>;\n}\n\nexport interface DynamicSwitch<T extends Asset = Asset> {\n /** A dynamic switch re-evaluates the applicable case as data changes */\n dynamicSwitch: Switch<T>;\n}\n\n/**\n * Expressions are a specialized way of executing code.\n * If the expression is a composite, the last expression executed is the return value\n */\nexport type Expression = string | string[];\nexport type ExpressionRef = `@[${string}]@`;\n\n/**\n * Bindings describe locations in the data model.\n */\nexport type Binding = string;\nexport type BindingRef = `{{${Binding}}}`;\n\n/**\n * The data-model is the location that all user data is stored\n */\nexport type DataModel = Record<any, unknown>;\n\n/** The navigation section of the flow describes a State Machine for the user. */\nexport type Navigation = {\n /** The name of the Flow to begin on */\n BEGIN: string;\n} & Record<string, string | NavigationFlow>;\n\n/** An object with an expression in it */\nexport interface ExpressionObject {\n /** The expression to run */\n exp?: Expression;\n}\n\n/** A state machine in the navigation */\nexport interface NavigationFlow {\n /** The first state to kick off the state machine */\n startState: string;\n\n /** An optional expression to run when this Flow starts */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run when this Flow ends */\n onEnd?: Expression | ExpressionObject;\n\n /**\n * An optional flow-level transitions map (fallback when node-level is not defined).\n * Used as a fallback when the current state doesn't have a transition defined.\n */\n transitions?: NavigationFlowTransition;\n\n /**\n * Optional flow-level error transitions map.\n * Maps error types directly to state names (no indirection through transitions map).\n */\n errorTransitions?: Record<string, string>;\n\n [key: string]:\n | undefined\n | string\n | Expression\n | ExpressionObject\n | NavigationFlowState\n | NavigationFlowTransition;\n}\n\nexport type NavigationFlowTransition = Record<string, string>;\n\ninterface CommentBase {\n /** Add comments that will not be processing, but are useful for code explanation */\n _comment?: string;\n}\n\n/** The base representation of a state within a Flow */\nexport interface NavigationBaseState<T extends string> extends CommentBase {\n /** A property to determine the type of state this is */\n state_type: T;\n\n /** An optional expression to run when this view renders */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run before view transition */\n onEnd?: Expression | ExpressionObject;\n\n /**\n * TS gets really confused with both the ActionState and the onStart state both declaring the `exp` property\n * So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'\n */\n exp?: T extends \"ACTION\" | \"ASYNC_ACTION\" ? Expression : never;\n}\n\n/** A generic state that can transition to another state */\nexport interface NavigationFlowTransitionableState<T extends string>\n extends NavigationBaseState<T> {\n /** A mapping of transition-name to FlowState name */\n transitions: NavigationFlowTransition;\n\n /**\n * Optional error transitions map.\n * Maps error types directly to state names (no indirection through transitions map).\n */\n errorTransitions?: Record<string, string>;\n}\n\n/** A state representing a view */\nexport interface NavigationFlowViewState\n extends NavigationFlowTransitionableState<\"VIEW\"> {\n /** An id corresponding to a view from the 'views' array */\n ref: string;\n\n /** View meta-properties */\n attributes?: {\n [key: string]: any;\n };\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/**\n * An END state of the flow.\n */\nexport interface NavigationFlowEndState extends NavigationBaseState<\"END\"> {\n /**\n * A description of _how_ the flow ended.\n * If this is a flow started from another flow, the outcome determines the flow transition\n */\n outcome: string;\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowActionState\n extends NavigationFlowTransitionableState<\"ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowAsyncActionState\n extends NavigationFlowTransitionableState<\"ASYNC_ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n\n /** Whether the expression(s) should be awaited before transitioning */\n await: boolean;\n}\n\n/**\n * External Flow states represent states in the FSM that can't be resolved internally in Player.\n * The flow will wait for the embedded application to manage moving to the next state via a transition\n */\nexport interface NavigationFlowExternalState\n extends NavigationFlowTransitionableState<\"EXTERNAL\"> {\n /** A reference for this external state */\n ref: string;\n /** Any additional properties are forwarded as options */\n [key: string]: unknown;\n}\n\nexport interface NavigationFlowFlowState\n extends NavigationFlowTransitionableState<\"FLOW\"> {\n /** A reference to a FLOW id state to run */\n ref: string;\n}\n\nexport type NavigationFlowState =\n | NavigationFlowViewState\n | NavigationFlowEndState\n | NavigationFlowFlowState\n | NavigationFlowActionState\n | NavigationFlowAsyncActionState\n | NavigationFlowExternalState;\n\n/** The data at the end of a flow */\nexport interface FlowResult {\n /** The outcome describes _how_ the flow ended (forwards, backwards, etc) */\n endState: NavigationFlowEndState;\n\n /** The serialized data-model */\n data?: any;\n}\n\n/** Any object that contains 1 or more templates */\nexport interface Templatable {\n /** A list of templates to process for this node */\n template?: Template[];\n}\n\n/** A template describes a mapping from a data array -> array of objects */\nexport interface Template<ValueType = unknown, Key extends string = string> {\n /** A pointer to the data-model containing an array of elements to map over */\n data: Binding;\n\n /**\n * The template to iterate over using each value in the supplied template data.\n * Any reference to _index_ is replaced with the current iteration index.\n */\n value: ValueType;\n\n /** should the template be recomputed when data changes */\n dynamic?: boolean;\n\n /**\n * A property on the parent object to store the new map under.\n * If it already exists, values are appended to the end.\n */\n output: Key;\n\n /** Specifies the template placement in relation to existing elements*/\n placement?: \"prepend\" | \"append\";\n}\n\n/**\n * The Schema organizes all content related to Data and it's types\n */\nexport declare namespace Schema {\n /** The authored schema object in the JSON payload */\n export interface Schema {\n /** The ROOT object is the top level object to use */\n ROOT: Node;\n\n /** Any additional keys are properties of the ROOT object */\n [key: string]: Node;\n }\n\n /** A Node describes a specific object in the tree */\n export interface Node {\n /** Each property describes a property of the object */\n [key: string]: DataTypes;\n }\n\n export type DataTypes = DataType | RecordType | ArrayType;\n\n /** Each prop in the object can have a specific DataType */\n export interface DataType<T = unknown> {\n /** The reference of the base type to use */\n type: string;\n\n /**\n * Any additional validations that are associated with this property\n * These will add to any base validations associated with the \"type\"\n */\n validation?: Validation.Reference[];\n\n /**\n * A reference to a specific data format to use.\n * If none is specified, will fallback to that of the base type\n */\n format?: Formatting.Reference;\n\n /**\n * A default value for this property.\n * Any reads for this property will result in this default value being written to the model.\n */\n default?: T;\n\n /** Any additional options */\n [key: string]: unknown;\n }\n /** Determines if the Datatype is a record object */\n export interface RecordType extends DataType {\n /** boolean to define if its a record */\n isRecord: boolean;\n\n /** This property is mutually exclusive with RecordType and can not be used with ArrayType */\n isArray?: never;\n }\n\n /** Determines if the DataType is an Array Object */\n export interface ArrayType extends DataType {\n /** boolean to define if its an array */\n isArray: boolean;\n\n /** This property is mutually exclusive with ArrayType and can not be used with RecordType */\n isRecord?: never;\n }\n}\n\n/** Namespace to wrap up core functionality to be used by the Language Service */\nexport declare namespace Language {\n /**\n * Helper to compliment `Schema.DataType` to provide a way to export a reference to a data type instead of the whole object\n */\n export interface DataTypeRef {\n /** Name of the type in Player Core */\n type: string;\n }\n}\n\n/** A spot for formatting */\nexport declare namespace Formatting {\n /** A reference to a specific formatter */\n export interface Reference {\n /** The name of the formatter (and de-formatter) to use */\n type: string;\n\n /** Any additional properties will be passed as options to the formatter function */\n [key: string]: unknown;\n }\n}\n\n/** A space for all thing validation */\nexport declare namespace Validation {\n /**\n * How serious are you about this error?\n * Warning validations are reserved for errors that could be ignored by the user without consequence\n * Errors must be fixed before proceeding\n */\n export type Severity = \"error\" | \"warning\";\n\n /**\n * When to _first_ start caring about a validation of a data-val.\n *\n * load - only check once the first time the binding appears on screen\n * change - check anytime the data changes\n * navigation - check once the user attempts to navigate away from a view\n */\n export type Trigger = \"navigation\" | \"change\" | \"load\";\n\n /**\n * Where the error/warning should be displayed.\n * - `field` is the default display target. This renders the error/warning directly underneath the field.\n * - `section` is used to display a message at a parent node that is designated as a \"section\"\n * - `page` a special section used to display a message at the top of the page.\n */\n export type DisplayTarget = \"page\" | \"section\" | \"field\";\n\n /** A reference to a validation object */\n export interface Reference {\n /**\n * The name of the referenced validation type\n * This will be used to lookup the proper handler\n */\n type: string;\n\n /** An optional means of overriding the default message if the validation is triggered */\n message?: string;\n\n /** An optional means of overriding the default severity of the validation if triggered */\n severity?: Severity;\n\n /** When to run this particular validation */\n trigger?: Trigger;\n\n /**\n * Each validation is passed the value of the data to run it's validation against.\n * By default, this is the value stored in the data-model (deformatted).\n * In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option\n */\n dataTarget?: \"formatted\" | \"deformatted\";\n\n /** Where the error should be displayed */\n displayTarget?: DisplayTarget;\n\n /**\n * If the validation blocks navigation\n * true/false - always/never block navigation\n * once - only block navigation if the validation has not been triggered before\n *\n * @default - true for errors, 'once' for warnings\n */\n blocking?: boolean | \"once\";\n\n /** Additional props to send down to a Validator */\n [key: string]: unknown;\n }\n\n export interface CrossfieldReference extends Reference {\n /** The binding to associate this validation with */\n ref?: Binding;\n\n /** Cross-field references and validation must run against the default (deformatted) value */\n dataTarget?: never;\n }\n}\n\nexport type View<T extends Asset = Asset> = unknown extends T[\"validation\"]\n ? T & {\n /** Each view can optionally supply a list of validations to run against a particular view */\n validation?: Array<Validation.CrossfieldReference>;\n }\n : T;\n\n/**\n * The JSON payload for running Player\n */\nexport interface Flow<T extends Asset = Asset> {\n /** A unique identifier for the flow */\n id: string;\n\n /** A list of views (each with an ID) that can be shown to a user */\n views?: Array<View<T>>;\n\n /**\n * The schema for the supplied (or referenced data).\n * This is used for validation, formatting, etc\n */\n schema?: Schema.Schema;\n\n /** Any initial data that the flow can use */\n data?: DataModel;\n\n /** A state machine to drive a user through the experience */\n navigation: Navigation;\n\n /** Other keys can be present. We just don't know what they are */\n [key: string]: unknown;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1582,6 +1582,36 @@
1582
1582
  "title": "NavigationFlow.onEnd",
1583
1583
  "description": "An optional expression to run when this Flow ends"
1584
1584
  }
1585
+ },
1586
+ "transitions": {
1587
+ "required": false,
1588
+ "node": {
1589
+ "source": "core/types/src/index.ts",
1590
+ "name": "NavigationFlowTransition",
1591
+ "type": "record",
1592
+ "keyType": {
1593
+ "type": "string"
1594
+ },
1595
+ "valueType": {
1596
+ "type": "string"
1597
+ },
1598
+ "title": "NavigationFlow.transitions",
1599
+ "description": "An optional flow-level transitions map (fallback when node-level is not defined).\nUsed as a fallback when the current state doesn't have a transition defined."
1600
+ }
1601
+ },
1602
+ "errorTransitions": {
1603
+ "required": false,
1604
+ "node": {
1605
+ "type": "record",
1606
+ "keyType": {
1607
+ "type": "string"
1608
+ },
1609
+ "valueType": {
1610
+ "type": "string"
1611
+ },
1612
+ "title": "NavigationFlow.errorTransitions",
1613
+ "description": "Optional flow-level error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
1614
+ }
1585
1615
  }
1586
1616
  },
1587
1617
  "additionalProperties": {
@@ -1734,6 +1764,20 @@
1734
1764
  "description": "A mapping of transition-name to FlowState name"
1735
1765
  }
1736
1766
  },
1767
+ "errorTransitions": {
1768
+ "required": false,
1769
+ "node": {
1770
+ "type": "record",
1771
+ "keyType": {
1772
+ "type": "string"
1773
+ },
1774
+ "valueType": {
1775
+ "type": "string"
1776
+ },
1777
+ "title": "NavigationFlowTransitionableState.errorTransitions",
1778
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
1779
+ }
1780
+ },
1737
1781
  "ref": {
1738
1782
  "required": true,
1739
1783
  "node": {
@@ -1982,6 +2026,20 @@
1982
2026
  "description": "A mapping of transition-name to FlowState name"
1983
2027
  }
1984
2028
  },
2029
+ "errorTransitions": {
2030
+ "required": false,
2031
+ "node": {
2032
+ "type": "record",
2033
+ "keyType": {
2034
+ "type": "string"
2035
+ },
2036
+ "valueType": {
2037
+ "type": "string"
2038
+ },
2039
+ "title": "NavigationFlowTransitionableState.errorTransitions",
2040
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
2041
+ }
2042
+ },
1985
2043
  "ref": {
1986
2044
  "required": true,
1987
2045
  "node": {
@@ -2108,6 +2166,20 @@
2108
2166
  "title": "NavigationFlowTransitionableState.transitions",
2109
2167
  "description": "A mapping of transition-name to FlowState name"
2110
2168
  }
2169
+ },
2170
+ "errorTransitions": {
2171
+ "required": false,
2172
+ "node": {
2173
+ "type": "record",
2174
+ "keyType": {
2175
+ "type": "string"
2176
+ },
2177
+ "valueType": {
2178
+ "type": "string"
2179
+ },
2180
+ "title": "NavigationFlowTransitionableState.errorTransitions",
2181
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
2182
+ }
2111
2183
  }
2112
2184
  },
2113
2185
  "additionalProperties": false,
@@ -2229,6 +2301,20 @@
2229
2301
  "description": "A mapping of transition-name to FlowState name"
2230
2302
  }
2231
2303
  },
2304
+ "errorTransitions": {
2305
+ "required": false,
2306
+ "node": {
2307
+ "type": "record",
2308
+ "keyType": {
2309
+ "type": "string"
2310
+ },
2311
+ "valueType": {
2312
+ "type": "string"
2313
+ },
2314
+ "title": "NavigationFlowTransitionableState.errorTransitions",
2315
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
2316
+ }
2317
+ },
2232
2318
  "await": {
2233
2319
  "required": true,
2234
2320
  "node": {
@@ -2355,6 +2441,20 @@
2355
2441
  "description": "A mapping of transition-name to FlowState name"
2356
2442
  }
2357
2443
  },
2444
+ "errorTransitions": {
2445
+ "required": false,
2446
+ "node": {
2447
+ "type": "record",
2448
+ "keyType": {
2449
+ "type": "string"
2450
+ },
2451
+ "valueType": {
2452
+ "type": "string"
2453
+ },
2454
+ "title": "NavigationFlowTransitionableState.errorTransitions",
2455
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
2456
+ }
2457
+ },
2358
2458
  "ref": {
2359
2459
  "required": true,
2360
2460
  "node": {
@@ -2370,6 +2470,18 @@
2370
2470
  }
2371
2471
  ],
2372
2472
  "title": "NavigationFlowState"
2473
+ },
2474
+ {
2475
+ "source": "core/types/src/index.ts",
2476
+ "name": "NavigationFlowTransition",
2477
+ "type": "record",
2478
+ "keyType": {
2479
+ "type": "string"
2480
+ },
2481
+ "valueType": {
2482
+ "type": "string"
2483
+ },
2484
+ "title": "NavigationFlowTransition"
2373
2485
  }
2374
2486
  ]
2375
2487
  },
@@ -108,6 +108,36 @@
108
108
  "title": "NavigationFlow.onEnd",
109
109
  "description": "An optional expression to run when this Flow ends"
110
110
  }
111
+ },
112
+ "transitions": {
113
+ "required": false,
114
+ "node": {
115
+ "source": "core/types/src/index.ts",
116
+ "name": "NavigationFlowTransition",
117
+ "type": "record",
118
+ "keyType": {
119
+ "type": "string"
120
+ },
121
+ "valueType": {
122
+ "type": "string"
123
+ },
124
+ "title": "NavigationFlow.transitions",
125
+ "description": "An optional flow-level transitions map (fallback when node-level is not defined).\nUsed as a fallback when the current state doesn't have a transition defined."
126
+ }
127
+ },
128
+ "errorTransitions": {
129
+ "required": false,
130
+ "node": {
131
+ "type": "record",
132
+ "keyType": {
133
+ "type": "string"
134
+ },
135
+ "valueType": {
136
+ "type": "string"
137
+ },
138
+ "title": "NavigationFlow.errorTransitions",
139
+ "description": "Optional flow-level error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
140
+ }
111
141
  }
112
142
  },
113
143
  "additionalProperties": {
@@ -260,6 +290,20 @@
260
290
  "description": "A mapping of transition-name to FlowState name"
261
291
  }
262
292
  },
293
+ "errorTransitions": {
294
+ "required": false,
295
+ "node": {
296
+ "type": "record",
297
+ "keyType": {
298
+ "type": "string"
299
+ },
300
+ "valueType": {
301
+ "type": "string"
302
+ },
303
+ "title": "NavigationFlowTransitionableState.errorTransitions",
304
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
305
+ }
306
+ },
263
307
  "ref": {
264
308
  "required": true,
265
309
  "node": {
@@ -508,6 +552,20 @@
508
552
  "description": "A mapping of transition-name to FlowState name"
509
553
  }
510
554
  },
555
+ "errorTransitions": {
556
+ "required": false,
557
+ "node": {
558
+ "type": "record",
559
+ "keyType": {
560
+ "type": "string"
561
+ },
562
+ "valueType": {
563
+ "type": "string"
564
+ },
565
+ "title": "NavigationFlowTransitionableState.errorTransitions",
566
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
567
+ }
568
+ },
511
569
  "ref": {
512
570
  "required": true,
513
571
  "node": {
@@ -634,6 +692,20 @@
634
692
  "title": "NavigationFlowTransitionableState.transitions",
635
693
  "description": "A mapping of transition-name to FlowState name"
636
694
  }
695
+ },
696
+ "errorTransitions": {
697
+ "required": false,
698
+ "node": {
699
+ "type": "record",
700
+ "keyType": {
701
+ "type": "string"
702
+ },
703
+ "valueType": {
704
+ "type": "string"
705
+ },
706
+ "title": "NavigationFlowTransitionableState.errorTransitions",
707
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
708
+ }
637
709
  }
638
710
  },
639
711
  "additionalProperties": false,
@@ -755,6 +827,20 @@
755
827
  "description": "A mapping of transition-name to FlowState name"
756
828
  }
757
829
  },
830
+ "errorTransitions": {
831
+ "required": false,
832
+ "node": {
833
+ "type": "record",
834
+ "keyType": {
835
+ "type": "string"
836
+ },
837
+ "valueType": {
838
+ "type": "string"
839
+ },
840
+ "title": "NavigationFlowTransitionableState.errorTransitions",
841
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
842
+ }
843
+ },
758
844
  "await": {
759
845
  "required": true,
760
846
  "node": {
@@ -881,6 +967,20 @@
881
967
  "description": "A mapping of transition-name to FlowState name"
882
968
  }
883
969
  },
970
+ "errorTransitions": {
971
+ "required": false,
972
+ "node": {
973
+ "type": "record",
974
+ "keyType": {
975
+ "type": "string"
976
+ },
977
+ "valueType": {
978
+ "type": "string"
979
+ },
980
+ "title": "NavigationFlowTransitionableState.errorTransitions",
981
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
982
+ }
983
+ },
884
984
  "ref": {
885
985
  "required": true,
886
986
  "node": {
@@ -896,6 +996,18 @@
896
996
  }
897
997
  ],
898
998
  "title": "NavigationFlowState"
999
+ },
1000
+ {
1001
+ "source": "core/types/src/index.ts",
1002
+ "name": "NavigationFlowTransition",
1003
+ "type": "record",
1004
+ "keyType": {
1005
+ "type": "string"
1006
+ },
1007
+ "valueType": {
1008
+ "type": "string"
1009
+ },
1010
+ "title": "NavigationFlowTransition"
899
1011
  }
900
1012
  ]
901
1013
  },
@@ -78,6 +78,36 @@
78
78
  "title": "NavigationFlow.onEnd",
79
79
  "description": "An optional expression to run when this Flow ends"
80
80
  }
81
+ },
82
+ "transitions": {
83
+ "required": false,
84
+ "node": {
85
+ "source": "core/types/src/index.ts",
86
+ "name": "NavigationFlowTransition",
87
+ "type": "record",
88
+ "keyType": {
89
+ "type": "string"
90
+ },
91
+ "valueType": {
92
+ "type": "string"
93
+ },
94
+ "title": "NavigationFlow.transitions",
95
+ "description": "An optional flow-level transitions map (fallback when node-level is not defined).\nUsed as a fallback when the current state doesn't have a transition defined."
96
+ }
97
+ },
98
+ "errorTransitions": {
99
+ "required": false,
100
+ "node": {
101
+ "type": "record",
102
+ "keyType": {
103
+ "type": "string"
104
+ },
105
+ "valueType": {
106
+ "type": "string"
107
+ },
108
+ "title": "NavigationFlow.errorTransitions",
109
+ "description": "Optional flow-level error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
110
+ }
81
111
  }
82
112
  },
83
113
  "additionalProperties": {
@@ -230,6 +260,20 @@
230
260
  "description": "A mapping of transition-name to FlowState name"
231
261
  }
232
262
  },
263
+ "errorTransitions": {
264
+ "required": false,
265
+ "node": {
266
+ "type": "record",
267
+ "keyType": {
268
+ "type": "string"
269
+ },
270
+ "valueType": {
271
+ "type": "string"
272
+ },
273
+ "title": "NavigationFlowTransitionableState.errorTransitions",
274
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
275
+ }
276
+ },
233
277
  "ref": {
234
278
  "required": true,
235
279
  "node": {
@@ -478,6 +522,20 @@
478
522
  "description": "A mapping of transition-name to FlowState name"
479
523
  }
480
524
  },
525
+ "errorTransitions": {
526
+ "required": false,
527
+ "node": {
528
+ "type": "record",
529
+ "keyType": {
530
+ "type": "string"
531
+ },
532
+ "valueType": {
533
+ "type": "string"
534
+ },
535
+ "title": "NavigationFlowTransitionableState.errorTransitions",
536
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
537
+ }
538
+ },
481
539
  "ref": {
482
540
  "required": true,
483
541
  "node": {
@@ -604,6 +662,20 @@
604
662
  "title": "NavigationFlowTransitionableState.transitions",
605
663
  "description": "A mapping of transition-name to FlowState name"
606
664
  }
665
+ },
666
+ "errorTransitions": {
667
+ "required": false,
668
+ "node": {
669
+ "type": "record",
670
+ "keyType": {
671
+ "type": "string"
672
+ },
673
+ "valueType": {
674
+ "type": "string"
675
+ },
676
+ "title": "NavigationFlowTransitionableState.errorTransitions",
677
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
678
+ }
607
679
  }
608
680
  },
609
681
  "additionalProperties": false,
@@ -725,6 +797,20 @@
725
797
  "description": "A mapping of transition-name to FlowState name"
726
798
  }
727
799
  },
800
+ "errorTransitions": {
801
+ "required": false,
802
+ "node": {
803
+ "type": "record",
804
+ "keyType": {
805
+ "type": "string"
806
+ },
807
+ "valueType": {
808
+ "type": "string"
809
+ },
810
+ "title": "NavigationFlowTransitionableState.errorTransitions",
811
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
812
+ }
813
+ },
728
814
  "await": {
729
815
  "required": true,
730
816
  "node": {
@@ -851,6 +937,20 @@
851
937
  "description": "A mapping of transition-name to FlowState name"
852
938
  }
853
939
  },
940
+ "errorTransitions": {
941
+ "required": false,
942
+ "node": {
943
+ "type": "record",
944
+ "keyType": {
945
+ "type": "string"
946
+ },
947
+ "valueType": {
948
+ "type": "string"
949
+ },
950
+ "title": "NavigationFlowTransitionableState.errorTransitions",
951
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
952
+ }
953
+ },
854
954
  "ref": {
855
955
  "required": true,
856
956
  "node": {
@@ -866,6 +966,18 @@
866
966
  }
867
967
  ],
868
968
  "title": "NavigationFlowState"
969
+ },
970
+ {
971
+ "source": "core/types/src/index.ts",
972
+ "name": "NavigationFlowTransition",
973
+ "type": "record",
974
+ "keyType": {
975
+ "type": "string"
976
+ },
977
+ "valueType": {
978
+ "type": "string"
979
+ },
980
+ "title": "NavigationFlowTransition"
869
981
  }
870
982
  ]
871
983
  },
@@ -112,6 +112,20 @@
112
112
  "title": "NavigationFlowTransitionableState.transitions",
113
113
  "description": "A mapping of transition-name to FlowState name"
114
114
  }
115
+ },
116
+ "errorTransitions": {
117
+ "required": false,
118
+ "node": {
119
+ "type": "record",
120
+ "keyType": {
121
+ "type": "string"
122
+ },
123
+ "valueType": {
124
+ "type": "string"
125
+ },
126
+ "title": "NavigationFlowTransitionableState.errorTransitions",
127
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
128
+ }
115
129
  }
116
130
  },
117
131
  "additionalProperties": false,
@@ -113,6 +113,20 @@
113
113
  "description": "A mapping of transition-name to FlowState name"
114
114
  }
115
115
  },
116
+ "errorTransitions": {
117
+ "required": false,
118
+ "node": {
119
+ "type": "record",
120
+ "keyType": {
121
+ "type": "string"
122
+ },
123
+ "valueType": {
124
+ "type": "string"
125
+ },
126
+ "title": "NavigationFlowTransitionableState.errorTransitions",
127
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
128
+ }
129
+ },
116
130
  "await": {
117
131
  "required": true,
118
132
  "node": {
@@ -111,6 +111,20 @@
111
111
  "description": "A mapping of transition-name to FlowState name"
112
112
  }
113
113
  },
114
+ "errorTransitions": {
115
+ "required": false,
116
+ "node": {
117
+ "type": "record",
118
+ "keyType": {
119
+ "type": "string"
120
+ },
121
+ "valueType": {
122
+ "type": "string"
123
+ },
124
+ "title": "NavigationFlowTransitionableState.errorTransitions",
125
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
126
+ }
127
+ },
114
128
  "ref": {
115
129
  "required": true,
116
130
  "node": {
@@ -111,6 +111,20 @@
111
111
  "description": "A mapping of transition-name to FlowState name"
112
112
  }
113
113
  },
114
+ "errorTransitions": {
115
+ "required": false,
116
+ "node": {
117
+ "type": "record",
118
+ "keyType": {
119
+ "type": "string"
120
+ },
121
+ "valueType": {
122
+ "type": "string"
123
+ },
124
+ "title": "NavigationFlowTransitionableState.errorTransitions",
125
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
126
+ }
127
+ },
114
128
  "ref": {
115
129
  "required": true,
116
130
  "node": {
@@ -116,6 +116,20 @@
116
116
  "description": "A mapping of transition-name to FlowState name"
117
117
  }
118
118
  },
119
+ "errorTransitions": {
120
+ "required": false,
121
+ "node": {
122
+ "type": "record",
123
+ "keyType": {
124
+ "type": "string"
125
+ },
126
+ "valueType": {
127
+ "type": "string"
128
+ },
129
+ "title": "NavigationFlowTransitionableState.errorTransitions",
130
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
131
+ }
132
+ },
119
133
  "ref": {
120
134
  "required": true,
121
135
  "node": {
@@ -364,6 +378,20 @@
364
378
  "description": "A mapping of transition-name to FlowState name"
365
379
  }
366
380
  },
381
+ "errorTransitions": {
382
+ "required": false,
383
+ "node": {
384
+ "type": "record",
385
+ "keyType": {
386
+ "type": "string"
387
+ },
388
+ "valueType": {
389
+ "type": "string"
390
+ },
391
+ "title": "NavigationFlowTransitionableState.errorTransitions",
392
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
393
+ }
394
+ },
367
395
  "ref": {
368
396
  "required": true,
369
397
  "node": {
@@ -490,6 +518,20 @@
490
518
  "title": "NavigationFlowTransitionableState.transitions",
491
519
  "description": "A mapping of transition-name to FlowState name"
492
520
  }
521
+ },
522
+ "errorTransitions": {
523
+ "required": false,
524
+ "node": {
525
+ "type": "record",
526
+ "keyType": {
527
+ "type": "string"
528
+ },
529
+ "valueType": {
530
+ "type": "string"
531
+ },
532
+ "title": "NavigationFlowTransitionableState.errorTransitions",
533
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
534
+ }
493
535
  }
494
536
  },
495
537
  "additionalProperties": false,
@@ -611,6 +653,20 @@
611
653
  "description": "A mapping of transition-name to FlowState name"
612
654
  }
613
655
  },
656
+ "errorTransitions": {
657
+ "required": false,
658
+ "node": {
659
+ "type": "record",
660
+ "keyType": {
661
+ "type": "string"
662
+ },
663
+ "valueType": {
664
+ "type": "string"
665
+ },
666
+ "title": "NavigationFlowTransitionableState.errorTransitions",
667
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
668
+ }
669
+ },
614
670
  "await": {
615
671
  "required": true,
616
672
  "node": {
@@ -737,6 +793,20 @@
737
793
  "description": "A mapping of transition-name to FlowState name"
738
794
  }
739
795
  },
796
+ "errorTransitions": {
797
+ "required": false,
798
+ "node": {
799
+ "type": "record",
800
+ "keyType": {
801
+ "type": "string"
802
+ },
803
+ "valueType": {
804
+ "type": "string"
805
+ },
806
+ "title": "NavigationFlowTransitionableState.errorTransitions",
807
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
808
+ }
809
+ },
740
810
  "ref": {
741
811
  "required": true,
742
812
  "node": {
@@ -139,6 +139,20 @@
139
139
  "title": "NavigationFlowTransitionableState.transitions",
140
140
  "description": "A mapping of transition-name to FlowState name"
141
141
  }
142
+ },
143
+ "errorTransitions": {
144
+ "required": false,
145
+ "node": {
146
+ "type": "record",
147
+ "keyType": {
148
+ "type": "string"
149
+ },
150
+ "valueType": {
151
+ "type": "string"
152
+ },
153
+ "title": "NavigationFlowTransitionableState.errorTransitions",
154
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
155
+ }
142
156
  }
143
157
  },
144
158
  "additionalProperties": false,
@@ -111,6 +111,20 @@
111
111
  "description": "A mapping of transition-name to FlowState name"
112
112
  }
113
113
  },
114
+ "errorTransitions": {
115
+ "required": false,
116
+ "node": {
117
+ "type": "record",
118
+ "keyType": {
119
+ "type": "string"
120
+ },
121
+ "valueType": {
122
+ "type": "string"
123
+ },
124
+ "title": "NavigationFlowTransitionableState.errorTransitions",
125
+ "description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
126
+ }
127
+ },
114
128
  "ref": {
115
129
  "required": true,
116
130
  "node": {
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "types"
7
7
  ],
8
8
  "name": "@player-ui/types",
9
- "version": "0.15.0",
9
+ "version": "0.15.1--canary.802.31569",
10
10
  "main": "dist/cjs/index.cjs",
11
11
  "module": "dist/index.legacy-esm.js",
12
12
  "types": "types/index.d.ts",
package/src/index.ts CHANGED
@@ -116,12 +116,25 @@ export interface NavigationFlow {
116
116
  /** An optional expression to run when this Flow ends */
117
117
  onEnd?: Expression | ExpressionObject;
118
118
 
119
+ /**
120
+ * An optional flow-level transitions map (fallback when node-level is not defined).
121
+ * Used as a fallback when the current state doesn't have a transition defined.
122
+ */
123
+ transitions?: NavigationFlowTransition;
124
+
125
+ /**
126
+ * Optional flow-level error transitions map.
127
+ * Maps error types directly to state names (no indirection through transitions map).
128
+ */
129
+ errorTransitions?: Record<string, string>;
130
+
119
131
  [key: string]:
120
132
  | undefined
121
133
  | string
122
134
  | Expression
123
135
  | ExpressionObject
124
- | NavigationFlowState;
136
+ | NavigationFlowState
137
+ | NavigationFlowTransition;
125
138
  }
126
139
 
127
140
  export type NavigationFlowTransition = Record<string, string>;
@@ -154,6 +167,12 @@ export interface NavigationFlowTransitionableState<T extends string>
154
167
  extends NavigationBaseState<T> {
155
168
  /** A mapping of transition-name to FlowState name */
156
169
  transitions: NavigationFlowTransition;
170
+
171
+ /**
172
+ * Optional error transitions map.
173
+ * Maps error types directly to state names (no indirection through transitions map).
174
+ */
175
+ errorTransitions?: Record<string, string>;
157
176
  }
158
177
 
159
178
  /** A state representing a view */
package/types/index.d.ts CHANGED
@@ -88,7 +88,17 @@ export interface NavigationFlow {
88
88
  onStart?: Expression | ExpressionObject;
89
89
  /** An optional expression to run when this Flow ends */
90
90
  onEnd?: Expression | ExpressionObject;
91
- [key: string]: undefined | string | Expression | ExpressionObject | NavigationFlowState;
91
+ /**
92
+ * An optional flow-level transitions map (fallback when node-level is not defined).
93
+ * Used as a fallback when the current state doesn't have a transition defined.
94
+ */
95
+ transitions?: NavigationFlowTransition;
96
+ /**
97
+ * Optional flow-level error transitions map.
98
+ * Maps error types directly to state names (no indirection through transitions map).
99
+ */
100
+ errorTransitions?: Record<string, string>;
101
+ [key: string]: undefined | string | Expression | ExpressionObject | NavigationFlowState | NavigationFlowTransition;
92
102
  }
93
103
  export type NavigationFlowTransition = Record<string, string>;
94
104
  interface CommentBase {
@@ -113,6 +123,11 @@ export interface NavigationBaseState<T extends string> extends CommentBase {
113
123
  export interface NavigationFlowTransitionableState<T extends string> extends NavigationBaseState<T> {
114
124
  /** A mapping of transition-name to FlowState name */
115
125
  transitions: NavigationFlowTransition;
126
+ /**
127
+ * Optional error transitions map.
128
+ * Maps error types directly to state names (no indirection through transitions map).
129
+ */
130
+ errorTransitions?: Record<string, string>;
116
131
  }
117
132
  /** A state representing a view */
118
133
  export interface NavigationFlowViewState extends NavigationFlowTransitionableState<"VIEW"> {