# @embedpdf/plugin-attachment — ./contract AnnotationRef [TypeAliasDeclaration] (from packages/engine/core/src/identity/AnnotationRef.ts): export type AnnotationRef = |{ kind: 'objectNumber'; page: PageRef; objectNumber: number; } |{ kind: 'baseIndex'; page: PageRef; baseIndex: number; } ; AttachedFile [InterfaceDeclaration]: export interface AttachedFile extends Readonly{ readonly id: string; readonly home: AttachedFileHome; } AttachedFileHome [TypeAliasDeclaration]: export type AttachedFileHome = |{ readonly kind: 'document'; readonly ref: AttachmentRef} |{ readonly kind: 'page'; readonly ref: AnnotationRef} ; AttachmentCapability [InterfaceDeclaration]: export interface AttachmentCapability{ list(): readonly AttachedFile[]; get(id: string): AttachedFile | null; getSelected(): readonly AttachedFile[]; select(files: readonly AttachedFile[]): void; isPending(file: AttachedFile): boolean; getStatus(): ResourceStatus; ensureLoaded(options?: OperationOptions): Promise; refresh(options?: OperationOptions): Promise; canDownload(): boolean; canCreate(): boolean; canDelete(file: AttachedFile): boolean; create( files: readonly AttachmentFileSource[], options?: OperationOptions, ): Promise; delete(file: AttachedFile, options?: OperationOptions): Promise; download(file: AttachedFile, options?: OperationOptions): Promise; reveal(file: AttachedFile): void; readonly onChanged: EventHook; readonly onResynced: EventHook; } AttachmentContent [InterfaceDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export interface AttachmentContent{ bytes: Uint8Array; name: string; mimeType: string | null; } AttachmentFileInfo [InterfaceDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export interface AttachmentFileInfo{ name: string; mimeType: string | null; description: string | null; sizeBytes: number | null; md5: string | null; createdAt: IsoDateTime | null; modifiedAt: IsoDateTime | null; } AttachmentFileSource [InterfaceDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export interface AttachmentFileSource{ data: Uint8Array | ArrayBuffer | Blob; name?: string; mimeType?: string; description?: string; } AttachmentRef [TypeAliasDeclaration] (from packages/engine/core/src/dto/Attachment.ts): export type AttachmentRef ={ kind: 'key'; key: string} ; AttachmentToken [VariableDeclaration] (from packages/plugin/attachment/src/token.ts): AttachmentToken = createCapabilityToken('attachment', { hint: "add attachmentPlugin() from '@embedpdf/plugin-attachment' to your plugins list", promises:{ ensureLoaded: true, refresh: true, create: true, delete: true, download: true, } , } ) AttachmentsChangedEvent [InterfaceDeclaration]: export interface AttachmentsChangedEvent{ readonly type: 'created' | 'deleted' | 'restored'; readonly files: readonly AttachedFile[]; readonly origin: EventOrigin; } AttachmentsResyncedEvent [InterfaceDeclaration]: export interface AttachmentsResyncedEvent{ readonly files: readonly AttachedFile[]; } displayNameOf [FunctionDeclaration] (from packages/plugin/attachment/src/names.ts): export function displayNameOf(file:{ readonly name: string} ): string{ return file.name.replace(HIDDEN, '').trim() || 'attachment'; }