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

1.0.9 • Public • Published

Installation

npm install --save @types/mongration

Summary

This package contains type definitions for mongration (https://github.com/awapps/mongration#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongration.

index.d.ts

import { Db } from "mongodb";

export interface DbConfig {
    hosts?: string | undefined;
    db?: string | undefined;
    user?: string | undefined;
    password?: string | undefined;
    mongoUri?: string | undefined;
    migrationCollection: string;
    replicaSet?: string | undefined;
}

export interface MigrationResponse {
    id: string;
    status: "not-run" | "skipped" | "pending" | "ok" | "error" | "rollback" | "rollback-error";
}

export class Migration {
    constructor(dbConfig: DbConfig);
    add: (paths: string | string[]) => void;
    addAllFromPath: (path: string) => void;
    migrate: (doneCb?: (err: Error | null, response: MigrationResponse[]) => void) => void;
}

export interface MigrationStep {
    id: string;
    up: (db: Db, cb: (err?: Error) => void) => void;
    down?: ((db: Db, cb: (err?: Error) => void) => void) | undefined;
}

Additional Details

Credits

These definitions were written by Anton Lobashev.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/mongration

Weekly Downloads

5

Version

1.0.9

License

MIT

Unpacked Size

4.45 kB

Total Files

5

Last publish

Collaborators

  • types