npm.io
1.0.6 • Published 2 years ago

@types/transform-pouch

Licence
MIT
Version
1.0.6
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/transform-pouch

Summary

This package contains type definitions for transform-pouch (https://github.com/pouchdb-community/transform-pouch).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/transform-pouch.

index.d.ts

/// <reference types="pouchdb-core" />

declare namespace PouchDB {
    interface Database<Content extends {} = {}> {
        transform<NewContent extends {}>(config: {
            incoming?(doc: Core.Document<Content>): Core.Document<NewContent> | Promise<Core.Document<NewContent>>;
            outgoing?(doc: Core.Document<NewContent>): Core.Document<Content> | Promise<Core.Document<Content>>;
        }): void;
        // api.filter provided for backwards compat with the old "filter-pouch"
        filter<NewContent extends {}>(config: {
            incoming?(doc: Core.Document<Content>): Core.Document<NewContent> | Promise<Core.Document<NewContent>>;
            outgoing?(doc: Core.Document<NewContent>): Core.Document<Content> | Promise<Core.Document<Content>>;
        }): void;
    }
}

// eslint-disable-next-line @definitelytyped/no-declare-current-package
declare module "transform-pouch" {
    const plugin: PouchDB.Plugin & { transform: () => void; filter: () => void };
    export = plugin;
}

Additional Details

Credits

These definitions were written by Lucas Rainett.