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
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/pouchdb, redux
Credits
These definitions were written by Adam Charron.