@types/pouch-redux-middleware
TypeScript icon, indicating that this package has built-in type declarations

1.2.5 • Public • Published

Installation

npm install --save @types/pouch-redux-middleware

Summary

This package contains type definitions for pouch-redux-middleware (https://github.com/pgte/pouch-redux-middleware).

Details

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

index.d.ts

import * as PouchDB from "pouchdb";
import { AnyAction, Dispatch, Middleware } from "redux";

export type Document<T = { [field: string]: any }> = PouchDB.Core.IdMeta & T;

export interface Path<T extends {} = { [field: string]: any }> {
    path: string;
    db: PouchDB.Database<T>;
    scheduleRemove?(doc: Document<T>): void;
    scheduleInset?(doc: Document<T>): void;
    propagateDelete?(doc: Document<T>, dispatch: Dispatch<any>): void;
    propagateBatchInsert?(doc: Array<Document<T>>, dispatch: Dispatch<any>): void;
    propagateInsert?(doc: Document<T>, dispatch: Dispatch<any>): void;
    propagateUpdate?(doc: Document<T>, dispatch: Dispatch<any>): void;
    handleResponse?(err: Error, data: any, errorCallback: (err: Error) => void): void;
    initialBatchDispatched?(err?: Error): void;
    queue?(...args: any[]): any;
    docs?: any;
    actions: {
        remove(doc: Document<T>): AnyAction;
        update(doc: Document<T>): AnyAction;
        insert(doc: Document<T>): AnyAction;
        batchInsert(docs: Array<Document<T>>): AnyAction;
    };
}

export default function PouchMiddlewareFactory<T extends {} = { [field: string]: any }>(
    paths?: Array<Path<T>> | Path<T>,
): Middleware;

Additional Details

Credits

These definitions were written by Adam Charron.

Dependents (0)

Package Sidebar

Install

npm i @types/pouch-redux-middleware

Weekly Downloads

17

Version

1.2.5

License

MIT

Unpacked Size

5.24 kB

Total Files

5

Last publish

Collaborators

  • types