# @embedpdf/plugin-stamp — ./contract AssetFromAnnotationsInput [TypeAliasDeclaration]: export type AssetFromAnnotationsInput = Omit; CreateAssetInput [InterfaceDeclaration]: export interface CreateAssetInput{ libraryId?: string; name?: string; label?: string; kind?: StampAssetKind; subject?: string; categories?: string[]; source?: BinarySource; mark?: MarkSource; preview?: BinarySource; size?:{ width: number; height: number} ; } CreateLibraryOptions [InterfaceDeclaration]: export interface CreateLibraryOptions extends OperationOptions{ readonly id?: string; readonly kind?: StampLibraryKind; readonly categories?: string[]; } DEFAULT_LIBRARY_KIND [VariableDeclaration] (from packages/plugin/stamp/src/convention.ts): DEFAULT_LIBRARY_KIND = 'stamps' ImportLibraryOptions [InterfaceDeclaration]: export interface ImportLibraryOptions extends OperationOptions{ id?: string; name?: string; categories?: string[]; assetKind?: StampAssetKind; libraryKind?: StampLibraryKind; assetName?: (pageIndex: number) => string; } MarkSource [TypeAliasDeclaration]: export type MarkSource = |{ kind: 'ink'; strokes: ReadonlyArray>; color?: string; strokeWidth?: number; } |{ kind: 'text'; text: string; fontFamily: string; color?: string; fontSize?: number} |{ kind: 'image'; source: BinarySource} |{ kind: 'pdf'; source: BinarySource; pageIndex?: number} ; STAMP_DEFAULTS [VariableDeclaration]: STAMP_DEFAULTS: StampSettings ={ assetEngine: null, fonts: [], previewWidth: 256, dynamic: true, } StampArmChangedEvent [InterfaceDeclaration]: export interface StampArmChangedEvent{ readonly documentId: string; readonly asset: StampAsset | null; } StampArmOptions [InterfaceDeclaration]: export interface StampArmOptions extends StampDocumentOptions{ readonly targetWidth?: number; } StampAsset [InterfaceDeclaration]: export interface StampAsset{ readonly id: string; readonly libraryId: string; readonly kind: StampAssetKind; readonly name: string; readonly label: string; readonly size:{ width: number; height: number} ; readonly page: PageRef; readonly subject?: string; readonly categories?: string[]; } StampAssetCreatedEvent [InterfaceDeclaration]: export interface StampAssetCreatedEvent{ readonly assetId: string; readonly libraryId: string; readonly asset: StampAsset; } StampAssetDeletedEvent [InterfaceDeclaration]: export interface StampAssetDeletedEvent{ readonly assetId: string; readonly libraryId: string; readonly asset: null; } StampAssetEngine [TypeAliasDeclaration]: export type StampAssetEngine = LocalEngine | (() => LocalEngine | Promise); StampAssetFilter [InterfaceDeclaration]: export interface StampAssetFilter{ readonly libraryId?: string; readonly kind?: StampAssetKind; readonly category?: string; } StampAssetKind [TypeAliasDeclaration]: export type StampAssetKind = 'stamp' | 'signature' | 'initials'; StampAssetPatch [InterfaceDeclaration]: export interface StampAssetPatch{ readonly label?: string; readonly subject?: string | null; readonly categories?: string[]; } StampAssetPreview [InterfaceDeclaration]: export interface StampAssetPreview{ readonly bytes: Uint8Array; readonly mimeType: string; } StampAssetUpdatedEvent [InterfaceDeclaration]: export interface StampAssetUpdatedEvent{ readonly assetId: string; readonly libraryId: string; readonly asset: StampAsset; } StampCapability [InterfaceDeclaration]: export interface StampCapability extends SettingsApi{ listLibraries(filter?: StampLibraryFilter): readonly StampLibrary[]; getLibrary(libraryId: string): StampLibrary | null; listAssets(filter?: StampAssetFilter): readonly StampAsset[]; getAsset(assetId: string): StampAsset | null; getAssetPreview(assetId: string): StampAssetPreview | null; renderAssetPreview( assetId: string, options:{ width: number} & OperationOptions, ): Promise; getAssetBytes(assetId: string): Uint8Array | null; createLibrary(name: string, options?: CreateLibraryOptions): Promise<{ library: StampLibrary} >; updateLibrary( libraryId: string, changes: StampLibraryPatch, options?: OperationOptions, ): Promise<{ library: StampLibrary} >; deleteLibrary(libraryId: string, options?: OperationOptions): Promise; importLibrary( source: BinarySource, options?: ImportLibraryOptions, ): Promise<{ library: StampLibrary} >; exportLibrary(libraryId: string, options?: OperationOptions): Promise; createAsset(input: CreateAssetInput, options?: OperationOptions): Promise<{ asset: StampAsset} >; createAssetFromAnnotations( page: PageRef | number, refs: readonly AnnotationRef[], input: AssetFromAnnotationsInput, options?: StampDocumentOptions, ): Promise<{ asset: StampAsset} >; updateAsset( assetId: string, changes: StampAssetPatch, options?: OperationOptions, ): Promise<{ asset: StampAsset} >; deleteAsset(assetId: string, options?: OperationOptions): Promise; moveAsset( assetId: string, to:{ libraryId: string} , options?: OperationOptions, ): Promise<{ asset: StampAsset} >; duplicateAsset( assetId: string, options?:{ label?: string} & OperationOptions, ): Promise<{ asset: StampAsset} >; armAsset(assetId: string, options?: StampArmOptions): Promise; disarm(documentId?: string): void; getArmedAsset(documentId?: string): StampAsset | null; placeAsset( assetId: string, placement: StampPlacement, options?: StampDocumentOptions, ): Promise<{ annotation: Annotation} >; placeAssetOnPages( assetId: string, pages: readonly (PageRef | number)[] | 'all', placement: Omit, options?: StampDocumentOptions, ): Promise>; canPlace(documentId?: string): boolean; canCreateFromAnnotations(documentId?: string): boolean; canImport(): boolean; readonly onLibraryCreated: EventHook; readonly onLibraryUpdated: EventHook; readonly onLibraryDeleted: EventHook; readonly onAssetCreated: EventHook; readonly onAssetUpdated: EventHook; readonly onAssetDeleted: EventHook; readonly onArmChanged: EventHook; readonly onLibraryChanged: EventHook; } StampConfig [TypeAliasDeclaration]: export type StampConfig = DeepPartial; StampDocumentOptions [InterfaceDeclaration]: export interface StampDocumentOptions extends OperationOptions{ readonly documentId?: string; } StampFont [InterfaceDeclaration]: export interface StampFont{ readonly key: string; readonly load: () => Promise; } StampLibrary [InterfaceDeclaration]: export interface StampLibrary{ readonly id: string; readonly name: string; readonly kind: StampLibraryKind; readonly locale?: string; readonly categories?: string[]; readonly assetIds: string[]; } StampLibraryChangedEvent [InterfaceDeclaration]: export interface StampLibraryChangedEvent{ readonly libraryId: string; readonly type: | 'created' | 'imported' | 'updated' | 'asset-created' | 'asset-updated' | 'asset-deleted' | 'deleted'; } StampLibraryCreatedEvent [InterfaceDeclaration]: export interface StampLibraryCreatedEvent{ readonly libraryId: string; readonly library: StampLibrary; } StampLibraryDeletedEvent [InterfaceDeclaration]: export interface StampLibraryDeletedEvent{ readonly libraryId: string; readonly library: null; } StampLibraryFilter [InterfaceDeclaration]: export interface StampLibraryFilter{ readonly kind?: StampLibraryKind | readonly StampLibraryKind[]; } StampLibraryKind [TypeAliasDeclaration]: export type StampLibraryKind = string; StampLibraryPatch [InterfaceDeclaration]: export interface StampLibraryPatch{ readonly name?: string; readonly categories?: string[]; } StampLibraryStore [InterfaceDeclaration] (from packages/plugin/stamp/src/persistence.ts): export interface StampLibraryStore{ list(): Promise>; put(id: string, bytes: Uint8Array): Promise; delete(id: string): Promise; } StampLibraryUpdatedEvent [InterfaceDeclaration]: export interface StampLibraryUpdatedEvent{ readonly libraryId: string; readonly library: StampLibrary; } StampPlacement [InterfaceDeclaration] (from packages/plugin/annotation/src/contract.ts): export interface StampPlacement{ readonly page: PageRef | number; readonly center: Point; readonly targetWidth?: number; readonly rotation?: number; readonly select?: boolean; } StampSettings [InterfaceDeclaration]: export interface StampSettings{ readonly assetEngine: StampAssetEngine | null; readonly fonts: readonly StampFont[]; readonly previewWidth: number; readonly dynamic: boolean; } StampToken [VariableDeclaration] (from packages/plugin/stamp/src/token.ts): StampToken = createCapabilityToken('stamp', { hint: `add stampPlugin() from '@embedpdf/plugin-stamp' to your plugins list`, } )