Encrypted Pouch - v0.2.1
    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: ErrorEvent[]) => 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: ErrorEvent[]) => void

    Optional callback for error events.

    Fires for two kinds of error:

    • kind: "decrypt" — a stored document failed to decrypt (wrong password, corrupted ciphertext).
    • kind: "write" — a document in a bulk write (see EncryptedPouch.putAll) was rejected by PouchDB (e.g. a revision conflict).

    Use the kind discriminator to handle each case.

    Type Declaration