@embedpdf/plugin-stamp 3.0.0-next.11 → 3.0.0-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract-B79Onij2.js +79 -0
- package/dist/contract-B79Onij2.js.map +1 -0
- package/dist/contract-BS3m51Au.d.cts +384 -0
- package/dist/contract-T-v5KaYd.cjs +162 -0
- package/dist/contract-T-v5KaYd.cjs.map +1 -0
- package/dist/contract-VuCLK5Sr.d.ts +384 -0
- package/dist/contract.cjs +14 -1
- package/dist/contract.d.cts +2 -2
- package/dist/contract.d.ts +2 -2
- package/dist/contract.js +2 -2
- package/dist/index.cjs +694 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +680 -223
- package/dist/index.js.map +1 -1
- package/package.json +12 -10
- package/dist/contract-BaN6-ypU.d.cts +0 -190
- package/dist/contract-BaN6-ypU.d.ts +0 -190
- package/dist/contract-CkPaVNAJ.js +0 -7
- package/dist/contract-CkPaVNAJ.js.map +0 -1
- package/dist/contract-DmQ4peF2.cjs +0 -11
- package/dist/contract-DmQ4peF2.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-T-v5KaYd.cjs","names":[],"sources":["../src/convention.ts","../src/types.ts"],"sourcesContent":["/**\n * Acrobat's stamp-library convention, interpreted in ONE place. A library is\n * a PDF whose `/Names /Pages` registry names each stamp page with a key of\n * the form `identifier=label`:\n *\n * - `identifier` (before the first `=`) is the stamp's durable identity\n * and becomes the placed annotation's `/Name` — a standard name such as\n * `Approved`, or a custom one such as Acrobat's `#LBGiYhk8V_oAfmqAPENiwD`;\n * - `label` (after it) is what the picker shows and the placed\n * annotation's default `/Subj`.\n *\n * The engine never interprets key text; this module does. A key without\n * `=` is its own label. `#` is never stripped — it is part of the identity.\n */\nimport type { PieceInfoPatch } from '@embedpdf/engine-core/runtime';\nimport type { StampAssetKind } from './types';\n\nexport interface StampKey {\n name: string;\n label: string;\n}\n\nexport function parseStampKey(key: string): StampKey {\n const separator = key.indexOf('=');\n if (separator < 0) return { name: key, label: key };\n return { name: key.slice(0, separator), label: key.slice(separator + 1) };\n}\n\nexport function stampKey(name: string, label: string): string {\n return `${name}=${label}`;\n}\n\nconst BASE62 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n/**\n * A fresh identifier for a stamp authored here, in Acrobat's own shape\n * (`#` + 22 base-62 characters) so a stamp created in this viewer keeps its\n * identity when the library is opened and placed in Acrobat.\n */\nexport function customStampName(random: () => number = Math.random): string {\n let out = '#';\n for (let i = 0; i < 22; i++) out += BASE62[Math.floor(random() * BASE62.length)];\n return out;\n}\n\n/** Asset ids are derived, not allocated: library id + identifier. */\nexport function assetIdFor(libraryId: string, name: string): string {\n return `${libraryId}:${name}`;\n}\n\n// ── PieceInfo: only what has no standard home ────────────────────────────────\n//\n// The title, the registry, and the artwork are standard PDF. What remains —\n// a durable library id, categories, a locale, a stamp's kind and an explicit\n// `/Subj` override — rides `/PieceInfo` under these application names, in\n// the shape below. Exported so a library authored outside the plugin (a\n// conversion script, a build step) writes the same dictionary the plugin\n// reads.\n\n/** Catalog `/PieceInfo` application name for library-level data. */\nexport const STAMP_LIBRARY_PIECEINFO_APP = 'EMBD_StampLibrary';\n/** Page `/PieceInfo` application name for per-stamp data. */\nexport const STAMP_PIECEINFO_APP = 'EMBD_Stamp';\n/** The `Version` both dictionaries carry. */\nexport const STAMP_PIECEINFO_VERSION = 2;\n\n/** The library kind every file has unless it says otherwise. */\nexport const DEFAULT_LIBRARY_KIND = 'stamps';\n\n/** `/Kind` names: the two the plugin defines keep their PDF spellings; others are written as given. */\nexport function libraryKindToPdfName(kind: string): string {\n return kind === 'stamps' ? 'StampLibrary' : kind === 'signatures' ? 'SignatureLibrary' : kind;\n}\n\nexport function libraryKindFromPdfName(name: string | undefined): string {\n if (!name || name === 'StampLibrary') return DEFAULT_LIBRARY_KIND;\n return name === 'SignatureLibrary' ? 'signatures' : name;\n}\n\nexport function stampKindToPdfName(kind: StampAssetKind): string {\n return kind === 'signature' ? 'Signature' : kind === 'initials' ? 'Initials' : 'Stamp';\n}\n\n/** The catalog patch: library id, categories, locale. The name is `/Title`. */\nexport function stampLibraryPieceInfo(\n id: string,\n opts: { kind?: string; categories?: readonly string[]; locale?: string } = {},\n): PieceInfoPatch {\n return {\n Version: STAMP_PIECEINFO_VERSION,\n Id: id,\n Kind: { name: libraryKindToPdfName(opts.kind ?? DEFAULT_LIBRARY_KIND) },\n // v2: the name is the PDF's /Title.\n Name: null,\n Categories: opts.categories ?? null,\n Locale: opts.locale ?? null,\n };\n}\n\n/** The page patch: kind, an explicit `/Subj` override, categories. */\nexport function stampPieceInfo(\n kind: StampAssetKind,\n opts: { subject?: string | null; categories?: readonly string[] } = {},\n): PieceInfoPatch {\n return {\n Version: STAMP_PIECEINFO_VERSION,\n Kind: { name: stampKindToPdfName(kind) },\n // v2: the identifier and label live in the /Names /Pages key; only an\n // explicit /Subj override has no standard home. v1 `Name`/`Subject` keys\n // are cleared so a re-imported v1 library cannot disagree with its registry.\n Name: null,\n Subject: null,\n SubjectOverride: opts.subject ?? null,\n Categories: opts.categories ?? null,\n };\n}\n","import type { BinarySource, Engine } from '@embedpdf/engine-core/runtime';\nimport { createCapabilityToken, type EventHook } from '@embedpdf/core';\nimport type { AnnotationRef, PageObjectNumber } from '@embedpdf/engine-core/runtime';\nimport type { StampPlacement } from '@embedpdf/plugin-annotation/contract';\n\n/**\n * The stamp plugin: a workspace-scoped ASSET substrate.\n *\n * The design law (\"documents have a home; assets ride the wire\"): imported\n * PDF libraries retain one canonical PDF whose catalog/page `/PieceInfo`\n * carries their metadata. Per-asset PDFs and previews are derived caches used\n * for placement. Standalone PNG/JPEG assets remain loose because the engine\n * intentionally has no raster-to-PDF-page authoring primitive.\n */\n\nexport type StampAssetKind = 'stamp' | 'signature' | 'initials';\n\n/**\n * What a library file is FOR — the routing key a surface queries by. Open:\n * the plugin defines `stamps` (the default) and `signatures`; an embedder\n * may define its own (`toolbar`, `legal-seals`). Persisted in the file.\n */\nexport type StampLibraryKind = string;\n\nexport interface StampLibraryQuery {\n /** One kind or several; omitted = every library. */\n kind?: StampLibraryKind | readonly StampLibraryKind[];\n}\n\n/**\n * How a mark is authored: drawn strokes (kept as a vector path), typed text\n * in a registered font (embedded by the flatten), a raster image, or a page\n * of a PDF. Ink strokes are in points, y-up, any origin — the asset page is\n * the mark's bounds.\n */\nexport type MarkSource =\n | {\n kind: 'ink';\n strokes: ReadonlyArray<ReadonlyArray<{ x: number; y: number }>>;\n color?: string;\n strokeWidth?: number;\n }\n | { kind: 'text'; text: string; fontFamily: string; color?: string; fontSize?: number }\n | { kind: 'image'; source: BinarySource }\n | { kind: 'pdf'; source: BinarySource; pageIndex?: number };\n\n/**\n * One asset's SERIALIZABLE descriptor. The bytes and the cached preview are\n * deliberately NOT here — the reducer state stays pure/serializable (kernel\n * rule 1); binary lives in the capability and crosses only as call\n * arguments/returns, mirroring the engine's own BinarySource rule.\n */\nexport interface StampAsset {\n /** Derived and stable: `${libraryId}:${name}` (never allocated). */\n id: string;\n libraryId: string;\n kind: StampAssetKind;\n /**\n * The stamp's IDENTIFIER — the text before the first `=` in its library\n * key, and the placed annotation's `/Name`: a standard name (`Approved`)\n * or a custom one (`#LBGiYhk8V_oAfmqAPENiwD`). Not display text.\n */\n name: string;\n /** What the picker shows and the placed annotation's default `/Subj` —\n * the text after `=` in the library key (`Goedgekeurd`). */\n label: string;\n /** Intrinsic size in PDF points (the source page's crop box / image pixels 1:1). */\n size: { width: number; height: number };\n /** The library page that IS this asset. Every asset is a page: a raster\n * added to a library becomes a page carrying the image. */\n pageObjectNumber: number;\n /** An explicit `/Subj` override (PieceInfo); placements use `label` otherwise. */\n subject?: string;\n categories?: string[];\n}\n\n/**\n * A library IS a PDF: its `/Title` is the name, its `/Names /Pages` registry\n * the assets, its pages the artwork, PieceInfo only what has no standard\n * home. One imported PDF becomes one library; `exportLibrary` returns it.\n */\nexport interface StampLibrary {\n /** PieceInfo `Id` — stable while the title is editable. */\n id: string;\n name: string;\n /** PieceInfo `Kind`: `'stamps'`, `'signatures'`, or an embedder's own. */\n kind: StampLibraryKind;\n /** PieceInfo `Locale` — the language of the labels, when the library says. */\n locale?: string;\n categories?: string[];\n /** Asset ids in display order. */\n assetIds: string[];\n}\n\nexport interface StampState {\n libraries: Record<string, StampLibrary>;\n /** Library display order (insertion order). */\n libraryOrder: string[];\n assets: Record<string, StampAsset>;\n}\n\nexport type StampAction =\n | { type: 'LIBRARY_ADDED'; library: StampLibrary }\n | { type: 'LIBRARY_UPDATED'; library: StampLibrary }\n | { type: 'LIBRARY_REMOVED'; libraryId: string }\n | { type: 'ASSET_ADDED'; asset: StampAsset }\n | { type: 'ASSET_UPDATED'; asset: StampAsset }\n | { type: 'ASSET_REMOVED'; assetId: string };\n\n/** Why a library's canonical bytes changed — the persistence signal. */\nexport interface StampLibraryChange {\n libraryId: string;\n reason:\n | 'created'\n | 'imported'\n | 'updated'\n | 'asset-added'\n | 'asset-updated'\n | 'asset-removed'\n | 'removed';\n}\n\nexport interface StampConfig {\n /**\n * The ASSET ENGINE port: any `Engine` that can open `{ kind: 'bytes' }` —\n * used only to slice an imported library PDF into per-page assets and\n * render their previews.\n *\n * Omitted → the kernel's own engine is used, which is exactly right for a\n * local deployment (same WASM instance, zero extra cost). In a CLOUD\n * deployment the kernel engine cannot open local bytes, so pass a factory —\n * it is called (and memoized) on the first import, never at viewer boot:\n *\n * ```ts\n * stampPlugin({\n * assetEngine: () => import('@embedpdf/engine').then((m) => m.createLocalEngine()),\n * })\n * ```\n */\n assetEngine?: Engine | (() => Engine | Promise<Engine>);\n /** Cached thumbnail width in device px (import-time render). Default 256. */\n previewWidth?: number;\n /**\n * Evaluate form-backed (dynamic) PDF stamp assets on arm. Default `true`.\n * Scripting itself is the workspace's ONE JavaScript switch,\n * `actionsPlugin({ javascript: { enabled } })`: stamp has no switch of its\n * own — it asks the target document's actions plugin for a DETACHED realm\n * (same identity, clock, sandbox, and budget; isolated globals), and arms\n * the template unevaluated when scripting is off or actions is absent.\n * `false` keeps templates static even with scripting on — a product\n * choice (a stamp's appearance must equal the reviewed template), not a\n * trust boundary: a detached realm can only alert and spend budget.\n */\n dynamic?: boolean;\n}\n\nexport interface ImportLibraryOptions {\n /**\n * FALLBACK library name, applied only when the PDF carries no `/Title`\n * (an Acrobat-authored or previously exported library names itself).\n * Default `'Stamps'`.\n */\n name?: string;\n /** Library categories written to catalog `/PieceInfo`. */\n categories?: string[];\n /** Kind stamped onto every imported asset. Default `'stamp'`. */\n kind?: StampAssetKind;\n /** What the file is for; overrides what the file says (an Acrobat-authored set imported for a toolbar). */\n libraryKind?: StampLibraryKind;\n /**\n * FALLBACK per-page labels for a plain PDF (no `/Names /Pages` registry):\n * every page becomes a stamp named `Stamp<n>` with this label. Ignored\n * when the PDF registers its stamps itself.\n */\n assetName?: (pageIndex: number) => string;\n}\n\nexport interface AddAssetInput {\n /** Target library; omitted → a new single-asset library named after the asset. */\n libraryId?: string;\n /** The identifier (placed `/Name`). Omit to mint an Acrobat-style `#…` one. */\n name?: string;\n /** Picker text and default `/Subj`. Defaults to `name`. */\n label?: string;\n kind?: StampAssetKind;\n subject?: string;\n categories?: string[];\n /**\n * Single-page PDF (vector) or PNG/JPEG bytes. A raster becomes a PAGE of\n * the library sized to `size` (default: its pixels as points, 1:1) with the\n * image flattened into it — so every asset is a page and every library a\n * complete PDF.\n */\n /** PNG, JPEG, or single-page PDF bytes. Exactly one of `source` / `mark`. */\n source?: BinarySource;\n /** An authored mark — drawn, typed, an image, or a PDF page. Exactly one of `source` / `mark`. */\n mark?: MarkSource;\n /** Thumbnail override for pickers (PNG/JPEG); rendered from the page otherwise. */\n preview?: BinarySource;\n /** Page size in PDF points for a RASTER source. Ignored for PDF sources (the page has one). */\n size?: { width: number; height: number };\n}\n\n/** A cached, browser-paintable render of an asset (PNG from import; raster assets as-is). */\nexport interface StampAssetPreview {\n bytes: Uint8Array;\n mimeType: string;\n}\n\nexport interface StampCapability {\n // ── selectors (pure reads over serializable state) ──\n libraries(query?: StampLibraryQuery): StampLibrary[];\n library(id: string): StampLibrary | null;\n /** Assets of one library, in library order — or every asset when omitted. */\n assets(libraryId?: string): StampAsset[];\n asset(id: string): StampAsset | null;\n // ── binary reads (capability-held, never store state) ──\n /** The asset's paintable preview, or null while none is cached. */\n assetPreview(id: string): StampAssetPreview | null;\n /** Placement bytes; derived from the canonical page for PDF-backed libraries. */\n assetBytes(id: string): Uint8Array | null;\n // ── library intents ──\n /**\n * A new, empty library: a PDF with the given title and no registered\n * stamps yet (like Acrobat, it carries one unregistered blank page so it\n * is a valid file from the start). Resolves to the library id; feed it to\n * `addAsset({ libraryId })` to fill it.\n */\n createLibrary(\n name: string,\n opts?: { id?: string; kind?: StampLibraryKind; categories?: string[] },\n ): Promise<string>;\n /** Rename (the PDF's `/Title`) or re-categorise a library. */\n updateLibrary(id: string, patch: { name?: string; categories?: string[] }): Promise<void>;\n /**\n * Import a PDF as a stamp library: every page becomes one vector asset\n * (single-page PDF bytes + a cached preview render). Uses the asset\n * engine; in a cloud deployment without one configured this rejects with\n * an actionable error. Resolves to the new library id.\n */\n importLibraryPdf(source: BinarySource, opts?: ImportLibraryOptions): Promise<string>;\n /**\n * Add a single asset as a page of its library (a raster is flattened into\n * a fresh page first) and register it under `identifier=label`. Without\n * `libraryId`, a new library named after the label is created for it.\n */\n addAsset(input: AddAssetInput): Promise<string>;\n /**\n * Turn selected annotations of an open document into an asset: their\n * appearances are exported by the engine as ONE single-page PDF sized to\n * their union rect (vector, positions preserved — exactly what the page\n * shows) and added like any PDF asset. The identifier defaults to an\n * Acrobat-style `#…` one so the stamp keeps its identity in Acrobat.\n * Rejects when any ref is not on `pageObjectNumber`, is hidden, or has no\n * appearance (all-or-nothing: a stamp missing a part is worse than an error).\n */\n addAssetFromAnnotations(\n documentId: string,\n pageObjectNumber: PageObjectNumber,\n refs: AnnotationRef[],\n input: Omit<AddAssetInput, 'source' | 'size'>,\n ): Promise<string>;\n /** Remove an asset, deleting its canonical page before state changes when PDF-backed. */\n removeAsset(id: string): Promise<void>;\n /** Remove a library and every asset in it, ordered with in-flight library mutations. */\n removeLibrary(id: string): Promise<void>;\n /**\n * Relabel an asset (the registry key is renamed in one job), set or clear\n * its `/Subj` override, or replace its categories. The identifier never\n * changes — it is the asset's identity and every placed stamp's `/Name`.\n */\n updateAsset(\n id: string,\n patch: { label?: string; subject?: string | null; categories?: string[] },\n ): Promise<void>;\n /**\n * The library as a PDF — its title, its named pages, its artwork: the\n * complete, Acrobat-readable file. This IS the persistence format: store\n * these bytes wherever you like and `importLibraryPdf` them back.\n */\n exportLibrary(id: string): Uint8Array | null;\n /** Fires after every change to a library's canonical bytes — subscribe to persist. */\n onLibraryChanged: EventHook<StampLibraryChange>;\n // ── placement (delegates to the annotation plugin of the named document) ──\n /**\n * Arm an asset on a document: the next click on that document's pages\n * places it (and the hover ghost previews the exact placement). With\n * scripting on (the actions plugin's `javascript` switch), form-backed\n * PDFs are evaluated against that target document in a detached realm and\n * flattened first. Rides `annotation.armStamp` — bytes,\n * preview, and intrinsic size all travel along, so vector stamps keep\n * their true aspect.\n */\n armAsset(documentId: string, assetId: string, opts?: { targetWidth?: number }): Promise<void>;\n /**\n * Place an asset WITHOUT the pointer: the same materialization, name,\n * subject, fit, and page clamp a click after `armAsset` would produce —\n * one placement law, two entry points. Resolves to the new annotation.\n */\n placeAsset(\n documentId: string,\n assetId: string,\n placement: StampPlacement,\n ): Promise<AnnotationRef>;\n /** Disarm the stamp tool on a document. */\n disarm(documentId: string): void;\n /** The asset armed on a document through {@link armAsset}, while the annotation plugin still holds it. */\n armedAsset(documentId: string): StampAsset | null;\n}\n\nexport const StampToken = createCapabilityToken<StampCapability>('stamp');\n"],"mappings":";;AAsBA,SAAgB,cAAc,KAAuB;CACnD,MAAM,YAAY,IAAI,QAAQ,GAAG;CACjC,IAAI,YAAY,GAAG,OAAO;EAAE,MAAM;EAAK,OAAO;CAAI;CAClD,OAAO;EAAE,MAAM,IAAI,MAAM,GAAG,SAAS;EAAG,OAAO,IAAI,MAAM,YAAY,CAAC;CAAE;AAC1E;AAEA,SAAgB,SAAS,MAAc,OAAuB;CAC5D,OAAO,GAAG,KAAK,GAAG;AACpB;AAEA,MAAM,SAAS;;;;;;AAOf,SAAgB,gBAAgB,SAAuB,KAAK,QAAgB;CAC1E,IAAI,MAAM;CACV,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK,OAAO,OAAO,KAAK,MAAM,OAAO,IAAI,EAAa;CAC9E,OAAO;AACT;;AAGA,SAAgB,WAAW,WAAmB,MAAsB;CAClE,OAAO,GAAG,UAAU,GAAG;AACzB;;AAYA,MAAa,8BAA8B;;AAE3C,MAAa,sBAAsB;;AAEnC,MAAa,0BAA0B;;AAGvC,MAAa,uBAAuB;;AAGpC,SAAgB,qBAAqB,MAAsB;CACzD,OAAO,SAAS,WAAW,iBAAiB,SAAS,eAAe,qBAAqB;AAC3F;AAEA,SAAgB,uBAAuB,MAAkC;CACvE,IAAI,CAAC,QAAQ,SAAS,gBAAgB,OAAO;CAC7C,OAAO,SAAS,qBAAqB,eAAe;AACtD;AAEA,SAAgB,mBAAmB,MAA8B;CAC/D,OAAO,SAAS,cAAc,cAAc,SAAS,aAAa,aAAa;AACjF;;AAGA,SAAgB,sBACd,IACA,OAA2E,CAAC,GAC5D;CAChB,OAAO;EACL,SAAA;EACA,IAAI;EACJ,MAAM,EAAE,MAAM,qBAAqB,KAAK,QAAA,QAA4B,EAAE;EAEtE,MAAM;EACN,YAAY,KAAK,cAAc;EAC/B,QAAQ,KAAK,UAAU;CACzB;AACF;;AAGA,SAAgB,eACd,MACA,OAAoE,CAAC,GACrD;CAChB,OAAO;EACL,SAAA;EACA,MAAM,EAAE,MAAM,mBAAmB,IAAI,EAAE;EAIvC,MAAM;EACN,SAAS;EACT,iBAAiB,KAAK,WAAW;EACjC,YAAY,KAAK,cAAc;CACjC;AACF;;;ACmMA,MAAa,cAAA,GAAA,eAAA,sBAAA,CAAoD,OAAO"}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { EventHook } from "@embedpdf/core";
|
|
2
|
+
import { AnnotationRef, BinarySource, Engine, PageObjectNumber, PieceInfoPatch } from "@embedpdf/engine-core/runtime";
|
|
3
|
+
import { StampPlacement } from "@embedpdf/plugin-annotation/contract";
|
|
4
|
+
//#region src/types.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The stamp plugin: a workspace-scoped ASSET substrate.
|
|
7
|
+
*
|
|
8
|
+
* The design law ("documents have a home; assets ride the wire"): imported
|
|
9
|
+
* PDF libraries retain one canonical PDF whose catalog/page `/PieceInfo`
|
|
10
|
+
* carries their metadata. Per-asset PDFs and previews are derived caches used
|
|
11
|
+
* for placement. Standalone PNG/JPEG assets remain loose because the engine
|
|
12
|
+
* intentionally has no raster-to-PDF-page authoring primitive.
|
|
13
|
+
*/
|
|
14
|
+
type StampAssetKind = 'stamp' | 'signature' | 'initials';
|
|
15
|
+
/**
|
|
16
|
+
* What a library file is FOR — the routing key a surface queries by. Open:
|
|
17
|
+
* the plugin defines `stamps` (the default) and `signatures`; an embedder
|
|
18
|
+
* may define its own (`toolbar`, `legal-seals`). Persisted in the file.
|
|
19
|
+
*/
|
|
20
|
+
type StampLibraryKind = string;
|
|
21
|
+
interface StampLibraryQuery {
|
|
22
|
+
/** One kind or several; omitted = every library. */
|
|
23
|
+
kind?: StampLibraryKind | readonly StampLibraryKind[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* How a mark is authored: drawn strokes (kept as a vector path), typed text
|
|
27
|
+
* in a registered font (embedded by the flatten), a raster image, or a page
|
|
28
|
+
* of a PDF. Ink strokes are in points, y-up, any origin — the asset page is
|
|
29
|
+
* the mark's bounds.
|
|
30
|
+
*/
|
|
31
|
+
type MarkSource = {
|
|
32
|
+
kind: 'ink';
|
|
33
|
+
strokes: ReadonlyArray<ReadonlyArray<{
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}>>;
|
|
37
|
+
color?: string;
|
|
38
|
+
strokeWidth?: number;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'text';
|
|
41
|
+
text: string;
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
color?: string;
|
|
44
|
+
fontSize?: number;
|
|
45
|
+
} | {
|
|
46
|
+
kind: 'image';
|
|
47
|
+
source: BinarySource;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'pdf';
|
|
50
|
+
source: BinarySource;
|
|
51
|
+
pageIndex?: number;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* One asset's SERIALIZABLE descriptor. The bytes and the cached preview are
|
|
55
|
+
* deliberately NOT here — the reducer state stays pure/serializable (kernel
|
|
56
|
+
* rule 1); binary lives in the capability and crosses only as call
|
|
57
|
+
* arguments/returns, mirroring the engine's own BinarySource rule.
|
|
58
|
+
*/
|
|
59
|
+
interface StampAsset {
|
|
60
|
+
/** Derived and stable: `${libraryId}:${name}` (never allocated). */
|
|
61
|
+
id: string;
|
|
62
|
+
libraryId: string;
|
|
63
|
+
kind: StampAssetKind;
|
|
64
|
+
/**
|
|
65
|
+
* The stamp's IDENTIFIER — the text before the first `=` in its library
|
|
66
|
+
* key, and the placed annotation's `/Name`: a standard name (`Approved`)
|
|
67
|
+
* or a custom one (`#LBGiYhk8V_oAfmqAPENiwD`). Not display text.
|
|
68
|
+
*/
|
|
69
|
+
name: string;
|
|
70
|
+
/** What the picker shows and the placed annotation's default `/Subj` —
|
|
71
|
+
* the text after `=` in the library key (`Goedgekeurd`). */
|
|
72
|
+
label: string;
|
|
73
|
+
/** Intrinsic size in PDF points (the source page's crop box / image pixels 1:1). */
|
|
74
|
+
size: {
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
};
|
|
78
|
+
/** The library page that IS this asset. Every asset is a page: a raster
|
|
79
|
+
* added to a library becomes a page carrying the image. */
|
|
80
|
+
pageObjectNumber: number;
|
|
81
|
+
/** An explicit `/Subj` override (PieceInfo); placements use `label` otherwise. */
|
|
82
|
+
subject?: string;
|
|
83
|
+
categories?: string[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A library IS a PDF: its `/Title` is the name, its `/Names /Pages` registry
|
|
87
|
+
* the assets, its pages the artwork, PieceInfo only what has no standard
|
|
88
|
+
* home. One imported PDF becomes one library; `exportLibrary` returns it.
|
|
89
|
+
*/
|
|
90
|
+
interface StampLibrary {
|
|
91
|
+
/** PieceInfo `Id` — stable while the title is editable. */
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
/** PieceInfo `Kind`: `'stamps'`, `'signatures'`, or an embedder's own. */
|
|
95
|
+
kind: StampLibraryKind;
|
|
96
|
+
/** PieceInfo `Locale` — the language of the labels, when the library says. */
|
|
97
|
+
locale?: string;
|
|
98
|
+
categories?: string[];
|
|
99
|
+
/** Asset ids in display order. */
|
|
100
|
+
assetIds: string[];
|
|
101
|
+
}
|
|
102
|
+
interface StampState {
|
|
103
|
+
libraries: Record<string, StampLibrary>;
|
|
104
|
+
/** Library display order (insertion order). */
|
|
105
|
+
libraryOrder: string[];
|
|
106
|
+
assets: Record<string, StampAsset>;
|
|
107
|
+
}
|
|
108
|
+
type StampAction = {
|
|
109
|
+
type: 'LIBRARY_ADDED';
|
|
110
|
+
library: StampLibrary;
|
|
111
|
+
} | {
|
|
112
|
+
type: 'LIBRARY_UPDATED';
|
|
113
|
+
library: StampLibrary;
|
|
114
|
+
} | {
|
|
115
|
+
type: 'LIBRARY_REMOVED';
|
|
116
|
+
libraryId: string;
|
|
117
|
+
} | {
|
|
118
|
+
type: 'ASSET_ADDED';
|
|
119
|
+
asset: StampAsset;
|
|
120
|
+
} | {
|
|
121
|
+
type: 'ASSET_UPDATED';
|
|
122
|
+
asset: StampAsset;
|
|
123
|
+
} | {
|
|
124
|
+
type: 'ASSET_REMOVED';
|
|
125
|
+
assetId: string;
|
|
126
|
+
};
|
|
127
|
+
/** Why a library's canonical bytes changed — the persistence signal. */
|
|
128
|
+
interface StampLibraryChange {
|
|
129
|
+
libraryId: string;
|
|
130
|
+
reason: 'created' | 'imported' | 'updated' | 'asset-added' | 'asset-updated' | 'asset-removed' | 'removed';
|
|
131
|
+
}
|
|
132
|
+
interface StampConfig {
|
|
133
|
+
/**
|
|
134
|
+
* The ASSET ENGINE port: any `Engine` that can open `{ kind: 'bytes' }` —
|
|
135
|
+
* used only to slice an imported library PDF into per-page assets and
|
|
136
|
+
* render their previews.
|
|
137
|
+
*
|
|
138
|
+
* Omitted → the kernel's own engine is used, which is exactly right for a
|
|
139
|
+
* local deployment (same WASM instance, zero extra cost). In a CLOUD
|
|
140
|
+
* deployment the kernel engine cannot open local bytes, so pass a factory —
|
|
141
|
+
* it is called (and memoized) on the first import, never at viewer boot:
|
|
142
|
+
*
|
|
143
|
+
* ```ts
|
|
144
|
+
* stampPlugin({
|
|
145
|
+
* assetEngine: () => import('@embedpdf/engine').then((m) => m.createLocalEngine()),
|
|
146
|
+
* })
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
assetEngine?: Engine | (() => Engine | Promise<Engine>);
|
|
150
|
+
/** Cached thumbnail width in device px (import-time render). Default 256. */
|
|
151
|
+
previewWidth?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Evaluate form-backed (dynamic) PDF stamp assets on arm. Default `true`.
|
|
154
|
+
* Scripting itself is the workspace's ONE JavaScript switch,
|
|
155
|
+
* `actionsPlugin({ javascript: { enabled } })`: stamp has no switch of its
|
|
156
|
+
* own — it asks the target document's actions plugin for a DETACHED realm
|
|
157
|
+
* (same identity, clock, sandbox, and budget; isolated globals), and arms
|
|
158
|
+
* the template unevaluated when scripting is off or actions is absent.
|
|
159
|
+
* `false` keeps templates static even with scripting on — a product
|
|
160
|
+
* choice (a stamp's appearance must equal the reviewed template), not a
|
|
161
|
+
* trust boundary: a detached realm can only alert and spend budget.
|
|
162
|
+
*/
|
|
163
|
+
dynamic?: boolean;
|
|
164
|
+
}
|
|
165
|
+
interface ImportLibraryOptions {
|
|
166
|
+
/**
|
|
167
|
+
* FALLBACK library name, applied only when the PDF carries no `/Title`
|
|
168
|
+
* (an Acrobat-authored or previously exported library names itself).
|
|
169
|
+
* Default `'Stamps'`.
|
|
170
|
+
*/
|
|
171
|
+
name?: string;
|
|
172
|
+
/** Library categories written to catalog `/PieceInfo`. */
|
|
173
|
+
categories?: string[];
|
|
174
|
+
/** Kind stamped onto every imported asset. Default `'stamp'`. */
|
|
175
|
+
kind?: StampAssetKind;
|
|
176
|
+
/** What the file is for; overrides what the file says (an Acrobat-authored set imported for a toolbar). */
|
|
177
|
+
libraryKind?: StampLibraryKind;
|
|
178
|
+
/**
|
|
179
|
+
* FALLBACK per-page labels for a plain PDF (no `/Names /Pages` registry):
|
|
180
|
+
* every page becomes a stamp named `Stamp<n>` with this label. Ignored
|
|
181
|
+
* when the PDF registers its stamps itself.
|
|
182
|
+
*/
|
|
183
|
+
assetName?: (pageIndex: number) => string;
|
|
184
|
+
}
|
|
185
|
+
interface AddAssetInput {
|
|
186
|
+
/** Target library; omitted → a new single-asset library named after the asset. */
|
|
187
|
+
libraryId?: string;
|
|
188
|
+
/** The identifier (placed `/Name`). Omit to mint an Acrobat-style `#…` one. */
|
|
189
|
+
name?: string;
|
|
190
|
+
/** Picker text and default `/Subj`. Defaults to `name`. */
|
|
191
|
+
label?: string;
|
|
192
|
+
kind?: StampAssetKind;
|
|
193
|
+
subject?: string;
|
|
194
|
+
categories?: string[];
|
|
195
|
+
/**
|
|
196
|
+
* Single-page PDF (vector) or PNG/JPEG bytes. A raster becomes a PAGE of
|
|
197
|
+
* the library sized to `size` (default: its pixels as points, 1:1) with the
|
|
198
|
+
* image flattened into it — so every asset is a page and every library a
|
|
199
|
+
* complete PDF.
|
|
200
|
+
*/
|
|
201
|
+
/** PNG, JPEG, or single-page PDF bytes. Exactly one of `source` / `mark`. */
|
|
202
|
+
source?: BinarySource;
|
|
203
|
+
/** An authored mark — drawn, typed, an image, or a PDF page. Exactly one of `source` / `mark`. */
|
|
204
|
+
mark?: MarkSource;
|
|
205
|
+
/** Thumbnail override for pickers (PNG/JPEG); rendered from the page otherwise. */
|
|
206
|
+
preview?: BinarySource;
|
|
207
|
+
/** Page size in PDF points for a RASTER source. Ignored for PDF sources (the page has one). */
|
|
208
|
+
size?: {
|
|
209
|
+
width: number;
|
|
210
|
+
height: number;
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
/** A cached, browser-paintable render of an asset (PNG from import; raster assets as-is). */
|
|
214
|
+
interface StampAssetPreview {
|
|
215
|
+
bytes: Uint8Array;
|
|
216
|
+
mimeType: string;
|
|
217
|
+
}
|
|
218
|
+
interface StampCapability {
|
|
219
|
+
libraries(query?: StampLibraryQuery): StampLibrary[];
|
|
220
|
+
library(id: string): StampLibrary | null;
|
|
221
|
+
/** Assets of one library, in library order — or every asset when omitted. */
|
|
222
|
+
assets(libraryId?: string): StampAsset[];
|
|
223
|
+
asset(id: string): StampAsset | null;
|
|
224
|
+
/** The asset's paintable preview, or null while none is cached. */
|
|
225
|
+
assetPreview(id: string): StampAssetPreview | null;
|
|
226
|
+
/** Placement bytes; derived from the canonical page for PDF-backed libraries. */
|
|
227
|
+
assetBytes(id: string): Uint8Array | null;
|
|
228
|
+
/**
|
|
229
|
+
* A new, empty library: a PDF with the given title and no registered
|
|
230
|
+
* stamps yet (like Acrobat, it carries one unregistered blank page so it
|
|
231
|
+
* is a valid file from the start). Resolves to the library id; feed it to
|
|
232
|
+
* `addAsset({ libraryId })` to fill it.
|
|
233
|
+
*/
|
|
234
|
+
createLibrary(name: string, opts?: {
|
|
235
|
+
id?: string;
|
|
236
|
+
kind?: StampLibraryKind;
|
|
237
|
+
categories?: string[];
|
|
238
|
+
}): Promise<string>;
|
|
239
|
+
/** Rename (the PDF's `/Title`) or re-categorise a library. */
|
|
240
|
+
updateLibrary(id: string, patch: {
|
|
241
|
+
name?: string;
|
|
242
|
+
categories?: string[];
|
|
243
|
+
}): Promise<void>;
|
|
244
|
+
/**
|
|
245
|
+
* Import a PDF as a stamp library: every page becomes one vector asset
|
|
246
|
+
* (single-page PDF bytes + a cached preview render). Uses the asset
|
|
247
|
+
* engine; in a cloud deployment without one configured this rejects with
|
|
248
|
+
* an actionable error. Resolves to the new library id.
|
|
249
|
+
*/
|
|
250
|
+
importLibraryPdf(source: BinarySource, opts?: ImportLibraryOptions): Promise<string>;
|
|
251
|
+
/**
|
|
252
|
+
* Add a single asset as a page of its library (a raster is flattened into
|
|
253
|
+
* a fresh page first) and register it under `identifier=label`. Without
|
|
254
|
+
* `libraryId`, a new library named after the label is created for it.
|
|
255
|
+
*/
|
|
256
|
+
addAsset(input: AddAssetInput): Promise<string>;
|
|
257
|
+
/**
|
|
258
|
+
* Turn selected annotations of an open document into an asset: their
|
|
259
|
+
* appearances are exported by the engine as ONE single-page PDF sized to
|
|
260
|
+
* their union rect (vector, positions preserved — exactly what the page
|
|
261
|
+
* shows) and added like any PDF asset. The identifier defaults to an
|
|
262
|
+
* Acrobat-style `#…` one so the stamp keeps its identity in Acrobat.
|
|
263
|
+
* Rejects when any ref is not on `pageObjectNumber`, is hidden, or has no
|
|
264
|
+
* appearance (all-or-nothing: a stamp missing a part is worse than an error).
|
|
265
|
+
*/
|
|
266
|
+
addAssetFromAnnotations(documentId: string, pageObjectNumber: PageObjectNumber, refs: AnnotationRef[], input: Omit<AddAssetInput, 'source' | 'size'>): Promise<string>;
|
|
267
|
+
/** Remove an asset, deleting its canonical page before state changes when PDF-backed. */
|
|
268
|
+
removeAsset(id: string): Promise<void>;
|
|
269
|
+
/** Remove a library and every asset in it, ordered with in-flight library mutations. */
|
|
270
|
+
removeLibrary(id: string): Promise<void>;
|
|
271
|
+
/**
|
|
272
|
+
* Relabel an asset (the registry key is renamed in one job), set or clear
|
|
273
|
+
* its `/Subj` override, or replace its categories. The identifier never
|
|
274
|
+
* changes — it is the asset's identity and every placed stamp's `/Name`.
|
|
275
|
+
*/
|
|
276
|
+
updateAsset(id: string, patch: {
|
|
277
|
+
label?: string;
|
|
278
|
+
subject?: string | null;
|
|
279
|
+
categories?: string[];
|
|
280
|
+
}): Promise<void>;
|
|
281
|
+
/**
|
|
282
|
+
* The library as a PDF — its title, its named pages, its artwork: the
|
|
283
|
+
* complete, Acrobat-readable file. This IS the persistence format: store
|
|
284
|
+
* these bytes wherever you like and `importLibraryPdf` them back.
|
|
285
|
+
*/
|
|
286
|
+
exportLibrary(id: string): Uint8Array | null;
|
|
287
|
+
/** Fires after every change to a library's canonical bytes — subscribe to persist. */
|
|
288
|
+
onLibraryChanged: EventHook<StampLibraryChange>;
|
|
289
|
+
/**
|
|
290
|
+
* Arm an asset on a document: the next click on that document's pages
|
|
291
|
+
* places it (and the hover ghost previews the exact placement). With
|
|
292
|
+
* scripting on (the actions plugin's `javascript` switch), form-backed
|
|
293
|
+
* PDFs are evaluated against that target document in a detached realm and
|
|
294
|
+
* flattened first. Rides `annotation.armStamp` — bytes,
|
|
295
|
+
* preview, and intrinsic size all travel along, so vector stamps keep
|
|
296
|
+
* their true aspect.
|
|
297
|
+
*/
|
|
298
|
+
armAsset(documentId: string, assetId: string, opts?: {
|
|
299
|
+
targetWidth?: number;
|
|
300
|
+
}): Promise<void>;
|
|
301
|
+
/**
|
|
302
|
+
* Place an asset WITHOUT the pointer: the same materialization, name,
|
|
303
|
+
* subject, fit, and page clamp a click after `armAsset` would produce —
|
|
304
|
+
* one placement law, two entry points. Resolves to the new annotation.
|
|
305
|
+
*/
|
|
306
|
+
placeAsset(documentId: string, assetId: string, placement: StampPlacement): Promise<AnnotationRef>;
|
|
307
|
+
/** Disarm the stamp tool on a document. */
|
|
308
|
+
disarm(documentId: string): void;
|
|
309
|
+
/** The asset armed on a document through {@link armAsset}, while the annotation plugin still holds it. */
|
|
310
|
+
armedAsset(documentId: string): StampAsset | null;
|
|
311
|
+
}
|
|
312
|
+
declare const StampToken: import("@embedpdf/core").CapabilityToken<StampCapability>;
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/convention.d.ts
|
|
315
|
+
interface StampKey {
|
|
316
|
+
name: string;
|
|
317
|
+
label: string;
|
|
318
|
+
}
|
|
319
|
+
declare function parseStampKey(key: string): StampKey;
|
|
320
|
+
declare function stampKey(name: string, label: string): string;
|
|
321
|
+
/**
|
|
322
|
+
* A fresh identifier for a stamp authored here, in Acrobat's own shape
|
|
323
|
+
* (`#` + 22 base-62 characters) so a stamp created in this viewer keeps its
|
|
324
|
+
* identity when the library is opened and placed in Acrobat.
|
|
325
|
+
*/
|
|
326
|
+
declare function customStampName(random?: () => number): string;
|
|
327
|
+
/** Asset ids are derived, not allocated: library id + identifier. */
|
|
328
|
+
declare function assetIdFor(libraryId: string, name: string): string;
|
|
329
|
+
/** Catalog `/PieceInfo` application name for library-level data. */
|
|
330
|
+
declare const STAMP_LIBRARY_PIECEINFO_APP = "EMBD_StampLibrary";
|
|
331
|
+
/** Page `/PieceInfo` application name for per-stamp data. */
|
|
332
|
+
declare const STAMP_PIECEINFO_APP = "EMBD_Stamp";
|
|
333
|
+
/** The `Version` both dictionaries carry. */
|
|
334
|
+
declare const STAMP_PIECEINFO_VERSION = 2;
|
|
335
|
+
/** The library kind every file has unless it says otherwise. */
|
|
336
|
+
declare const DEFAULT_LIBRARY_KIND = "stamps";
|
|
337
|
+
/** `/Kind` names: the two the plugin defines keep their PDF spellings; others are written as given. */
|
|
338
|
+
declare function libraryKindToPdfName(kind: string): string;
|
|
339
|
+
declare function libraryKindFromPdfName(name: string | undefined): string;
|
|
340
|
+
declare function stampKindToPdfName(kind: StampAssetKind): string;
|
|
341
|
+
/** The catalog patch: library id, categories, locale. The name is `/Title`. */
|
|
342
|
+
declare function stampLibraryPieceInfo(id: string, opts?: {
|
|
343
|
+
kind?: string;
|
|
344
|
+
categories?: readonly string[];
|
|
345
|
+
locale?: string;
|
|
346
|
+
}): PieceInfoPatch;
|
|
347
|
+
/** The page patch: kind, an explicit `/Subj` override, categories. */
|
|
348
|
+
declare function stampPieceInfo(kind: StampAssetKind, opts?: {
|
|
349
|
+
subject?: string | null;
|
|
350
|
+
categories?: readonly string[];
|
|
351
|
+
}): PieceInfoPatch;
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/persistence.d.ts
|
|
354
|
+
/** The persistence port: bytes by library id. */
|
|
355
|
+
interface StampLibraryStore {
|
|
356
|
+
list(): Promise<Array<{
|
|
357
|
+
id: string;
|
|
358
|
+
bytes: Uint8Array;
|
|
359
|
+
}>>;
|
|
360
|
+
put(id: string, bytes: Uint8Array): Promise<void>;
|
|
361
|
+
delete(id: string): Promise<void>;
|
|
362
|
+
}
|
|
363
|
+
/** An in-memory store — tests and SSR. */
|
|
364
|
+
declare function memoryStampStore(): StampLibraryStore;
|
|
365
|
+
/**
|
|
366
|
+
* Bring every stored library back: each PDF is imported as-is (its title,
|
|
367
|
+
* registry, and PieceInfo id come from the file — the store's key is only a
|
|
368
|
+
* hint). Call once at boot, before seeding defaults, so "already has
|
|
369
|
+
* libraries" means the user's own.
|
|
370
|
+
*/
|
|
371
|
+
declare function restoreStampLibraries(stamp: StampCapability, store: StampLibraryStore): Promise<string[]>;
|
|
372
|
+
/**
|
|
373
|
+
* Keep the store in sync from now on: every canonical change writes the
|
|
374
|
+
* library's PDF (coalesced per library so a burst of edits saves once),
|
|
375
|
+
* a removal deletes it. `except` names libraries never to persist — the
|
|
376
|
+
* bundled default set, typically. Returns the unsubscribe.
|
|
377
|
+
*/
|
|
378
|
+
declare function persistStampLibraries(stamp: StampCapability, store: StampLibraryStore, opts?: {
|
|
379
|
+
except?: readonly string[];
|
|
380
|
+
debounceMs?: number;
|
|
381
|
+
}): () => void;
|
|
382
|
+
//#endregion
|
|
383
|
+
export { StampLibraryKind as A, StampAsset as C, StampConfig as D, StampCapability as E, StampState as M, StampToken as N, StampLibrary as O, StampAction as S, StampAssetPreview as T, stampLibraryPieceInfo as _, DEFAULT_LIBRARY_KIND as a, ImportLibraryOptions as b, STAMP_PIECEINFO_VERSION as c, customStampName as d, libraryKindFromPdfName as f, stampKindToPdfName as g, stampKey as h, restoreStampLibraries as i, StampLibraryQuery as j, StampLibraryChange as k, StampKey as l, parseStampKey as m, memoryStampStore as n, STAMP_LIBRARY_PIECEINFO_APP as o, libraryKindToPdfName as p, persistStampLibraries as r, STAMP_PIECEINFO_APP as s, StampLibraryStore as t, assetIdFor as u, stampPieceInfo as v, StampAssetKind as w, MarkSource as x, AddAssetInput as y };
|
|
384
|
+
//# sourceMappingURL=contract-VuCLK5Sr.d.ts.map
|
package/dist/contract.cjs
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_contract = require("./contract-
|
|
2
|
+
const require_contract = require("./contract-T-v5KaYd.cjs");
|
|
3
|
+
exports.DEFAULT_LIBRARY_KIND = require_contract.DEFAULT_LIBRARY_KIND;
|
|
4
|
+
exports.STAMP_LIBRARY_PIECEINFO_APP = require_contract.STAMP_LIBRARY_PIECEINFO_APP;
|
|
5
|
+
exports.STAMP_PIECEINFO_APP = require_contract.STAMP_PIECEINFO_APP;
|
|
6
|
+
exports.STAMP_PIECEINFO_VERSION = require_contract.STAMP_PIECEINFO_VERSION;
|
|
3
7
|
exports.StampToken = require_contract.StampToken;
|
|
8
|
+
exports.assetIdFor = require_contract.assetIdFor;
|
|
9
|
+
exports.customStampName = require_contract.customStampName;
|
|
10
|
+
exports.libraryKindFromPdfName = require_contract.libraryKindFromPdfName;
|
|
11
|
+
exports.libraryKindToPdfName = require_contract.libraryKindToPdfName;
|
|
12
|
+
exports.parseStampKey = require_contract.parseStampKey;
|
|
13
|
+
exports.stampKey = require_contract.stampKey;
|
|
14
|
+
exports.stampKindToPdfName = require_contract.stampKindToPdfName;
|
|
15
|
+
exports.stampLibraryPieceInfo = require_contract.stampLibraryPieceInfo;
|
|
16
|
+
exports.stampPieceInfo = require_contract.stampPieceInfo;
|
package/dist/contract.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { type AddAssetInput, type ImportLibraryOptions, type StampAsset, type StampAssetKind, type StampAssetPreview, type StampCapability, type StampConfig, type StampLibrary, type StampState, StampToken };
|
|
1
|
+
import { A as StampLibraryKind, C as StampAsset, D as StampConfig, E as StampCapability, M as StampState, N as StampToken, O as StampLibrary, T as StampAssetPreview, _ as stampLibraryPieceInfo, a as DEFAULT_LIBRARY_KIND, b as ImportLibraryOptions, c as STAMP_PIECEINFO_VERSION, d as customStampName, f as libraryKindFromPdfName, g as stampKindToPdfName, h as stampKey, j as StampLibraryQuery, k as StampLibraryChange, l as StampKey, m as parseStampKey, o as STAMP_LIBRARY_PIECEINFO_APP, p as libraryKindToPdfName, s as STAMP_PIECEINFO_APP, t as StampLibraryStore, u as assetIdFor, v as stampPieceInfo, w as StampAssetKind, x as MarkSource, y as AddAssetInput } from "./contract-BS3m51Au.cjs";
|
|
2
|
+
export { type AddAssetInput, DEFAULT_LIBRARY_KIND, type ImportLibraryOptions, type MarkSource, STAMP_LIBRARY_PIECEINFO_APP, STAMP_PIECEINFO_APP, STAMP_PIECEINFO_VERSION, type StampAsset, type StampAssetKind, type StampAssetPreview, type StampCapability, type StampConfig, type StampKey, type StampLibrary, type StampLibraryChange, type StampLibraryKind, type StampLibraryQuery, type StampLibraryStore, type StampState, StampToken, assetIdFor, customStampName, libraryKindFromPdfName, libraryKindToPdfName, parseStampKey, stampKey, stampKindToPdfName, stampLibraryPieceInfo, stampPieceInfo };
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { type AddAssetInput, type ImportLibraryOptions, type StampAsset, type StampAssetKind, type StampAssetPreview, type StampCapability, type StampConfig, type StampLibrary, type StampState, StampToken };
|
|
1
|
+
import { A as StampLibraryKind, C as StampAsset, D as StampConfig, E as StampCapability, M as StampState, N as StampToken, O as StampLibrary, T as StampAssetPreview, _ as stampLibraryPieceInfo, a as DEFAULT_LIBRARY_KIND, b as ImportLibraryOptions, c as STAMP_PIECEINFO_VERSION, d as customStampName, f as libraryKindFromPdfName, g as stampKindToPdfName, h as stampKey, j as StampLibraryQuery, k as StampLibraryChange, l as StampKey, m as parseStampKey, o as STAMP_LIBRARY_PIECEINFO_APP, p as libraryKindToPdfName, s as STAMP_PIECEINFO_APP, t as StampLibraryStore, u as assetIdFor, v as stampPieceInfo, w as StampAssetKind, x as MarkSource, y as AddAssetInput } from "./contract-VuCLK5Sr.js";
|
|
2
|
+
export { type AddAssetInput, DEFAULT_LIBRARY_KIND, type ImportLibraryOptions, type MarkSource, STAMP_LIBRARY_PIECEINFO_APP, STAMP_PIECEINFO_APP, STAMP_PIECEINFO_VERSION, type StampAsset, type StampAssetKind, type StampAssetPreview, type StampCapability, type StampConfig, type StampKey, type StampLibrary, type StampLibraryChange, type StampLibraryKind, type StampLibraryQuery, type StampLibraryStore, type StampState, StampToken, assetIdFor, customStampName, libraryKindFromPdfName, libraryKindToPdfName, parseStampKey, stampKey, stampKindToPdfName, stampLibraryPieceInfo, stampPieceInfo };
|
package/dist/contract.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as StampToken } from "./contract-
|
|
2
|
-
export { StampToken };
|
|
1
|
+
import { a as STAMP_PIECEINFO_VERSION, c as libraryKindFromPdfName, d as stampKey, f as stampKindToPdfName, i as STAMP_PIECEINFO_APP, l as libraryKindToPdfName, m as stampPieceInfo, n as DEFAULT_LIBRARY_KIND, o as assetIdFor, p as stampLibraryPieceInfo, r as STAMP_LIBRARY_PIECEINFO_APP, s as customStampName, t as StampToken, u as parseStampKey } from "./contract-B79Onij2.js";
|
|
2
|
+
export { DEFAULT_LIBRARY_KIND, STAMP_LIBRARY_PIECEINFO_APP, STAMP_PIECEINFO_APP, STAMP_PIECEINFO_VERSION, StampToken, assetIdFor, customStampName, libraryKindFromPdfName, libraryKindToPdfName, parseStampKey, stampKey, stampKindToPdfName, stampLibraryPieceInfo, stampPieceInfo };
|