import { Cp as FormFieldValue, Dp as FormFieldDraft, Ko as DraftResolveOptions, Mf as AnnotationImportDrop, Of as PlannedAnnotationCopy, Rv as PdfCoordinates, Tf as AnnotationCopyPlacement, Xd as FormCopyPlan, Xf as AnnotationBundle, _o as Annotation, af as FormImportDrop, ap as BundleImportPages, bo as AnnotationPatch, df as FormValuesImportDropReason, hf as WidgetFlags, nh as AnnotationReplyType, op as BundleImportTarget, qo as ResolveOptions, ry as FormFieldRef, tf as planFormCopies, uf as FormValuesImportDrop, vf as FormBundle, wb as PageRef, wv as FormFieldKind, yo as AnnotationDraft } from "./AnnotationList-D-ioWPfN.js"; //#region src/annotation/checkWrite.d.ts /** * A prepared create's data checked against its kind's schema. The caller * writes its own data, not the schema's output, so nothing is reshaped on its * way in. */ declare function assertAnnotationDraft(draft: AnnotationDraft, options?: { /** * Link fields the caller has taken out of the draft and links itself (a * change set's `reply` and popup `parent`); they aren't checked here. */ linked?: readonly string[]; }): void; /** * A prepared update's data (`pdfPrepareAnnotationPatch`) checked against the * kind it leaves the annotation: its own, or the sibling the patch names. A * `readBack()` value still in it is a change, as preparation drops one sent * back as it reads, so one a write can't make is refused; the rest is checked * against the kind's update schema. */ declare function assertAnnotationPatch(current: Annotation, prepared: AnnotationPatch): void; /** * The draft the engine writes for `draft`, in the file's coordinates: * prepared (`pdfPrepareAnnotationDraft`), checked against its kind, and * every field that follows from it stated (`pdfDeriveAnnotationDraft`). A * viewer predicts the same without schema validation * (`pdfPredictAnnotationDraft`). * * Throws `InvalidArg` for a draft the engine refuses. Pure: it reads nothing * but its arguments. */ declare function pdfResolveAnnotationDraft(draft: AnnotationDraft, options?: DraftResolveOptions): AnnotationDraft; /** * The patch the engine writes for `patch` on `current`, in the file's * coordinates: prepared (`pdfPrepareAnnotationPatch`), checked against its * kind (`assertAnnotationPatch`), and every field that follows from it * stated (`pdfDeriveAnnotationPatch`). A viewer predicts the same without * schema validation (`pdfPredictAnnotationPatch`). * * Throws `InvalidArg` for a patch the engine refuses. Pure: it reads nothing * but its arguments. */ declare function pdfResolveAnnotationPatch(current: Annotation, patch: AnnotationPatch, options?: ResolveOptions): AnnotationPatch; //#endregion //#region src/transfer/planAnnotationImport.d.ts /** One annotation an import creates. */ interface PlannedAnnotation { /** Its item in the bundle. */ readonly item: number; /** The page it goes on. */ readonly page: PageRef; /** What `create` writes: the item's data, its pages mapped, without its links and dropped fields. */ readonly draft: AnnotationDraft; /** The annotation it replies to, by its place in `creates`. */ readonly replyTo?: { readonly planned: number; readonly type: AnnotationReplyType; }; /** For a popup: the annotation it shows, by its place in `creates`. */ readonly parent?: number; } interface AnnotationImportPlan { /** In bundle order. */ readonly creates: readonly PlannedAnnotation[]; readonly dropped: readonly AnnotationImportDrop[]; } /** * What an import of `bundle` into the `target` pages creates, and what it * leaves out. Nothing here touches a document, so an import refuses before * its first write: * * - `InvalidArg` when an item's data isn't valid for its kind, or when a * page an item is on or points at maps to no target page (naming them); * - `NotFound` when a page list maps to a page the target doesn't have. * * Unsupported items and unresolved relationships are left out in this order: * * 1. an item of an unsupported kind, and a form field's widget; a field * marker leaves out only that field; * 2. an item whose `reply.to` or `parent` is no item of the bundle on the * same target page (`parent-missing`); * 3. an item whose name is used on its target page, or by an earlier item * going to the same page (`name-conflict`); * 4. then, until nothing changes, an item whose `reply.to` or `parent` was * left out (`parent-dropped`), so a whole branch goes together. * * `nameTaken(page, nm)` answers for the target page as it is before the import. */ declare function planAnnotationImport(input: { readonly bundle: Pick; readonly pages?: BundleImportPages; readonly target: readonly BundleImportTarget[]; readonly nameTaken: (page: PageRef, nm: string) => boolean; }): AnnotationImportPlan; //#endregion //#region src/transfer/planAnnotationCopy.d.ts /** One annotation a copy creates. */ interface PlannedCopyCreate extends Omit { /** What `create` writes: the source's data, moved, without its links and dropped fields. */ readonly draft: AnnotationDraft; } interface AnnotationCopyCreates { /** In the order of the annotations given. */ readonly creates: readonly PlannedCopyCreate[]; /** What was left out, whole or one field of it, in the order given. */ readonly dropped: readonly AnnotationImportDrop[]; } /** * What a copy of `sources` (in page space) creates, and what it leaves out. * Nothing here touches a document, so a copy refuses before its first write: * `InvalidArg` when a source's data isn't valid for its kind. * * {@link planAnnotationCopies} leaves a field that marks something the engine * can't write out of its copy, and each one is reported here. Beyond that, a * source with a value every create of its kind needs and no write can make * is left out, and any other field with such a value is left out of its copy. */ declare function planAnnotationCopy(sources: readonly Annotation[], placement: AnnotationCopyPlacement): AnnotationCopyCreates; //#endregion //#region src/transfer/planFormImport.d.ts /** One field a design import creates. */ interface PlannedFormField { /** Its row in the bundle. */ readonly field: number; /** What `create` writes: the field's settings, scripts and widgets, their pages mapped. */ readonly draft: FormFieldDraft; /** Each widget's row in the bundle, in `draft.widgets` order. */ readonly widgets: readonly number[]; /** Each widget's flags, in `draft.widgets` order. */ readonly flags: readonly WidgetFlags[]; /** The value it gets; absent when the import writes none. */ readonly value?: FormFieldValue; } interface FormImportPlan { /** In bundle order. */ readonly creates: readonly PlannedFormField[]; /** The calculation order among the creates, by their place in `creates`, as the bundle has it. */ readonly calculationOrder: readonly number[]; readonly dropped: readonly FormImportDrop[]; } /** * What a design import of `bundle` into the `target` pages creates, and what * it leaves out. Nothing here touches a document, so an import refuses * before its first write: * * - `InvalidArg` when a field's data isn't valid for its kind, or when a * page a widget is on or points at maps to no target page; * - `NotFound` when a page list maps to a page the target doesn't have. * * Left out, in bundle order: a field of an unknown kind, a field whose * name is taken (`nameTaken`, for the document as it is before the * import), a widget whose field isn't in the bundle, and each action that * is a script, a submit or a link when `mayScript` is false * (`doc.forms.script`), or that a write can't make. Each field keeps every * widget it has. With `values`, each field gets the value the bundle holds. */ declare function planFormImport(input: { readonly bundle: Pick; readonly pages?: BundleImportPages; readonly target: readonly BundleImportTarget[]; readonly nameTaken: (name: string) => boolean; readonly mayScript: boolean; readonly values: boolean; }): FormImportPlan; /** A field of the document a values import fills. */ interface FormValuesImportTarget { readonly ref: FormFieldRef; readonly name: string; readonly kind: FormFieldKind; } /** One value a values import writes. */ interface PlannedValueWrite { /** Its field's row in the bundle. */ readonly field: number; /** The document's field of that name. */ readonly target: T; readonly value: FormFieldValue; } /** * What a values import of `bundle` writes into a form whose fields are * `target`: each field the bundle holds a value for gets it, matched by full * name. Left out, in bundle order: a field the document doesn't have * (`no-field`), one of another kind (`wrong-kind`), and one `refusal` * names a reason for: a value the field can't take, a field a signature * locked, a field the session may not fill in. So everything is decided * before the first write. */ declare function planFormValuesImport(input: { readonly bundle: Pick; readonly target: readonly T[]; readonly refusal?: (target: T, value: FormFieldValue) => Extract | null; }): { readonly writes: readonly PlannedValueWrite[]; readonly dropped: readonly FormValuesImportDrop[]; }; //#endregion //#region src/transfer/planFormCopy.d.ts /** * What a copy of fields of `form` (in page space) creates, and what it * leaves out. Nothing here touches a document, so a copy refuses before its * first write: as {@link planFormCopies} refuses, and with `InvalidArg` when * a source's data isn't valid for its kind. */ declare function planFormCopy(input: Parameters[0]): FormCopyPlan; //#endregion export { type AnnotationCopyCreates, type AnnotationImportPlan, type FormImportPlan, type FormValuesImportTarget, type PlannedAnnotation, type PlannedCopyCreate, type PlannedFormField, type PlannedValueWrite, assertAnnotationDraft, assertAnnotationPatch, pdfResolveAnnotationDraft, pdfResolveAnnotationPatch, planAnnotationCopy, planAnnotationImport, planFormCopy, planFormImport, planFormValuesImport }; //# sourceMappingURL=validation.d.ts.map