import { type ReactNode } from 'react'; import { type AppWorkflowLaunchContextDeclaration, type AppWorkflowLaunchInputBindingDeclaration, type AppWorkflowNamedOperationOutputDeclaration } from 'openxiangda-contracts/browser'; type JsonObject = Record; export interface WorkflowSubjectDefinition { resourceCode: string; factProjection: Record; /** * Fields selected by the compiler for the bounded business summary. * * Generated application definitions are intentionally emitted with * `as const`; accepting a readonly array keeps the public input contract * compatible with those generated literals while normalizeWorkflowDefinitions * still copies the values into its own mutable runtime representation. */ summaryFields?: readonly string[]; } interface GeneratedWorkflowDefinitionBase { code: string; title: string; description?: string; subject: WorkflowSubjectDefinition; detailRouteCode?: { desktop: string; mobile: string; }; } export interface GeneratedWorkflowNamedOperationIntent { operationCode: string; method: 'POST'; path: string; requiredCapability: string; requestSchemaDigest: string; responseSchemaDigest: string; inputs: Readonly>; output: AppWorkflowNamedOperationOutputDeclaration; } export interface GeneratedWorkflowNamedOperationSubmission { kind: 'named-operation'; create?: GeneratedWorkflowNamedOperationIntent; existing?: GeneratedWorkflowNamedOperationIntent; context: readonly AppWorkflowLaunchContextDeclaration[]; } export type GeneratedWorkflowDefinition = (GeneratedWorkflowDefinitionBase & { launch: { mode: 'standalone' | 'hidden-handoff'; submission?: never; }; processOperationCode: string; }) | (GeneratedWorkflowDefinitionBase & { launch: { mode: 'standalone' | 'hidden-handoff'; submission: GeneratedWorkflowNamedOperationSubmission; }; processOperationCode?: never; }) | (GeneratedWorkflowDefinitionBase & { launch: { mode: 'custom-page' | 'work-center-only'; submission?: never; }; processOperationCode?: never; }); export type StandardWorkflowDefinition = GeneratedWorkflowDefinition; export type StandardWorkflowDefinitionsInput = readonly StandardWorkflowDefinition[]; export declare function normalizeWorkflowDefinitions(input: StandardWorkflowDefinitionsInput): Map; export interface WorkflowTaskFormLinkageContext { workflowCode: string; nodeId: string; pageCode: string; } export interface WorkflowTaskFormBehavior { /** Synchronous presentation only. The platform still validates every task write. */ valueLinkage?: (changed: Readonly, values: Readonly, context: Readonly) => JsonObject; } export type WorkflowTaskFormBehaviors = Readonly>; export interface WorkflowDetailFieldContext { workflowCode: string; definitionVersion: number; bindingVersion: number; resourceCode: string | null; fieldCode: string; /** Only the platform's readable projection, never hidden record fields. */ record: Readonly>; } export interface WorkflowDetailBehavior { /** Presentation only. False hides an empty field; historical values remain. */ fieldVisibility?: (context: Readonly) => boolean | undefined; } export type WorkflowDetailBehaviors = Readonly>; export declare function OpenXiangdaWorkflowDefinitionsProvider({ children, definitions, taskForms, details, }: { children: ReactNode; definitions: StandardWorkflowDefinitionsInput; taskForms?: WorkflowTaskFormBehaviors; details?: WorkflowDetailBehaviors; }): import("react/jsx-runtime").JSX.Element; export declare function useWorkflowTaskFormBehavior(code: string): WorkflowTaskFormBehavior | undefined; export declare function useWorkflowDetailBehavior(code: string): WorkflowDetailBehavior | undefined; export declare function useWorkflowDefinitions(): ReadonlyMap; export declare function useWorkflowDefinition(code: string): GeneratedWorkflowDefinition | undefined; export {}; //# sourceMappingURL=workflow-definitions.d.ts.map