1.2.5 • Published 6 months ago

@types/pouch-redux-middleware v1.2.5

Weekly downloads
54
License
MIT
Repository
github
Last release
6 months ago

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

Credits

These definitions were written by Adam Charron.

1.2.5

6 months ago

1.2.4

7 months ago

1.2.3

8 months ago

1.2.2

2 years ago

1.2.1

3 years ago

1.2.0

5 years ago

0.5.5

7 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago