1.0.9 • Published 6 months ago

@types/mongration v1.0.9

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

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

// Type definitions for mongration 1.0
// Project: https://github.com/awapps/mongration#readme
// Definitions by: Anton Lobashev <https://github.com/soulthreads>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 4.1

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

  • Last updated: Sun, 24 Apr 2022 14:31:48 GMT
  • Dependencies: @types/mongodb
  • Global values: none

Credits

These definitions were written by Anton Lobashev.

1.0.9

6 months ago

1.0.8

7 months ago

1.0.7

8 months ago

1.0.6

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago