<commit_before>// Type definitions for Browser Harness
// Project: https://github.com/scriby/browser-harness
// Definitions by: <NAME> <https://github.com/scriby>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

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

declare module "browser-harness" {
    import events = require("events");

    interface HarnessEvents extends events.NodeEventEmitter {
        once(event: string, listener: (driver: Driver) => void);
        once(event: 'ready', listener: (driver: Driver) => void);

        on(event: string, listener: (driver: Driver) => void);
        on(event: 'ready', listener: (driver: Driver) => void);
    }

    interface DriverEvents extends events.NodeEventEmitter {
        once(event: string, listener: (text: string) => void);
        once(event: 'console.log', listener: (text: string) => void);
        once(event: 'console.warn', listener: (text: string) => void);
        once(event: 'console.error', listener: (text: string) => void);
        once(event: 'window.onerror', listener: (text: string) => void);

        on(event: string, listener: (text: string) => void);
        on(event: 'console.log', listener: (text: string) => void);
        on(event: 'console.warn', listener: (text: string) => void);
        on(event: 'console.error', listener: (text: string) => void);
        on(event: 'window.onerror', listener: (text: string) => void);
    }

    export interface Driver {
        exec(args: { func: Function; args?: any[]}, callback?: Function) : any;
        exec(func: Function, callback?: Function) : any;

        setUrl(url: string, callback?: Function);

        waitFor(args: { condition: Function; exec?: Function; timeoutMS?: number }, callback?: Function);
        waitFor(condition: Function, callback?: Function);

        findElement(selector: string, callback?: (err: Error, element: ElementProxy) => void): ElementProxy;
        findElements(selector: string, callback?: (err: Error, elements: ElementProxy) => void): ElementProxy;

        findVisible(selector: string, callback?: (err: Error, element: ElementProxy) => void): ElementProxy;
        findVisibles(selector: string, callback?: (err: Error, elements: ElementProxy) => void): ElementProxy;
        find(selector: string, callback?: (err: Error, elements: ElementProxy) => void): ElementProxy;
<commit_msg>fix(browser-harness) fix for new definitions of nodejs<commit_after>// Type definitions for Browser Harness
// Project: https://github.com/scriby/browser-harness
// Definitions by: <NAME> <https://github.com/scriby>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

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

declare module "browser-harness" {
    import events = require("events");

    interface HarnessEvents extends events.NodeEventEmitter {
        once(event: string, listener: (driver: Driver) => void): events.NodeEventEmitter;
        once(event: 'ready', listener: (driver: Driver) => void): events.NodeEventEmitter;

        on(event: string, listener: (driver: Driver) => void): events.NodeEventEmitter;
        on(event: 'ready', listener: (driver: Driver) => void): events.NodeEventEmitter;
    }

    interface DriverEvents extends events.NodeEventEmitter {
        once(event: string, listener: (text: string) => void): events.NodeEventEmitter;
        once(event: 'console.log', listener: (text: string) => void): events.NodeEventEmitter;
        once(event: 'console.warn', listener: (text: string) => void): events.NodeEventEmitter;
        once(event: 'console.error', listener: (text: string) => void): events.NodeEventEmitter;
        once(event: 'window.onerror', listener: (text: string) => void): events.NodeEventEmitter;

        on(event: string, listener: (text: string) => void): events.NodeEventEmitter;
        on(event: 'console.log', listener: (text: string) => void): events.NodeEventEmitter;
        on(event: 'console.warn', listener: (text: string) => void): events.NodeEventEmitter;
        on(event: 'console.error', listener: (text: string) => void): events.NodeEventEmitter;
        on(event: 'window.onerror', listener: (text: string) => void): events.NodeEventEmitter;
    }

    export interface Driver {
        exec(args: { func: Function; args?: any[]}, callback?: Function) : any;
        exec(func: Function, callback?: Function) : any;

        setUrl(url: string, callback?: Function);

        waitFor(args: { condition: Function; exec?: Function; timeoutMS?: number }, callback?: Function);
        waitFor(condition: Function, callback?: Function);

        findElement(selector: string, callback?: (err: Error, element: ElementProxy) => void): ElementProxy;
        findElements(selector: string, callback?: (err: Error, elements: ElementProxy) => void): ElementProxy;

        findVisible(selector: string, callback?: (err: Error, element: ElementProxy) => void): ElementProxy;
        findVisibles(selector: string, callback?: (err: Error, elements: ElementProxy) => void): ElementProxy;
        find(selector: string, callback?: (err: Error, elements: ElementProxy) => void): ElementProxy;

{'fraction_non_alphanumeric': 0.15365141187925999, 'fraction_numerical': 0.0, 'mean_word_length': 3.967117988394584, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 47, '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': '5378277', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1413, 'n_words': 404}