mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Per the README, and with research prompted by #19691, the shape of PouchDB export should reflect what is currently the node package's package.json main export shape (not jsnext:main).
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
// Type definitions for pouch-redux-middleware 0.5
|
|
// Project: https://github.com/pgte/pouch-redux-middleware
|
|
// Definitions by: Adam Charron <https://github.com/charrondev>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.3
|
|
|
|
import { Dispatch, Action, Middleware } from 'redux';
|
|
import * as PouchDB from 'pouchdb';
|
|
|
|
export interface Document {
|
|
_id: any;
|
|
[field: string]: any;
|
|
}
|
|
|
|
export interface Path {
|
|
path: string;
|
|
db: PouchDB.Database<any>;
|
|
scheduleRemove?(doc: Document): void;
|
|
scheduleInset?(doc: Document): void;
|
|
propagateDelete?(doc: Document, dispatch: Dispatch<any>): void;
|
|
propagateInsert?(doc: Document, dispatch: Dispatch<any>): void;
|
|
propagateUpdate?(doc: Document, dispatch: Dispatch<any>): void;
|
|
handleResponse?(err: Error, data: any, errorCallback: (err: Error) => void): void;
|
|
queue?(...args: any[]): any;
|
|
docs?: any;
|
|
actions: {
|
|
remove(doc: Document): Action;
|
|
update(doc: Document): Action;
|
|
insert(doc: Document): Action;
|
|
};
|
|
}
|
|
|
|
export default function PouchMiddlewareFactory(paths?: Path[] | Path): Middleware;
|