import type { WorkflowCommandResult, WorkflowDetailSurfaceV2, WorkflowSurface, WorkflowTask, WorkflowTimeline, WorkflowTimelineDisplayEntry } from 'openxiangda-contracts/browser'; import { type ReactNode } from 'react'; import { type SurfaceFieldRenderers } from '../resource/SurfaceFields'; import { type ResourceFormDrawerState } from '../resource/ResourceFormFrame'; import { type WorkflowSubmissionFieldStates, type WorkflowSubmissionSubtableFieldStates } from './workflow-submission-form'; export type { WorkflowSubmissionFieldState, WorkflowSubmissionFieldStates, WorkflowSubmissionSubtableFieldStates } from './workflow-submission-form'; type PageVariant = 'desktop' | 'mobile'; export type WorkflowPageVariant = PageVariant; type JsonObject = Record; export type WorkflowSurfaceKind = 'task' | 'instance'; /** Read context after an unchanged, confirmed platform command result. */ export interface WorkflowCommandCompletionContext { /** The actor can no longer read the old task, although the instance may continue. */ taskSurfaceUnavailable: boolean; } /** * An advanced task command has completed the current task and may have * created a new task. Reading the old task Surface in that case is expected * to fail, so only instance commands and non-advanced task commands refresh a * Surface through the current identifier. */ export declare function shouldRefreshWorkflowSurface(kind: WorkflowSurfaceKind, result: WorkflowCommandResult): boolean; /** * Apply the command-completion lifecycle shared by the standard and * embeddable Workflow panels. The explicit command callback always receives * the platform result; the legacy Surface callback only runs when a valid * current Surface was refreshed. */ export declare function completeWorkflowCommand(kind: WorkflowSurfaceKind, result: WorkflowCommandResult, options: { refresh: () => Promise; onCommandCompleted?: (result: WorkflowCommandResult, context?: WorkflowCommandCompletionContext) => void | Promise; onCompleted?: (surface: WorkflowSurface, result?: WorkflowCommandResult) => void | Promise; }): Promise; export declare function WorkflowBusinessDetailSections({ surface, variant, }: { surface: WorkflowSurface; variant: PageVariant; }): import("react/jsx-runtime").JSX.Element; export declare function WorkflowStatusIcon({ status, }: { status: WorkflowTimelineDisplayEntry['status']; }): import("react/jsx-runtime").JSX.Element; export declare function WorkflowTimelineSection({ timeline, compact, task, footer, }: { timeline: WorkflowTimeline | null; compact?: boolean; task?: WorkflowTask | null; footer?: ReactNode; }): import("react/jsx-runtime").JSX.Element; export interface WorkflowTaskOperationsPanelProps { /** The platform task identifier. It is never inferred from application data. */ taskId: string; /** Desktop renders a sticky action bar; mobile renders the same actions for touch surfaces. */ variant?: WorkflowPageVariant; /** An already loaded task Surface. When omitted, the panel loads it from the platform. */ surface?: WorkflowSurface | null; /** Called whenever the panel obtains a fresh task Surface. */ onSurfaceChange?: (surface: WorkflowSurface) => void; /** * Called after a command succeeds and the task Surface has been refreshed. * The optional second argument carries the unchanged platform command * result for existing consumers that still use this callback. */ onCompleted?: (surface: WorkflowSurface, result?: WorkflowCommandResult) => void | Promise; /** Called with the platform command result after successful completion. */ onCommandCompleted?: (result: WorkflowCommandResult, context?: WorkflowCommandCompletionContext) => void | Promise; /** Places content/actions and reads the actual current Surface without another controller. */ renderLayout?: (parts: { content: ReactNode; actions: ReactNode; surface?: WorkflowSurface; }) => ReactNode; } /** Public, embeddable Workflow task operation surface. */ export declare function WorkflowTaskOperationsPanel({ taskId, variant, surface, onSurfaceChange, onCompleted, onCommandCompleted, renderLayout, }: WorkflowTaskOperationsPanelProps): import("react/jsx-runtime").JSX.Element; export interface WorkflowInstanceOperationsPanelProps { /** The platform workflow instance identifier. It is never inferred from business data. */ instanceId: string; /** Desktop renders a sticky action bar; mobile renders the same actions for touch surfaces. */ variant?: WorkflowPageVariant; /** An already loaded instance Surface. When omitted, the panel loads it from the platform. */ surface?: WorkflowSurface | null; /** Called whenever the panel obtains a fresh instance Surface. */ onSurfaceChange?: (surface: WorkflowSurface) => void; /** * Called after a command succeeds and the instance Surface has been * refreshed. The optional second argument carries the platform command * result for existing consumers that still use this callback. */ onCompleted?: (surface: WorkflowSurface, result?: WorkflowCommandResult) => void | Promise; /** Called with the platform command result after successful completion. */ onCommandCompleted?: (result: WorkflowCommandResult, context?: WorkflowCommandCompletionContext) => void | Promise; } /** Public, embeddable Workflow instance operation surface. */ export declare function WorkflowInstanceOperationsPanel({ instanceId, variant, surface, onSurfaceChange, onCompleted, onCommandCompleted, }: WorkflowInstanceOperationsPanelProps): import("react/jsx-runtime").JSX.Element; export declare function WorkflowSummarySection({ surface }: { surface: WorkflowSurface; }): import("react/jsx-runtime").JSX.Element; interface WorkflowDetailRendererProps { surface: WorkflowSurface; timeline: WorkflowTimeline | null; warning: string; operations: ReactNode; taskContent?: ReactNode; onClose?: () => void; onEdit?: () => void; drawer?: boolean; drawerState?: ResourceFormDrawerState; newPageHref?: string; editing?: ReactNode; busy?: boolean; } export declare function DesktopWorkflowDetailRenderer(props: WorkflowDetailRendererProps): import("react/jsx-runtime").JSX.Element; export declare function MobileWorkflowDetailRenderer(props: WorkflowDetailRendererProps): import("react/jsx-runtime").JSX.Element; export declare function useWorkflowDetail({ kind, id, resourceCode }: { kind: 'task' | 'instance' | 'record'; id: string; resourceCode?: string; }): { detail: WorkflowDetailSurfaceV2 | null; surface: WorkflowSurface | null; timeline: import("openxiangda-contracts").WorkflowDetailTimeline | null; loading: boolean; error: string; refresh: () => Promise; }; export declare function WorkflowRecordDetailPage({ variant, ...props }: { resourceCode: string; recordId?: string; variant?: PageVariant; onDismiss?: () => void; drawerState?: ResourceFormDrawerState; }): import("react/jsx-runtime").JSX.Element; export declare function WorkflowTaskPage({ variant, returnPath, }: { variant?: PageVariant; /** Application Router's declared work-center path for this device. */ returnPath?: string; }): import("react/jsx-runtime").JSX.Element; export declare function WorkflowInstancePage({ variant, returnPath, }: { variant?: PageVariant; /** Application Router's declared work-center path for this device. */ returnPath?: string; }): import("react/jsx-runtime").JSX.Element; export declare function WorkflowWorkCenterPage({ variant }: { variant?: PageVariant; }): import("react/jsx-runtime").JSX.Element; export interface WorkflowSubmissionFormOptions { /** Canonical values for the matched launch inputs, applied once to untouched fields. */ initialValues?: JsonObject; /** Pre-save candidate search context, including trusted preparation facts that * are not bound launch inputs. Never inserted into form submission/drafts. */ candidateScopeValues?: Readonly; fieldState?: (values: Readonly) => WorkflowSubmissionFieldStates; /** Narrows named-create child presentation; hidden values are retained and remain server-validated. */ subtableFieldState?: (values: Readonly) => WorkflowSubmissionSubtableFieldStates; /** Assistance for matched datetime/range inputs; never a server submission rule. */ dateTimeConstraints?: SurfaceFieldRenderers['dateTimeConstraints']; /** Dynamic help next to matched fields; independent of requirements and writes. */ fieldHints?: (values: Readonly) => Readonly>; /** Synchronous canonical patch after user input, limited to editable launch fields. */ valueLinkage?: (changed: Readonly, values: Readonly) => JsonObject; /** Display derived owned-child values without including them in named create input. */ subtableReadonlyFields?: Readonly>; /** Keep loaded source rows; their values remain editable within the sealed field closure. */ subtableFixedRows?: readonly string[]; /** Original source file read entries; uploads and permission checks are unchanged. */ fileResourceCodes?: SurfaceFieldRenderers['fileResourceCodes']; /** Readonly source IDs/revisions remain untrusted inputs for server-side reconciliation. */ subtableReadonlyInputFields?: Readonly>; intro?: ReactNode; /** Blocks only a new form; original submission recovery always takes priority. */ preparation?: ReactNode; } export declare function WorkflowSubmissionPage({ instancePath, workflowCode: declaredWorkflowCode, variant, onDismiss, onCompleted, formOptions, }?: { instancePath?: string; workflowCode?: string; variant?: PageVariant; onDismiss?: () => void; onCompleted?: (subjectId: string) => void; formOptions?: WorkflowSubmissionFormOptions; }): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable | Promise> | Iterable | null | undefined> | null | undefined; //# sourceMappingURL=StandardWorkflowPages.d.ts.map