<commit_before>// Type definitions for node-polyglot v0.4.2
// Project: https://github.com/airbnb/polyglot.js
// Definitions by: <NAME> <https://github.com/timjk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped


declare namespace Polyglot {
    interface InterpolationOptions {
        smart_count?: number | { length: number };
        _?: string;

        [interpolationKey: string]: any;
    }

    interface PolyglotOptions {
        phrases?: any;
        locale?: string;
        allowMissing?: boolean;
        onMissingKey?: (key: string, options?: Polyglot.InterpolationOptions, locale?: string) => string;
    }
}

declare class Polyglot {
    constructor(options?: Polyglot.PolyglotOptions);

    extend(phrases: any): void;

    t(phrase: string): string;

    t(phrase: string, smartCount: number): string;

    t(phrase: string, interpolationOptions: Polyglot.InterpolationOptions): string;

    clear(): void;

    replace(phrases: any): void;

    locale(): string;

    locale(locale: string): void;

    has(phrase: string): boolean;
}

export = Polyglot;<commit_msg>[node-polyglot] Fix `t` and `locale` overloads to allow optional arguments (#31522)<commit_after>// Type definitions for node-polyglot v0.4.3
// Project: https://github.com/airbnb/polyglot.js
// Definitions by: <NAME> <https://github.com/timjk>
//                 <NAME> <https://github.com/liamross>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace Polyglot {
    interface InterpolationOptions {
        smart_count?: number | { length: number };
        _?: string;

        [interpolationKey: string]: any;
    }

    interface PolyglotOptions {
        phrases?: any;
        locale?: string;
        allowMissing?: boolean;
        onMissingKey?: (key: string, options?: Polyglot.InterpolationOptions, locale?: string) => string;
    }
}

declare class Polyglot {
    constructor(options?: Polyglot.PolyglotOptions);

    extend(phrases: any): void;

    t(phrase: string, options?: number | Polyglot.InterpolationOptions): string;

    clear(): void;

    replace(phrases: any): void;

    locale(locale?: string): void;

    has(phrase: string): boolean;
}

export = Polyglot;
{'fraction_non_alphanumeric': 0.13117699910152741, 'fraction_numerical': 0.004941599281221923, 'mean_word_length': 3.324271844660194, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 7, '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': '5605318', 'n_tokens_mistral': 685, 'n_tokens_neox': 668, 'n_words': 160}