<commit_before>// Type definitions for gridfs-stream 0.5.0
// Project: https://github.com/aheckmann/gridfs-stream
// Definitions by: <NAME> <https://github.com/liorm/>

/* =================== USAGE ===================

 import express = require('express');
 var app = express();

 =============================================== */

/// <reference path="../node/node.d.ts" />
/// <reference path="../mongodb/mongodb.d.ts" />

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

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

        range?: Range;

        // any other options from the GridStore may be passed too, e.g.
        chunkSize?: number;
        content_type?: string;
        root?: string;
        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;
    }
}

declare module "gridfs-stream" {
    import mongo = require('mongodb');

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

    module g {

        export class Grid {
            files: mongo.Collection;
            collection: mongo.Collection;

            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;
        }
    }

    export = g;<commit_msg>Updated fixed "collection" function in gridfs-stream interface<commit_after>// Type definitions for gridfs-stream 0.5.0
// Project: https://github.com/aheckmann/gridfs-stream
// Definitions by: <NAME> <https://github.com/liorm/>

/* =================== USAGE ===================

 import express = require('express');
 var app = express();

 =============================================== */

/// <reference path="../node/node.d.ts" />
/// <reference path="../mongodb/mongodb.d.ts" />

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

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

        range?: Range;

        // any other options from the GridStore may be passed too, e.g.
        chunkSize?: number;
        content_type?: string;
        root?: string;
        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;
    }
}

declare module "gridfs-stream" {
    import mongo = require('mongodb');

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

    module g {

        export class Grid {

            files: mongo.Collection;
            collection(name?: string): mongo.Collection;

            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;
        }
    }

    export = g;
{'fraction_non_alphanumeric': 0.1507573936042318, 'fraction_numerical': 0.001442654484251022, 'mean_word_length': 2.5800344234079176, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7637356', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1090, 'n_words': 304}