1.2.5 • Published 6 months ago
@types/pouch-redux-middleware v1.2.5
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
// Type definitions for pouch-redux-middleware 1.2
// 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, AnyAction, Middleware } from 'redux';
import * as PouchDB from 'pouchdb';
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: Sat, 23 Apr 2022 00:01:41 GMT
- Dependencies: @types/redux, @types/pouchdb
- Global values: none
Credits
These definitions were written by Adam Charron.