<commit_before>/*
**  BindingJS -- View Data Binding for JavaScript <http://bindingjs.com>
**  Copyright (c) 2014 <NAME> <http://engelschall.com>
**
**  This Source Code Form is subject to the terms of the Mozilla Public
**  License (MPL), version 2.0. If a copy of the MPL was not distributed
**  with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

/*  external library API symbol  */
declare var BindingJS: BindingJS_API_external;

/*  external library API (available to everyone)  */
interface BindingJS_API_external {
    symbol              (   name?: string                 ): BindingJS_API_external
    version:            {   major: number;
                            minor: number;
                            micro: number;
                            date:  number;                }
    bootstrap           (                                 ): void
    shutdown            (                                 ): void
    plugin              (                                 ): string[]
    plugin              (   name: string                  ): boolean
    plugin              (   name: string,
                            callback: (
                                _api: BindingJS_API_internal,
                                $api: BindingJS_API_external,
                                GLOBAL: any
                            ) => void                     ): void
    create              (                                 ): BindingJS_API_binding
}

/*  internal library API (available to plugins only)  */
interface BindingJS_API_internal {
    registerAdapter     (   name: string,
                            spec: BindingJS_API_adapter   ): void
    registerConnector   (   name: string,
                            spec: BindingJS_API_connector ): void
    registerFunction    (   name: string,
                            spec: BindingJS_API_function  ): void
}

/*  internal adapter API  */
interface BindingJS_API_adapter {
    init                (                                 ): void
    shutdown            (                                 ): void
    observe             (                                 ): number
    unobserve           (   id: number                    ): void
    get                 (   field: string                 ): any
    set                 (   field: string,
                            value: any                    ): any
}

/*  internal connector API  */
interface BindingJS_API_connector {
    init                (                                 ): void
    shutdown            (                                 ): void
    process             (   args: any[]                   ): any[]
}

/*  internal function API  */
interface BindingJS_API_function {
    init                (                                 ): void
    shutdown            (                                 ): void
    process             (   args: any[]                   ): any
}

/*  external binding API  */
interface BindingJS_API_binding {
    destroy             (                                 ): void
    template            (   template: any                 ): BindingJS_API_binding
    model               (   model: any                    ): BindingJS_API_binding
}
<commit_msg>extend with the slot API and use the DOM types<commit_after>/*
**  BindingJS -- View Data Binding for JavaScript <http://bindingjs.com>
**  Copyright (c) 2014 <NAME> <http://engelschall.com>
**
**  This Source Code Form is subject to the terms of the Mozilla Public
**  License (MPL), version 2.0. If a copy of the MPL was not distributed
**  with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

/*  external library API symbol  */
declare var BindingJS: BindingJS_API_external;

/*  external library API (available to everyone)  */
interface BindingJS_API_external {
    symbol              (   name?: string                 ): BindingJS_API_external
    version:            {   major: number;
                            minor: number;
                            micro: number;
                            date:  number;                }
    bootstrap           (                                 ): void
    shutdown            (                                 ): void
    plugin              (                                 ): string[]
    plugin              (   name: string                  ): boolean
    plugin              (   name: string,
                            callback: (
                                _api: BindingJS_API_internal,
                                $api: BindingJS_API_external,
                                GLOBAL: any
                            ) => void                     ): void
    create              (                                 ): BindingJS_API_binding
}

/*  internal library API (available to plugins only)  */
interface BindingJS_API_internal {
    registerAdapter     (   name: string,
                            spec: BindingJS_API_adapter   ): void
    registerConnector   (   name: string,
                            spec: BindingJS_API_connector ): void
    registerFunction    (   name: string,
                            spec: BindingJS_API_function  ): void
}

/*  internal adapter API  */
interface BindingJS_API_adapter {
    init                (                                 ): void
    shutdown            (                                 ): void
    observe             (                                 ): number
    unobserve           (   id: number                    ): void
    get                 (   field: string                 ): any
    set                 (   field: string,
                            value: any                    ): any
}

/*  internal connector API  */
interface BindingJS_API_connector {
    init                (                                 ): void
    shutdown            (                                 ): void
    process             (   args: any[]                   ): any[]
}

/*  internal function API  */
interface BindingJS_API_function {
    init                (                                 ): void
    shutdown            (                                 ): void
    process             (   args: any[]                   ): any
}

/*  external binding API  */
interface BindingJS_API_binding {
    destroy             (                                 ): void
    template            (   selector: string              ): BindingJS_API_binding
    template            (   element: HTMLElement          ): BindingJS_API_binding
    template            (   fragment: DocumentFragment    ): BindingJS_API_binding
    model               (   model: Object                 ): BindingJS_API_binding
    mount               (   selector: string              ): BindingJS_API_binding
    mount               (   element: HTMLElement          ): BindingJS_API_binding
    mount               (   cb: (
                                fragment: DocumentFragment
                            ) => void                     ): BindingJS_API_binding
    slot                (   name: string                  ): BindingJS_API_slot
}

/*  external slot API  */
interface BindingJS_API_slot {
    length              (                                 ): number
    find                (   element: HTMLElement          ): number
    get                 (                                 ): any[]
    get                 (   indexBegin: number,
                            indexEnd: number              ): any[]
    get                 (   index: number                 ): any
    set                 (   index: number,
                            elements: HTMLElement[]       ): void
    set                 (   index: number,
                            ...element: HTMLElement[]     ): void
    splice              (   index: number,
                            len: number,
                            elements: HTMLElement[]       ): any[]
    splice              (   index: number,
                            len: number,
                            ...element: HTMLElement[]     ): any[]
    push                (   elements: HTMLElement[]       ): void
    push                (   ...element: HTMLElement[]     ): void
    pop                 (                                 ): any
    unshift             (   elements: HTMLElement[]       ): void
    unshift             (   ...element: HTMLElement[]     ): void
    shift               (                                 ): any
    delete              (   index: number                 ): void
    delete              (   elements: HTMLElement[]       ): void
    delete              (   ...element: HTMLElement[]     ): void
    delete              (                                 ): void
}

{'fraction_non_alphanumeric': 0.07028571428571428, 'fraction_numerical': 0.0018285714285714285, 'mean_word_length': 0.870671227020094, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 61, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5410098', 'n_tokens_mistral': 1942, 'n_tokens_neox': 1855, 'n_words': 508}