<commit_before>// Type definitions for auth0-lock 10.16
// Project: http://auth0.com
// Definitions by: <NAME> <https://github.com/carusology>
//                 <NAME> <https://github.com/goldcaddy77>
//                 <NAME> <https://github.com/lfaudreejr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="auth0-js" />

interface Auth0LockAdditionalSignUpFieldOption {
  value: string;
  label: string;
}

type Auth0LockAdditionalSignUpFieldOptionsCallback =
    (error: auth0.Auth0Error, options: Auth0LockAdditionalSignUpFieldOption[]) => void;

type Auth0LockAdditionalSignUpFieldOptionsFunction =
    (callback: Auth0LockAdditionalSignUpFieldOptionsCallback) => void;

type Auth0LockAdditionalSignUpFieldPrefillCallback =
    (error: auth0.Auth0Error, prefill: string) => void;

type Auth0LockAdditionalSignUpFieldPrefillFunction =
    (callback: Auth0LockAdditionalSignUpFieldPrefillCallback) => void;

interface Auth0LockAdditionalTextSignUpField {
    type?: "text";
    icon?: string;
    name: string;
    options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction;
    placeholder: string;
    prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction;
    validator?: (input: string) => { valid: boolean; hint?: string };
}

interface Auth0LockAdditionalSelectSignUpField {
    type?: "select";
    icon?: string;
    name: string;
    options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction;
    placeholder: string;
    prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction;
    validator?: (input: string) => { valid: boolean; hint?: string };
}

interface Auth0LockAdditionalCheckboxSignUpField {
    type?: "checkbox";
    icon?: string;
    name: string;
    placeholder: string;
    prefill: "true" | "false";
    validator?: (input: string) => { valid: boolean, hint?: string };
}

type Auth0LockAdditionalSignUpField = Auth0LockAdditionalSelectSignUpField |Auth0LockAdditionalTextSignUpField |Auth0LockAdditionalCheckboxSignUpField;

type Auth0LockAvatarUrlCallback = (error: auth0.Auth0Error, url: string) => void;
type Auth0LockAvatarDisplayNameCallback = (error: auth0.Auth0Error, displayName: string) => void;

interface Auth0LockAvatarOptions {
    url: (email: string, callback: Auth0LockAvatarUrlCallback) => void;
    displayName: (email: string, callback: Auth0LockAvatarDisplayNameCallback) => void;
}

interface Auth0LockThemeButton {
    displayName: string;
    primaryColor?: string;
    foregroundColor?: string;
    icon?: string;
}
interface Auth0LockThemeButtonOptions {
    [provider: string]: Auth0LockThemeButton;
}

interface Auth0LockThemeOptions {
    authButtons?: Auth0LockThemeButtonOptions;
    labeledSubmitButton?: boolean;
    logo?: string;
    primaryColor?: string;
}

// https://auth0.com/docs/libraries/lock/v10/sending-authentication-parameters
interface Auth0LockAuthParamsOptions {
    access_token?: any;
    connection_scopes?: any;
    device?: any;
    nonce?: any;
    protocol?: any;
    request_id?: any;
    scope?: string;
    state?: string;
}

interface Auth0LockAuthOptions {
    params?: Auth0LockAuthParamsOptions;
    redirect?: boolean;
    redirectUrl?: string;
    responseType?: string;
    sso?: boolean;
    audience?: string;
}

interface Auth0LockPopupOptions {
    width: number;
    height: number;
    left: number;
    top: number;
}

interface Auth0LockConstructorOptions {
    additionalSignUpFields?: Auth0LockAdditionalSignUpField[];
    allowedConnections?: string[];
    allowForgotPassword?: boolean;
    allowLogin?: boolean;
    allowSignUp?: boolean;
    assetsUrl?: string;
    auth?: Auth0LockAuthOptions;
    autoclose?: boolean;
    autofocus?: boolean;
    avatar?: Auth0LockAvatarOptions;
    clientBaseUrl?: string;
    closable?: boolean;
    configurationBaseUrl?: string;
    container?: string;
    defaultADUsernameFromEmailPrefix?: string;
    defaultDatabaseConnection?: string;
    defaultEnterpriseConnection?: string;
    forgotPasswordLink?: string;
    hashCleanup?: boolean;
    initialScreen?: "login" | "signUp" | "forgotPassword";
    language?: string;
    languageBaseUrl?: string;
    languageDictionary?: any;
    leeway?: number;
    loginAfterSignUp?: boolean;
    mustAcceptTerms?: boolean;
    oidcConformant?: boolean;
    popupOptions?: Auth0LockPopupOptions;
    prefill?: { email?: string, username?: string};
    rememberLastLogin?: boolean;
    signupLink?: string;
    socialButtonStyle?: "big" | "small";
    theme?: Auth0LockThemeOptions;
    usernameStyle?: string;
}

interface Auth0LockFlashMessageOptions {
    type: "success" | "error";
    text: string;
}

interface Auth0LockShowOptions {
    allowedConnections?: string[];
    allowForgotPassword?: boolean;
    allowLogin?: boolean;
    allowSignUp?: boolean;
    auth?: Auth0LockAuthOptions;
    initialScreen?: "login" | "signUp" | "forgotPassword";
    flashMessage?: Auth0LockFlashMessageOptions;
    rememberLastLogin?: boolean;
}

