<commit_before>import { Storage } from './core/storage';
import { Provider } from './core/provider';
import { Shared } from './core/shared';
import { Common, Logger } from '../utils';

export abstract class Handler extends Storage {
  protected logger: Logger;

  public constructor(config?: Handler.Config) {
    super(config);

    this.config = Common.defaults(this.config, {
      level: 'warn'
    });
    this.logger = new Logger(`@salte-auth/salte-auth:handlers/${this.$name}`, this.config.level);
  }

  public abstract open(options: Handler.OpenOptions): Promise<any>;

  /**
   * The unique name of the handler
   */
  public get $name() {
    return this.config.name || this.name;
  }

  /**
   * Returns a scoped key for storage.
   * @param key The storage key.
   *
   * @example redirect.key('hello') // 'salte.auth.handler.redirect.hello'
   */
  protected key(key: string) {
    return `salte.auth.handler.${this.$name}.${key}`;
  }

  /**
   * Navigates to the url provided.
   * @param url the url to navigate to
   */
  /* istanbul ignore next */
  protected navigate(url: string) {
    location.href = url;
  }

  /**
   * The unique name of the handler
   */
  protected abstract get name(): string;

  /**
   * Determines whether the handler supports automatic login.
   */
  public abstract get auto(): boolean;
}

export interface Handler {
  config: Handler.Config;

  connected?(options: Handler.ConnectedOptions): void;
}

export declare namespace Handler {
  export interface Config extends Storage.Config {
    /**
     * Overrides the default name of the handler.
     */
    name?: string;

    /**
     * Dictates that this is the default handler.
     */
    default?: boolean;

    /**
     * Determines the level of verbosity of the logs.
     *
     * @default 'warn'
     */
    level?: ('error'|'warn'|'info'|'trace');
  }

  export interface ConnectedOptions {
    action?: string;
    handler?: string;
    provider?: Provider;
  }

  export interface OpenOptions {
    url: string;
    redirectUrl: string | Shared.RedirectUrl;
    auto?: boolean;
  }
}<commit_msg>Removed unused auto property from Handler's OpenOptions<commit_after>import { Storage } from './core/storage';
import { Provider } from './core/provider';
import { Shared } from './core/shared';
import { Common, Logger } from '../utils';

export abstract class Handler extends Storage {
  protected logger: Logger;

  public constructor(config?: Handler.Config) {
    super(config);

    this.config = Common.defaults(this.config, {
      level: 'warn'
    });
    this.logger = new Logger(`@salte-auth/salte-auth:handlers/${this.$name}`, this.config.level);
  }

  public abstract open(options: Handler.OpenOptions): Promise<any>;

  /**
   * The unique name of the handler
   */
  public get $name() {
    return this.config.name || this.name;
  }

  /**
   * Returns a scoped key for storage.
   * @param key The storage key.
   *
   * @example redirect.key('hello') // 'salte.auth.handler.redirect.hello'
   */
  protected key(key: string) {
    return `salte.auth.handler.${this.$name}.${key}`;
  }

  /**
   * Navigates to the url provided.
   * @param url the url to navigate to
   */
  /* istanbul ignore next */
  protected navigate(url: string) {
    location.href = url;
  }

  /**
   * The unique name of the handler
   */
  protected abstract get name(): string;

  /**
   * Determines whether the handler supports automatic login.
   */
  public abstract get auto(): boolean;
}

export interface Handler {
  config: Handler.Config;

  connected?(options: Handler.ConnectedOptions): void;
}

export declare namespace Handler {
  export interface Config extends Storage.Config {
    /**
     * Overrides the default name of the handler.
     */
    name?: string;

    /**
     * Dictates that this is the default handler.
     */
    default?: boolean;

    /**
     * Determines the level of verbosity of the logs.
     *
     * @default 'warn'
     */
    level?: ('error'|'warn'|'info'|'trace');
  }

  export interface ConnectedOptions {
    action?: string;
    handler?: string;
    provider?: Provider;
  }

  export interface OpenOptions {
    url: string;
    redirectUrl: string | Shared.RedirectUrl;
  }
}
{'fraction_non_alphanumeric': 0.1336166194523135, 'fraction_numerical': 0.0, 'mean_word_length': 2.8343891402714934, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5858756', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1240, 'n_words': 370}