<commit_before>// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.5
// Project: http://angularjs.org
// Definitions by: <NAME> <http://github.com/diegovilar>, <NAME> <http://github.com/daltin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="angular" />
/// <reference path="mocks.d.ts" />

import * as angular from 'angular';

///////////////////////////////////////////////////////////////////////////////
// ngMock module (angular-mocks.js)
///////////////////////////////////////////////////////////////////////////////
declare module 'angular' {

  ///////////////////////////////////////////////////////////////////////////
  // AngularStatic
  // We reopen it to add the MockStatic definition
  ///////////////////////////////////////////////////////////////////////////
  interface IAngularStatic {
    mock: IMockStatic;
  }

  // see https://docs.angularjs.org/api/ngMock/function/angular.mock.inject
  interface IInjectStatic {
    (...fns: Function[]): any;
    (...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works
    strictDi(val?: boolean): void;
  }

  interface IMockStatic {
    // see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump
    dump(obj: any): string;

    inject: IInjectStatic

    // see https://docs.angularjs.org/api/ngMock/function/angular.mock.module
    module: {
      (...modules: any[]): any;
      sharedInjector(): void;
    }

    // see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate
    TzDate(offset: number, timestamp: number): Date;
    TzDate(offset: number, timestamp: string): Date;
  }

  ///////////////////////////////////////////////////////////////////////////
  // ExceptionHandlerService
  // see https://docs.angularjs.org/api/ngMock/service/$exceptionHandler
  // see https://docs.angularjs.org/api/ngMock/provider/$exceptionHandlerProvider
  ///////////////////////////////////////////////////////////////////////////
  interface IExceptionHandlerProvider extends IServiceProvider {
    mode(mode: string): void;
  }

  ///////////////////////////////////////////////////////////////////////////
  // TimeoutService
  // see https://docs.angularjs.org/api/ngMock/service/$timeout
  // Augments the original service
  ///////////////////////////////////////////////////////////////////////////
  interface ITimeoutService {
    flush(delay?: number): void;
    flushNext(expectedDelay?: number): void;
    verifyNoPendingTasks(): void;
  }

  ///////////////////////////////////////////////////////////////////////////
  // IntervalService
  // see https://docs.angularjs.org/api/ngMock/service/$interval
  // Augments the original service
  ///////////////////////////////////////////////////////////////////////////
  interface IIntervalService {
    flush(millis?: number): number;
  }

  ///////////////////////////////////////////////////////////////////////////
  // LogService
  // see https://docs.angularjs.org/api/ngMock/service/$log
  // Augments the original service
  ///////////////////////////////////////////////////////////////////////////
  interface ILogService {
    assertEmpty(): void;
    reset(): void;
  }

  interface ILogCall {
    logs: string[];
  }

  ///////////////////////////////////////////////////////////////////////////
  // ControllerService mock
  // see https://docs.angularjs.org/api/ngMock/service/$controller
  // This interface extends http://docs.angularjs.org/api/ng.$controller
  ///////////////////////////////////////////////////////////////////////////
  interface IControllerService {
    // Although the documentation doesn't state this, locals are optional
    <T>(controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T;
    <T>(controllerConstructor: Function, locals?: any, bindings?: any): T;
    <T>(controllerName: string, locals?: any, bindings?: any): T;
  }

  ///////////////////////////////////////////////////////////////////////////
  // ComponentControllerService
  // see https://docs.angularjs.org/api/ngMock/service/$componentController
  ///////////////////////////////////////////////////////////////////////////
  interface IComponentControllerService {
    // TBinding is an interface exposed by a component as per John Papa's style guide
    // https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#accessible-members-up-top
    <T, TBinding>(componentName: string, locals: { $scope?: IScope, [key: string]: any }, bindings?: TBinding, ident?: string): T;
  }


