import { type SelectOption } from '../../components/select'; import { type OperatorChannel, type SignatureChannel } from './channel-meta'; /** Select value for "Assign later" in every operator picker. */ export declare const ASSIGN_LATER = "__assign-later__"; /** What a required item is. Anamnesis interviews never carry a second signee. */ export type RequiredSignatureItemKind = 'document' | 'anamnesis'; /** One outstanding document or anamnesis interview in the batch. */ export interface RequiredSignatureItem { /** Host id, the key of `operatorAssignments` in the submission. */ id: string; kind: RequiredSignatureItemKind; /** Display name, e.g. the document template name. */ name: string; /** Whether an operator must sign this item. Shows its operator picker. */ requiresOperator: boolean; /** * Whether this document has a field for the second signee. The second * signee is offered only when every listed item can carry it. Ignored for * `kind: 'anamnesis'`, which never can. Default `false`. */ canCarrySecondary?: boolean; /** * Preselected operator for this item; `null` preselects "Assign later". * Omit to use the modal's `initialOperatorId`. */ initialOperatorId?: string | null; /** * Whether the item is already signed (platform `signed` on a document, * `isSigned` on an interview). Signed items are left out. Default `false`. * There is no per-party standing: platform's documents API has none. */ signed?: boolean; } /** The items that still need a signature: those not signed. */ export declare function itemsStillToSign(items: readonly RequiredSignatureItem[]): RequiredSignatureItem[]; /** * The second signee signs the whole batch in one round, so it is offered * only when every item can carry that signature. `[].every()` is true, so an * empty batch cannot. */ export declare function batchCanCarrySecondary(items: readonly RequiredSignatureItem[]): boolean; /** Whether an item gets an operator picker: an operator must sign it. */ export declare function needsOperatorPick(item: RequiredSignatureItem): boolean; /** * One option in an operator picker. "Assign later" comes first, as on * platform (OperatorSignee.js). A `disabled` operator shows greyed out with * its `description` (the host's reason); a `deleted` one is hidden unless it * is the picker's current value. */ export interface OperatorPickerOption { value: string; label: string; disabled?: boolean; description?: string; deleted?: boolean; } /** The options one picker lists, given its current value. */ export declare function operatorPickerOptions(options: readonly OperatorPickerOption[], selected: string | undefined): SelectOption[]; /** Whether a user could pick this value: listed, not greyed out or deleted. */ export declare function isPickableOperator(options: readonly OperatorPickerOption[], value: string): boolean; /** * The greyed-out operators and their reasons, for the picker trigger: a * disabled option cannot take focus, so its own description is never heard. * `undefined` when none is greyed out. */ export declare function operatorReasonsHint(options: readonly OperatorPickerOption[], locale: string): string | undefined; /** * Why the second signee is withheld from a batch, first reason first; `null` * when it is offered. Mirrors platform (secondarySigneeAvailability.ts and * SecondarySignee.tsx): every item can carry it, the batch is signed on this * device, and the main signer is a registered signee, not the patient. */ export type SecondSigneeBlock = 'anamnesis' | 'documents' | 'patient' | 'channel'; export declare function secondSigneeBlock({ items, channel, primaryIsPatient, }: { items: readonly RequiredSignatureItem[]; channel: SignatureChannel; primaryIsPatient: boolean; }): SecondSigneeBlock | null; /** What is wrong with the chosen second signee (platform secondarySigneeValidation.ts). */ export type SecondSigneeIssue = 'sameAsPrimary' | 'unknownSignee' | 'missingPhone' | 'missingEmail'; /** The parts of a `SignerOption` the second signee checks read. */ export interface SecondSigneeCandidate { value: string; isPatient?: boolean; availableChannels?: readonly SignatureChannel[]; unavailableChannels?: ReadonlyArray<{ channel: SignatureChannel; }>; } /** * The first issue with a second signee, or `null`. SMS needs a phone; e-mail * and WhatsApp need an e-mail. Phone and e-mail are read * from channel availability, not from `contact` (which only the recipient * check shows): a person who cannot receive SMS or WhatsApp has no phone, one * who cannot receive e-mail has no e-mail. The patient is never a signee, so * picking them is unknown. */ export declare function secondSigneeIssue({ primaryId, secondId, channel, options, }: { primaryId: string | undefined; secondId: string; channel: SignatureChannel; options: readonly SecondSigneeCandidate[]; }): SecondSigneeIssue | null; export interface RequiredDocumentsProps { /** The items to list, already narrowed to those still to sign. */ items: readonly RequiredSignatureItem[]; loading?: boolean; /** * Operator options, "Assign later" first when allowed. Deleted operators * show only in a picker whose value they are. */ operatorOptions: readonly OperatorPickerOption[]; /** The picker value per item id, for items that require an operator. */ assignments: Readonly>; onAssign: (itemId: string, operatorValue: string) => void; /** Shows "Assign all to me" when passed. */ onAssignAllToMe?: () => void; busy?: boolean; /** * Adds each picked operator's channel beside their picker, in place of * the note that their settings decide. Default `false`. */ showOperatorChannels?: boolean; /** The channel per item id, for items with an assigned operator. */ operatorChannels?: Readonly>; onOperatorChannel?: (itemId: string, channel: OperatorChannel) => void; } export declare function RequiredDocuments({ items, loading, operatorOptions, assignments, onAssign, onAssignAllToMe, busy, showOperatorChannels, operatorChannels, onOperatorChannel, }: RequiredDocumentsProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=required-documents.d.ts.map