import type { Note, NoteAttachment } from '../notes/types.js'; import type { NoteShareRecord } from './share-types.js'; import type { ShareStore } from './share-store.js'; export interface NoteShareManifestAttachment { id: string; type: NoteAttachment['type']; mimeType: string; fileName: string; size: number; artifactFileName: string; checksum: string; duration?: number; } export interface NoteShareManifest { schemaVersion: 1; shareId: string; source: { noteId: string; noteVersion: number; }; title: string; markdown: string; snapshotAt: string; attachments: NoteShareManifestAttachment[]; } export interface NoteShareSource { getNote(id: string): Promise; getAttachmentPath(noteId: string, attachmentId: string): Promise<{ filePath: string; mimeType: string; fileName: string; } | null>; } export interface CreateNoteShareInput { expectedNoteVersion?: number; attachmentIds?: string[]; ttlMs?: number; maxViews?: number | null; description?: string; gatewayTokenHash: string; } export declare class NoteShareVersionConflictError extends Error { readonly currentVersion: number; constructor(currentVersion: number); } export declare class NoteShareService { private readonly store; private readonly notes; constructor(store: ShareStore, notes: NoteShareSource); create(noteId: string, input: CreateNoteShareInput): Promise; refresh(noteId: string, shareId: string, input: Pick): Promise; list(noteId: string): NoteShareRecord[]; revokeForNote(noteId: string): Promise; removeArtifact(shareId: string): Promise; readManifest(record: NoteShareRecord): Promise; issueAssetTicket(record: NoteShareRecord): string; verifyAssetTicket(record: NoteShareRecord, ticket: string): boolean; resolveAsset(record: NoteShareRecord, attachmentId: string): Promise<{ path: string; attachment: NoteShareManifestAttachment; } | null>; publicMarkdown(record: NoteShareRecord, manifest: NoteShareManifest, ticket: string): string; private requireNote; private buildArtifact; private artifactRelativePath; private artifactDir; }