  ///////////////////////////////////////////////////////////////////////////
  // HttpBackendService
  // see https://docs.angularjs.org/api/ngMock/service/$httpBackend
  ///////////////////////////////////////////////////////////////////////////
  interface IHttpBackendService {
    /**
      * Flushes pending requests using the trained responses. Requests are flushed in the order they were made, but it is also possible to skip one or more requests (for example to have them flushed later). This is useful for simulating scenarios where responses arrive from the server in any order.
      *
      * If there are no pending requests to flush when the method is called, an exception is thrown (as this is typically a sign of programming error).
      * @param count Number of responses to flush. If undefined/null, all pending requests (starting after `skip`) will be flushed.
      * @param skip Number of pending requests to skip. For example, a value of 5 would skip the first 5 pending requests and start flushing from the 6th onwards. _(default: 0)_
      */
    flush(count?: number, skip?: number): void;

    /**
      * Resets all request expectations, but preserves all backend definitions.
      */
    resetExpectations(): void;

    /**
      * Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception.
      * @param digest Do digest before checking expectation. Pass anything expect false to trigger digest.
      */
    verifyNoOutstandingExpectation(digest?: boolean): void;

    /**
      * Verifies that there are no outstanding requests that need to be flushed.
      */
    verifyNoOutstandingRequest(): void;

        /**
          * Creates a new request expectation.
          * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
          * Returns an object with respond method that controls how a matched request is handled.
          * @param method HTTP method.
          * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
          * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
          * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
          * @param keys Array of keys to assign to regex matches in the request url.
          */
    expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler;