interface AuthResult {
    accessToken: string;
    idToken: string;
    idTokenPayload: {
        aud: string;
        exp: number;
        iat: number;
        iss: string;<commit_msg>Adds _enableImpersonation config option for auth0-lock<commit_after>// Type definitions for auth0-lock 11.4
// Project: http://auth0.com
// Definitions by: <NAME> <https://github.com/carusology>
//                 <NAME> <https://github.com/goldcaddy77>
//                 <NAME> <https://github.com/lfaudreejr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="auth0-js" />

interface Auth0LockAdditionalSignUpFieldOption {
  value: string;
  label: string;
}

type Auth0LockAdditionalSignUpFieldOptionsCallback =
    (error: auth0.Auth0Error, options: Auth0LockAdditionalSignUpFieldOption[]) => void;

type Auth0LockAdditionalSignUpFieldOptionsFunction =
    (callback: Auth0LockAdditionalSignUpFieldOptionsCallback) => void;

type Auth0LockAdditionalSignUpFieldPrefillCallback =
    (error: auth0.Auth0Error, prefill: string) => void;

type Auth0LockAdditionalSignUpFieldPrefillFunction =
    (callback: Auth0LockAdditionalSignUpFieldPrefillCallback) => void;

interface Auth0LockAdditionalTextSignUpField {
    type?: "text";
    icon?: string;
    name: string;
    options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction;
    placeholder: string;
    prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction;
    validator?: (input: string) => { valid: boolean; hint?: string };
}

interface Auth0LockAdditionalSelectSignUpField {
    type?: "select";
    icon?: string;
    name: string;
    options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction;
    placeholder: string;
    prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction;
    validator?: (input: string) => { valid: boolean; hint?: string };
}

interface Auth0LockAdditionalCheckboxSignUpField {
    type?: "checkbox";
    icon?: string;
    name: string;
    placeholder: string;
    prefill: "true" | "false";
    validator?: (input: string) => { valid: boolean, hint?: string };
}

type Auth0LockAdditionalSignUpField = Auth0LockAdditionalSelectSignUpField |Auth0LockAdditionalTextSignUpField |Auth0LockAdditionalCheckboxSignUpField;

type Auth0LockAvatarUrlCallback = (error: auth0.Auth0Error, url: string) => void;
type Auth0LockAvatarDisplayNameCallback = (error: auth0.Auth0Error, displayName: string) => void;

interface Auth0LockAvatarOptions {
    url: (email: string, callback: Auth0LockAvatarUrlCallback) => void;
    displayName: (email: string, callback: Auth0LockAvatarDisplayNameCallback) => void;
}

interface Auth0LockThemeButton {
    displayName: string;
    primaryColor?: string;
    foregroundColor?: string;
    icon?: string;
}
interface Auth0LockThemeButtonOptions {
    [provider: string]: Auth0LockThemeButton;
}

interface Auth0LockThemeOptions {
    authButtons?: Auth0LockThemeButtonOptions;
    labeledSubmitButton?: boolean;
    logo?: string;
    primaryColor?: string;
}

// https://auth0.com/docs/libraries/lock/v10/sending-authentication-parameters
interface Auth0LockAuthParamsOptions {
    access_token?: any;
    connection_scopes?: any;
    device?: any;
    nonce?: any;
    protocol?: any;
    request_id?: any;
    scope?: string;
    state?: string;
}

interface Auth0LockAuthOptions {
    params?: Auth0LockAuthParamsOptions;
    redirect?: boolean;
    redirectUrl?: string;
    responseType?: string;
    sso?: boolean;
    audience?: string;
}

interface Auth0LockPopupOptions {
    width: number;
    height: number;
    left: number;
    top: number;
}

interface Auth0LockConstructorOptions {
    additionalSignUpFields?: Auth0LockAdditionalSignUpField[];
    allowedConnections?: string[];
    allowForgotPassword?: boolean;
    allowLogin?: boolean;
    allowSignUp?: boolean;
    assetsUrl?: string;
    auth?: Auth0LockAuthOptions;
    autoclose?: boolean;
    autofocus?: boolean;
    avatar?: Auth0LockAvatarOptions;
    clientBaseUrl?: string;
    closable?: boolean;
    configurationBaseUrl?: string;
    container?: string;
    defaultADUsernameFromEmailPrefix?: string;
    defaultDatabaseConnection?: string;
    defaultEnterpriseConnection?: string;
    forgotPasswordLink?: string;
    hashCleanup?: boolean;
    initialScreen?: "login" | "signUp" | "forgotPassword";
    language?: string;
    languageBaseUrl?: string;
    languageDictionary?: any;
    leeway?: number;
    loginAfterSignUp?: boolean;
    mustAcceptTerms?: boolean;
    oidcConformant?: boolean;
    popupOptions?: Auth0LockPopupOptions;
    prefill?: { email?: string, username?: string};
    rememberLastLogin?: boolean;
    signupLink?: string;
    socialButtonStyle?: "big" | "small";
    theme?: Auth0LockThemeOptions;
    usernameStyle?: string;
    _enableImpersonation?: boolean;
}

interface Auth0LockFlashMessageOptions {
    type: "success" | "error";
    text: string;
}

interface Auth0LockShowOptions {
    allowedConnections?: string[];
    allowForgotPassword?: boolean;
    allowLogin?: boolean;
    allowSignUp?: boolean;
    auth?: Auth0LockAuthOptions;
    initialScreen?: "login" | "signUp" | "forgotPassword";
    flashMessage?: Auth0LockFlashMessageOptions;
    rememberLastLogin?: boolean;
}

interface AuthResult {
    accessToken: string;
    idToken: string;
    idTokenPayload: {
        aud: string;
        exp: number;
        iat: number;
        iss: string;
{'fraction_non_alphanumeric': 0.10553143288653954, 'fraction_numerical': 0.012271096847272041, 'mean_word_length': 4.5268648930620765, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 39, 'https://': 10, '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': '7631062', 'n_tokens_mistral': 3083, 'n_tokens_neox': 3030, 'n_words': 676}