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

0.5.39 • Public • Published

Installation

npm install --save @types/gridfs-stream

Summary

This package contains type definitions for gridfs-stream (https://github.com/aheckmann/gridfs-stream).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gridfs-stream.

index.d.ts

/// <reference types="node" />

declare namespace GridFSStream {
    export interface Range {
        startPos: number;
        endPos: number;
    }

    export interface Options {
        _id?: string | undefined;
        filename?: string | undefined;
        mode?: string | undefined;

        range?: Range | undefined;

        // any other options from the GridStore may be passed too, e.g.
        chunkSize?: number | undefined;
        content_type?: string | undefined;
        root?: string | undefined;
        metadata?: any;
    }

    export interface WriteStream extends NodeJS.WritableStream {
        writable: boolean;
        name: string;
        id: string;
        options: Options;
        mode: string;
    }

    export interface ReadStream extends NodeJS.ReadableStream {
        readable: boolean;
        paused: boolean;
    }
}

import mongo = require("mongodb");

// Merged declaration, g is both a callable function and a namespace
declare function g(db: any, mongo: any): g.Grid;

declare namespace g {
    export class Grid {
        files: mongo.Collection;
        collection(name?: string): mongo.Collection;
        curCol: string;

        createWriteStream(options?: GridFSStream.Options): GridFSStream.WriteStream;
        createReadStream(options?: GridFSStream.Options): GridFSStream.ReadStream;
        createWriteStream(options?: string): GridFSStream.WriteStream;
        createReadStream(options?: string): GridFSStream.ReadStream;

        remove(options: GridFSStream.Options, callback: (err: Error) => void): void;
        exist(options: GridFSStream.Options, callback: (err: Error, found: boolean) => void): void;
        findOne(options: GridFSStream.Options, callback: (err: Error, record: any) => void): void;
    }
}

export = g;

Additional Details

Credits

These definitions were written by Lior Mualem.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.5.280ts2.0
0.5.280ts2.1
0.5.280ts2.2
0.5.391,640ts5.7
0.5.391,640ts5.6
0.5.391,640latest
0.5.391,640ts4.5
0.5.391,640ts4.6
0.5.391,640ts4.7
0.5.391,640ts4.8
0.5.391,640ts4.9
0.5.391,640ts5.0
0.5.391,640ts5.1
0.5.391,640ts5.2
0.5.391,640ts5.3
0.5.391,640ts5.4
0.5.391,640ts5.5
0.5.391,640ts5.8
0.5.31233ts2.8
0.5.31233ts2.9
0.5.36217ts4.1
0.5.36217ts4.2
0.5.36217ts4.3
0.5.36217ts4.4
0.5.3551ts3.6
0.5.3551ts3.7
0.5.3551ts3.8
0.5.3551ts3.9
0.5.3551ts4.0
0.5.3336ts3.2
0.5.3336ts3.3
0.5.3336ts3.4
0.5.3336ts3.5
0.5.303ts2.3
0.5.303ts2.4
0.5.303ts2.5
0.5.303ts2.6
0.5.303ts2.7
0.5.321ts3.0
0.5.321ts3.1

Version History

VersionDownloads (Last 7 Days)Published
0.5.391,640
0.5.389
0.5.370
0.5.36217
0.5.3551
0.5.340
0.5.3336
0.5.321
0.5.31233
0.5.303
0.5.290
0.5.280
0.5.270
0.5.26-alpha0
0.5.25-alpha0
0.5.24-alpha0
0.5.23-alpha0
0.5.22-alpha0
0.5.21-alpha0
0.5.20-alpha0
0.5.15-alpha0
0.5.14-alpha0

Package Sidebar

Install

npm i @types/gridfs-stream

Weekly Downloads

2,190

Version

0.5.39

License

MIT

Unpacked Size

6.29 kB

Total Files

5

Last publish

Collaborators

  • types