import * as i0 from '@angular/core'; import { InjectionToken, Type } from '@angular/core'; interface RuntimeActionTranslatable { display?: string; en?: string; ar?: string; } type RuntimeActionAfterSuccess = 'refresh' | 'close'; interface RuntimeActionReason { source?: string; code?: string; message?: string; blocking?: boolean; details?: string | null; ruleKey?: string | null; requestId?: number | null; requestStatus?: string | null; requestSchemaId?: number | null; relatedRequestIds?: number[]; } interface RuntimeAction { actionKey: string; actionName?: RuntimeActionTranslatable | string | null; httpMethod?: string | null; url?: string | null; isAvailable?: boolean; afterSuccess?: RuntimeActionAfterSuccess | null; stepIds?: Array; needConfirmation?: boolean; payloadKeys?: string[]; requiredPayloadKeys?: string[]; payloadTemplate?: Record | null; formId?: string | number | null; targetType?: string; targetId?: number; moduleKey?: string; operationKey?: string; primaryReasonCode?: string | null; reasons?: RuntimeActionReason[]; } type RuntimeActionStatus = 'success' | 'error' | 'cancelled'; interface RuntimeActionResult { status: RuntimeActionStatus; actionKey: string; afterSuccess: RuntimeActionAfterSuccess | null; response?: unknown; error?: unknown; } interface RuntimeActionExecuteOptions { externalPayloadResolvers?: Record unknown>; defaultAfterSuccess?: RuntimeActionAfterSuccess; successMessage?: (response: unknown, action: RuntimeAction) => string; errorMessage?: (error: unknown, action: RuntimeAction) => string; transformPayload?: (payload: Record | undefined, action: RuntimeAction) => Record | undefined; silent?: boolean; } interface RuntimeActionFormValue { requestPropertyId?: number; propertyKey: string; value: unknown; } interface RuntimeActionFormSource { getSubmitValues(): RuntimeActionFormValue[] | undefined; } declare function resolveActionLabel(action: RuntimeAction): string; declare function buildActionPayload(action: RuntimeAction, formValue: Record | undefined, externalResolvers?: Record unknown>): Record | undefined; declare function normalizePayloadValue(key: string, value: unknown): unknown; declare function resolveDefaultPayloadValue(key: string): unknown; /** * The declared operation inputs the payload would submit with no value — the * `{ propertyKey, value: null }` placeholders the backend sent, still unfilled. * * A non-empty result means the action was fired without rendering its form, and * submitting it would write nulls over the record (or fail the contract's * `operation_input.required` rule). Hosts fill these by running the operation * through `process-form-load` / `process-submit` instead. */ declare function getUnfilledActionInputKeys(payload: Record | undefined): string[]; declare function getMissingRequiredPayloadKeys(action: RuntimeAction, payload: Record | undefined): string[]; declare function isMissingPayloadValue(value: unknown): boolean; declare function normalizeHttpMethod(value: string | null | undefined): string | null; declare function methodSupportsBody(method: string): boolean; declare function buildRequestOptions(method: string, payload: Record | undefined): Record; /** * The action collects free-form request metadata — a reason, a note, a * delegate, attachments — which the generic confirm dialog can render on its * own because the keys are fixed and operation-independent. * * Operation *inputs* are a different thing entirely: see * {@link hasActionInputFields}. */ declare function hasActionFormFields(action: RuntimeAction): boolean; /** * The action declares operation inputs the user still has to supply — its * `payloadTemplate.fields` is a non-empty list of `{ propertyKey, value: null }` * placeholders. * * Firing such an action straight from its template submits those nulls, so a * host must instead run the operation through its own form: `process-form-load` * for the effective form and current values, `process-submit/validate`, then * `process-submit`. The backend owns which fields those are — never infer them * from the operation key. */ declare function hasActionInputFields(action: RuntimeAction): boolean; /** * The property keys an action declares as its operation inputs, in the * backend's own casing. Pass them to `mt-client-form`'s `allowedFieldKeys` to * scope a configured form down to the inputs this action actually writes. */ declare function getActionInputFieldKeys(action: RuntimeAction): string[]; declare class RuntimeActionContextStore { private readonly formSource; setFormSource(source: RuntimeActionFormSource | null): void; resolveFormValues(): RuntimeActionFormValue[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare const RUNTIME_ACTION_CONFIRM_DIALOG: InjectionToken>; declare class RuntimeActionRunner { private readonly http; private readonly confirmation; private readonly modal; private readonly toast; private readonly transloco; private readonly confirmDialogClass; execute(action: RuntimeAction, options?: RuntimeActionExecuteOptions): Promise; private runWithFormDialog; private confirmPlain; private run; private notExecutableMessage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { RUNTIME_ACTION_CONFIRM_DIALOG, RuntimeActionContextStore, RuntimeActionRunner, buildActionPayload, buildRequestOptions, getActionInputFieldKeys, getMissingRequiredPayloadKeys, getUnfilledActionInputKeys, hasActionFormFields, hasActionInputFields, isMissingPayloadValue, methodSupportsBody, normalizeHttpMethod, normalizePayloadValue, resolveActionLabel, resolveDefaultPayloadValue }; export type { RuntimeAction, RuntimeActionAfterSuccess, RuntimeActionExecuteOptions, RuntimeActionFormSource, RuntimeActionFormValue, RuntimeActionReason, RuntimeActionResult, RuntimeActionStatus, RuntimeActionTranslatable };