        /**
          * Creates a new request expectation for DELETE requests.
          * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
          * Returns an object with respond method that controls how a matched request is handled.
          * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected.
          * @param headers HTTP headers object to be compared with the HTTP headers in the request.
          * @param keys Array of keys to assign to regex matches in the request url.<commit_msg>Update comment, fix typo<commit_after>// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.5
// Project: http://angularjs.org
// Definitions by: <NAME> <http://github.com/diegovilar>, <NAME> <http://github.com/daltin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="angular" />
/// <reference path="mocks.d.ts" />

import * as angular from 'angular';

///////////////////////////////////////////////////////////////////////////////
// ngMock module (angular-mocks.js)
///////////////////////////////////////////////////////////////////////////////
declare module 'angular' {

  ///////////////////////////////////////////////////////////////////////////
  // AngularStatic
  // We reopen it to add the MockStatic definition
  ///////////////////////////////////////////////////////////////////////////
  interface IAngularStatic {
    mock: IMockStatic;
  }

  // see https://docs.angularjs.org/api/ngMock/function/angular.mock.inject
  interface IInjectStatic {
    (...fns: Function[]): any;
    (...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works
    strictDi(val?: boolean): void;
  }

  interface IMockStatic {
    // see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump
    dump(obj: any): string;

    inject: IInjectStatic

    // see https://docs.angularjs.org/api/ngMock/function/angular.mock.module
    module: {
      (...modules: any[]): any;
      sharedInjector(): void;
    }

    // see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate
    TzDate(offset: number, timestamp: number): Date;
    TzDate(offset: number, timestamp: string): Date;
  }

  ///////////////////////////////////////////////////////////////////////////
  // ExceptionHandlerService
  // see https://docs.angularjs.org/api/ngMock/service/$exceptionHandler
  // see https://docs.angularjs.org/api/ngMock/provider/$exceptionHandlerProvider
  ///////////////////////////////////////////////////////////////////////////
  interface IExceptionHandlerProvider extends IServiceProvider {
    mode(mode: string): void;
  }

  ///////////////////////////////////////////////////////////////////////////
  // TimeoutService
  // see https://docs.angularjs.org/api/ngMock/service/$timeout
  // Augments the original service
  ///////////////////////////////////////////////////////////////////////////
  interface ITimeoutService {
    flush(delay?: number): void;
    flushNext(expectedDelay?: number): void;
    verifyNoPendingTasks(): void;
  }

  ///////////////////////////////////////////////////////////////////////////
  // IntervalService
  // see https://docs.angularjs.org/api/ngMock/service/$interval
  // Augments the original service
  ///////////////////////////////////////////////////////////////////////////
  interface IIntervalService {
    flush(millis?: number): number;
  }

  ///////////////////////////////////////////////////////////////////////////
  // LogService
  // see https://docs.angularjs.org/api/ngMock/service/$log
  // Augments the original service
  ///////////////////////////////////////////////////////////////////////////
  interface ILogService {
    assertEmpty(): void;
    reset(): void;
  }

  interface ILogCall {
    logs: string[];
  }

  ///////////////////////////////////////////////////////////////////////////
  // ControllerService mock
  // see https://docs.angularjs.org/api/ngMock/service/$controller
  // This interface extends http://docs.angularjs.org/api/ng.$controller
  ///////////////////////////////////////////////////////////////////////////
  interface IControllerService {
    // Although the documentation doesn't state this, locals are optional
    <T>(controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T;
    <T>(controllerConstructor: Function, locals?: any, bindings?: any): T;
    <T>(controllerName: string, locals?: any, bindings?: any): T;
  }

  ///////////////////////////////////////////////////////////////////////////
  // ComponentControllerService
  // see https://docs.angularjs.org/api/ngMock/service/$componentController
  ///////////////////////////////////////////////////////////////////////////
  interface IComponentControllerService {
    // TBinding is an interface exposed by a component as per <NAME>'s style guide
    // https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#accessible-members-up-top
    <T, TBinding>(componentName: string, locals: { $scope?: IScope, [key: string]: any }, bindings?: TBinding, ident?: string): T;
  }


  ///////////////////////////////////////////////////////////////////////////
  // HttpBackendService
  // see https://docs.angularjs.org/api/ngMock/service/$httpBackend
  ///////////////////////////////////////////////////////////////////////////
  interface IHttpBackendService {
    /**
      * Flushes pending requests using the trained responses. Requests are flushed in the order they were made, but it is also possible to skip one or more requests (for example to have them flushed later). This is useful for simulating scenarios where responses arrive from the server in any order.
      *
      * If there are no pending requests to flush when the method is called, an exception is thrown (as this is typically a sign of programming error).
      * @param count Number of responses to flush. If undefined/null, all pending requests (starting after `skip`) will be flushed.
      * @param skip Number of pending requests to skip. For example, a value of 5 would skip the first 5 pending requests and start flushing from the 6th onwards. _(default: 0)_
      */
    flush(count?: number, skip?: number): void;

    /**
      * Resets all request expectations, but preserves all backend definitions.
      */
    resetExpectations(): void;

    /**
      * Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception.
      * @param digest Do digest before checking expectation. Pass anything except false to trigger digest. NOTE this flag is purposely undocumented by Angular, which means it's not to be used in normal client code.
      */
    verifyNoOutstandingExpectation(digest?: boolean): void;

    /**
      * Verifies that there are no outstanding requests that need to be flushed.
      */
    verifyNoOutstandingRequest(): void;

        /**
          * Creates a new request expectation.
          * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
          * Returns an object with respond method that controls how a matched request is handled.
          * @param method HTTP method.
          * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
          * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
          * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
          * @param keys Array of keys to assign to regex matches in the request url.
          */
    expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler;

        /**
          * Creates a new request expectation for DELETE requests.
          * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
          * Returns an object with respond method that controls how a matched request is handled.
          * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected.
          * @param headers HTTP headers object to be compared with the HTTP headers in the request.
          * @param keys Array of keys to assign to regex matches in the request url.
{'fraction_non_alphanumeric': 0.25042860641685033, 'fraction_numerical': 0.0009796718099436689, 'mean_word_length': 1.736304238565924, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 32, 'https://': 28, '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': '5182406', 'n_tokens_mistral': 3685, 'n_tokens_neox': 3602, 'n_words': 1360}