<commit_before>// Type definitions for Awesomplete 1.1
// Project: https://leaverou.github.io/awesomplete/
// Definitions by: webbiesdk <https://github.com/webbiesdk>
//                 <NAME> <https://github.com/bmdixon>
//                 <NAME> <https://github.com/tbekolay>
//                 <NAME> <https://github.com/chrislopresto>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare class Awesomplete {
    constructor(input: Element | HTMLElement | string, o?: Awesomplete.Options);
    static all: any[];
    static $$(expr: string | ParentNode, con?: any): NodeList;
    static ITEM: (text: string, input: string) => HTMLElement;
    static $: {
        (expr: string|Element, con?: ParentNode): string | Element;
        regExpEscape(s: { replace(arg0: RegExp, arg1: string): void }): any;
        create(tag: string, o: any): HTMLElement;
        fire(target: EventTarget, type: string, properties: any): any;
        siblingIndex(el: Element): number;
    };
    static FILTER_STARTSWITH: (text: string, input: string) => boolean;
    static FILTER_CONTAINS: (text: string, input: string) => boolean;
    static SORT_BYLENGTH: (left: number | any[], right: number | any[]) => number;
    static REPLACE: (text: string) => void;
    static DATA: (item: Awesomplete.Suggestion) => Awesomplete.Suggestion;
    next: () => void;
    container: HTMLElement;
    select: (selected?: HTMLElement, originalTarget?: HTMLElement) => void;
    previous: () => void;
    index: number;
    opened: number;
    list: string | Element | Awesomplete.Suggestion[];
    input: HTMLElement | string;
    goto: (i: number) => void;
    ul: HTMLElement;
    close: () => void;
    evaluate: () => void;
    selected: boolean;
    open: () => void;
    status: HTMLElement;
    destroy: () => void;
}

declare namespace Awesomplete {
    type Suggestion = string | { label: string | any, value: string | any } | [string, string];
    type SortFunction = (left: number | any[], right: number | any[]) => number;

    interface Options {
        list?: string | string[] | Element | Array<{ label: string, value: any }> | Array<[string, string]>;
        minChars?: number;
        maxItems?: number;
        autoFirst?: boolean;
        data?(item: Suggestion, input: string): string;
        filter?(text: string, input: string): boolean;
        sort?: boolean | SortFunction;
        item?(text: string, input: string): HTMLElement;
        replace?(text: string): void;
    }
}

export = Awesomplete;
export as namespace Awesomplete;<commit_msg>[@types/awesomplete] Update replace param (#39183)<commit_after>// Type definitions for Awesomplete 1.1
// Project: https://leaverou.github.io/awesomplete/
// Definitions by: webbiesdk <https://github.com/webbiesdk>
//                 <NAME> <https://github.com/bmdixon>
//                 <NAME> <https://github.com/tbekolay>
//                 <NAME> <https://github.com/chrislopresto>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare class Awesomplete {
    constructor(input: Element | HTMLElement | string, o?: Awesomplete.Options);
    static all: any[];
    static $$(expr: string | ParentNode, con?: any): NodeList;
    static ITEM: (text: string, input: string) => HTMLElement;
    static $: {
        (expr: string|Element, con?: ParentNode): string | Element;
        regExpEscape(s: { replace(arg0: RegExp, arg1: string): void }): any;
        create(tag: string, o: any): HTMLElement;
        fire(target: EventTarget, type: string, properties: any): any;
        siblingIndex(el: Element): number;
    };
    static FILTER_STARTSWITH: (text: string, input: string) => boolean;
    static FILTER_CONTAINS: (text: string, input: string) => boolean;
    static SORT_BYLENGTH: (left: number | any[], right: number | any[]) => number;
    static REPLACE: (text: string) => void;
    static DATA: (item: Awesomplete.Suggestion) => Awesomplete.Suggestion;
    next: () => void;
    container: HTMLElement;
    select: (selected?: HTMLElement, originalTarget?: HTMLElement) => void;
    previous: () => void;
    index: number;
    opened: number;
    list: string | Element | Awesomplete.Suggestion[];
    input: HTMLElement | string;
    goto: (i: number) => void;
    ul: HTMLElement;
    close: () => void;
    evaluate: () => void;
    selected: boolean;
    open: () => void;
    status: HTMLElement;
    destroy: () => void;
}

declare namespace Awesomplete {
    type Suggestion = string | { label: string | any, value: string | any } | [string, string];
    type SortFunction = (left: number | any[], right: number | any[]) => number;

    interface Options {
        list?: string | string[] | Element | Array<{ label: string, value: any }> | Array<[string, string]>;
        minChars?: number;
        maxItems?: number;
        autoFirst?: boolean;
        data?(item: Suggestion, input: string): string;
        filter?(text: string, input: string): boolean;
        sort?: boolean | SortFunction;
        item?(text: string, input: string): HTMLElement;
        replace?(suggestion: string | Suggestion): void;
    }
}

export = Awesomplete;
export as namespace Awesomplete;
{'fraction_non_alphanumeric': 0.14731970690320093, 'fraction_numerical': 0.002506748939452372, 'mean_word_length': 3.1898222940226173, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 51, 'https://': 12, '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': '1335485', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1609, 'n_words': 440}