Public API reference
Find public entry points and their source-derived signatures for sessions, templates, HTTP and printing.
Signatures below come from the public package exports. Mount the workspace in the browser. Template, HTTP and print subpaths are also available to backend integrations. Mounting example · Workstation HTTP
Browser workspace
Editor
@quirekit/ofd-editorCommercial licenseCommercial OFD workspace with its own browser session and view lifecycle.
export class Editor {
constructor(options?: OFDEditorOptions);
mount(target: string | Element): this;
destroy(): void;
}OFDMountedEditorSession
@quirekit/ofd-editorCommercial licenseFile operations attached to the particular editor currently observed by the host.
export interface OFDMountedEditorSession extends OFDEditorSession {
getBusinessDraft(): import("./drafts/types").OFDDraftEntry | undefined;
openBusinessDraft(id: string): Promise<"opened" | "pending" | "failed">;
saveBusinessDraft(id?: string): Promise<boolean>;
readonly templateStore: import("./templates/types").OFDTemplateStore;
getEditingTemplate(): import("./templates/types").OFDTemplateEntry | undefined;
openTemplate(entry: import("./templates/types").OFDTemplateEntry, mode: "new-document" | "edit-template"): Promise<"opened" | "pending" | "failed">;
saveAsTemplate(name: string): Promise<import("./templates/types").OFDTemplateEntry>;
updateTemplate(): Promise<boolean>;
printDocument(): import("./printing/types").OFDPrintDocument;
}Templates and fill services
instantiateOFDTemplate
@quirekit/ofd-editor/templatesCommercial licenseCreates a separate native document, leaving the stored master and its object/resource references intact. @param bytes - Editable master OFD package. @param prepare - Optional domain initialization after assigning file identities. @param reference - Registered source edition persisted for shared field mappings. @returns Independent package, with a fresh DocID for each document body.
function instantiateOFDTemplate(bytes: Uint8Array, prepare?: (source: OFDSourceDocument) => OFDSourceDocument, reference?: OFDTemplateReference): Uint8ArraydescribeOFDTemplateFields
@quirekit/ofd-editor/httpCommercial license@param source - Versioned native master. @returns Portable controls and a value-free request example.
function describeOFDTemplateFields(source: OFDSourceDocument): { schema: { $schema: string; title: string; type: string; required: string[]; additionalProperties: boolean; properties: { version: { const: number; }; context: { type: string; additionalProperties: boolean; required: string[]; properties: { patientId: { type: string; minLength: number; maxLength: number; pattern: string; }; encounterId: { type: string; minLength: number; maxLength: number; pattern: string; }; }; }; values: { type: string; additionalProperties: boolean; properties: { [k: string]: { title: string; type: string; }; }; }; repeats: { type: string; additionalProperties: boolean; properties: { [k: string]: { title: string; type: string; minItems: number; maxItems: number; items: { type: string; additionalProperties: boolean; properties: { [k: string]: { title: string; type: string; }; }; }; }; }; }; rowKeys: { type: string; additionalProperties: boolean; properties: { [k: string]: { readonly enum: string[]; }; }; }; assets: { type: string; maxProperties: number; patternProperties: { "^[1-9][0-9]{0,9}$": { type: string; contentEncoding: string; }; }; additionalProperties: boolean; }; corrections: { type: string; maxItems: number; items: boolean | { oneOf: object[]; }; }; approved: { type: string; maxItems: number; items: { type: string; pattern: string; }; }; }; }; example: import("@quirekit/ofd-editor-core/forms").OFDFormFillData; documentType?: string | undefined; standard?: string | undefined; fields: { codeSystem?: string | undefined; element?: string | undefined; required?: boolean; key: string; label: string; kind: import("@quirekit/ofd-editor-core/forms").OFDFormControlKind; multiline?: boolean; maxLength?: number; preset?: import("@quirekit/ofd-editor-core/forms").OFDFormPreset; format?: string; options?: readonly import("@quirekit/ofd-editor-core/forms").OFDFormOption[]; }[]; groups: { fields: { codeSystem?: string | undefined; element?: string | undefined; required?: boolean; key: string; label: string; kind: import("@quirekit/ofd-editor-core/forms").OFDFormControlKind; multiline?: boolean; maxLength?: number; preset?: import("@quirekit/ofd-editor-core/forms").OFDFormPreset; format?: string; options?: readonly import("@quirekit/ofd-editor-core/forms").OFDFormOption[]; }[]; required?: boolean | undefined; key: string; label: string; capacity: number; }[]; }fillOFDTemplate
@quirekit/ofd-editor/httpCommercial licenseFills a new editable file without opening a window or changing the source template. @param master - Immutable bytes from an authorized versioned store. @param input - Portable fill record or a previous snapshot. @param fallbackFont - Complete font to cover new characters absent from an embedded subset. @param reference - Exact source edition to retain on the generated document. @returns Independent native document and any outstanding completion checks.
function fillOFDTemplate(master: Uint8Array, input: unknown, fallbackFont?: OFDFlowEmbeddedFont, reference?: import("../../templates/types").OFDTemplateReference): { document: OFDSourceDocument; issues: readonly import("@quirekit/ofd-editor-core/forms").OFDFormInputIssue[]; accepted: number; changed: boolean; conflicts: import("@quirekit/ofd-editor-core/forms").OFDFormFillChange[]; }handleOFDHttpRequest
@quirekit/ofd-editor/httpCommercial licenseHandles one request with services already scoped to the calling tenant, including print receipt access. @param request - Web-standard request, including the current user's abort signal. @param services - Authorized stores for this request. @param mount - Absolute path prefix configured by the host. @returns JSON metadata, OFD bytes, or an HTTP error.
function handleOFDHttpRequest(request: Request, services: OFDHttpServices, mount?: string): Promise<Response>Print service
parseOFDPrintRange
@quirekit/ofd-editor/printCommercial license@param text - One-based page ranges, for example 1,3-5. @param count - Source page count. @returns Unique physical page numbers in source order.
function parseOFDPrintRange(text: string, count: number): number[]OFDPrintService
@quirekit/ofd-editor/printCommercial licenseHost integration for a native print queue or authenticated backend.
export interface OFDPrintService {
readonly label: string;
submit(job: OFDPrintJob, signal: AbortSignal): Promise<OFDPrintReceipt>;
status?(jobId: string, signal: AbortSignal): Promise<OFDPrintJobStatus>;
}