import { List } from "immutable"; import { BasicFun, DispatchParsedType, DispatchSpecificationDeserializationResult, DispatchFormsParserState, PredicateValue, Sum, Unit, ValueOrErrors, Template, DispatchOnChange, DispatchInjectablesTypes, DispatchInfiniteStreamSources, DispatchEnumOptionsSources, DispatchEntityApis, DispatchTableApiSources, DispatchLookupSources, FormRefEditApiHandlers, FormRefCreateApiHandlers, Guid, BasicUpdater, Updater, Renderer, DispatcherContext, CommonAbstractRendererReadonlyContext, CommonAbstractRendererState, CommonAbstractRendererForeignMutationsExpected, PreprocessedSpecContext } from "../../../../../main"; import { DispatchCreateFormLauncherState } from "./domains/kind/create/state"; import { DispatchEditFormLauncherState } from "./domains/kind/edit/state"; import { DispatchPassthroughFormLauncherState } from "./domains/kind/passthrough/state"; export type DispatcherContextWithApiSources, Flags, CustomPresentationContext, ExtraContext> = Omit, "defaultState"> & BaseApiSources & { defaultState: (t: DispatchParsedType, renderer: Renderer) => ValueOrErrors; }; export type BaseLauncherRef = { name: string; apiSources: T; }; export type LauncherRefWithEntityApis = T & { entityApis: DispatchEntityApis; }; export type BaseApiSources = { infiniteStreamSources: DispatchInfiniteStreamSources; enumOptionsSources: DispatchEnumOptionsSources; tableApiSources?: DispatchTableApiSources; lookupSources?: DispatchLookupSources; }; export type EntityLauncherRefConfig = { source: "entity"; value: Sum, "not initialized">; } | { source: "api"; getGlobalConfig?: () => Promise; }; export type PassthroughLauncherRef = { kind: "passthrough"; entity: Sum, "not initialized">; config: Sum, "not initialized">; onEntityChange: DispatchOnChange; } & BaseLauncherRef; export type EditLauncherRef = { kind: "edit"; entityId: Guid; apiHandlers?: FormRefEditApiHandlers; config: EntityLauncherRefConfig; } & BaseLauncherRef>; export type CreateLauncherRef = { kind: "create"; apiHandlers?: FormRefCreateApiHandlers; config: EntityLauncherRefConfig; } & BaseLauncherRef>; export type LauncherRef = PassthroughLauncherRef | EditLauncherRef | CreateLauncherRef; export type DispatchFormRunnerStatus, Flags, CustomPresentationContext, ExtraContext> = { kind: "not initialized"; } | { kind: "loading"; } | { kind: "loaded"; Form: Template, PredicateValue, CustomPresentationContext, ExtraContext> & CommonAbstractRendererState, CommonAbstractRendererState, CommonAbstractRendererForeignMutationsExpected>; } | { kind: "error"; errors: List; }; export type DispatchFormRunnerContext, Flags, CustomPresentationContext = Unit, ExtraContext = Unit> = { extraContext: ExtraContext; globallyDisabled: boolean; globallyReadOnly: boolean; launcherRef: LauncherRef; showFormParsingErrors: BasicFun, JSX.Element>; remoteEntityVersionIdentifier: string; loadingComponent?: JSX.Element; errorComponent?: JSX.Element; preprocessedSpecContext?: PreprocessedSpecContext; usePreprocessor: boolean; } & DispatchFormsParserState; export type DispatchFormRunnerState, Flags, CustomPresentationContext, ExtraContext> = { innerFormState: { kind: "create"; state: DispatchCreateFormLauncherState; } | { kind: "edit"; state: DispatchEditFormLauncherState; } | { kind: "passthrough"; state: DispatchPassthroughFormLauncherState; }; }; export declare const DispatchFormRunnerState: , Flags, CustomPresentationContext, ExtraContext>() => { Default: { create: () => DispatchFormRunnerState; edit: () => DispatchFormRunnerState; passthrough: () => DispatchFormRunnerState; }; Updaters: { Core: { innerFormState: import("../../../../../main").Widening, "innerFormState">; }; Template: { create: (upd: BasicUpdater>) => Updater>; edit: (upd: BasicUpdater>) => Updater>; passthrough: (upd: BasicUpdater>) => Updater>; }; }; }; export type DispatchFormRunnerForeignMutationsExpected = Unit; export type DispatchCommonFormRunnerState, Flags, CustomPresentationContext, ExtraContext> = { status: DispatchFormRunnerStatus; formState: CommonAbstractRendererState; formName: string; }; export declare const DispatchCommonFormRunnerState: , Flags, CustomPresentationContext, ExtraContext>() => { Default: () => DispatchCommonFormRunnerState; Updaters: { formName: import("../../../../../main").Widening, "formName">; formState: import("../../../../../main").Widening, "formState">; status: import("../../../../../main").Widening, "status">; }; }; //# sourceMappingURL=state.d.ts.map