<commit_before>// Type definitions for vfile 2.2
// Project: https://github.com/vfile/vfile#readme
// Definitions by: <NAME> <https://github.com/rokt33r>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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

declare namespace vfile {
    type Contents = string | Buffer;

    interface Position {
        line: number;
        column: number;
    }

    interface Location {
        start: Position;
        end: Position;
    }

    interface VFileParams {
        contents?: Contents;
        path?: string;
        basename?: string;
        stem?: string;
        extname?: string;
        dirname?: string;
        cwd?: string;
    }

    interface VFileError {
        ruleId: string;
        name: string;
        file: string;
        reason: string;
        line: number;
        column: number;
        location: Location;
        source: string;
        fatal: boolean;
    }

    type Message = (reason: string, position?: Position, ruleId?: string) => VFileError;

    type Fail = (reason?: string, position?: Position, ruleId?: string) => void;

    type Info = (reason?: string, position?: Position, ruleId?: string) => void;

    type ToString = (encoding?: BufferEncoding) => string;

    interface VFile {
        (input?: Contents | VFile | VFileParams): VFile;
        message: Message;
        fail: Fail;
        info: Info;
        history: string[];
        data: {};
        messages: VFileError[];
        contents: string;
        path: string;
        dirname: string;
        basename: string;
        stem: string;
        extname: string;
        cwd: string;
        toString: ToString;
    }
}

declare const vfile: vfile.VFile;

export = vfile;
<commit_msg>Fix typings for vfile by the guide of the author<commit_after>// Type definitions for vfile 2.2
// Project: https://github.com/vfile/vfile#readme
// Definitions by: <NAME> <https://github.com/rokt33r>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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

declare namespace vfile {
    type Contents = string | Buffer;

    interface Point {
        line: number;
        column: number;
    }

    interface Position {
        start: Point;
        end: Point;
    }

    interface VFileParams {
        contents?: Contents;
        path?: string;
        basename?: string;
        stem?: string;
        extname?: string;
        dirname?: string;
        cwd?: string;
    }

    interface VFileError {
        ruleId: string | null;
        name: string;
        file: string;
        reason: string;
        line: number | null;
        column: number | null;
        location: Position;
        source: string | null;
        fatal?: boolean | null;
    }

    type Message = (reason: string, position?: Position, ruleId?: string) => VFileError;

    type Fail = (reason?: string, position?: Position, ruleId?: string) => void;

    type Info = (reason?: string, position?: Position, ruleId?: string) => void;

    type ToString = (encoding?: BufferEncoding) => string;

    interface VFile {
        (input?: Contents | VFile | VFileParams): VFile;
        message: Message;
        fail: Fail;
        info: Info;
        history: string[];
        data: {};
        messages: VFileError[];
        contents: Contents;
        path?: string;
        dirname?: string;
        basename?: string;
        stem?: string;
        extname?: string;
        cwd: string;
        toString: ToString;
    }
}

declare const vfile: vfile.VFile;

export = vfile;

{'fraction_non_alphanumeric': 0.11819464033850494, 'fraction_numerical': 0.002256699576868829, 'mean_word_length': 2.1380530973451326, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 6, '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': '6778280', 'n_tokens_mistral': 1021, 'n_tokens_neox': 995, 'n_words': 300}