Encrypted Pouch - v0.1.0
    Preparing search index...

    Interface PouchListener

    Callbacks for document changes, deletions, conflicts, sync events, and errors

    interface PouchListener {
        onChange: (changes: { table: string; docs: Doc[] }[]) => void;
        onDelete: (deletions: { table: string; docs: DocRef[] }[]) => void;
        onConflict?: (conflicts: ConflictInfo[]) => void;
        onSync?: (info: SyncInfo) => void;
        onError?: (errors: DecryptionErrorEvent[]) => void;
    }
    Index

    Properties

    onChange: (changes: { table: string; docs: Doc[] }[]) => void

    Called when documents are added or updated. Documents are batched by table for performance. On initial load with thousands of documents, you get one callback per table instead of thousands of individual callbacks.

    Type Declaration

      • (changes: { table: string; docs: Doc[] }[]): void
      • Parameters

        • changes: { table: string; docs: Doc[] }[]

          Array of changes, each containing a table name and array of documents

        Returns void

    onDelete: (deletions: { table: string; docs: DocRef[] }[]) => void

    Called when documents are deleted. Deletions are batched by table for performance.

    Type Declaration

      • (deletions: { table: string; docs: DocRef[] }[]): void
      • Parameters

        • deletions: { table: string; docs: DocRef[] }[]

          Array of deletions, each containing a table name and array of document references

        Returns void

    onConflict?: (conflicts: ConflictInfo[]) => void

    Optional callback for conflict detection. Called when PouchDB detects conflicting versions of a document during sync.

    Type Declaration

    onSync?: (info: SyncInfo) => void

    Optional callback for sync progress events. Called during sync operations to report progress.

    Type Declaration

      • (info: SyncInfo): void
      • Parameters

        • info: SyncInfo

          Information about the sync operation

        Returns void

    onError?: (errors: DecryptionErrorEvent[]) => void

    Optional callback for decryption errors. Called when a document fails to decrypt (e.g., wrong password, corrupted data).

    Type Declaration