<commit_before>import { UnsubscribeFunction } from "callback-registry";

/**
 * Factory function that creates a new Glue42 instance.
 */
export type GlueCoreFactoryFunction = (config?: Glue42Core.Config, ext?: Glue42Core.Extension) => Promise<Glue42Core.GlueCore>;
declare const GlueCoreFactory: GlueCoreFactoryFunction;
export default GlueCoreFactory;

// tslint:disable-next-line:no-namespace
export namespace Glue42Core {

    export type LogLevel = "off" | "trace" | "debug" | "info" | "warn" | "error";

    /** Optional configuration object when initializing the Glue42 library. */
    export interface Config {
        /**
         * Application name. If not specified, the value depends on the hosting environment.
         * For the browser - `document.title + random number` (e.g., ClientList321333).
         * In Glue42 - `containerName + browserWindowName` (e.g., Internal.ClientList).
         */
        application?: string;

        /** Configurations for the Glue42 Gateway connection. */
        gateway?: GatewayConfig;

        /** Metrics configurations. */
        metrics?: boolean | MetricsConfig;

        /** Enable or disable the Contexts API. */
        contexts?: boolean;

        /** Enable or disable the Pub/Sub API. */
        bus?: boolean;

        /** Defines logging levels per output target. */
        logger?: LogLevel | LoggerConfig;

        /** Pass this to override the build-in logger and handle logging on your own */
        customLogger?: Glue42Core.CustomLogger;

        /**
         * Authentication can use one of the following flows:
         * - username/password;
         * - `token` - access tokens can be generated after successful login from the Auth Provider (e.g., Auth0);
         * - `gatewayToken` - Gateway tokens are time limited tokens generated by the Gateway after an explicit request. To generate one, use the `glue.connection.authToken()` method;
         * - `sspi` - using `sessionId` and authentication challenge callback;
         */
        auth?: Glue42Core.Auth | string;
    }

    /** Configurations for the Glue42 Gateway connection. */
    export interface GatewayConfig {
        /** URL for the WebSocket connections to the Gateway. */
        ws?: string;

        /** Legacy (Version of the Gateway that you are connected to)  */
        protocolVersion?: number;

        /**
         * Reconnect interval in milliseconds.
         * @default 500
         */
        reconnectInterval?: number;

        /**
         * Number of reconnect attempts.
         * @default 10
         */
        reconnectAttempts?: number;

        /** A way to pass custom token provider for Gateway v.3 tokens. */
        gwTokenProvider?: GwTokenProvider;

        /** Path to the shared worker file that contains glue0 shared worker related code  */
        sharedWorker?: string;

        /** Connect with GW in memory */
        inproc?: InprocGWSettings;

        /**
         * @ignore
         * if `protocolVersion` is 3, this is used to create the connection `replayer`
         * property. Allows out-of-band subscription and replaying of Glue42 messages.
         */
        replaySpecs?: Glue42Core.Connection.MessageReplaySpec[];
    }

    export interface InprocGWSettings {
        facade: Glue42Core.Connection.GW3Facade;
    }

    /**
     * A way to pass custom token provider for Gateway v.3 tokens.
     * @ignore
     */
    export interface GwTokenProvider {
        get: () => string;
    }

    /** Metrics configurations. */
    export interface MetricsConfig {

        /**
         *  If `false` (default), an App system will be created on top level, and all other metrics will live in it.
         *  If `true`, an App system will be created, and all metrics will live on top level.
         */
        disableAutoAppSystem?: boolean;

        pagePerformanceMetrics: PagePerformanceMetricsConfig;
    }
<commit_msg>pagePerformanceMetrics config should be optional<commit_after>import { UnsubscribeFunction } from "callback-registry";

/**
 * Factory function that creates a new Glue42 instance.
 */
export type GlueCoreFactoryFunction = (config?: Glue42Core.Config, ext?: Glue42Core.Extension) => Promise<Glue42Core.GlueCore>;
declare const GlueCoreFactory: GlueCoreFactoryFunction;
export default GlueCoreFactory;

// tslint:disable-next-line:no-namespace
export namespace Glue42Core {

    export type LogLevel = "off" | "trace" | "debug" | "info" | "warn" | "error";

    /** Optional configuration object when initializing the Glue42 library. */
    export interface Config {
        /**
         * Application name. If not specified, the value depends on the hosting environment.
         * For the browser - `document.title + random number` (e.g., ClientList321333).
         * In Glue42 - `containerName + browserWindowName` (e.g., Internal.ClientList).
         */
        application?: string;

        /** Configurations for the Glue42 Gateway connection. */
        gateway?: GatewayConfig;

        /** Metrics configurations. */
        metrics?: boolean | MetricsConfig;

        /** Enable or disable the Contexts API. */
        contexts?: boolean;

        /** Enable or disable the Pub/Sub API. */
        bus?: boolean;

        /** Defines logging levels per output target. */
        logger?: LogLevel | LoggerConfig;

        /** Pass this to override the build-in logger and handle logging on your own */
        customLogger?: Glue42Core.CustomLogger;

        /**
         * Authentication can use one of the following flows:
         * - username/password;
         * - `token` - access tokens can be generated after successful login from the Auth Provider (e.g., Auth0);
         * - `gatewayToken` - Gateway tokens are time limited tokens generated by the Gateway after an explicit request. To generate one, use the `glue.connection.authToken()` method;
         * - `sspi` - using `sessionId` and authentication challenge callback;
         */
        auth?: Glue42Core.Auth | string;
    }

    /** Configurations for the Glue42 Gateway connection. */
    export interface GatewayConfig {
        /** URL for the WebSocket connections to the Gateway. */
        ws?: string;

        /** Legacy (Version of the Gateway that you are connected to)  */
        protocolVersion?: number;

        /**
         * Reconnect interval in milliseconds.
         * @default 500
         */
        reconnectInterval?: number;

        /**
         * Number of reconnect attempts.
         * @default 10
         */
        reconnectAttempts?: number;

        /** A way to pass custom token provider for Gateway v.3 tokens. */
        gwTokenProvider?: GwTokenProvider;

        /** Path to the shared worker file that contains glue0 shared worker related code  */
        sharedWorker?: string;

        /** Connect with GW in memory */
        inproc?: InprocGWSettings;

        /**
         * @ignore
         * if `protocolVersion` is 3, this is used to create the connection `replayer`
         * property. Allows out-of-band subscription and replaying of Glue42 messages.
         */
        replaySpecs?: Glue42Core.Connection.MessageReplaySpec[];
    }

    export interface InprocGWSettings {
        facade: Glue42Core.Connection.GW3Facade;
    }

    /**
     * A way to pass custom token provider for Gateway v.3 tokens.
     * @ignore
     */
    export interface GwTokenProvider {
        get: () => string;
    }

    /** Metrics configurations. */
    export interface MetricsConfig {

        /**
         *  If `false` (default), an App system will be created on top level, and all other metrics will live in it.
         *  If `true`, an App system will be created, and all metrics will live on top level.
         */
        disableAutoAppSystem?: boolean;

        pagePerformanceMetrics?: PagePerformanceMetricsConfig;
    }

{'fraction_non_alphanumeric': 0.09440914866581956, 'fraction_numerical': 0.011435832274459974, 'mean_word_length': 2.3309352517985613, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '4085178', 'n_tokens_mistral': 2098, 'n_tokens_neox': 1962, 'n_words': 726}