From adc7f781dab580d33aaef192678208e7265525db Mon Sep 17 00:00:00 2001 From: Rich Christiansen Date: Wed, 8 Jun 2016 13:06:11 -0600 Subject: [PATCH] Migrating from TSD to typings TSD has been deprecated (https://github.com/DefinitelyTyped/tsd/issues/269), with typings suggested as the replacement. These changes migrate the code from TSD to typings. --- lib/typings.json | 19 + .../angular-ui-router/index.d.ts} | 35 +- .../globals/angular-ui-router/typings.json | 8 + .../angular/index.d.ts} | 327 +++++++++++---- lib/typings/globals/angular/typings.json | 8 + .../globals/cordova-plugin-spinner/index.d.ts | 28 ++ .../cordova-plugin-spinner/typings.json | 8 + .../cordova/index.d.ts} | 35 +- .../cordova/plugins/batterystatus/index.d.ts} | 12 +- .../plugins/batterystatus/typings.json | 8 + .../cordova/plugins/camera/index.d.ts} | 14 +- .../cordova/plugins/camera/typings.json | 8 + .../plugins/networkinformation/index.d.ts} | 18 +- .../plugins/networkinformation/typings.json | 8 + lib/typings/globals/cordova/typings.json | 8 + .../ionic.d.ts => globals/ionic/index.d.ts} | 74 ++-- lib/typings/globals/ionic/typings.json | 8 + .../jquery.d.ts => globals/jquery/index.d.ts} | 377 +++++++++--------- lib/typings/globals/jquery/typings.json | 8 + .../globals/ng-cordova/camera/index.d.ts | 8 + .../globals/ng-cordova/camera/typings.json | 8 + .../globals/ng-cordova/network/index.d.ts | 14 + .../globals/ng-cordova/network/typings.json | 8 + lib/typings/globals/ng-cordova/tsd/index.d.ts | 2 + .../globals/ng-cordova/tsd/typings.json | 8 + lib/typings/globals/require/index.d.ts | 368 +++++++++++++++++ lib/typings/globals/require/typings.json | 8 + lib/typings/index.d.ts | 15 + lib/typings/ng-cordova/camera.d.ts | 14 - lib/typings/ng-cordova/network.d.ts | 19 - lib/typings/ng-cordova/tsd.d.ts | 21 - lib/typings/require.d.ts | 10 +- lib/typings/tsd.d.ts | 6 - tsconfig.json | 2 +- 34 files changed, 1075 insertions(+), 447 deletions(-) create mode 100644 lib/typings.json rename lib/typings/{angular-ui-router/angular-ui-router.d.ts => globals/angular-ui-router/index.d.ts} (92%) create mode 100644 lib/typings/globals/angular-ui-router/typings.json rename lib/typings/{angularjs/angular.d.ts => globals/angular/index.d.ts} (84%) create mode 100644 lib/typings/globals/angular/typings.json create mode 100644 lib/typings/globals/cordova-plugin-spinner/index.d.ts create mode 100644 lib/typings/globals/cordova-plugin-spinner/typings.json rename lib/typings/{cordova/cordova.d.ts => globals/cordova/index.d.ts} (74%) rename lib/typings/{cordova/plugins/BatteryStatus.d.ts => globals/cordova/plugins/batterystatus/index.d.ts} (95%) create mode 100644 lib/typings/globals/cordova/plugins/batterystatus/typings.json rename lib/typings/{cordova/plugins/Camera.d.ts => globals/cordova/plugins/camera/index.d.ts} (93%) create mode 100644 lib/typings/globals/cordova/plugins/camera/typings.json rename lib/typings/{cordova/plugins/NetworkInformation.d.ts => globals/cordova/plugins/networkinformation/index.d.ts} (79%) create mode 100644 lib/typings/globals/cordova/plugins/networkinformation/typings.json create mode 100644 lib/typings/globals/cordova/typings.json rename lib/typings/{ionic/ionic.d.ts => globals/ionic/index.d.ts} (89%) create mode 100644 lib/typings/globals/ionic/typings.json rename lib/typings/{jquery/jquery.d.ts => globals/jquery/index.d.ts} (97%) create mode 100644 lib/typings/globals/jquery/typings.json create mode 100644 lib/typings/globals/ng-cordova/camera/index.d.ts create mode 100644 lib/typings/globals/ng-cordova/camera/typings.json create mode 100644 lib/typings/globals/ng-cordova/network/index.d.ts create mode 100644 lib/typings/globals/ng-cordova/network/typings.json create mode 100644 lib/typings/globals/ng-cordova/tsd/index.d.ts create mode 100644 lib/typings/globals/ng-cordova/tsd/typings.json create mode 100644 lib/typings/globals/require/index.d.ts create mode 100644 lib/typings/globals/require/typings.json create mode 100644 lib/typings/index.d.ts delete mode 100644 lib/typings/ng-cordova/camera.d.ts delete mode 100644 lib/typings/ng-cordova/network.d.ts delete mode 100644 lib/typings/ng-cordova/tsd.d.ts delete mode 100644 lib/typings/tsd.d.ts diff --git a/lib/typings.json b/lib/typings.json new file mode 100644 index 0000000..dbaa5b6 --- /dev/null +++ b/lib/typings.json @@ -0,0 +1,19 @@ +{ + "name": "ionic-cross-platform-boilerplate", + "version": false, + "globalDependencies": { + "angular": "registry:dt/angular#1.5.0+20160602160139", + "angular-ui-router": "registry:dt/angular-ui-router#1.1.5+20160521151413", + "cordova": "registry:dt/cordova#0.0.0+20160510234918", + "cordova-plugin-spinner": "registry:dt/cordova-plugin-spinner#1.0.0+20160317120654", + "cordova/plugins/batterystatus": "registry:dt/cordova/plugins/batterystatus#0.0.0+20160316155526", + "cordova/plugins/camera": "registry:dt/cordova/plugins/camera#0.0.0+20160316155526", + "cordova/plugins/networkinformation": "registry:dt/cordova/plugins/networkinformation#0.0.0+20160514150524", + "ionic": "registry:dt/ionic#0.0.0+20160501155303", + "jquery": "registry:dt/jquery#1.10.0+20160417213236", + "ng-cordova/camera": "registry:dt/ng-cordova/camera#0.0.0+20160316171810", + "ng-cordova/network": "registry:dt/ng-cordova/network#0.0.0+20160316171810", + "ng-cordova/tsd": "registry:dt/ng-cordova/tsd#0.0.0+20151202000610", + "require": "registry:dt/require#2.1.20+20160316155526" + } +} diff --git a/lib/typings/angular-ui-router/angular-ui-router.d.ts b/lib/typings/globals/angular-ui-router/index.d.ts similarity index 92% rename from lib/typings/angular-ui-router/angular-ui-router.d.ts rename to lib/typings/globals/angular-ui-router/index.d.ts index 422af03..5733274 100644 --- a/lib/typings/angular-ui-router/angular-ui-router.d.ts +++ b/lib/typings/globals/angular-ui-router/index.d.ts @@ -1,9 +1,5 @@ -// Type definitions for Angular JS 1.1.5+ (ui.router module) -// Project: https://github.com/angular-ui/ui-router -// Definitions by: Michel Salib -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -// Support for AMD require and CommonJS +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/41f31600a1bff1adef3c76642183b20ec97aa81e/angular-ui-router/angular-ui-router.d.ts declare module 'angular-ui-router' { // Since angular-ui-router adds providers for a bunch of // injectable dependencies, it doesn't really return any @@ -26,14 +22,14 @@ declare module 'angular-ui-router' { export type IType = angular.ui.IType; } -declare module angular.ui { +declare namespace angular.ui { interface IState { name?: string; /** * String HTML content, or function that returns an HTML string */ - template?: any | string | {(): string}; + template?: string | {(params: IStateParamsService): string}; /** * String URL path to template file OR Function, returns URL path string */ @@ -98,6 +94,12 @@ declare module angular.ui { cache?: boolean; } + interface IUnfoundState { + to: string, + toParams: {}, + options: IStateOptions + } + interface IStateProvider extends angular.IServiceProvider { state(name:string, config:IState): IStateProvider; state(config:IState): IStateProvider; @@ -221,9 +223,9 @@ declare module angular.ui { */ notify?: boolean; /** - * {boolean=false}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params. + * {boolean=false|string|IState}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params. */ - reload?: boolean; + reload?: boolean | string | IState; } interface IHrefOptions { @@ -255,11 +257,15 @@ declare module angular.ui { transitionTo(state: string, params?: {}, options?: IStateOptions): angular.IPromise; transitionTo(state: IState, params?: {}, options?: IStateOptions): angular.IPromise; includes(state: string, params?: {}): boolean; + includes(state: string, params?: {}, options?:any): boolean; is(state:string, params?: {}): boolean; is(state: IState, params?: {}): boolean; href(state: IState, params?: {}, options?: IHrefOptions): string; href(state: string, params?: {}, options?: IHrefOptions): string; - get(state: string): IState; + get(state: string, context?: string): IState; + get(state: IState, context?: string): IState; + get(state: string, context?: IState): IState; + get(state: IState, context?: IState): IState; get(): IState[]; /** A reference to the state's config object. However you passed it in. Useful for accessing custom data. */ current: IState; @@ -298,7 +304,10 @@ declare module angular.ui { * */ sync(): void; - listen(): void; + listen(): Function; + href(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): string; + update(read?: boolean): void; + push(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): void; } interface IUiViewScrollProvider { @@ -351,4 +360,4 @@ declare module angular.ui { */ pattern?: RegExp; } -} +} \ No newline at end of file diff --git a/lib/typings/globals/angular-ui-router/typings.json b/lib/typings/globals/angular-ui-router/typings.json new file mode 100644 index 0000000..639278d --- /dev/null +++ b/lib/typings/globals/angular-ui-router/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/41f31600a1bff1adef3c76642183b20ec97aa81e/angular-ui-router/angular-ui-router.d.ts", + "raw": "registry:dt/angular-ui-router#1.1.5+20160521151413", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/41f31600a1bff1adef3c76642183b20ec97aa81e/angular-ui-router/angular-ui-router.d.ts" + } +} diff --git a/lib/typings/angularjs/angular.d.ts b/lib/typings/globals/angular/index.d.ts similarity index 84% rename from lib/typings/angularjs/angular.d.ts rename to lib/typings/globals/angular/index.d.ts index 50ebbef..015d956 100644 --- a/lib/typings/angularjs/angular.d.ts +++ b/lib/typings/globals/angular/index.d.ts @@ -1,11 +1,5 @@ -// Type definitions for Angular JS 1.4+ -// Project: http://angularjs.org -// Definitions by: Diego Vilar -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -/// - +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/cec53b2710e2cc07e44d6260fc25d13ae21d640c/angularjs/angular.d.ts declare var angular: angular.IAngularStatic; // Support for painless dependency injection @@ -23,7 +17,7 @@ declare module 'angular' { /////////////////////////////////////////////////////////////////////////////// // ng module (angular.js) /////////////////////////////////////////////////////////////////////////////// -declare module angular { +declare namespace angular { // not directly implemented, but ensures that constructed class implements $get interface IServiceProviderClass { @@ -178,9 +172,13 @@ declare module angular { // see http://docs.angularjs.org/api/angular.Module /////////////////////////////////////////////////////////////////////////// interface IModule { - animation(name: string, animationFactory: Function): IModule; - animation(name: string, inlineAnnotatedFunction: any[]): IModule; - animation(object: Object): IModule; + /** + * Use this method to register a component. + * + * @param name The name of the component. + * @param options A definition object passed into the component. + */ + component(name: string, options: IComponentOptions): IModule; /** * Use this method to register work which needs to be performed on module loading. * @@ -193,13 +191,14 @@ declare module angular { * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration. */ config(inlineAnnotatedFunction: any[]): IModule; + config(object: Object): IModule; /** * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator. * * @param name The name of the constant. * @param value The constant value. */ - constant(name: string, value: any): IModule; + constant(name: string, value: T): IModule; constant(object: Object): IModule; /** * The $controller service is used by Angular to create new controllers. @@ -266,7 +265,19 @@ declare module angular { * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests. */ run(inlineAnnotatedFunction: any[]): IModule; + /** + * Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. + * + * @param name The name of the instance. + * @param serviceConstructor An injectable class (constructor function) that will be instantiated. + */ service(name: string, serviceConstructor: Function): IModule; + /** + * Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. + * + * @param name The name of the instance. + * @param inlineAnnotatedConstructor An injectable class (constructor function) that will be instantiated. + */ service(name: string, inlineAnnotatedConstructor: any[]): IModule; service(object: Object): IModule; /** @@ -277,7 +288,7 @@ declare module angular { * @param name The name of the instance. * @param value The value. */ - value(name: string, value: any): IModule; + value(name: string, value: T): IModule; value(object: Object): IModule; /** @@ -328,6 +339,12 @@ declare module angular { */ $removeClass(classVal: string): void; + /** + * Adds and removes the appropriate CSS class values to the element based on the difference between + * the new and old CSS class values (specified as newClasses and oldClasses). + */ + $updateClass(newClasses: string, oldClasses: string): void; + /** * Set DOM element attribute value. */ @@ -365,9 +382,10 @@ declare module angular { $invalid: boolean; $submitted: boolean; $error: any; - $addControl(control: INgModelController): void; - $removeControl(control: INgModelController): void; - $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController): void; + $pending: any; + $addControl(control: INgModelController | IFormController): void; + $removeControl(control: INgModelController | IFormController): void; + $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController | IFormController): void; $setDirty(): void; $setPristine(): void; $commitViewValue(): void; @@ -418,6 +436,16 @@ declare module angular { $invalid: boolean; } + //Allows tuning how model updates are done. + //https://docs.angularjs.org/api/ng/directive/ngModelOptions + interface INgModelOptions { + updateOn?: string; + debounce?: any; + allowInvalid?: boolean; + getterSetter?: boolean; + timezone?: string; + } + interface IModelValidators { /** * viewValue is any because it can be an object that is called in the view like $viewValue.name:$viewValue.subName @@ -500,18 +528,18 @@ declare module angular { * @param name Event name to listen on. * @param listener Function to call when the event is emitted. */ - $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): Function; + $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): () => void; - $watch(watchExpression: string, listener?: string, objectEquality?: boolean): Function; - $watch(watchExpression: string, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): Function; - $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): Function; - $watch(watchExpression: (scope: IScope) => T, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): Function; + $watch(watchExpression: string, listener?: string, objectEquality?: boolean): () => void; + $watch(watchExpression: string, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): () => void; + $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): () => void; + $watch(watchExpression: (scope: IScope) => T, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): () => void; - $watchCollection(watchExpression: string, listener: (newValue: T, oldValue: T, scope: IScope) => any): Function; - $watchCollection(watchExpression: (scope: IScope) => T, listener: (newValue: T, oldValue: T, scope: IScope) => any): Function; + $watchCollection(watchExpression: string, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void; + $watchCollection(watchExpression: (scope: IScope) => T, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void; - $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; - $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; + $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; + $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; $parent: IScope; $root: IRootScopeService; @@ -597,15 +625,6 @@ declare module angular { [key: string]: any; } - /////////////////////////////////////////////////////////////////////////// - // BrowserService - // TODO undocumented, so we need to get it from the source code - /////////////////////////////////////////////////////////////////////////// - interface IBrowserService { - defer: angular.ITimeoutService; - [key: string]: any; - } - /////////////////////////////////////////////////////////////////////////// // TimeoutService // see http://docs.angularjs.org/api/ng.$timeout @@ -625,35 +644,6 @@ declare module angular { cancel(promise: IPromise): boolean; } - /////////////////////////////////////////////////////////////////////////// - // AnimateProvider - // see http://docs.angularjs.org/api/ng/provider/$animateProvider - /////////////////////////////////////////////////////////////////////////// - interface IAnimateProvider { - /** - * Registers a new injectable animation factory function. - * - * @param name The name of the animation. - * @param factory The factory function that will be executed to return the animation object. - */ - register(name: string, factory: () => IAnimateCallbackObject): void; - - /** - * Gets and/or sets the CSS class expression that is checked when performing an animation. - * - * @param expression The className expression which will be checked against all animations. - * @returns The current CSS className expression value. If null then there is no expression value. - */ - classNameFilter(expression?: RegExp): RegExp; - } - - /** - * The animation object which contains callback functions for each event that is expected to be animated. - */ - interface IAnimateCallbackObject { - eventFn(element: Node, doneFn: () => void): Function; - } - /** * $filter - $filterProvider - service in module ng * @@ -887,6 +877,24 @@ declare module angular { unwrapPromises(): boolean; unwrapPromises(value: boolean): IParseProvider; + + /** + * Configure $parse service to add literal values that will be present as literal at expressions. + * + * @param literalName Token for the literal value. The literal name value must be a valid literal name. + * @param literalValue Value for this literal. All literal values must be primitives or `undefined`. + **/ + addLiteral(literalName: string, literalValue: any): void; + + /** + * Allows defining the set of characters that are allowed in Angular expressions. The function identifierStart will get called to know if a given character is a valid character to be the first character for an identifier. The function identifierContinue will get called to know if a given character is a valid character to be a follow-up identifier character. The functions identifierStart and identifierContinue will receive as arguments the single character to be identifier and the character code point. These arguments will be string and numeric. Keep in mind that the string parameter can be two characters long depending on the character representation. It is expected for the function to return true or false, whether that character is allowed or not. + * Since this function will be called extensivelly, keep the implementation of these functions fast, as the performance of these functions have a direct impact on the expressions parsing speed. + * + * @param identifierStart The function that will decide whether the given character is a valid identifier start character. + * @param identifierContinue The function that will decide whether the given character is a valid identifier continue character. + **/ + setIdentifierFns(identifierStart?: (character: string, codePoint: number) => boolean, + identifierContinue?: (character: string, codePoint: number) => boolean): void; } interface ICompiledExpression { @@ -1010,7 +1018,16 @@ declare module angular { * * @param promises An array of promises. */ - all(promises: IPromise[]): IPromise; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise, T10 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise]): IPromise<[T1, T2, T3, T4, T5]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise ]): IPromise<[T1, T2, T3, T4]>; + all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise]): IPromise<[T1, T2, T3]>; + all(values: [T1 | IPromise, T2 | IPromise]): IPromise<[T1, T2]>; + all(promises: IPromise[]): IPromise; /** * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. * @@ -1076,7 +1093,7 @@ declare module angular { } interface IDeferred { - resolve(value?: T): void; + resolve(value?: T|IPromise): void; reject(reason?: any): void; notify(state?: any): void; promise: IPromise; @@ -1201,10 +1218,15 @@ declare module angular { interface ICompileProvider extends IServiceProvider { directive(name: string, directiveFactory: Function): ICompileProvider; + directive(directivesMap: Object, directiveFactory: Function): ICompileProvider; + directive(name: string, inlineAnnotatedFunction: any[]): ICompileProvider; + directive(directivesMap: Object, inlineAnnotatedFunction: any[]): ICompileProvider; // Undocumented, but it is there... directive(directivesMap: any): ICompileProvider; + component(name: string, options: IComponentOptions): ICompileProvider; + aHrefSanitizationWhitelist(): RegExp; aHrefSanitizationWhitelist(regexp: RegExp): ICompileProvider; @@ -1239,9 +1261,9 @@ declare module angular { /////////////////////////////////////////////////////////////////////////// interface IControllerService { // Although the documentation doesn't state this, locals are optional - (controllerConstructor: new (...args: any[]) => T, locals?: any, bindToController?: any): T; - (controllerConstructor: Function, locals?: any, bindToController?: any): T; - (controllerName: string, locals?: any, bindToController?: any): T; + (controllerConstructor: new (...args: any[]) => T, locals?: any, later?: boolean, ident?: string): T; + (controllerConstructor: Function, locals?: any, later?: boolean, ident?: string): T; + (controllerName: string, locals?: any, later?: boolean, ident?: string): T; } interface IControllerProvider extends IServiceProvider { @@ -1250,6 +1272,15 @@ declare module angular { allowGlobals(): void; } + /** + * xhrFactory + * Replace or decorate this service to create your own custom XMLHttpRequest objects. + * see https://docs.angularjs.org/api/ng/service/$xhrFactory + */ + interface IXhrFactory { + (method: string, url: string): T; + } + /** * HttpService * see http://docs.angularjs.org/api/ng/service/$http @@ -1391,8 +1422,18 @@ declare module angular { } interface IHttpPromise extends IPromise> { - success(callback: IHttpPromiseCallback): IHttpPromise; - error(callback: IHttpPromiseCallback): IHttpPromise; + /** + * The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. + * If $httpProvider.useLegacyPromiseExtensions is set to false then these methods will throw $http/legacy error. + * @deprecated + */ + success?(callback: IHttpPromiseCallback): IHttpPromise; + /** + * The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. + * If $httpProvider.useLegacyPromiseExtensions is set to false then these methods will throw $http/legacy error. + * @deprecated + */ + error?(callback: IHttpPromiseCallback): IHttpPromise; } // See the jsdoc for transformData() at https://github.com/angular/angular.js/blob/master/src/ng/http.js#L228 @@ -1405,13 +1446,15 @@ declare module angular { (data: any, headersGetter: IHttpHeadersGetter, status: number): any; } + type HttpHeaderType = {[requestType: string]:string|((config:IRequestConfig) => string)}; + interface IHttpRequestConfigHeaders { - [requestType: string]: string|(() => string); - common?: string|(() => string); - get?: string|(() => string); - post?: string|(() => string); - put?: string|(() => string); - patch?: string|(() => string); + [requestType: string]: any; + common?: any; + get?: any; + post?: any; + put?: any; + patch?: any; } /** @@ -1471,7 +1514,7 @@ declare module angular { interface IHttpInterceptor { request?: (config: IRequestConfig) => IRequestConfig|IPromise; requestError?: (rejection: any) => any; - response?: (response: IHttpPromiseCallbackArg) => IPromise|T; + response?: (response: IHttpPromiseCallbackArg) => IPromise>|IHttpPromiseCallbackArg; responseError?: (rejection: any) => any; } @@ -1620,6 +1663,60 @@ declare module angular { totalPendingRequests: number; } + /////////////////////////////////////////////////////////////////////////// + // Component + // see http://angularjs.blogspot.com.br/2015/11/angularjs-15-beta2-and-14-releases.html + // and http://toddmotto.com/exploring-the-angular-1-5-component-method/ + /////////////////////////////////////////////////////////////////////////// + /** + * Component definition object (a simplified directive definition object) + */ + interface IComponentOptions { + /** + * Controller constructor function that should be associated with newly created scope or the name of a registered + * controller if passed as a string. Empty function by default. + * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) + */ + controller?: string | Function | (string | Function)[]; + /** + * An identifier name for a reference to the controller. If present, the controller will be published to scope under + * the controllerAs name. If not present, this will default to be the same as the component name. + * @default "$ctrl" + */ + controllerAs?: string; + /** + * html template as a string or a function that returns an html template as a string which should be used as the + * contents of this component. Empty string by default. + * If template is a function, then it is injected with the following locals: + * $element - Current element + * $attrs - Current attributes object for the element + * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) + */ + template?: string | Function | (string | Function)[]; + /** + * path or function that returns a path to an html template that should be used as the contents of this component. + * If templateUrl is a function, then it is injected with the following locals: + * $element - Current element + * $attrs - Current attributes object for the element + * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) + */ + templateUrl?: string | Function | (string | Function)[]; + /** + * Define DOM attribute binding to component properties. Component properties are always bound to the component + * controller and not to the scope. + */ + bindings?: {[binding: string]: string}; + /** + * Whether transclusion is enabled. Enabled by default. + */ + transclude?: boolean | string | {[slot: string]: string}; + require?: string | string[] | {[controller: string]: string}; + } + + interface IComponentTemplateFn { + ( $element?: IAugmentedJQuery, $attrs?: IAttributes ): string; + } + /////////////////////////////////////////////////////////////////////////// // Directive // see http://docs.angularjs.org/api/ng.$compileProvider#directive @@ -1649,6 +1746,12 @@ declare module angular { ( templateElement: IAugmentedJQuery, templateAttributes: IAttributes, + /** + * @deprecated + * Note: The transclude function that is passed to the compile function is deprecated, + * as it e.g. does not know about the right outer scope. Please use the transclude function + * that is passed to the link function instead. + */ transclude: ITranscludeFunction ): IDirectivePrePost; } @@ -1657,19 +1760,29 @@ declare module angular { compile?: IDirectiveCompileFn; controller?: any; controllerAs?: string; - bindToController?: boolean|Object; + /** + * @deprecated + * Deprecation warning: although bindings for non-ES6 class controllers are currently bound to this before + * the controller constructor is called, this use is now deprecated. Please place initialization code that + * relies upon bindings inside a $onInit method on the controller, instead. + */ + bindToController?: boolean | Object; link?: IDirectiveLinkFn | IDirectivePrePost; + multiElement?: boolean; name?: string; priority?: number; + /** + * @deprecated + */ replace?: boolean; - require?: any; + require?: string | string[] | {[controller: string]: string}; restrict?: string; - scope?: any; - template?: any; + scope?: boolean | Object; + template?: string | Function; templateNamespace?: string; - templateUrl?: any; + templateUrl?: string | Function; terminal?: boolean; - transclude?: any; + transclude?: boolean | string | {[slot: string]: string}; } /** @@ -1700,6 +1813,11 @@ declare module angular { controller(name: string): any; injector(): any; scope(): IScope; + + /** + * Overload for custom scope interfaces + */ + scope(): T; isolateScope(): IScope; inheritedData(key: string, value: any): JQuery; @@ -1717,13 +1835,41 @@ declare module angular { // see http://docs.angularjs.org/api/AUTO.$injector /////////////////////////////////////////////////////////////////////// interface IInjectorService { - annotate(fn: Function): string[]; + annotate(fn: Function, strictDi?: boolean): string[]; annotate(inlineAnnotatedFunction: any[]): string[]; get(name: string, caller?: string): T; + get(name: '$anchorScroll'): IAnchorScrollService + get(name: '$cacheFactory'): ICacheFactoryService + get(name: '$compile'): ICompileService + get(name: '$controller'): IControllerService + get(name: '$document'): IDocumentService + get(name: '$exceptionHandler'): IExceptionHandlerService + get(name: '$filter'): IFilterService + get(name: '$http'): IHttpService + get(name: '$httpBackend'): IHttpBackendService + get(name: '$httpParamSerializer'): IHttpParamSerializer + get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer + get(name: '$interpolate'): IInterpolateService + get(name: '$interval'): IIntervalService + get(name: '$locale'): ILocaleService + get(name: '$location'): ILocationService + get(name: '$log'): ILogService + get(name: '$parse'): IParseService + get(name: '$q'): IQService + get(name: '$rootElement'): IRootElementService + get(name: '$rootScope'): IRootScopeService + get(name: '$sce'): ISCEService + get(name: '$sceDelegate'): ISCEDelegateService + get(name: '$templateCache'): ITemplateCacheService + get(name: '$templateRequest'): ITemplateRequestService + get(name: '$timeout'): ITimeoutService + get(name: '$window'): IWindowService + get(name: '$xhrFactory'): IXhrFactory has(name: string): boolean; instantiate(typeConstructor: Function, locals?: any): T; invoke(inlineAnnotatedFunction: any[]): any; invoke(func: Function, context?: any, locals?: any): any; + strictDi: boolean; } /////////////////////////////////////////////////////////////////////// @@ -1765,8 +1911,17 @@ declare module angular { provider(name: string, provider: IServiceProvider): IServiceProvider; provider(name: string, serviceProviderConstructor: Function): IServiceProvider; service(name: string, constructor: Function): IServiceProvider; + service(name: string, inlineAnnotatedFunction: any[]): IServiceProvider; value(name: string, value: any): IServiceProvider; } } -} + + /** + * $http params serializer that converts objects to strings + * see https://docs.angularjs.org/api/ng/service/$httpParamSerializer + */ + interface IHttpParamSerializer { + (obj: Object): string; + } +} \ No newline at end of file diff --git a/lib/typings/globals/angular/typings.json b/lib/typings/globals/angular/typings.json new file mode 100644 index 0000000..52319b6 --- /dev/null +++ b/lib/typings/globals/angular/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/cec53b2710e2cc07e44d6260fc25d13ae21d640c/angularjs/angular.d.ts", + "raw": "registry:dt/angular#1.5.0+20160602160139", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/cec53b2710e2cc07e44d6260fc25d13ae21d640c/angularjs/angular.d.ts" + } +} diff --git a/lib/typings/globals/cordova-plugin-spinner/index.d.ts b/lib/typings/globals/cordova-plugin-spinner/index.d.ts new file mode 100644 index 0000000..3d9d5b6 --- /dev/null +++ b/lib/typings/globals/cordova-plugin-spinner/index.d.ts @@ -0,0 +1,28 @@ +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/cordova-plugin-spinner/cordova-plugin-spinner.d.ts +declare namespace SpinnerPlugin { + + interface SpinnerPluginStatic { + + /** + * Blocks user input using an indeterminate spinner. + * + * An optional label can be shown below the spinner. + * + * @param labelText The optional value to show in a label. + * @param successCallback The success callback for this asynchronous function. + * @param failureCallback The failure callback for this asynchronous function; receives an error string. + */ + activityStart(labelText?: string, successCallback?: () => void, failureCallback?: (error: string) => void): void; + + /** + * Allows user input by hiding the indeterminate spinner. + * + * @param successCallback The success callback for this asynchronous function. + * @param failureCallback The failure callback for this asynchronous function; receives an error string. + */ + activityStop(successCallback?: () => void, failureCallback?: (error: string) => void): void; + } +} + +declare var SpinnerPlugin: SpinnerPlugin.SpinnerPluginStatic; \ No newline at end of file diff --git a/lib/typings/globals/cordova-plugin-spinner/typings.json b/lib/typings/globals/cordova-plugin-spinner/typings.json new file mode 100644 index 0000000..d41b35b --- /dev/null +++ b/lib/typings/globals/cordova-plugin-spinner/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/cordova-plugin-spinner/cordova-plugin-spinner.d.ts", + "raw": "registry:dt/cordova-plugin-spinner#1.0.0+20160317120654", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/cordova-plugin-spinner/cordova-plugin-spinner.d.ts" + } +} diff --git a/lib/typings/cordova/cordova.d.ts b/lib/typings/globals/cordova/index.d.ts similarity index 74% rename from lib/typings/cordova/cordova.d.ts rename to lib/typings/globals/cordova/index.d.ts index d17da79..67314fb 100644 --- a/lib/typings/cordova/cordova.d.ts +++ b/lib/typings/globals/cordova/index.d.ts @@ -1,32 +1,5 @@ -// Type definitions for Apache Cordova -// Project: http://cordova.apache.org -// Definitions by: Microsoft Open Technologies Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped -// -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. - -/// -/// -// / -// / -// / -// / -// / -// / -// / -// / -// / -// / -// / -/// -// / -// / -// / -// / -// / -// / - +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/844831b968857a9dc2f44e0698ff282863c5c238/cordova/cordova.d.ts interface Cordova { /** Invokes native functionality by specifying corresponding service name, action and optional parameters. * @param success A success callback function. @@ -35,7 +8,7 @@ interface Cordova { * @param action The action name to call on the native side (generally corresponds to the native class method). * @param args An array of arguments to pass into the native environment. */ - exec(success: () => any, fail: () => any, service: string, action: string, args?: string[]): void; + exec(success: () => any, fail: () => any, service: string, action: string, args?: any[]): void; /** Gets the operating system name. */ platformId: string; /** Gets Cordova framework version */ @@ -98,4 +71,4 @@ declare var cordova: Cordova; declare module 'cordova' { export = cordova; -} +} \ No newline at end of file diff --git a/lib/typings/cordova/plugins/BatteryStatus.d.ts b/lib/typings/globals/cordova/plugins/batterystatus/index.d.ts similarity index 95% rename from lib/typings/cordova/plugins/BatteryStatus.d.ts rename to lib/typings/globals/cordova/plugins/batterystatus/index.d.ts index 3df81fd..eb54d4a 100644 --- a/lib/typings/cordova/plugins/BatteryStatus.d.ts +++ b/lib/typings/globals/cordova/plugins/batterystatus/index.d.ts @@ -1,11 +1,5 @@ -// Type definitions for Apache Cordova BatteryStatus plugin. -// Project: https://github.com/apache/cordova-plugin-battery-status -// Definitions by: Microsoft Open Technologies, Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped -// -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. - +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/cordova/plugins/BatteryStatus.d.ts interface Window { onbatterystatus: (type: BatteryStatusEvent) => void; onbatterycritical: (type: BatteryStatusEvent) => void; @@ -122,4 +116,4 @@ interface BatteryStatusEvent extends Event { level: number; /* A boolean that indicates whether the device is plugged in. */ isPlugged: boolean; -} +} \ No newline at end of file diff --git a/lib/typings/globals/cordova/plugins/batterystatus/typings.json b/lib/typings/globals/cordova/plugins/batterystatus/typings.json new file mode 100644 index 0000000..36facb6 --- /dev/null +++ b/lib/typings/globals/cordova/plugins/batterystatus/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/cordova/plugins/BatteryStatus.d.ts", + "raw": "registry:dt/cordova/plugins/batterystatus#0.0.0+20160316155526", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/cordova/plugins/BatteryStatus.d.ts" + } +} diff --git a/lib/typings/cordova/plugins/Camera.d.ts b/lib/typings/globals/cordova/plugins/camera/index.d.ts similarity index 93% rename from lib/typings/cordova/plugins/Camera.d.ts rename to lib/typings/globals/cordova/plugins/camera/index.d.ts index 768dd26..05f8e5b 100644 --- a/lib/typings/cordova/plugins/Camera.d.ts +++ b/lib/typings/globals/cordova/plugins/camera/index.d.ts @@ -1,11 +1,5 @@ -// Type definitions for Apache Cordova Camera plugin. -// Project: https://github.com/apache/cordova-plugin-camera -// Definitions by: Microsoft Open Technologies, Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped -// -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. - +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/cordova/plugins/Camera.d.ts interface Navigator { /** * This plugin provides an API for taking pictures and for choosing images from the system's image library. @@ -129,7 +123,7 @@ interface CameraPopoverOptions { /** * Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection * Matches iOS UIPopoverArrowDirection constants. - * ARROW_UP : 1, + * ARROW_UP : 1, * ARROW_DOWN : 2, * ARROW_LEFT : 4, * ARROW_RIGHT : 8, @@ -171,4 +165,4 @@ declare var Camera: { ARROW_RIGHT: number; ARROW_ANY: number; } -}; +}; \ No newline at end of file diff --git a/lib/typings/globals/cordova/plugins/camera/typings.json b/lib/typings/globals/cordova/plugins/camera/typings.json new file mode 100644 index 0000000..d0eb8a0 --- /dev/null +++ b/lib/typings/globals/cordova/plugins/camera/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/cordova/plugins/Camera.d.ts", + "raw": "registry:dt/cordova/plugins/camera#0.0.0+20160316155526", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/cordova/plugins/Camera.d.ts" + } +} diff --git a/lib/typings/cordova/plugins/NetworkInformation.d.ts b/lib/typings/globals/cordova/plugins/networkinformation/index.d.ts similarity index 79% rename from lib/typings/cordova/plugins/NetworkInformation.d.ts rename to lib/typings/globals/cordova/plugins/networkinformation/index.d.ts index f10789a..0e35313 100644 --- a/lib/typings/cordova/plugins/NetworkInformation.d.ts +++ b/lib/typings/globals/cordova/plugins/networkinformation/index.d.ts @@ -1,11 +1,5 @@ -// Type definitions for Apache Cordova Network Information plugin. -// Project: https://github.com/apache/cordova-plugin-network-information -// Definitions by: Microsoft Open Technologies, Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped -// -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. - +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/57fdaeeec3e49a60b41c9743b788adb108e9953b/cordova/plugins/NetworkInformation.d.ts interface Navigator { /** * This plugin provides an implementation of an old version of the Network Information API. @@ -13,7 +7,7 @@ interface Navigator { */ connection: Connection; // see https://github.com/apache/cordova-plugin-network-information/blob/dev/doc/index.md#api-change - // for + // for network: { /** * This plugin provides an implementation of an old version of the Network Information API. @@ -45,7 +39,9 @@ interface Connection { * Connection.CELL * Connection.NONE */ - type: string + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } declare var Connection: { @@ -57,4 +53,4 @@ declare var Connection: { CELL_4G: string; CELL: string; NONE: string; -} +} \ No newline at end of file diff --git a/lib/typings/globals/cordova/plugins/networkinformation/typings.json b/lib/typings/globals/cordova/plugins/networkinformation/typings.json new file mode 100644 index 0000000..30192f4 --- /dev/null +++ b/lib/typings/globals/cordova/plugins/networkinformation/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/57fdaeeec3e49a60b41c9743b788adb108e9953b/cordova/plugins/NetworkInformation.d.ts", + "raw": "registry:dt/cordova/plugins/networkinformation#0.0.0+20160514150524", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/57fdaeeec3e49a60b41c9743b788adb108e9953b/cordova/plugins/NetworkInformation.d.ts" + } +} diff --git a/lib/typings/globals/cordova/typings.json b/lib/typings/globals/cordova/typings.json new file mode 100644 index 0000000..cce7441 --- /dev/null +++ b/lib/typings/globals/cordova/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/844831b968857a9dc2f44e0698ff282863c5c238/cordova/cordova.d.ts", + "raw": "registry:dt/cordova#0.0.0+20160510234918", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/844831b968857a9dc2f44e0698ff282863c5c238/cordova/cordova.d.ts" + } +} diff --git a/lib/typings/ionic/ionic.d.ts b/lib/typings/globals/ionic/index.d.ts similarity index 89% rename from lib/typings/ionic/ionic.d.ts rename to lib/typings/globals/ionic/index.d.ts index a767b85..28e1c0d 100644 --- a/lib/typings/ionic/ionic.d.ts +++ b/lib/typings/globals/ionic/index.d.ts @@ -1,10 +1,5 @@ -// Type definitions for Ionic -// Project: http://ionicframework.com -// Definitions by: Spencer Williams -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/28cd028ab871a770027b35e0e14bd8c7005eca21/ionic/ionic.d.ts interface IonicStatic { /** * What Ionic package version is. @@ -32,6 +27,10 @@ interface IonicStatic { * Return the current device (given by cordova). */ device(): any; + /** + * Check if the platform name provided is detected. + */ + is(platformName: string): boolean; /** * Check if we are running within a WebView (such as Cordova). */ @@ -97,8 +96,8 @@ declare module 'ionic' { export = ionic; } -declare module ionic { - module actionSheet { +declare namespace ionic { + namespace actionSheet { interface IonicActionSheetService { show(options: IonicActionSheetOptions): ()=>void; } @@ -117,15 +116,15 @@ declare module ionic { cssClass?: string; } } - module backdrop { + namespace backdrop { interface IonicBackdropService { retain(): void; release(): void; } } - module gestures { + namespace gestures { interface IonicGestureService { - on(eventType: string, callback: (e: any)=>any, $element: ng.IAugmentedJQuery, options: any): IonicGesture; + on(eventType: string, callback: (e: any)=>any, $element: angular.IAugmentedJQuery, options: any): IonicGesture; off(gesture: IonicGesture, eventType: string, callback: (e: any)=>any): void; } @@ -140,7 +139,7 @@ declare module ionic { } } - module list { + namespace list { interface IonicListDelegate { showReorder(showReorder?: boolean): boolean; showDelete(showDelete?: boolean): boolean; @@ -149,7 +148,7 @@ declare module ionic { $getByHandle(handle: string): IonicListDelegate; } } - module loading { + namespace loading { interface IonicLoadingService { show(opts?: IonicLoadingOptions): void; hide(): void; @@ -164,17 +163,17 @@ declare module ionic { duration?: number; } } - module modal { + namespace modal { interface IonicModalService { fromTemplate(templateString: string, options?: IonicModalOptions): IonicModalController; - fromTemplateUrl(templateUrl: string, options?: IonicModalOptions): ng.IPromise; + fromTemplateUrl(templateUrl: string, options?: IonicModalOptions): angular.IPromise; } interface IonicModalController { initialize(options: IonicModalOptions): void; - show(): ng.IPromise; - hide(): ng.IPromise; - remove(): ng.IPromise; + show(): angular.IPromise; + hide(): angular.IPromise; + remove(): angular.IPromise; isShown(): boolean; } @@ -186,7 +185,7 @@ declare module ionic { hardwareBackButtonClose?: boolean; } } - module navigation { + namespace navigation { interface IonicNavBarDelegate { align(direction?: string): void; showBackButton(show?: boolean): boolean; @@ -210,7 +209,7 @@ declare module ionic { goBack(backCount?: number): void; clearHistory(): void; - clearCache(): ng.IPromise; + clearCache(): angular.IPromise; nextViewOptions(options: IonicHistoryNextViewOptions): void; } interface IonicHistoryNextViewOptions { @@ -219,26 +218,26 @@ declare module ionic { historyRoot?: boolean; } } - module platform { + namespace platform { interface IonicPlatformService { onHardwareBackButton(callback: Function): void; offHardwareBackButton(callback: Function): void; registerBackButtonAction(callback: Function, priority: number, actionId?: any): Function; on(type: string, callback: Function): Function; - ready(callback?: Function): ng.IPromise; + ready(callback?: Function): angular.IPromise; } } - module popover { + namespace popover { interface IonicPopoverService { fromTemplate(templateString: string, options: IonicPopoverOptions): IonicPopoverController; - fromTemplateUrl(templateUrl: string, options: IonicPopoverOptions): ng.IPromise; + fromTemplateUrl(templateUrl: string, options: IonicPopoverOptions): angular.IPromise; } interface IonicPopoverController { initialize(options: IonicPopoverOptions): void; - show($event?: any): ng.IPromise; - hide(): ng.IPromise; + show($event?: any): angular.IPromise; + hide(): angular.IPromise; isShown(): boolean; - remove(): ng.IPromise; + remove(): angular.IPromise; } interface IonicPopoverOptions { scope?: any; @@ -247,7 +246,7 @@ declare module ionic { hardwareBackButtonClose?: boolean; } } - module popup { + namespace popup { interface IonicPopupService { show(options: IonicPopupFullOptions): IonicPopupPromise; alert(options: IonicPopupAlertOptions): IonicPopupPromise; @@ -255,10 +254,10 @@ declare module ionic { prompt(options: IonicPopupPromptOptions): IonicPopupPromise; } - interface IonicPopupConfirmPromise extends ng.IPromise { + interface IonicPopupConfirmPromise extends angular.IPromise { close(value?: boolean): void; } - interface IonicPopupPromise extends ng.IPromise { + interface IonicPopupPromise extends angular.IPromise { close(value?: any): any; } interface IonicPopupBaseOptions { @@ -296,7 +295,7 @@ declare module ionic { okType?: string; } } - module scroll { + namespace scroll { interface IonicScrollDelegate { resize(): void; scrollTop(shouldAnimate?: boolean): void; @@ -313,7 +312,7 @@ declare module ionic { $getByHandle(handle: string): IonicScrollDelegate; } } - module sideMenu { + namespace sideMenu { interface IonicSideMenuDelegate { toggleLeft(isOpen?: boolean): void; toggleRight(isOpen?: boolean): void; @@ -326,7 +325,7 @@ declare module ionic { $getByHandle(handle: string): IonicSideMenuDelegate; } } - module slideBox { + namespace slideBox { interface IonicSlideBoxDelegate { update(): void; slide(to: number, speed?: number): void; @@ -340,7 +339,7 @@ declare module ionic { $getByHandle(handle: string): IonicSlideBoxDelegate; } } - module tabs { + namespace tabs { interface IonicTabsDelegate { select(index: number): void; selectedIndex(): number; @@ -348,12 +347,13 @@ declare module ionic { showBar(show?: boolean): boolean; } } - module utility { + namespace utility { interface IonicConfigProvider { views: { transition(transition?: string): string; maxCache(maxNumber?: number): number; forwardCache(value?: boolean): boolean; + swipeBackEnabled(value?: boolean): boolean; }; scrolling: { jsScrolling(value?: boolean): boolean; @@ -388,4 +388,4 @@ declare module ionic { offset(element: any): {top: number; left: number; width: number; height: number}; } } -} +} \ No newline at end of file diff --git a/lib/typings/globals/ionic/typings.json b/lib/typings/globals/ionic/typings.json new file mode 100644 index 0000000..a449786 --- /dev/null +++ b/lib/typings/globals/ionic/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/28cd028ab871a770027b35e0e14bd8c7005eca21/ionic/ionic.d.ts", + "raw": "registry:dt/ionic#0.0.0+20160501155303", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/28cd028ab871a770027b35e0e14bd8c7005eca21/ionic/ionic.d.ts" + } +} diff --git a/lib/typings/jquery/jquery.d.ts b/lib/typings/globals/jquery/index.d.ts similarity index 97% rename from lib/typings/jquery/jquery.d.ts rename to lib/typings/globals/jquery/index.d.ts index b8b036c..b4208b3 100644 --- a/lib/typings/jquery/jquery.d.ts +++ b/lib/typings/globals/jquery/index.d.ts @@ -1,27 +1,5 @@ -// Type definitions for jQuery 1.10.x / 2.0.x -// Project: http://jquery.com/ -// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - - -/** - * Interface for the AJAX setting that will configure the AJAX request - */ +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4cdfbe96b666eec5e1defbb519a62abf04e96764/jquery/jquery.d.ts interface JQueryAjaxSettings { /** * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. @@ -48,7 +26,7 @@ interface JQueryAjaxSettings { */ contents?: { [key: string]: any; }; //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" - // https://github.com/borisyankov/DefinitelyTyped/issues/742 + // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/742 /** * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. */ @@ -74,7 +52,7 @@ interface JQueryAjaxSettings { */ dataFilter? (data: any, ty: any): any; /** - * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). + * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). */ dataType?: string; /** @@ -168,11 +146,11 @@ interface JQueryAjaxSettings { */ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { /** - * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). + * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). */ overrideMimeType(mimeType: string): any; /** - * Cancel the request. + * Cancel the request. * * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" */ @@ -180,7 +158,7 @@ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { /** * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. */ - then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; + then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; /** * Property containing the parsed response if the response Content-Type is json */ @@ -197,13 +175,13 @@ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { interface JQueryCallback { /** * Add a callback or a collection of callbacks to a callback list. - * + * * @param callbacks A function, or array of functions, that are to be added to the callback list. */ add(callbacks: Function): JQueryCallback; /** * Add a callback or a collection of callbacks to a callback list. - * + * * @param callbacks A function, or array of functions, that are to be added to the callback list. */ add(callbacks: Function[]): JQueryCallback; @@ -225,7 +203,7 @@ interface JQueryCallback { /** * Call all of the callbacks with the given arguments - * + * * @param arguments The argument or list of arguments to pass back to the callback list. */ fire(...arguments: any[]): JQueryCallback; @@ -237,7 +215,7 @@ interface JQueryCallback { /** * Call all callbacks in a list with the given context and arguments. - * + * * @param context A reference to the context in which the callbacks in the list should be fired. * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. */ @@ -245,7 +223,7 @@ interface JQueryCallback { /** * Determine whether a supplied callback is in a list - * + * * @param callback The callback to search for. */ has(callback: Function): boolean; @@ -262,13 +240,13 @@ interface JQueryCallback { /** * Remove a callback or a collection of callbacks from a callback list. - * + * * @param callbacks A function, or array of functions, that are to be removed from the callback list. */ remove(callbacks: Function): JQueryCallback; /** * Remove a callback or a collection of callbacks from a callback list. - * + * * @param callbacks A function, or array of functions, that are to be removed from the callback list. */ remove(callbacks: Function[]): JQueryCallback; @@ -280,7 +258,7 @@ interface JQueryCallback { interface JQueryGenericPromise { /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * + * * @param doneFilter A function that is called when the Deferred is resolved. * @param failFilter An optional function that is called when the Deferred is rejected. */ @@ -288,7 +266,7 @@ interface JQueryGenericPromise { /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * + * * @param doneFilter A function that is called when the Deferred is resolved. * @param failFilter An optional function that is called when the Deferred is rejected. */ @@ -316,28 +294,28 @@ interface JQueryPromise extends JQueryGenericPromise { state(): string; /** * Add handlers to be called when the Deferred object is either resolved or rejected. - * + * * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved. - * + * * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; /** * Add handlers to be called when the Deferred object is rejected. - * + * * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; /** * Add handlers to be called when the Deferred object generates progress notifications. - * + * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; @@ -356,42 +334,42 @@ interface JQueryDeferred extends JQueryGenericPromise { state(): string; /** * Add handlers to be called when the Deferred object is either resolved or rejected. - * + * * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; /** * Add handlers to be called when the Deferred object is resolved. - * + * * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; /** * Add handlers to be called when the Deferred object is rejected. - * + * * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; /** * Add handlers to be called when the Deferred object generates progress notifications. - * + * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; /** * Call the progressCallbacks on a Deferred object with the given args. - * + * * @param args Optional arguments that are passed to the progressCallbacks. */ notify(value?: any, ...args: any[]): JQueryDeferred; /** * Call the progressCallbacks on a Deferred object with the given context and args. - * + * * @param context Context passed to the progressCallbacks as the this object. * @param args Optional arguments that are passed to the progressCallbacks. */ @@ -399,13 +377,13 @@ interface JQueryDeferred extends JQueryGenericPromise { /** * Reject a Deferred object and call any failCallbacks with the given args. - * + * * @param args Optional arguments that are passed to the failCallbacks. */ reject(value?: any, ...args: any[]): JQueryDeferred; /** * Reject a Deferred object and call any failCallbacks with the given context and args. - * + * * @param context Context passed to the failCallbacks as the this object. * @param args An optional array of arguments that are passed to the failCallbacks. */ @@ -413,7 +391,7 @@ interface JQueryDeferred extends JQueryGenericPromise { /** * Resolve a Deferred object and call any doneCallbacks with the given args. - * + * * @param value First argument passed to doneCallbacks. * @param args Optional subsequent arguments that are passed to the doneCallbacks. */ @@ -421,7 +399,7 @@ interface JQueryDeferred extends JQueryGenericPromise { /** * Resolve a Deferred object and call any doneCallbacks with the given context and args. - * + * * @param context Context passed to the doneCallbacks as the this object. * @param args An optional array of arguments that are passed to the doneCallbacks. */ @@ -429,7 +407,7 @@ interface JQueryDeferred extends JQueryGenericPromise { /** * Return a Deferred's Promise object. - * + * * @param target Object onto which the promise methods have to be attached */ promise(target?: any): JQueryPromise; @@ -519,14 +497,14 @@ interface JQuerySupport { interface JQueryParam { /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * + * * @param obj An array or object to serialize. */ (obj: any): string; /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * + * * @param obj An array or object to serialize. * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. */ @@ -560,53 +538,63 @@ interface JQuerySerializeArrayElement { value: string; } -interface JQueryAnimationOptions { +interface JQueryAnimationOptions { /** * A string or number determining how long the animation will run. */ - duration?: any; + duration?: any; /** * A string indicating which easing function to use for the transition. */ - easing?: string; + easing?: string; /** * A function to call once the animation is complete. */ - complete?: Function; + complete?: Function; /** * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. */ - step?: (now: number, tween: any) => any; + step?: (now: number, tween: any) => any; /** * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) */ - progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; + progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; /** * A function to call when the animation begins. (version added: 1.8) */ - start?: (animation: JQueryPromise) => any; + start?: (animation: JQueryPromise) => any; /** * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) */ - done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; /** * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) */ - fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; /** * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) */ - always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; /** * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. */ - queue?: any; + queue?: any; /** * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) */ specialEasing?: Object; } +interface JQueryEasingFunction { + ( percent: number ): number; +} + +interface JQueryEasingFunctions { + [ name: string ]: JQueryEasingFunction; + linear: JQueryEasingFunction; + swing: JQueryEasingFunction; +} + /** * Static members of jQuery (those on $ and jQuery themselves) */ @@ -666,6 +654,12 @@ interface JQueryStatic { * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param settings The JQueryAjaxSettings to be used for the request + */ + get(settings : JQueryAjaxSettings): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * @@ -711,7 +705,12 @@ interface JQueryStatic { * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - + /** + * Load data from the server using a HTTP POST request. + * + * @param settings The JQueryAjaxSettings to be used for the request + */ + post(settings : JQueryAjaxSettings): JQueryXHR; /** * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. * @@ -795,7 +794,7 @@ interface JQueryStatic { * * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). */ - noConflict(removeAll?: boolean): Object; + noConflict(removeAll?: boolean): JQueryStatic; /** * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. @@ -889,6 +888,9 @@ interface JQueryStatic { /** * Effects */ + + easing: JQueryEasingFunctions; + fx: { tick: () => void; /** @@ -940,7 +942,7 @@ interface JQueryStatic { /** * Check to see if a DOM element is a descendant of another DOM element. - * + * * @param container The DOM element that may contain the other element. * @param contained The DOM element that may be contained by (a descendant of) the other element. */ @@ -948,7 +950,7 @@ interface JQueryStatic { /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * + * * @param collection The object or array to iterate over. * @param callback The function that will be executed on every object. */ @@ -959,7 +961,7 @@ interface JQueryStatic { /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * + * * @param collection The object or array to iterate over. * @param callback The function that will be executed on every object. */ @@ -1056,21 +1058,21 @@ interface JQueryStatic { /** * Convert an array-like object into a true JavaScript array. - * + * * @param obj Any object to turn into a native Array. */ makeArray(obj: any): any[]; /** * Translate all items in an array or object to new array of items. - * + * * @param array The Array to translate. * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. */ map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; /** * Translate all items in an array or object to new array of items. - * + * * @param arrayOrObject The Array or Object to translate. * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. */ @@ -1078,7 +1080,7 @@ interface JQueryStatic { /** * Merge the contents of two arrays together into the first array. - * + * * @param first The first array to merge, the elements of second added. * @param second The second array to merge into the first, unaltered. */ @@ -1096,7 +1098,7 @@ interface JQueryStatic { /** * Takes a well-formed JSON string and returns the resulting JavaScript object. - * + * * @param json The JSON string to parse. */ parseJSON(json: string): any; @@ -1110,21 +1112,21 @@ interface JQueryStatic { /** * Remove the whitespace from the beginning and end of a string. - * + * * @param str Remove the whitespace from the beginning and end of a string. */ trim(str: string): string; /** * Determine the internal JavaScript [[Class]] of an object. - * + * * @param obj Object to get the internal JavaScript [[Class]] of. */ type(obj: any): string; /** * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. - * + * * @param array The Array of DOM elements. */ unique(array: Element[]): Element[]; @@ -1251,7 +1253,7 @@ interface JQuery { * @param attributes An object of attribute-value pairs to set. */ attr(attributes: Object): JQuery; - + /** * Determine whether any of the matched elements are assigned the given class. * @@ -1429,7 +1431,7 @@ interface JQuery { * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ innerHeight(height: number|string): JQuery; - + /** * Get the current computed width for the first element in the set of matched elements, including padding but not border. */ @@ -1441,7 +1443,7 @@ interface JQuery { * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ innerWidth(width: number|string): JQuery; - + /** * Get the current coordinates of the first element in the set of matched elements, relative to the document. */ @@ -1874,7 +1876,7 @@ interface JQuery { /** * Attach a handler to an event for the elements. - * + * * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. @@ -1882,14 +1884,14 @@ interface JQuery { bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. - * + * * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param handler A function to execute each time the event is triggered. */ bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. - * + * * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param eventData An object containing data that will be passed to the event handler. * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. @@ -1897,14 +1899,14 @@ interface JQuery { bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; /** * Attach a handler to an event for the elements. - * + * * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. */ bind(eventType: string, preventBubble: boolean): JQuery; /** * Attach a handler to an event for the elements. - * + * * @param events An object containing one or more DOM event types and functions to execute for them. */ bind(events: any): JQuery; @@ -2258,6 +2260,13 @@ interface JQuery { * @param handler A handler function previously attached for the event(s), or the special value false. */ off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on(). + */ + off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Remove an event handler. * @@ -2454,14 +2463,14 @@ interface JQuery { /** * Execute all handlers and behaviors attached to the matched elements for the given event type. - * + * * @param eventType A string containing a JavaScript event type, such as click or submit. * @param extraParameters Additional parameters to pass along to the event handler. */ trigger(eventType: string, extraParameters?: any[]|Object): JQuery; /** * Execute all handlers and behaviors attached to the matched elements for the given event type. - * + * * @param event A jQuery.Event object. * @param extraParameters Additional parameters to pass along to the event handler. */ @@ -2469,7 +2478,7 @@ interface JQuery { /** * Execute all handlers attached to an element for an event. - * + * * @param eventType A string containing a JavaScript event type, such as click or submit. * @param extraParameters An array of additional parameters to pass along to the event handler. */ @@ -2477,7 +2486,7 @@ interface JQuery { /** * Execute all handlers attached to an element for an event. - * + * * @param event A jQuery.Event object. * @param extraParameters An array of additional parameters to pass along to the event handler. */ @@ -2485,21 +2494,21 @@ interface JQuery { /** * Remove a previously-attached event handler from the elements. - * + * * @param eventType A string containing a JavaScript event type, such as click or submit. * @param handler The function that is to be no longer executed. */ unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove a previously-attached event handler from the elements. - * + * * @param eventType A string containing a JavaScript event type, such as click or submit. * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). */ unbind(eventType: string, fls: boolean): JQuery; /** * Remove a previously-attached event handler from the elements. - * + * * @param evt A JavaScript event object as passed to an event handler. */ unbind(evt: any): JQuery; @@ -2510,7 +2519,7 @@ interface JQuery { undelegate(): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * + * * @param selector A selector which will be used to filter the event results. * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" * @param handler A function to execute at the time the event is triggered. @@ -2518,27 +2527,27 @@ interface JQuery { undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * + * * @param selector A selector which will be used to filter the event results. * @param events An object of one or more event types and previously bound functions to unbind from them. */ undelegate(selector: string, events: Object): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * + * * @param namespace A string containing a namespace to unbind all events from. */ undelegate(namespace: string): JQuery; /** * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) - * + * * @param handler A function to execute when the event is triggered. */ unload(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) - * + * * @param eventData A plain object of data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ @@ -2553,13 +2562,13 @@ interface JQuery { /** * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) - * + * * @param handler A function to execute when the event is triggered. */ error(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) - * + * * @param eventData A plain object of data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ @@ -2567,13 +2576,13 @@ interface JQuery { /** * Add a collection of DOM elements onto the jQuery stack. - * + * * @param elements An array of elements to push onto the stack and make into a new jQuery object. */ pushStack(elements: any[]): JQuery; /** * Add a collection of DOM elements onto the jQuery stack. - * + * * @param elements An array of elements to push onto the stack and make into a new jQuery object. * @param name The name of a jQuery method that generated the array of elements. * @param arguments The arguments that were passed in to the jQuery method (for serialization). @@ -2582,56 +2591,56 @@ interface JQuery { /** * Insert content, specified by the parameter, after each element in the set of matched elements. - * + * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. */ after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. - * + * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ after(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * + * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. */ append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * + * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ append(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Insert every element in the set of matched elements to the end of the target. - * + * * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. */ appendTo(target: JQuery|any[]|Element|string): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. - * + * * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. */ before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. - * + * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ before(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Create a deep copy of the set of matched elements. - * + * * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). */ @@ -2639,7 +2648,7 @@ interface JQuery { /** * Remove the set of matched elements from the DOM. - * + * * param selector A selector expression that filters the set of matched elements to be removed. */ detach(selector?: string): JQuery; @@ -2651,62 +2660,62 @@ interface JQuery { /** * Insert every element in the set of matched elements after the target. - * + * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. */ insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; /** * Insert every element in the set of matched elements before the target. - * + * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. */ insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * + * * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. */ prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * + * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Insert every element in the set of matched elements to the beginning of the target. - * + * * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. */ prependTo(target: JQuery|any[]|Element|string): JQuery; /** * Remove the set of matched elements from the DOM. - * + * * @param selector A selector expression that filters the set of matched elements to be removed. */ remove(selector?: string): JQuery; /** * Replace each target element with the set of matched elements. - * + * * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. */ replaceAll(target: JQuery|any[]|Element|string): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. - * + * * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. */ replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. - * + * * param func A function that returns content with which to replace the set of matched elements. */ replaceWith(func: () => Element|JQuery): JQuery; @@ -2717,13 +2726,13 @@ interface JQuery { text(): string; /** * Set the content of each element in the set of matched elements to the specified text. - * + * * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. */ text(text: string|number|boolean): JQuery; /** * Set the content of each element in the set of matched elements to the specified text. - * + * * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. */ text(func: (index: number, text: string) => string): JQuery; @@ -2740,20 +2749,20 @@ interface JQuery { /** * Wrap an HTML structure around each element in the set of matched elements. - * + * * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrap(wrappingElement: JQuery|Element|string): JQuery; /** * Wrap an HTML structure around each element in the set of matched elements. - * + * * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ wrap(func: (index: number) => string|JQuery): JQuery; /** * Wrap an HTML structure around all elements in the set of matched elements. - * + * * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrapAll(wrappingElement: JQuery|Element|string): JQuery; @@ -2761,27 +2770,27 @@ interface JQuery { /** * Wrap an HTML structure around the content of each element in the set of matched elements. - * + * * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. */ wrapInner(wrappingElement: JQuery|Element|string): JQuery; /** * Wrap an HTML structure around the content of each element in the set of matched elements. - * + * * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ wrapInner(func: (index: number) => string): JQuery; /** * Iterate over a jQuery object, executing a function for each matched element. - * + * * @param func A function to execute for each matched element. */ each(func: (index: number, elem: Element) => any): JQuery; /** * Retrieve one of the elements matched by the jQuery object. - * + * * @param index A zero-based integer indicating which element to retrieve. */ get(index: number): HTMLElement; @@ -2796,7 +2805,7 @@ interface JQuery { index(): number; /** * Search for a given element from among the matched elements. - * + * * @param selector A selector representing a jQuery collection in which to look for an element. */ index(selector: string|JQuery|Element): number; @@ -2815,66 +2824,66 @@ interface JQuery { /** * Add elements to the set of matched elements. - * + * * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. */ add(selector: string, context?: Element): JQuery; /** * Add elements to the set of matched elements. - * + * * @param elements One or more elements to add to the set of matched elements. */ add(...elements: Element[]): JQuery; /** * Add elements to the set of matched elements. - * + * * @param html An HTML fragment to add to the set of matched elements. */ add(html: string): JQuery; /** * Add elements to the set of matched elements. - * + * * @param obj An existing jQuery object to add to the set of matched elements. */ add(obj: JQuery): JQuery; /** * Get the children of each element in the set of matched elements, optionally filtered by a selector. - * + * * @param selector A string containing a selector expression to match elements against. */ children(selector?: string): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * + * * @param selector A string containing a selector expression to match elements against. */ closest(selector: string): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * + * * @param selector A string containing a selector expression to match elements against. * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. */ closest(selector: string, context?: Element): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * + * * @param obj A jQuery object to match elements against. */ closest(obj: JQuery): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * + * * @param element An element to match elements against. */ closest(element: Element): JQuery; /** * Get an array of all the elements and selectors matched against the current element up through the DOM tree. - * + * * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. */ @@ -2892,52 +2901,52 @@ interface JQuery { /** * Reduce the set of matched elements to the one at the specified index. - * + * * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. - * + * */ eq(index: number): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. - * + * * @param selector A string containing a selector expression to match the current set of elements against. */ filter(selector: string): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. - * + * * @param func A function used as a test for each element in the set. this is the current DOM element. */ filter(func: (index: number, element: Element) => any): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. - * + * * @param element An element to match the current set of elements against. */ filter(element: Element): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. - * + * * @param obj An existing jQuery object to match the current set of elements against. */ filter(obj: JQuery): JQuery; /** * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * + * * @param selector A string containing a selector expression to match elements against. */ find(selector: string): JQuery; /** * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * + * * @param element An element to match elements against. */ find(element: Element): JQuery; /** * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * + * * @param obj A jQuery object to match elements against. */ find(obj: JQuery): JQuery; @@ -2949,38 +2958,38 @@ interface JQuery { /** * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * + * * @param selector A string containing a selector expression to match elements against. */ has(selector: string): JQuery; /** * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * + * * @param contained A DOM element to match elements against. */ has(contained: Element): JQuery; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * + * * @param selector A string containing a selector expression to match elements against. */ is(selector: string): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * + * * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. */ is(func: (index: number, element: Element) => boolean): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * + * * @param obj An existing jQuery object to match the current set of elements against. */ is(obj: JQuery): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * + * * @param elements One or more elements to match the current set of elements against. */ is(elements: any): boolean; @@ -2992,42 +3001,42 @@ interface JQuery { /** * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. - * + * * @param callback A function object that will be invoked for each element in the current set. */ map(callback: (index: number, domElement: Element) => any): JQuery; /** * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. - * + * * @param selector A string containing a selector expression to match elements against. */ next(selector?: string): JQuery; /** * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. - * + * * @param selector A string containing a selector expression to match elements against. */ nextAll(selector?: string): JQuery; /** * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * + * * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. * @param filter A string containing a selector expression to match elements against. */ nextUntil(selector?: string, filter?: string): JQuery; /** * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * + * * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. * @param filter A string containing a selector expression to match elements against. */ nextUntil(element?: Element, filter?: string): JQuery; /** * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * + * * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. * @param filter A string containing a selector expression to match elements against. */ @@ -3035,25 +3044,25 @@ interface JQuery { /** * Remove elements from the set of matched elements. - * + * * @param selector A string containing a selector expression to match elements against. */ not(selector: string): JQuery; /** * Remove elements from the set of matched elements. - * + * * @param func A function used as a test for each element in the set. this is the current DOM element. */ not(func: (index: number, element: Element) => boolean): JQuery; /** * Remove elements from the set of matched elements. - * + * * @param elements One or more DOM elements to remove from the matched set. */ not(elements: Element|Element[]): JQuery; /** * Remove elements from the set of matched elements. - * + * * @param obj An existing jQuery object to match the current set of elements against. */ not(obj: JQuery): JQuery; @@ -3065,35 +3074,35 @@ interface JQuery { /** * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. - * + * * @param selector A string containing a selector expression to match elements against. */ parent(selector?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. - * + * * @param selector A string containing a selector expression to match elements against. */ parents(selector?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * + * * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. * @param filter A string containing a selector expression to match elements against. */ parentsUntil(selector?: string, filter?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * + * * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. * @param filter A string containing a selector expression to match elements against. */ parentsUntil(element?: Element, filter?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * + * * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. * @param filter A string containing a selector expression to match elements against. */ @@ -3101,35 +3110,35 @@ interface JQuery { /** * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. - * + * * @param selector A string containing a selector expression to match elements against. */ prev(selector?: string): JQuery; /** * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. - * + * * @param selector A string containing a selector expression to match elements against. */ prevAll(selector?: string): JQuery; /** * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * + * * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. * @param filter A string containing a selector expression to match elements against. */ prevUntil(selector?: string, filter?: string): JQuery; /** * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * + * * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. * @param filter A string containing a selector expression to match elements against. */ prevUntil(element?: Element, filter?: string): JQuery; /** * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * + * * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. * @param filter A string containing a selector expression to match elements against. */ @@ -3137,14 +3146,14 @@ interface JQuery { /** * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. - * + * * @param selector A string containing a selector expression to match elements against. */ siblings(selector?: string): JQuery; /** * Reduce the set of matched elements to a subset specified by a range of indices. - * + * * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. */ @@ -3152,32 +3161,32 @@ interface JQuery { /** * Show the queue of functions to be executed on the matched elements. - * + * * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. */ queue(queueName?: string): any[]; /** * Manipulate the queue of functions to be executed, once for each matched element. - * + * * @param newQueue An array of functions to replace the current queue contents. */ queue(newQueue: Function[]): JQuery; /** * Manipulate the queue of functions to be executed, once for each matched element. - * + * * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. */ queue(callback: Function): JQuery; /** * Manipulate the queue of functions to be executed, once for each matched element. - * + * * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param newQueue An array of functions to replace the current queue contents. */ queue(queueName: string, newQueue: Function[]): JQuery; /** * Manipulate the queue of functions to be executed, once for each matched element. - * + * * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. */ @@ -3187,4 +3196,4 @@ declare module "jquery" { export = $; } declare var jQuery: JQueryStatic; -declare var $: JQueryStatic; +declare var $: JQueryStatic; \ No newline at end of file diff --git a/lib/typings/globals/jquery/typings.json b/lib/typings/globals/jquery/typings.json new file mode 100644 index 0000000..0af7c54 --- /dev/null +++ b/lib/typings/globals/jquery/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4cdfbe96b666eec5e1defbb519a62abf04e96764/jquery/jquery.d.ts", + "raw": "registry:dt/jquery#1.10.0+20160417213236", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4cdfbe96b666eec5e1defbb519a62abf04e96764/jquery/jquery.d.ts" + } +} diff --git a/lib/typings/globals/ng-cordova/camera/index.d.ts b/lib/typings/globals/ng-cordova/camera/index.d.ts new file mode 100644 index 0000000..be90dea --- /dev/null +++ b/lib/typings/globals/ng-cordova/camera/index.d.ts @@ -0,0 +1,8 @@ +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/14fe4313f4a1cf69add3505a2ab1dbc690dc2116/ng-cordova/camera.d.ts +declare namespace ngCordova { + export interface ICameraService { + getPicture(options?: CameraOptions): ng.IPromise; + cleanup(): ng.IPromise; + } +} \ No newline at end of file diff --git a/lib/typings/globals/ng-cordova/camera/typings.json b/lib/typings/globals/ng-cordova/camera/typings.json new file mode 100644 index 0000000..067a20b --- /dev/null +++ b/lib/typings/globals/ng-cordova/camera/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/14fe4313f4a1cf69add3505a2ab1dbc690dc2116/ng-cordova/camera.d.ts", + "raw": "registry:dt/ng-cordova/camera#0.0.0+20160316171810", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/14fe4313f4a1cf69add3505a2ab1dbc690dc2116/ng-cordova/camera.d.ts" + } +} diff --git a/lib/typings/globals/ng-cordova/network/index.d.ts b/lib/typings/globals/ng-cordova/network/index.d.ts new file mode 100644 index 0000000..61f2261 --- /dev/null +++ b/lib/typings/globals/ng-cordova/network/index.d.ts @@ -0,0 +1,14 @@ +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/14fe4313f4a1cf69add3505a2ab1dbc690dc2116/ng-cordova/network.d.ts +declare namespace ngCordova { + + export interface INetworkInformationService { + + getNetwork(): string; + isOnline(): boolean; + isOffline(): boolean; + clearOfflineWatch(): void; + clearOnlineWatch(): void; + } + +} \ No newline at end of file diff --git a/lib/typings/globals/ng-cordova/network/typings.json b/lib/typings/globals/ng-cordova/network/typings.json new file mode 100644 index 0000000..48e30f6 --- /dev/null +++ b/lib/typings/globals/ng-cordova/network/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/14fe4313f4a1cf69add3505a2ab1dbc690dc2116/ng-cordova/network.d.ts", + "raw": "registry:dt/ng-cordova/network#0.0.0+20160316171810", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/14fe4313f4a1cf69add3505a2ab1dbc690dc2116/ng-cordova/network.d.ts" + } +} diff --git a/lib/typings/globals/ng-cordova/tsd/index.d.ts b/lib/typings/globals/ng-cordova/tsd/index.d.ts new file mode 100644 index 0000000..5731608 --- /dev/null +++ b/lib/typings/globals/ng-cordova/tsd/index.d.ts @@ -0,0 +1,2 @@ +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/64ed3fcbf0a47510b51d167f5323ed2ea6b25caf/ng-cordova/tsd.d.ts diff --git a/lib/typings/globals/ng-cordova/tsd/typings.json b/lib/typings/globals/ng-cordova/tsd/typings.json new file mode 100644 index 0000000..d56eb0e --- /dev/null +++ b/lib/typings/globals/ng-cordova/tsd/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/64ed3fcbf0a47510b51d167f5323ed2ea6b25caf/ng-cordova/tsd.d.ts", + "raw": "registry:dt/ng-cordova/tsd#0.0.0+20151202000610", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/64ed3fcbf0a47510b51d167f5323ed2ea6b25caf/ng-cordova/tsd.d.ts" + } +} diff --git a/lib/typings/globals/require/index.d.ts b/lib/typings/globals/require/index.d.ts new file mode 100644 index 0000000..428438d --- /dev/null +++ b/lib/typings/globals/require/index.d.ts @@ -0,0 +1,368 @@ +// Generated by typings +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/requirejs/require.d.ts +declare module 'module' { + var mod: { + config: () => any; + id: string; + uri: string; + } + export = mod; +} + +interface RequireError extends Error { + + /** + * The error ID that maps to an ID on a web page. + **/ + requireType: string; + + /** + * Required modules. + **/ + requireModules: string[]; + + /** + * The original error, if there is one (might be null). + **/ + originalError: Error; +} + +interface RequireShim { + + /** + * List of dependencies. + **/ + deps?: string[]; + + /** + * Name the module will be exported as. + **/ + exports?: string; + + /** + * Initialize function with all dependcies passed in, + * if the function returns a value then that value is used + * as the module export value instead of the object + * found via the 'exports' string. + * @param dependencies + * @return + **/ + init?: (...dependencies: any[]) => any; +} + +interface RequireConfig { + + // The root path to use for all module lookups. + baseUrl?: string; + + // Path mappings for module names not found directly under + // baseUrl. + paths?: { [key: string]: any; }; + + + // Dictionary of Shim's. + // does not cover case of key->string[] + shim?: { [key: string]: RequireShim; }; + + /** + * For the given module prefix, instead of loading the + * module with the given ID, substitude a different + * module ID. + * + * @example + * requirejs.config({ + * map: { + * 'some/newmodule': { + * 'foo': 'foo1.2' + * }, + * 'some/oldmodule': { + * 'foo': 'foo1.0' + * } + * } + * }); + **/ + map?: { + [id: string]: { + [id: string]: string; + }; + }; + + /** + * Allows pointing multiple module IDs to a module ID that contains a bundle of modules. + * + * @example + * requirejs.config({ + * bundles: { + * 'primary': ['main', 'util', 'text', 'text!template.html'], + * 'secondary': ['text!secondary.html'] + * } + * }); + **/ + bundles?: { [key: string]: string[]; }; + + /** + * AMD configurations, use module.config() to access in + * define() functions + **/ + config?: { [id: string]: {}; }; + + /** + * Configures loading modules from CommonJS packages. + **/ + packages?: {}; + + /** + * The number of seconds to wait before giving up on loading + * a script. The default is 7 seconds. + **/ + waitSeconds?: number; + + /** + * A name to give to a loading context. This allows require.js + * to load multiple versions of modules in a page, as long as + * each top-level require call specifies a unique context string. + **/ + context?: string; + + /** + * An array of dependencies to load. + **/ + deps?: string[]; + + /** + * A function to pass to require that should be require after + * deps have been loaded. + * @param modules + **/ + callback?: (...modules: any[]) => void; + + /** + * If set to true, an error will be thrown if a script loads + * that does not call define() or have shim exports string + * value that can be checked. + **/ + enforceDefine?: boolean; + + /** + * If set to true, document.createElementNS() will be used + * to create script elements. + **/ + xhtml?: boolean; + + /** + * Extra query string arguments appended to URLs that RequireJS + * uses to fetch resources. Most useful to cache bust when + * the browser or server is not configured correctly. + * + * @example + * urlArgs: "bust= + (new Date()).getTime() + **/ + urlArgs?: string; + + /** + * Specify the value for the type="" attribute used for script + * tags inserted into the document by RequireJS. Default is + * "text/javascript". To use Firefox's JavasScript 1.8 + * features, use "text/javascript;version=1.8". + **/ + scriptType?: string; + + /** + * If set to true, skips the data-main attribute scanning done + * to start module loading. Useful if RequireJS is embedded in + * a utility library that may interact with other RequireJS + * library on the page, and the embedded version should not do + * data-main loading. + **/ + skipDataMain?: boolean; + + /** + * Allow extending requirejs to support Subresource Integrity + * (SRI). + **/ + onNodeCreated?: (node: HTMLScriptElement, config: RequireConfig, moduleName: string, url: string) => void; +} + +// todo: not sure what to do with this guy +interface RequireModule { + + /** + * + **/ + config(): {}; + +} + +/** +* +**/ +interface RequireMap { + + /** + * + **/ + prefix: string; + + /** + * + **/ + name: string; + + /** + * + **/ + parentMap: RequireMap; + + /** + * + **/ + url: string; + + /** + * + **/ + originalName: string; + + /** + * + **/ + fullName: string; +} + +interface Require { + + /** + * Configure require.js + **/ + config(config: RequireConfig): Require; + + /** + * CommonJS require call + * @param module Module to load + * @return The loaded module + */ + (module: string): any; + + /** + * Start the main app logic. + * Callback is optional. + * Can alternatively use deps and callback. + * @param modules Required modules to load. + **/ + (modules: string[]): void; + + /** + * @see Require() + * @param ready Called when required modules are ready. + **/ + (modules: string[], ready: Function): void; + + /** + * @see http://requirejs.org/docs/api.html#errbacks + * @param ready Called when required modules are ready. + **/ + (modules: string[], ready: Function, errback: Function): void; + + /** + * Generate URLs from require module + * @param module Module to URL + * @return URL string + **/ + toUrl(module: string): string; + + /** + * Returns true if the module has already been loaded and defined. + * @param module Module to check + **/ + defined(module: string): boolean; + + /** + * Returns true if the module has already been requested or is in the process of loading and should be available at some point. + * @param module Module to check + **/ + specified(module: string): boolean; + + /** + * On Error override + * @param err + **/ + onError(err: RequireError, errback?: (err: RequireError) => void): void; + + /** + * Undefine a module + * @param module Module to undefine. + **/ + undef(module: string): void; + + /** + * Semi-private function, overload in special instance of undef() + **/ + onResourceLoad(context: Object, map: RequireMap, depArray: RequireMap[]): void; +} + +interface RequireDefine { + + /** + * Define Simple Name/Value Pairs + * @param config Dictionary of Named/Value pairs for the config. + **/ + (config: { [key: string]: any; }): void; + + /** + * Define function. + * @param func: The function module. + **/ + (func: () => any): void; + + /** + * Define function with dependencies. + * @param deps List of dependencies module IDs. + * @param ready Callback function when the dependencies are loaded. + * callback param deps module dependencies + * callback return module definition + **/ + (deps: string[], ready: Function): void; + + /** + * Define module with simplified CommonJS wrapper. + * @param ready + * callback require requirejs instance + * callback exports exports object + * callback module module + * callback return module definition + **/ + (ready: (require: Require, exports: { [key: string]: any; }, module: RequireModule) => any): void; + + /** + * Define a module with a name and dependencies. + * @param name The name of the module. + * @param deps List of dependencies module IDs. + * @param ready Callback function when the dependencies are loaded. + * callback deps module dependencies + * callback return module definition + **/ + (name: string, deps: string[], ready: Function): void; + + /** + * Define a module with a name. + * @param name The name of the module. + * @param ready Callback function when the dependencies are loaded. + * callback return module definition + **/ + (name: string, ready: Function): void; + + /** + * Used to allow a clear indicator that a global define function (as needed for script src browser loading) conforms + * to the AMD API, any global define function SHOULD have a property called "amd" whose value is an object. + * This helps avoid conflict with any other existing JavaScript code that could have defined a define() function + * that does not conform to the AMD API. + * define.amd.jQuery is specific to jQuery and indicates that the loader is able to account for multiple version + * of jQuery being loaded simultaneously. + */ + amd: Object; +} + +// Ambient declarations for 'require' and 'define' +declare var requirejs: Require; +declare var require: Require; +declare var define: RequireDefine; \ No newline at end of file diff --git a/lib/typings/globals/require/typings.json b/lib/typings/globals/require/typings.json new file mode 100644 index 0000000..446025f --- /dev/null +++ b/lib/typings/globals/require/typings.json @@ -0,0 +1,8 @@ +{ + "resolution": "main", + "tree": { + "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/requirejs/require.d.ts", + "raw": "registry:dt/require#2.1.20+20160316155526", + "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/requirejs/require.d.ts" + } +} diff --git a/lib/typings/index.d.ts b/lib/typings/index.d.ts new file mode 100644 index 0000000..bf36d92 --- /dev/null +++ b/lib/typings/index.d.ts @@ -0,0 +1,15 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/lib/typings/ng-cordova/camera.d.ts b/lib/typings/ng-cordova/camera.d.ts deleted file mode 100644 index e9a6cd2..0000000 --- a/lib/typings/ng-cordova/camera.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Type definitions for ngCordova.plugins.camera -// Project: https://github.com/driftyco/ng-cordova -// Definitions by: Jacques Kang -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -declare module ngCordova { - export interface ICameraService { - getPicture(options?: CameraOptions): ng.IPromise; - cleanup(): ng.IPromise; - } -} diff --git a/lib/typings/ng-cordova/network.d.ts b/lib/typings/ng-cordova/network.d.ts deleted file mode 100644 index 2188714..0000000 --- a/lib/typings/ng-cordova/network.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for ngCordova network plugin -// Project: https://github.com/driftyco/ng-cordova -// Definitions by: Kapil Sachdeva -// Definitions: https://github.com/ksachdeva/DefinitelyTyped - -/// - -declare module ngCordova { - - export interface INetworkInformationService { - - getNetwork(): string; - isOnline(): boolean; - isOffline(): boolean; - clearOfflineWatch(): void; - clearOnlineWatch(): void; - } - -} diff --git a/lib/typings/ng-cordova/tsd.d.ts b/lib/typings/ng-cordova/tsd.d.ts deleted file mode 100644 index fef6c43..0000000 --- a/lib/typings/ng-cordova/tsd.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for ngCordova plugins -// Project: https://github.com/driftyco/ng-cordova -// Definitions by: Kapil Sachdeva -// Definitions: https://github.com/ksachdeva/DefinitelyTyped - -// / -// / -/// -// / -// / -// / -// / -// / -// / -// / -// / -/// -// / -// / -// / -// / diff --git a/lib/typings/require.d.ts b/lib/typings/require.d.ts index 1d4bf34..a93ae79 100644 --- a/lib/typings/require.d.ts +++ b/lib/typings/require.d.ts @@ -1,7 +1,7 @@ -declare var require: { - (path: string): T; - (paths: string[], callback: (...modules: any[]) => void): void; - ensure: (paths: string[], callback: (require: (path: string) => T) => void) => void; -}; +// declare var require: { +// (path: string): T; +// (paths: string[], callback: (...modules: any[]) => void): void; +// ensure: (paths: string[], callback: (require: (path: string) => T) => void) => void; +// }; declare var module: any; diff --git a/lib/typings/tsd.d.ts b/lib/typings/tsd.d.ts deleted file mode 100644 index 3dc23a3..0000000 --- a/lib/typings/tsd.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -/// -/// -/// -/// -/// diff --git a/tsconfig.json b/tsconfig.json index 0da71c4..ba3c275 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,6 @@ "sourceMap": true }, "files": [ - "lib/typings/tsd.d.ts" + "lib/typings/index.d.ts" ] }