├── src
├── .gitignore
├── export.ts
├── shared
│ ├── RouteControllerBase.ts
│ └── MeteorMethod.ts
└── client
│ └── MeteorTemplate.ts
├── .versions
├── package.js
├── LICENSE
├── README.md
├── typings
├── meteor-typescript-utils
│ └── meteor-typescript-utils.d.ts
├── meteor
│ ├── ironrouter.d.ts
│ └── meteor.d.ts
└── jquery
│ └── jquery.d.ts
└── dist
└── meteor-typescript-utils.js
/src/.gitignore:
--------------------------------------------------------------------------------
1 | *.js
2 |
--------------------------------------------------------------------------------
/.versions:
--------------------------------------------------------------------------------
1 | dataflows:typescript-utils@0.1.5
2 | meteor@1.1.6
3 | underscore@1.0.3
4 |
--------------------------------------------------------------------------------
/src/export.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
5 | declare var meteorts: any;
6 | meteorts = meteortypescript;
7 |
--------------------------------------------------------------------------------
/package.js:
--------------------------------------------------------------------------------
1 | Package.describe({
2 | name: 'dataflows:typescript-utils',
3 | summary: 'Typescript utils for core Meteor functionalities',
4 | version: '0.1.5',
5 | git: 'https://github.com/dataflows/meteor-meteor-typescript-utils.git'
6 | });
7 |
8 | Package.onUse(function (api) {
9 | api.export('meteorts', ['server', 'client']);
10 |
11 | api.addFiles('dist/meteor-typescript-utils.js', ['server', 'client']);
12 |
13 | });
14 |
--------------------------------------------------------------------------------
/src/shared/RouteControllerBase.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | module meteortypescript {
4 | export class RouteControllerBase {
5 | protected ready: () => boolean; // Injected by iron:router
6 | protected redirect: (route: string) => boolean; // Injected by iron:router
7 | protected render: (name: string) => void; // Injected by iron:router
8 | protected params: RouteParams; // Injected by iron:router
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 dataflows
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/src/shared/MeteorMethod.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | module meteortypescript {
4 |
5 | export interface IMeteorCallback {
6 | (error: Meteor.Error, result: Returns): void
7 | }
8 |
9 | export class MeteorMethod {
10 | constructor(public name: string) {}
11 | // TOOD(marek): Consider migrating this to promises.
12 | call(args: Args, callback?: IMeteorCallback): void {
13 | Meteor.call(this.name, args, callback);
14 | }
15 | }
16 |
17 | export module MeteorMethod {
18 |
19 | export interface Impl {
20 | apply(args: Args): Returns;
21 | }
22 |
23 | // This provides typing for stuff injected by Meteor.
24 | export class BaseMixin {
25 | unblock(): void {}
26 | }
27 |
28 | export function register(method: MeteorMethod, impl: Impl) {
29 | let updater: any = {};
30 | updater[method.name] = function(args: Args): Returns {
31 | return impl.apply.call(this, args);
32 | };
33 | Meteor.methods(updater);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Warning: this project is not maintained or actively developed.
2 |
3 | # Meteor Typescript utils
4 | This package provides Typescript wrappers for core Meteor functionalities. This lets develop Meteor projects with the full type safety of Typescript.
5 |
6 | Check out sample Meteor project: https://github.com/dataflows/meteor-typescript-utils-example
7 |
8 | ## What's included
9 | 1. Typescript typings for Meteor, Iron:Router, Lodash and this package (meteorts).
10 | 2. Typed wrappers for Meteor methods
11 | 3. Typed wrappers for Meteor Templates
12 | 4. Typed wrappers for Iron:Router routes
13 |
14 | ## Install
15 | 1. Add Meteor package: `meteor add dataflows:typescript-utils`.
16 | 2. Copy typings from `typings` directory into your project so that you can reference them.
17 |
18 | ## Guide
19 |
20 | ### Methods
21 | ```
22 |
23 | # Define method:
24 | interface ISaveClickArgs {
25 | name: string;
26 | }
27 | var SaveClick = new MeteorMethod("SaveClick");
28 |
29 | # Call method:
30 | SaveClick.call({ name: name });
31 | ```
32 |
33 | ### Templates
34 | ```
35 | class MainTemplateContext extends MainTemplateData {
36 | @MeteorTemplate.event("click #heybutton")
37 | buttonClick(event: Meteor.Event, template: Blaze.Template): void {
38 | // ...
39 | }
40 |
41 | @MeteorTemplate.helper
42 | clicksCount(): number {
43 | // ...
44 | }
45 | }
46 |
47 | class MainTemplate extends MeteorTemplate.Base {
48 | constructor() {
49 | super("MainTemplate", new MainTemplateContext());
50 | }
51 |
52 | rendered(): void {
53 | // ...
54 | }
55 | }
56 |
57 | MeteorTemplate.register(new MainTemplate());
58 | ```
59 |
60 | ### RouteControllers
61 | ```
62 | export class SingleClickController extends RouteControllerBase {
63 | public template: string = ...;
64 |
65 | public waitOn(): any {
66 | // ...
67 | }
68 |
69 | public data(): any {
70 | // ... this.params holds typed route params
71 | }
72 | }
73 | ```
74 |
75 | ## For developers
76 | Compilation:
77 | ```
78 | tsc src/**/*.ts --out dist/meteor-typescript-utils.js --module commonjs
79 | ```
80 |
81 | ## License
82 | This project is provided on the MIT license.
83 |
--------------------------------------------------------------------------------
/typings/meteor-typescript-utils/meteor-typescript-utils.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for Meteor Typescript Utils Version 0.1
2 | // Project: https://github.com/dataflows/meteor-typescript-utils
3 | // Definitions by: Marek Rogala
4 | // Definitions: https://github.com/dataflows/meteor-typescript-utils
5 |
6 | ///
7 | ///
8 | ///
9 | ///
10 |
11 | declare module meteorts {
12 |
13 | module MeteorTemplate {
14 |
15 | interface IEventHandler {
16 | (event: Meteor.Event, template: IBlaze): void;
17 | }
18 |
19 | function event(eventMatcher: string): (target: Function, key: string, value: any) => any;
20 |
21 | function helper(target: Function, key: string, value: any): any;
22 |
23 | class Base {
24 | name: string;
25 | context: T;
26 | constructor(name: string, context: T);
27 | protected data: T;
28 | protected $: JQueryStatic;
29 | }
30 |
31 | interface IEventsMap {
32 | [event: string]: IEventHandler;
33 | }
34 |
35 | interface IMeteorTemplate {
36 | name: string;
37 | context: T;
38 | rendered?: () => void;
39 | }
40 |
41 | interface IBlaze extends Blaze.Template {
42 | data: T;
43 | }
44 |
45 | function register(template: IMeteorTemplate): void;
46 | }
47 | }
48 |
49 | declare module meteorts {
50 |
51 | interface IMeteorCallback {
52 | (error: Meteor.Error, result: Returns): void;
53 | }
54 |
55 | class MeteorMethod {
56 | name: string;
57 | constructor(name: string);
58 | call(args: Args, callback?: IMeteorCallback): void;
59 | }
60 |
61 | module MeteorMethod {
62 | interface Impl {
63 | apply(args: Args): Returns;
64 | }
65 | class BaseMixin {
66 | unblock(): void;
67 | }
68 | function register(method: MeteorMethod, impl: Impl): void;
69 | }
70 |
71 | }
72 |
73 | declare module meteorts {
74 |
75 | class RouteControllerBase {
76 | protected ready: () => boolean;
77 | protected redirect: (route: string) => boolean;
78 | protected render: (name: string) => void;
79 | protected params: RouteParams;
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/src/client/MeteorTemplate.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
5 | module meteortypescript {
6 |
7 | export module MeteorTemplate {
8 |
9 | interface IMeteorContextMember extends Function {
10 | __meteorEventMatcher__?: string;
11 | __isMeteorHelper__?: boolean;
12 | }
13 |
14 | export interface IEventHandler {
15 | (event: Meteor.Event, template: IBlaze): void
16 | }
17 |
18 | export function event(eventMatcher: string) {
19 | return function(target: Function, key: string, value: any): any {
20 | var decoratedFun: IMeteorContextMember = value.value;
21 | decoratedFun.__meteorEventMatcher__ = eventMatcher;
22 | return { value: decoratedFun };
23 | };
24 | }
25 |
26 | export function helper(target: Function, key: string, value: any): any {
27 | var decoratedFun: IMeteorContextMember = value.value;
28 | decoratedFun.__isMeteorHelper__ = true;
29 | return { value: decoratedFun };
30 | }
31 |
32 | export class Base {
33 | constructor(
34 | public name: string,
35 | public context: T) {}
36 |
37 | // This properties are injected by Meteor.
38 | protected data: T;
39 | protected $: JQueryStatic;
40 | }
41 |
42 |
43 | export interface IEventsMap {
44 | [event: string]: IEventHandler
45 | }
46 |
47 | export interface IMeteorTemplate {
48 | name: string;
49 | context: T;
50 | rendered?: () => void;
51 | }
52 |
53 | export interface IBlaze extends Blaze.Template {
54 | data: T;
55 | }
56 |
57 | export function register(template: IMeteorTemplate) {
58 | var templateContextObj = template.context;
59 | var contextFunctionNames = _.functions(template.context);
60 | var contextFunctions = _.map(contextFunctionNames, (funName: string) => templateContextObj[funName]);
61 | var contextFunctionsWithNames = _.map(contextFunctionNames, (funName: string) => [funName, templateContextObj[funName]]);
62 |
63 | var contextEventFunctions = _.filter(contextFunctions,
64 | (fun: IMeteorContextMember): boolean => !!fun.__meteorEventMatcher__);
65 | var events: IEventsMap = _.indexBy(contextEventFunctions,
66 | (fun: IMeteorContextMember): string => fun.__meteorEventMatcher__);
67 |
68 | var contextHelperFunctions = _.filter(contextFunctionsWithNames,
69 | (fun: [string, IMeteorContextMember]): boolean => fun[1].__isMeteorHelper__);
70 | var helpersWithNames = _.indexBy(contextHelperFunctions, (fun: [string, IMeteorContextMember]): string => fun[0]);
71 | var helpers = _.object(
72 | _.map(helpersWithNames,
73 | (fun: [string, [string, IMeteorContextMember]]): [string, IMeteorContextMember] => [fun[0], fun[1][1]]));
74 |
75 | Template[template.name].events(events);
76 | Template[template.name].helpers(helpers);
77 | if (template.rendered) {
78 | Template[template.name].rendered = template.rendered;
79 | }
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/typings/meteor/ironrouter.d.ts:
--------------------------------------------------------------------------------
1 | // Definitions for the iron-router smart package
2 | //
3 | // https://atmosphere.meteor.com/package/iron-router
4 | // https://github.com/EventedMind/iron-router
5 |
6 | declare module Router {
7 |
8 | interface TemplateConfig {
9 | to?: string;
10 | waitOn?: boolean;
11 | data?: boolean;
12 | }
13 |
14 | interface TemplateConfigDico {[id:string]:TemplateConfig}
15 |
16 | interface GlobalConfig {
17 | load?: Function;
18 | autoRender?: boolean;
19 | layoutTemplate?: string;
20 | notFoundTemplate?: string;
21 | loadingTemplate?: string;
22 | waitOn?: any;
23 | }
24 |
25 | interface MapConfig {
26 | path?:string;
27 | // by default template is the route name, this field is the override
28 | template?:string;
29 | layoutTemplate?: string;
30 | yieldTemplates?: TemplateConfigDico;
31 | // can be a Function or an object literal {}
32 | data?: any;
33 | // waitOn can be a subscription handle, an array of subscription handles or a function that returns a subscription handle
34 | // or array of subscription handles. A subscription handle is what gets returned when you call Meteor.subscribe
35 | waitOn?: any;
36 | loadingTemplate?:string;
37 | notFoundTemplate?: string;
38 | controller?: RouteController;
39 | action?: Function;
40 |
41 | // The before and after hooks can be Functions or an array of Functions
42 | before?: any;
43 | after?: any;
44 | load?: Function;
45 | unload?: Function;
46 | reactive?: boolean;
47 | }
48 |
49 | interface HookOptions {
50 | except?: string[];
51 | }
52 |
53 | interface HookOptionsDico {[id:string]:HookOptions}
54 |
55 | // Deprecated: for old "Router" smart package
56 | export function page():void;
57 | export function add(route:Object):void;
58 | export function to(path:string, ...args:any[]):void;
59 | export function filters(filtersMap:Object): any;
60 | export function filter(filterName:string, options?:Object): any;
61 |
62 | // These are for Iron-Router
63 | export function configure(config:GlobalConfig): any;
64 | export function plugin(name: string, ...params: any[]): void;
65 | export function map(func:Function):void;
66 | export function route(name:string, handler?: any, routeParams?:MapConfig): void;
67 | export function path(route:string, params?:Object):string;
68 | export function url(route:string):string;
69 | export function go(route:string, params?:Object):void;
70 | export function before(func: Function, options?: HookOptionsDico): void;
71 | export function after(func: Function, options?: HookOptionsDico): void;
72 | export function load(func: Function, options?: HookOptionsDico): void;
73 | export function unload(func: Function, options?: HookOptionsDico): void;
74 | export function render(template?: string, options?: TemplateConfigDico): void;
75 | export function wait(): void;
76 | export function stop(): void;
77 | export function redirect(route:string): void;
78 | export function current(): any;
79 | export function insert(options: any): any;
80 | export function start(): void;
81 |
82 | export function onRun(hook?: string, func?: Function, params?: any): void;
83 | export function onBeforeAction(hook?: string, func?: Function, params?: any): void;
84 | export function onBeforeAction(hook?: string, params?: any): void;
85 | export function onAfterAction(hook?: string, func?: Function, params?: any): void;
86 | export function onStop(hook?: string, func?: Function, params?: any): void;
87 | export function onData(hook?: string, func?: Function, params?: any): void;
88 | export function waitOn(hook?: string, func?: Function, params?: any): void;
89 |
90 | export var routes: Object;
91 | export var params: any;
92 |
93 | }
94 |
95 | interface RouteController {
96 | render(route:string): void;
97 | extend(routeParams: Router.MapConfig): RouteController;
98 | }
99 |
100 |
101 | declare var RouteController: RouteController;
102 |
103 |
--------------------------------------------------------------------------------
/dist/meteor-typescript-utils.js:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 | var meteortypescript;
5 | (function (meteortypescript) {
6 | var MeteorTemplate;
7 | (function (MeteorTemplate) {
8 | function event(eventMatcher) {
9 | return function (target, key, value) {
10 | var decoratedFun = value.value;
11 | decoratedFun.__meteorEventMatcher__ = eventMatcher;
12 | return { value: decoratedFun };
13 | };
14 | }
15 | MeteorTemplate.event = event;
16 | function helper(target, key, value) {
17 | var decoratedFun = value.value;
18 | decoratedFun.__isMeteorHelper__ = true;
19 | return { value: decoratedFun };
20 | }
21 | MeteorTemplate.helper = helper;
22 | var Base = (function () {
23 | function Base(name, context) {
24 | this.name = name;
25 | this.context = context;
26 | }
27 | return Base;
28 | })();
29 | MeteorTemplate.Base = Base;
30 | function register(template) {
31 | var templateContextObj = template.context;
32 | var contextFunctionNames = _.functions(template.context);
33 | var contextFunctions = _.map(contextFunctionNames, function (funName) { return templateContextObj[funName]; });
34 | var contextFunctionsWithNames = _.map(contextFunctionNames, function (funName) { return [funName, templateContextObj[funName]]; });
35 | var contextEventFunctions = _.filter(contextFunctions, function (fun) { return !!fun.__meteorEventMatcher__; });
36 | var events = _.indexBy(contextEventFunctions, function (fun) { return fun.__meteorEventMatcher__; });
37 | var contextHelperFunctions = _.filter(contextFunctionsWithNames, function (fun) { return fun[1].__isMeteorHelper__; });
38 | var helpersWithNames = _.indexBy(contextHelperFunctions, function (fun) { return fun[0]; });
39 | var helpers = _.object(_.map(helpersWithNames, function (fun) { return [fun[0], fun[1][1]]; }));
40 | Template[template.name].events(events);
41 | Template[template.name].helpers(helpers);
42 | if (template.rendered) {
43 | Template[template.name].rendered = template.rendered;
44 | }
45 | }
46 | MeteorTemplate.register = register;
47 | })(MeteorTemplate = meteortypescript.MeteorTemplate || (meteortypescript.MeteorTemplate = {}));
48 | })(meteortypescript || (meteortypescript = {}));
49 | ///
50 | var meteortypescript;
51 | (function (meteortypescript) {
52 | var MeteorMethod = (function () {
53 | function MeteorMethod(name) {
54 | this.name = name;
55 | }
56 | // TOOD(marek): Consider migrating this to promises.
57 | MeteorMethod.prototype.call = function (args, callback) {
58 | Meteor.call(this.name, args, callback);
59 | };
60 | return MeteorMethod;
61 | })();
62 | meteortypescript.MeteorMethod = MeteorMethod;
63 | var MeteorMethod;
64 | (function (MeteorMethod) {
65 | // This provides typing for stuff injected by Meteor.
66 | var BaseMixin = (function () {
67 | function BaseMixin() {
68 | }
69 | BaseMixin.prototype.unblock = function () { };
70 | return BaseMixin;
71 | })();
72 | MeteorMethod.BaseMixin = BaseMixin;
73 | function register(method, impl) {
74 | var updater = {};
75 | updater[method.name] = function (args) {
76 | return impl.apply.call(this, args);
77 | };
78 | Meteor.methods(updater);
79 | }
80 | MeteorMethod.register = register;
81 | })(MeteorMethod = meteortypescript.MeteorMethod || (meteortypescript.MeteorMethod = {}));
82 | })(meteortypescript || (meteortypescript = {}));
83 | ///
84 | var meteortypescript;
85 | (function (meteortypescript) {
86 | var RouteControllerBase = (function () {
87 | function RouteControllerBase() {
88 | }
89 | return RouteControllerBase;
90 | })();
91 | meteortypescript.RouteControllerBase = RouteControllerBase;
92 | })(meteortypescript || (meteortypescript = {}));
93 | ///
94 | ///
95 | ///
96 | meteorts = meteortypescript;
97 |
--------------------------------------------------------------------------------
/typings/meteor/meteor.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for Meteor 1.0.3.1
2 | // Project: http://www.meteor.com/
3 | // Definitions by: Dave Allen
4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped
5 |
6 | /**
7 | * These are the modules and interfaces that can't be automatically generated from the Meteor data.js file
8 | */
9 |
10 | interface EJSON extends JSON {}
11 | interface TemplateStatic {
12 | new(): Template;
13 | [templateName: string]: Meteor.TemplatePage;
14 | }
15 |
16 | declare module Match {
17 | var Any: any;
18 | var String: any;
19 | var Integer: any;
20 | var Boolean: any;
21 | var undefined: any;
22 | //function null(); // not allowed in TypeScript
23 | var Object: any;
24 | function Optional(pattern: any):boolean;
25 | function ObjectIncluding(dico: any):boolean;
26 | function OneOf(...patterns: any[]): any;
27 | function Where(condition: any): any;
28 | }
29 |
30 | declare module Deps {
31 | function flush(): void;
32 | }
33 |
34 | declare module Meteor {
35 | //interface EJSONObject extends Object {}
36 |
37 | /** Start definitions for Template **/
38 | // DA: "Template" needs to support these functions:
39 | // Template..rendered
40 | // Template..created
41 | // Template..destroyed
42 | // Template..helpers
43 | // Template..events
44 | // and
45 | // Template.currentData
46 | // Template.parentData, etc.
47 |
48 | interface Event {
49 | type:string;
50 | target:HTMLElement;
51 | currentTarget:HTMLElement;
52 | which: number;
53 | stopPropagation():void;
54 | stopImmediatePropagation():void;
55 | preventDefault():void;
56 | isPropagationStopped():boolean;
57 | isImmediatePropagationStopped():boolean;
58 | isDefaultPrevented():boolean;
59 | }
60 |
61 | interface EventHandlerFunction extends Function {
62 | (event?:Meteor.Event, template?: Blaze.Template):any;
63 | }
64 |
65 | interface EventMap {
66 | [id:string]:Meteor.EventHandlerFunction;
67 | }
68 |
69 | interface TemplatePage {
70 | rendered: Function;
71 | created: Function;
72 | destroyed: Function;
73 | events(eventMap:Meteor.EventMap): void;
74 | helpers(helpers: any): void;
75 | }
76 | /** End definitions for Template **/
77 |
78 | interface LoginWithExternalServiceOptions {
79 | requestPermissions?: string[];
80 | requestOfflineToken?: Boolean;
81 | forceApprovalPrompt?: Boolean;
82 | userEmail?: string;
83 | loginStyle?: string;
84 | }
85 |
86 | function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
87 | function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
88 | function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
89 | function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
90 | function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
91 | function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
92 | function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
93 |
94 | interface UserEmail {
95 | address:string;
96 | verified:boolean;
97 | }
98 |
99 | interface User {
100 | _id?:string;
101 | username?:string;
102 | emails?:Meteor.UserEmail[];
103 | createdAt?: number;
104 | profile?: any;
105 | services?: any;
106 | }
107 |
108 | interface SubscriptionHandle {
109 | stop(): void;
110 | ready(): boolean;
111 | }
112 |
113 | interface Tinytest {
114 | add(name:string, func:Function): any;
115 | addAsync(name:string, func:Function): any;
116 | }
117 |
118 | enum StatusEnum {
119 | connected,
120 | connecting,
121 | failed,
122 | waiting,
123 | offline
124 | }
125 |
126 | interface LiveQueryHandle {
127 | stop(): void;
128 | }
129 |
130 | interface EmailFields {
131 | subject?: Function;
132 | text?: Function;
133 | }
134 |
135 | interface EmailTemplates {
136 | from: string;
137 | siteName: string;
138 | resetPassword: Meteor.EmailFields;
139 | enrollAccount: Meteor.EmailFields;
140 | verifyEmail: Meteor.EmailFields;
141 | }
142 |
143 | interface Error {
144 | error: number;
145 | reason?: string;
146 | details?: string;
147 | }
148 |
149 | interface Connection {
150 | id: string;
151 | close: Function;
152 | onClose: Function;
153 | clientAddress: string;
154 | httpHeaders: Object;
155 | }
156 | }
157 |
158 | declare module Mongo {
159 | interface Selector extends Object {}
160 | interface Modifier {}
161 | interface SortSpecifier {}
162 | interface FieldSpecifier {
163 | [id: string]: Number;
164 | }
165 | enum IdGenerationEnum {
166 | STRING,
167 | MONGO
168 | }
169 | interface AllowDenyOptions {
170 | insert?: (userId: string, doc: any) => boolean;
171 | update?: (userId: string, doc: any, fieldNames: any, modifier: any) => boolean;
172 | remove?: (userId: string, doc: any) => boolean;
173 | fetch?: string[];
174 | transform?: Function;
175 | }
176 | }
177 |
178 | declare module HTTP {
179 | interface HTTPRequest {
180 | content?:string;
181 | data?:any;
182 | query?:string;
183 | params?:{[id:string]:string};
184 | auth?:string;
185 | headers?:{[id:string]:string};
186 | timeout?:number;
187 | followRedirects?:boolean;
188 | }
189 |
190 | interface HTTPResponse {
191 | statusCode:number;
192 | content:string;
193 | // response is not always json
194 | data:any;
195 | headers:{[id:string]:string};
196 | }
197 | }
198 |
199 | declare module Email {
200 | interface EmailMessage {
201 | from: string;
202 | to: any; // string or string[]
203 | cc?: any; // string or string[]
204 | bcc?: any; // string or string[]
205 | replyTo?: any; // string or string[]
206 | subject: string;
207 | text?: string;
208 | html?: string;
209 | headers?: {[id: string]: string};
210 | }
211 | }
212 |
213 | declare module DDP {
214 | interface DDPStatic {
215 | subscribe(name: any, ...rest: any[]): any;
216 | call(method:string, ...parameters: any[]):void;
217 | apply(method:string, ...parameters: any[]):void;
218 | methods(IMeteorMethodsDictionary: any): any;
219 | status():DDPStatus;
220 | reconnect(): any;
221 | disconnect(): any;
222 | onReconnect(): any;
223 | }
224 |
225 | interface DDPStatus {
226 | connected: boolean;
227 | status: Meteor.StatusEnum;
228 | retryCount: number;
229 | //To turn this into an interval until the next reconnection, use retryTime - (new Date()).getTime()
230 | retryTime?: number;
231 | reason?: string;
232 | }
233 | }
234 |
235 | declare module Random {
236 | function id(numberOfChars?: number): string;
237 | function secret(numberOfChars?: number): string;
238 | function fraction():number;
239 | function hexString(numberOfDigits:number):string; // @param numberOfDigits, @returns a random hex string of the given length
240 | function choice(array:any[]):string; // @param array, @return a random element in array
241 | function choice(str:string):string; // @param str, @return a random char in str
242 | }
243 |
244 | declare module Blaze {
245 | interface View {
246 | name: string;
247 | parentView: Blaze.View;
248 | isCreated: boolean;
249 | isRendered: boolean;
250 | isDestroyed: boolean;
251 | renderCount: number;
252 | autorun(runFunc: Function): void;
253 | onViewCreated(func: Function): void;
254 | onViewReady(func: Function): void;
255 | onViewDestroyed(func: Function): void;
256 | firstNode(): Node;
257 | lastNode(): Node;
258 | template: Blaze.Template;
259 | templateInstance(): any;
260 | }
261 | interface Template {
262 | viewName: string;
263 | renderFunction: Function;
264 | constructView(): Blaze.View;
265 | $: Function;
266 | }
267 | }
268 |
269 | /**
270 | * These modules and interfaces are automatically generated from the Meteor api.js file
271 | */
272 | declare module Accounts {
273 | var ui: {
274 | config(options: {
275 | requestPermissions?: Object;
276 | requestOfflineToken?: Object;
277 | forceApprovalPrompt?: Object;
278 | passwordSignupFields?: string;
279 | }): void;
280 | };
281 | var emailTemplates: Meteor.EmailTemplates;
282 | function config(options: {
283 | sendVerificationEmail?: boolean;
284 | forbidClientAccountCreation?: Boolean;
285 | restrictCreationByEmailDomain?: string | Function;
286 | loginExpirationInDays?: number;
287 | oauthSecretKey?: string;
288 | }): void;
289 | function validateLoginAttempt(func: Function): {stop: Function};
290 | function onLogin(func: Function): {stop: Function};
291 | function onLoginFailure(func: Function): {stop: Function};
292 | function onCreateUser(func: Function): void;
293 | function validateNewUser(func: Function): void;
294 | function onResetPasswordLink(callback: Function): void;
295 | function onEmailVerificationLink(callback: Function): void;
296 | function onEnrollmentLink(callback: Function): void;
297 | function createUser(options: {
298 | username?: string;
299 | email?: string;
300 | password?: string;
301 | profile?: Object;
302 | }, callback?: Function): string;
303 | function changePassword(oldPassword: string, newPassword: string, callback?: Function): void;
304 | function forgotPassword(options: {
305 | email?: string;
306 | }, callback?: Function): void;
307 | function resetPassword(token: string, newPassword: string, callback?: Function): void;
308 | function verifyEmail(token: string, callback?: Function): void;
309 | function setPassword(userId: string, newPassword: string): void;
310 | function sendResetPasswordEmail(userId: string, email?: string): void;
311 | function sendEnrollmentEmail(userId: string, email?: string): void;
312 | function sendVerificationEmail(userId: string, email?: string): void;
313 | }
314 |
315 | declare module Blaze {
316 | var currentView: Blaze.View;
317 | function With(data: Object | Function, contentFunc: Function): Blaze.View;
318 | function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View;
319 | function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View;
320 | function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View;
321 | function isTemplate(value: any): boolean;
322 | function render(templateOrView: Template | Blaze.View, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View;
323 | function renderWithData(templateOrView: Template | Blaze.View, data: Object | Function, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View;
324 | function remove(renderedView: Blaze.View): void;
325 | function toHTML(templateOrView: Template | Blaze.View): string;
326 | function toHTMLWithData(templateOrView: Template | Blaze.View, data: Object | Function): string;
327 | function getData(elementOrView?: HTMLElement | Blaze.View): Object;
328 | function getView(element?: HTMLElement): Blaze.View;
329 | function Template(viewName?: string, renderFunction?: Function): void;
330 | interface Template{
331 | }
332 |
333 | function TemplateInstance(view: Blaze.View): void;
334 | interface TemplateInstance{
335 | data: Object;
336 | view: Object;
337 | firstNode: Object;
338 | lastNode: Object;
339 | $(selector: string): Node[];
340 | findAll(selector: string): HTMLElement[];
341 | find(selector?: string): HTMLElement;
342 | autorun(runFunc: Function): Object;
343 | }
344 |
345 | function View(name?: string, renderFunction?: Function): void;
346 | interface View{
347 | }
348 |
349 | }
350 |
351 | declare module Match {
352 | function test(value: any, pattern: any): boolean;
353 | }
354 |
355 | declare module DDP {
356 | function connect(url: string): DDP.DDPStatic;
357 | }
358 |
359 | declare module EJSON {
360 | var newBinary: any;
361 | function addType(name: string, factory: Function): void;
362 | function toJSONValue(val: EJSON): JSON;
363 | function fromJSONValue(val: JSON): any;
364 | function stringify(val: EJSON, options?: {
365 | indent?: boolean | number | string;
366 | canonical?: Boolean;
367 | }): string;
368 | function parse(str: string): EJSON;
369 | function isBinary(x: Object): boolean;
370 | function equals(a: EJSON, b: EJSON, options?: {
371 | keyOrderSensitive?: boolean;
372 | }): boolean;
373 | function clone(val:T): T;
374 | function CustomType(): void;
375 | interface CustomType{
376 | typeName(): string;
377 | toJSONValue(): JSON;
378 | clone(): EJSON.CustomType;
379 | equals(other: Object): boolean;
380 | }
381 |
382 | }
383 |
384 | declare module Meteor {
385 | var users: Mongo.Collection;
386 | var isClient: boolean;
387 | var isServer: boolean;
388 | var settings: {[id:string]: any};
389 | var isCordova: boolean;
390 | var release: string;
391 | function userId(): string;
392 | function loggingIn(): boolean;
393 | function user(): Meteor.User;
394 | function logout(callback?: Function): void;
395 | function logoutOtherClients(callback?: Function): void;
396 | function loginWith(options?: {
397 | requestPermissions?: string[];
398 | requestOfflineToken?: boolean;
399 | forceApprovalPrompt?: Boolean;
400 | userEmail?: string;
401 | loginStyle?: string;
402 | }, callback?: Function): void;
403 | function loginWithPassword(user: Object | string, password: string, callback?: Function): void;
404 | function subscribe(name: string, ...args: any[]): SubscriptionHandle;
405 | function call(name: string, ...args: any[]): void;
406 | function apply(name: string, args: EJSON[], options?: {
407 | wait?: boolean;
408 | onResultReceived?: Function;
409 | }, asyncCallback?: Function): void;
410 | function status(): Meteor.StatusEnum;
411 | function reconnect(): void;
412 | function disconnect(): void;
413 | function onConnection(callback: Function): void;
414 | function publish(name: string, func: Function): void;
415 | function publishComposite(name: string, spec: {}): void;
416 | function methods(methods: Object): void;
417 | function wrapAsync(func: Function, context?: Object): any;
418 | function startup(func: Function): void;
419 | function setTimeout(func: Function, delay: number): number;
420 | function setInterval(func: Function, delay: number): number;
421 | function clearInterval(id: number): void;
422 | function clearTimeout(id: number): void;
423 | function absoluteUrl(path?: string, options?: {
424 | secure?: boolean;
425 | replaceLocalhost?: Boolean;
426 | rootUrl?: string;
427 | }): string;
428 | function Error(error: string, reason?: string, details?: string): void;
429 | interface Error{
430 | }
431 |
432 | }
433 |
434 | declare module Mongo {
435 | var Collection: CollectionStatic;
436 | interface CollectionStatic {
437 | new(name: string, options?: {
438 | connection?: Object;
439 | idGeneration?: string;
440 | transform?: Function;
441 | }): Collection;
442 | }
443 | interface Collection{
444 | insert(doc: Object, callback?: Function): string;
445 | update(selector: Mongo.Selector, modifier: Mongo.Modifier, options?: {
446 | multi?: boolean;
447 | upsert?: Boolean;
448 | }, callback?: Function): number;
449 | find(selector?: Mongo.Selector, options?: {
450 | sort?: Mongo.SortSpecifier;
451 | skip?: number;
452 | limit?: number;
453 | fields?: Mongo.FieldSpecifier;
454 | reactive?: boolean;
455 | transform?: Function;
456 | }): Mongo.Cursor;
457 | findOne(selector?: Mongo.Selector, options?: {
458 | sort?: Mongo.SortSpecifier;
459 | skip?: number;
460 | fields?: Mongo.FieldSpecifier;
461 | reactive?: boolean;
462 | transform?: Function;
463 | }): T;
464 | remove(selector: Mongo.Selector, callback: Function): void;
465 | remove(selector: Mongo.Selector): number;
466 | upsert(selector: Mongo.Selector, modifier: Mongo.Modifier, options?: {
467 | multi?: boolean;
468 | }, callback?: Function): {numberAffected?: number; insertedId?: string;};
469 | allow(options: {
470 | insert?: (userId:string, doc: any) => boolean;
471 | update?: (userId: string, doc: any, fieldNames: any, modifier: any) => boolean;
472 | remove?: (userId: string, doc: any) => boolean;
473 | fetch?: string[];
474 | transform?: Function;
475 | }): boolean;
476 | deny(options: {
477 | insert?: (userId:string, doc: any) => boolean;
478 | update?: (userId: string, doc: any, fieldNames: any, modifier: any) => boolean;
479 | remove?: (userId: string, doc: any) => boolean;
480 | fetch?: string[];
481 | transform?: Function;
482 | }): boolean;
483 | }
484 |
485 | function ObjectID(hexString: string): void;
486 | interface ObjectID{
487 | }
488 |
489 | function Cursor(): void;
490 | interface Cursor{
491 | forEach(callback: Function, thisArg?: any): void;
492 | map(callback: Function, thisArg?: any): void;
493 | fetch(): Array;
494 | count(): number;
495 | observe(callbacks: Object): Meteor.LiveQueryHandle;
496 | observeChanges(callbacks: Object): Meteor.LiveQueryHandle;
497 | }
498 |
499 | }
500 |
501 | declare module Tracker {
502 | var active: boolean;
503 | var currentComputation: Tracker.Computation;
504 | function Computation(): void;
505 | interface Computation{
506 | stopped: boolean;
507 | invalidated: boolean;
508 | firstRun: boolean;
509 | onInvalidate(callback: Function): void;
510 | invalidate(): void;
511 | stop(): void;
512 | }
513 |
514 | function flush(): void;
515 | function autorun(runFunc: Function): Tracker.Computation;
516 | function nonreactive(func: Function): void;
517 | function onInvalidate(callback: Function): void;
518 | function afterFlush(callback: Function): void;
519 | function Dependency(): void;
520 | interface Dependency{
521 | depend(fromComputation?: Tracker.Computation): boolean
522 | changed(): void;
523 | hasDependents(): boolean
524 | }
525 |
526 | }
527 |
528 | declare module Assets {
529 | function getText(assetPath: string, asyncCallback?: Function): string;
530 | function getBinary(assetPath: string, asyncCallback?: Function): EJSON;
531 | }
532 |
533 | declare module App {
534 | function info(options: {
535 | id?: string;
536 | version?: string;
537 | name?: string;
538 | description?: string;
539 | author?: string;
540 | email?: string;
541 | website?: string;
542 | }): void;
543 | function setPreference(name: string, value: string): void;
544 | function configurePlugin(pluginName: string, config: Object): void;
545 | function icons(icons: Object): void;
546 | function launchScreens(launchScreens: Object): void;
547 | }
548 |
549 | declare module Package {
550 | function describe(options: {
551 | summary?: string;
552 | version?: string;
553 | name?: string;
554 | git?: string;
555 | documentation?: string;
556 | }): void;
557 | function onUse(func: Function): void;
558 | function onTest(func: Function): void;
559 | function registerBuildPlugin(options?: {
560 | name?: string;
561 | use?: string | string[];
562 | sources?: string[];
563 | npmDependencies?: Object;
564 | }): void;
565 | }
566 |
567 | declare module Npm {
568 | function depends(dependencies:{[id:string]:string}): void;
569 | function require(name: string): void;
570 | }
571 |
572 | declare module Cordova {
573 | function depends(dependencies:{[id:string]:string}): void;
574 | }
575 |
576 | declare module Session {
577 | function set(key: string, value: EJSON | any /** Undefined **/): void;
578 | function setDefault(key: string, value: EJSON | any /** Undefined **/): void;
579 | function get(key: string): T;
580 | function equals(key: string, value: string | number | boolean | any /** Null **/ | any /** Undefined **/): boolean;
581 | }
582 |
583 | declare module HTTP {
584 | function call(method: string, url: string, options?: {
585 | content?: string;
586 | data?: Object;
587 | query?: string;
588 | params?: Object;
589 | auth?: string;
590 | headers?: Object;
591 | timeout?: number;
592 | followRedirects?: boolean;
593 | }, asyncCallback?: Function): HTTP.HTTPResponse;
594 | function get(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse;
595 | function post(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse;
596 | function put(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse;
597 | function del(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse;
598 | }
599 |
600 | declare module Email {
601 | function send(options: {
602 | from?: string;
603 | to?: string | string[];
604 | cc?: string | string[];
605 | bcc?: string | string[];
606 | replyTo?: string | string[];
607 | subject?: string;
608 | text?: string;
609 | html?: string;
610 | headers?: Object;
611 | }): void;
612 | }
613 |
614 | declare function Subscription(): void;
615 | interface Subscription{
616 | connection: Meteor.Connection;
617 | userId: string;
618 | error(error: Error): void;
619 | stop(): void;
620 | onStop(func: Function): void;
621 | added(collection: string, id: string, fields: Object): void;
622 | changed(collection: string, id: string, fields: Object): void;
623 | removed(collection: string, id: string): void;
624 | ready(): void;
625 | }
626 |
627 | declare function ReactiveVar(initialValue: T, equalsFunc?: Function): void;
628 | interface ReactiveVar{
629 | get(): T;
630 | set(newValue: T): void;
631 | }
632 |
633 | declare var Template: TemplateStatic;
634 | // TemplateStatic interface should be defined separately at top with static methods
635 | interface Template{
636 | onCreated: Function;
637 | onRendered: Function;
638 | onDestroyed: Function;
639 | created: Function;
640 | rendered: Function;
641 | destroyed: Function;
642 | body: TemplateStatic;
643 | helpers(helpers:{[id:string]: any}): void;
644 | events(eventMap: {[actions: string]: Function}): void;
645 | instance(): Blaze.TemplateInstance;
646 | currentData(): {};
647 | parentData(numLevels?: number): {};
648 | registerHelper(name: string, helperFunction: Function): void;
649 | }
650 |
651 | declare function CompileStep(): void;
652 | interface CompileStep{
653 | inputSize: any; /** TODO: add return value **/
654 | inputPath: any; /** TODO: add return value **/
655 | fullInputPath: any; /** TODO: add return value **/
656 | pathForSourceMap: any; /** TODO: add return value **/
657 | packageName: any; /** TODO: add return value **/
658 | rootOutputPath: any; /** TODO: add return value **/
659 | arch: any; /** TODO: add return value **/
660 | fileOptions: any; /** TODO: add return value **/
661 | declaredExports: any; /** TODO: add return value **/
662 | read(n?: number): any; /** TODO: add return value **/
663 | addHtml(options: {
664 | section?: string;
665 | data?: string;
666 | }): any; /** TODO: add return value **/
667 | addStylesheet(options: {
668 | }, path: string, data: string, sourceMap: string): any; /** TODO: add return value **/
669 | addJavaScript(options: {
670 | path?: string;
671 | data?: string;
672 | sourcePath?: string;
673 | }): any; /** TODO: add return value **/
674 | addAsset(options: {
675 | }, path: string, data: any /** Buffer **/ | string): any; /** TODO: add return value **/
676 | error(options: {
677 | }, message: string, sourcePath?: string, line?: number, func?: string): any; /** TODO: add return value **/
678 | }
679 |
680 | declare function PackageAPI(): void;
681 | interface PackageAPI{
682 | use(packageNames: string | string[], architecture?: string, options?: {
683 | weak?: boolean;
684 | unordered?: Boolean;
685 | }): void;
686 | imply(packageSpecs: string | string[]): void;
687 | addFiles(filename: string | string[], architecture?: string): void;
688 | versionsFrom(meteorRelease: string | string[]): void;
689 | export(exportedObject: string, architecture?: string): void;
690 | }
691 |
--------------------------------------------------------------------------------
/typings/jquery/jquery.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for jQuery 1.10.x / 2.0.x
2 | // Project: http://jquery.com/
3 | // 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
4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped
5 |
6 | /* *****************************************************************************
7 | Copyright (c) Microsoft Corporation. All rights reserved.
8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
9 | this file except in compliance with the License. You may obtain a copy of the
10 | License at http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
14 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
15 | MERCHANTABLITY OR NON-INFRINGEMENT.
16 |
17 | See the Apache Version 2.0 License for specific language governing permissions
18 | and limitations under the License.
19 | ***************************************************************************** */
20 |
21 |
22 | /**
23 | * Interface for the AJAX setting that will configure the AJAX request
24 | */
25 | interface JQueryAjaxSettings {
26 | /**
27 | * 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.
28 | */
29 | accepts?: any;
30 | /**
31 | * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success().
32 | */
33 | async?: boolean;
34 | /**
35 | * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request.
36 | */
37 | beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any;
38 | /**
39 | * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.
40 | */
41 | cache?: boolean;
42 | /**
43 | * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
44 | */
45 | complete? (jqXHR: JQueryXHR, textStatus: string): any;
46 | /**
47 | * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5)
48 | */
49 | contents?: { [key: string]: any; };
50 | //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false"
51 | // https://github.com/borisyankov/DefinitelyTyped/issues/742
52 | /**
53 | * 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.
54 | */
55 | contentType?: any;
56 | /**
57 | * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax).
58 | */
59 | context?: any;
60 | /**
61 | * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5)
62 | */
63 | converters?: { [key: string]: any; };
64 | /**
65 | * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5)
66 | */
67 | crossDomain?: boolean;
68 | /**
69 | * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
70 | */
71 | data?: any;
72 | /**
73 | * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter.
74 | */
75 | dataFilter? (data: any, ty: any): any;
76 | /**
77 | * 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).
78 | */
79 | dataType?: string;
80 | /**
81 | * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event.
82 | */
83 | error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any;
84 | /**
85 | * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events.
86 | */
87 | global?: boolean;
88 | /**
89 | * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5)
90 | */
91 | headers?: { [key: string]: any; };
92 | /**
93 | * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data.
94 | */
95 | ifModified?: boolean;
96 | /**
97 | * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1)
98 | */
99 | isLocal?: boolean;
100 | /**
101 | * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }
102 | */
103 | jsonp?: any;
104 | /**
105 | * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function.
106 | */
107 | jsonpCallback?: any;
108 | /**
109 | * A mime type to override the XHR mime type. (version added: 1.5.1)
110 | */
111 | mimeType?: string;
112 | /**
113 | * A password to be used with XMLHttpRequest in response to an HTTP access authentication request.
114 | */
115 | password?: string;
116 | /**
117 | * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false.
118 | */
119 | processData?: boolean;
120 | /**
121 | * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script.
122 | */
123 | scriptCharset?: string;
124 | /**
125 | * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5)
126 | */
127 | statusCode?: { [key: string]: any; };
128 | /**
129 | * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
130 | */
131 | success? (data: any, textStatus: string, jqXHR: JQueryXHR): any;
132 | /**
133 | * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.
134 | */
135 | timeout?: number;
136 | /**
137 | * Set this to true if you wish to use the traditional style of param serialization.
138 | */
139 | traditional?: boolean;
140 | /**
141 | * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.
142 | */
143 | type?: string;
144 | /**
145 | * A string containing the URL to which the request is sent.
146 | */
147 | url?: string;
148 | /**
149 | * A username to be used with XMLHttpRequest in response to an HTTP access authentication request.
150 | */
151 | username?: string;
152 | /**
153 | * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory.
154 | */
155 | xhr?: any;
156 | /**
157 | * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1)
158 | */
159 | xhrFields?: { [key: string]: any; };
160 | }
161 |
162 | /**
163 | * Interface for the jqXHR object
164 | */
165 | interface JQueryXHR extends XMLHttpRequest, JQueryPromise {
166 | /**
167 | * 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).
168 | */
169 | overrideMimeType(mimeType: string): any;
170 | /**
171 | * Cancel the request.
172 | *
173 | * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled"
174 | */
175 | abort(statusText?: string): void;
176 | /**
177 | * 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.
178 | */
179 | then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise;
180 | /**
181 | * Property containing the parsed response if the response Content-Type is json
182 | */
183 | responseJSON?: any;
184 | }
185 |
186 | /**
187 | * Interface for the JQuery callback
188 | */
189 | interface JQueryCallback {
190 | /**
191 | * Add a callback or a collection of callbacks to a callback list.
192 | *
193 | * @param callbacks A function, or array of functions, that are to be added to the callback list.
194 | */
195 | add(callbacks: Function): JQueryCallback;
196 | /**
197 | * Add a callback or a collection of callbacks to a callback list.
198 | *
199 | * @param callbacks A function, or array of functions, that are to be added to the callback list.
200 | */
201 | add(callbacks: Function[]): JQueryCallback;
202 |
203 | /**
204 | * Disable a callback list from doing anything more.
205 | */
206 | disable(): JQueryCallback;
207 |
208 | /**
209 | * Determine if the callbacks list has been disabled.
210 | */
211 | disabled(): boolean;
212 |
213 | /**
214 | * Remove all of the callbacks from a list.
215 | */
216 | empty(): JQueryCallback;
217 |
218 | /**
219 | * Call all of the callbacks with the given arguments
220 | *
221 | * @param arguments The argument or list of arguments to pass back to the callback list.
222 | */
223 | fire(...arguments: any[]): JQueryCallback;
224 |
225 | /**
226 | * Determine if the callbacks have already been called at least once.
227 | */
228 | fired(): boolean;
229 |
230 | /**
231 | * Call all callbacks in a list with the given context and arguments.
232 | *
233 | * @param context A reference to the context in which the callbacks in the list should be fired.
234 | * @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
235 | */
236 | fireWith(context?: any, ...args: any[]): JQueryCallback;
237 |
238 | /**
239 | * Determine whether a supplied callback is in a list
240 | *
241 | * @param callback The callback to search for.
242 | */
243 | has(callback: Function): boolean;
244 |
245 | /**
246 | * Lock a callback list in its current state.
247 | */
248 | lock(): JQueryCallback;
249 |
250 | /**
251 | * Determine if the callbacks list has been locked.
252 | */
253 | locked(): boolean;
254 |
255 | /**
256 | * Remove a callback or a collection of callbacks from a callback list.
257 | *
258 | * @param callbacks A function, or array of functions, that are to be removed from the callback list.
259 | */
260 | remove(callbacks: Function): JQueryCallback;
261 | /**
262 | * Remove a callback or a collection of callbacks from a callback list.
263 | *
264 | * @param callbacks A function, or array of functions, that are to be removed from the callback list.
265 | */
266 | remove(callbacks: Function[]): JQueryCallback;
267 | }
268 |
269 | /**
270 | * Allows jQuery Promises to interop with non-jQuery promises
271 | */
272 | interface JQueryGenericPromise {
273 | /**
274 | * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
275 | *
276 | * @param doneFilter A function that is called when the Deferred is resolved.
277 | * @param failFilter An optional function that is called when the Deferred is rejected.
278 | */
279 | then(doneFilter: (value: T) => U|JQueryGenericPromise, failFilter?: (reason: any) => U|JQueryGenericPromise): JQueryGenericPromise;
280 | }
281 |
282 | /**
283 | * Interface for the JQuery promise/deferred callbacks
284 | */
285 | interface JQueryPromiseCallback {
286 | (value?: T, ...args: any[]): void;
287 | }
288 |
289 | interface JQueryPromiseOperator {
290 | (callback: JQueryPromiseCallback, ...callbacks: JQueryPromiseCallback[]): JQueryPromise;
291 | (callback: JQueryPromiseCallback[], ...callbacks: JQueryPromiseCallback[]): JQueryPromise;
292 | }
293 |
294 | /**
295 | * Interface for the JQuery promise, part of callbacks
296 | */
297 | interface JQueryPromise {
298 | /**
299 | * Add handlers to be called when the Deferred object is either resolved or rejected.
300 | *
301 | * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
302 | * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
303 | */
304 | always: JQueryPromiseOperator;
305 | /**
306 | * Add handlers to be called when the Deferred object is resolved.
307 | *
308 | * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
309 | * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
310 | */
311 | done: JQueryPromiseOperator;
312 | /**
313 | * Add handlers to be called when the Deferred object is rejected.
314 | *
315 | * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
316 | * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
317 | */
318 | fail: JQueryPromiseOperator;
319 | /**
320 | * Add handlers to be called when the Deferred object generates progress notifications.
321 | *
322 | * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
323 | */
324 | progress(progressCallback: JQueryPromiseCallback): JQueryPromise;
325 | progress(progressCallbacks: JQueryPromiseCallback[]): JQueryPromise;
326 |
327 | /**
328 | * Determine the current state of a Deferred object.
329 | */
330 | state(): string;
331 |
332 | // Deprecated - given no typings
333 | pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise;
334 |
335 | /**
336 | * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
337 | *
338 | * @param doneFilter A function that is called when the Deferred is resolved.
339 | * @param failFilter An optional function that is called when the Deferred is rejected.
340 | * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
341 | */
342 | then(doneFilter: (value: T) => U|JQueryGenericPromise, failFilter?: (...reasons: any[]) => U|JQueryGenericPromise, progressFilter?: (...progression: any[]) => any): JQueryPromise;
343 |
344 | // Because JQuery Promises Suck
345 | /**
346 | * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
347 | *
348 | * @param doneFilter A function that is called when the Deferred is resolved.
349 | * @param failFilter An optional function that is called when the Deferred is rejected.
350 | * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
351 | */
352 | then(doneFilter: (...values: any[]) => U|JQueryGenericPromise, failFilter?: (...reasons: any[]) => U|JQueryGenericPromise, progressFilter?: (...progression: any[]) => any): JQueryPromise;
353 | }
354 |
355 | /**
356 | * Interface for the JQuery deferred, part of callbacks
357 | */
358 | interface JQueryDeferred extends JQueryPromise {
359 | /**
360 | * Add handlers to be called when the Deferred object is either resolved or rejected.
361 | *
362 | * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
363 | * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
364 | */
365 | always(alwaysCallbacks1?: JQueryPromiseCallback, ...alwaysCallbacks2: JQueryPromiseCallback[]): JQueryDeferred;
366 | always(alwaysCallbacks1?: JQueryPromiseCallback[], ...alwaysCallbacks2: JQueryPromiseCallback[]): JQueryDeferred;
367 | always(alwaysCallbacks1?: JQueryPromiseCallback, ...alwaysCallbacks2: any[]): JQueryDeferred;
368 | always(alwaysCallbacks1?: JQueryPromiseCallback[], ...alwaysCallbacks2: any[]): JQueryDeferred;
369 | /**
370 | * Add handlers to be called when the Deferred object is resolved.
371 | *
372 | * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
373 | * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
374 | */
375 | done(doneCallbacks1?: JQueryPromiseCallback, ...doneCallbacks2: JQueryPromiseCallback[]): JQueryDeferred;
376 | done(doneCallbacks1?: JQueryPromiseCallback[], ...doneCallbacks2: JQueryPromiseCallback[]): JQueryDeferred;
377 | done(doneCallbacks1?: JQueryPromiseCallback, ...doneCallbacks2: any[]): JQueryDeferred;
378 | done(doneCallbacks1?: JQueryPromiseCallback[], ...doneCallbacks2: any[]): JQueryDeferred;
379 | /**
380 | * Add handlers to be called when the Deferred object is rejected.
381 | *
382 | * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
383 | * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
384 | */
385 | fail(failCallbacks1?: JQueryPromiseCallback, ...failCallbacks2: JQueryPromiseCallback[]): JQueryDeferred;
386 | fail(failCallbacks1?: JQueryPromiseCallback[], ...failCallbacks2: JQueryPromiseCallback[]): JQueryDeferred;
387 | fail(failCallbacks1?: JQueryPromiseCallback, ...failCallbacks2: any[]): JQueryDeferred;
388 | fail(failCallbacks1?: JQueryPromiseCallback[], ...failCallbacks2: any[]): JQueryDeferred;
389 | /**
390 | * Add handlers to be called when the Deferred object generates progress notifications.
391 | *
392 | * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
393 | */
394 | progress(progressCallback: JQueryPromiseCallback): JQueryDeferred;
395 | progress(progressCallbacks: JQueryPromiseCallback[]): JQueryDeferred;
396 |
397 | /**
398 | * Call the progressCallbacks on a Deferred object with the given args.
399 | *
400 | * @param args Optional arguments that are passed to the progressCallbacks.
401 | */
402 | notify(...args: any[]): JQueryDeferred;
403 |
404 | /**
405 | * Call the progressCallbacks on a Deferred object with the given context and args.
406 | *
407 | * @param context Context passed to the progressCallbacks as the this object.
408 | * @param args Optional arguments that are passed to the progressCallbacks.
409 | */
410 | notifyWith(context: any, ...args: any[]): JQueryDeferred;
411 |
412 | /**
413 | * Reject a Deferred object and call any failCallbacks with the given args.
414 | *
415 | * @param args Optional arguments that are passed to the failCallbacks.
416 | */
417 | reject(...args: any[]): JQueryDeferred;
418 | /**
419 | * Reject a Deferred object and call any failCallbacks with the given context and args.
420 | *
421 | * @param context Context passed to the failCallbacks as the this object.
422 | * @param args An optional array of arguments that are passed to the failCallbacks.
423 | */
424 | rejectWith(context: any, ...args: any[]): JQueryDeferred;
425 |
426 | /**
427 | * Resolve a Deferred object and call any doneCallbacks with the given args.
428 | *
429 | * @param value First argument passed to doneCallbacks.
430 | * @param args Optional subsequent arguments that are passed to the doneCallbacks.
431 | */
432 | resolve(value?: T, ...args: any[]): JQueryDeferred;
433 |
434 | /**
435 | * Resolve a Deferred object and call any doneCallbacks with the given context and args.
436 | *
437 | * @param context Context passed to the doneCallbacks as the this object.
438 | * @param args An optional array of arguments that are passed to the doneCallbacks.
439 | */
440 | resolveWith(context: any, ...args: any[]): JQueryDeferred;
441 |
442 | /**
443 | * Return a Deferred's Promise object.
444 | *
445 | * @param target Object onto which the promise methods have to be attached
446 | */
447 | promise(target?: any): JQueryPromise;
448 | }
449 |
450 | /**
451 | * Interface of the JQuery extension of the W3C event object
452 | */
453 | interface BaseJQueryEventObject extends Event {
454 | data: any;
455 | delegateTarget: Element;
456 | isDefaultPrevented(): boolean;
457 | isImmediatePropagationStopped(): boolean;
458 | isPropagationStopped(): boolean;
459 | namespace: string;
460 | originalEvent: Event;
461 | preventDefault(): any;
462 | relatedTarget: Element;
463 | result: any;
464 | stopImmediatePropagation(): void;
465 | stopPropagation(): void;
466 | target: Element;
467 | pageX: number;
468 | pageY: number;
469 | which: number;
470 | metaKey: boolean;
471 | }
472 |
473 | interface JQueryInputEventObject extends BaseJQueryEventObject {
474 | altKey: boolean;
475 | ctrlKey: boolean;
476 | metaKey: boolean;
477 | shiftKey: boolean;
478 | }
479 |
480 | interface JQueryMouseEventObject extends JQueryInputEventObject {
481 | button: number;
482 | clientX: number;
483 | clientY: number;
484 | offsetX: number;
485 | offsetY: number;
486 | pageX: number;
487 | pageY: number;
488 | screenX: number;
489 | screenY: number;
490 | }
491 |
492 | interface JQueryKeyEventObject extends JQueryInputEventObject {
493 | char: any;
494 | charCode: number;
495 | key: any;
496 | keyCode: number;
497 | }
498 |
499 | interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
500 | }
501 |
502 | /*
503 | Collection of properties of the current browser
504 | */
505 |
506 | interface JQuerySupport {
507 | ajax?: boolean;
508 | boxModel?: boolean;
509 | changeBubbles?: boolean;
510 | checkClone?: boolean;
511 | checkOn?: boolean;
512 | cors?: boolean;
513 | cssFloat?: boolean;
514 | hrefNormalized?: boolean;
515 | htmlSerialize?: boolean;
516 | leadingWhitespace?: boolean;
517 | noCloneChecked?: boolean;
518 | noCloneEvent?: boolean;
519 | opacity?: boolean;
520 | optDisabled?: boolean;
521 | optSelected?: boolean;
522 | scriptEval? (): boolean;
523 | style?: boolean;
524 | submitBubbles?: boolean;
525 | tbody?: boolean;
526 | }
527 |
528 | interface JQueryParam {
529 | /**
530 | * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
531 | *
532 | * @param obj An array or object to serialize.
533 | */
534 | (obj: any): string;
535 |
536 | /**
537 | * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
538 | *
539 | * @param obj An array or object to serialize.
540 | * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
541 | */
542 | (obj: any, traditional: boolean): string;
543 | }
544 |
545 | /**
546 | * The interface used to construct jQuery events (with $.Event). It is
547 | * defined separately instead of inline in JQueryStatic to allow
548 | * overriding the construction function with specific strings
549 | * returning specific event objects.
550 | */
551 | interface JQueryEventConstructor {
552 | (name: string, eventProperties?: any): JQueryEventObject;
553 | new (name: string, eventProperties?: any): JQueryEventObject;
554 | }
555 |
556 | /**
557 | * The interface used to specify coordinates.
558 | */
559 | interface JQueryCoordinates {
560 | left: number;
561 | top: number;
562 | }
563 |
564 | /**
565 | * Elements in the array returned by serializeArray()
566 | */
567 | interface JQuerySerializeArrayElement {
568 | name: string;
569 | value: string;
570 | }
571 |
572 | interface JQueryAnimationOptions {
573 | /**
574 | * A string or number determining how long the animation will run.
575 | */
576 | duration?: any;
577 | /**
578 | * A string indicating which easing function to use for the transition.
579 | */
580 | easing?: string;
581 | /**
582 | * A function to call once the animation is complete.
583 | */
584 | complete?: Function;
585 | /**
586 | * 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.
587 | */
588 | step?: (now: number, tween: any) => any;
589 | /**
590 | * 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)
591 | */
592 | progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any;
593 | /**
594 | * A function to call when the animation begins. (version added: 1.8)
595 | */
596 | start?: (animation: JQueryPromise) => any;
597 | /**
598 | * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
599 | */
600 | done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any;
601 | /**
602 | * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
603 | */
604 | fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any;
605 | /**
606 | * 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)
607 | */
608 | always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any;
609 | /**
610 | * 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.
611 | */
612 | queue?: any;
613 | /**
614 | * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
615 | */
616 | specialEasing?: Object;
617 | }
618 |
619 | /**
620 | * Static members of jQuery (those on $ and jQuery themselves)
621 | */
622 | interface JQueryStatic {
623 |
624 | /**
625 | * Perform an asynchronous HTTP (Ajax) request.
626 | *
627 | * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
628 | */
629 | ajax(settings: JQueryAjaxSettings): JQueryXHR;
630 | /**
631 | * Perform an asynchronous HTTP (Ajax) request.
632 | *
633 | * @param url A string containing the URL to which the request is sent.
634 | * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
635 | */
636 | ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
637 |
638 | /**
639 | * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
640 | *
641 | * @param dataTypes An optional string containing one or more space-separated dataTypes
642 | * @param handler A handler to set default values for future Ajax requests.
643 | */
644 | ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
645 | /**
646 | * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
647 | *
648 | * @param handler A handler to set default values for future Ajax requests.
649 | */
650 | ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
651 |
652 | ajaxSettings: JQueryAjaxSettings;
653 |
654 | /**
655 | * Set default values for future Ajax requests. Its use is not recommended.
656 | *
657 | * @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
658 | */
659 | ajaxSetup(options: JQueryAjaxSettings): void;
660 |
661 | /**
662 | * Load data from the server using a HTTP GET request.
663 | *
664 | * @param url A string containing the URL to which the request is sent.
665 | * @param success A callback function that is executed if the request succeeds.
666 | * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
667 | */
668 | get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
669 | /**
670 | * Load data from the server using a HTTP GET request.
671 | *
672 | * @param url A string containing the URL to which the request is sent.
673 | * @param data A plain object or string that is sent to the server with the request.
674 | * @param success A callback function that is executed if the request succeeds.
675 | * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
676 | */
677 | get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
678 | /**
679 | * Load JSON-encoded data from the server using a GET HTTP request.
680 | *
681 | * @param url A string containing the URL to which the request is sent.
682 | * @param success A callback function that is executed if the request succeeds.
683 | */
684 | getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
685 | /**
686 | * Load JSON-encoded data from the server using a GET HTTP request.
687 | *
688 | * @param url A string containing the URL to which the request is sent.
689 | * @param data A plain object or string that is sent to the server with the request.
690 | * @param success A callback function that is executed if the request succeeds.
691 | */
692 | getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
693 | /**
694 | * Load a JavaScript file from the server using a GET HTTP request, then execute it.
695 | *
696 | * @param url A string containing the URL to which the request is sent.
697 | * @param success A callback function that is executed if the request succeeds.
698 | */
699 | getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
700 |
701 | /**
702 | * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
703 | */
704 | param: JQueryParam;
705 |
706 | /**
707 | * Load data from the server using a HTTP POST request.
708 | *
709 | * @param url A string containing the URL to which the request is sent.
710 | * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
711 | * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
712 | */
713 | post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
714 | /**
715 | * Load data from the server using a HTTP POST request.
716 | *
717 | * @param url A string containing the URL to which the request is sent.
718 | * @param data A plain object or string that is sent to the server with the request.
719 | * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
720 | * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
721 | */
722 | post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
723 |
724 | /**
725 | * A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
726 | *
727 | * @param flags An optional list of space-separated flags that change how the callback list behaves.
728 | */
729 | Callbacks(flags?: string): JQueryCallback;
730 |
731 | /**
732 | * Holds or releases the execution of jQuery's ready event.
733 | *
734 | * @param hold Indicates whether the ready hold is being requested or released
735 | */
736 | holdReady(hold: boolean): void;
737 |
738 | /**
739 | * Accepts a string containing a CSS selector which is then used to match a set of elements.
740 | *
741 | * @param selector A string containing a selector expression
742 | * @param context A DOM Element, Document, or jQuery to use as context
743 | */
744 | (selector: string, context?: Element|JQuery): JQuery;
745 | /**
746 | * Accepts a string containing a CSS selector which is then used to match a set of elements.
747 | *
748 | * @param element A DOM element to wrap in a jQuery object.
749 | */
750 | (element: Element): JQuery;
751 | /**
752 | * Accepts a string containing a CSS selector which is then used to match a set of elements.
753 | *
754 | * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object.
755 | */
756 | (elementArray: Element[]): JQuery;
757 | /**
758 | * Accepts a string containing a CSS selector which is then used to match a set of elements.
759 | *
760 | * @param object A plain object to wrap in a jQuery object.
761 | */
762 | (object: {}): JQuery;
763 | /**
764 | * Accepts a string containing a CSS selector which is then used to match a set of elements.
765 | *
766 | * @param object An existing jQuery object to clone.
767 | */
768 | (object: JQuery): JQuery;
769 | /**
770 | * Specify a function to execute when the DOM is fully loaded.
771 | */
772 | (): JQuery;
773 |
774 | /**
775 | * Creates DOM elements on the fly from the provided string of raw HTML.
776 | *
777 | * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML.
778 | * @param ownerDocument A document in which the new elements will be created.
779 | */
780 | (html: string, ownerDocument?: Document): JQuery;
781 | /**
782 | * Creates DOM elements on the fly from the provided string of raw HTML.
783 | *
784 | * @param html A string defining a single, standalone, HTML element (e.g. or ).
785 | * @param attributes An object of attributes, events, and methods to call on the newly-created element.
786 | */
787 | (html: string, attributes: Object): JQuery;
788 |
789 | /**
790 | * Binds a function to be executed when the DOM has finished loading.
791 | *
792 | * @param callback A function to execute after the DOM is ready.
793 | */
794 | (callback: Function): JQuery;
795 |
796 | /**
797 | * Relinquish jQuery's control of the $ variable.
798 | *
799 | * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
800 | */
801 | noConflict(removeAll?: boolean): Object;
802 |
803 | /**
804 | * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
805 | *
806 | * @param deferreds One or more Deferred objects, or plain JavaScript objects.
807 | */
808 | when(...deferreds: JQueryGenericPromise[]): JQueryPromise;
809 | /**
810 | * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
811 | *
812 | * @param deferreds One or more Deferred objects, or plain JavaScript objects.
813 | */
814 | when(...deferreds: T[]): JQueryPromise;
815 | /**
816 | * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
817 | *
818 | * @param deferreds One or more Deferred objects, or plain JavaScript objects.
819 | */
820 | when(...deferreds: any[]): JQueryPromise;
821 |
822 | /**
823 | * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
824 | */
825 | cssHooks: { [key: string]: any; };
826 | cssNumber: any;
827 |
828 | /**
829 | * Store arbitrary data associated with the specified element. Returns the value that was set.
830 | *
831 | * @param element The DOM element to associate with the data.
832 | * @param key A string naming the piece of data to set.
833 | * @param value The new data value.
834 | */
835 | data(element: Element, key: string, value: T): T;
836 | /**
837 | * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
838 | *
839 | * @param element The DOM element to associate with the data.
840 | * @param key A string naming the piece of data to set.
841 | */
842 | data(element: Element, key: string): any;
843 | /**
844 | * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
845 | *
846 | * @param element The DOM element to associate with the data.
847 | */
848 | data(element: Element): any;
849 |
850 | /**
851 | * Execute the next function on the queue for the matched element.
852 | *
853 | * @param element A DOM element from which to remove and execute a queued function.
854 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
855 | */
856 | dequeue(element: Element, queueName?: string): void;
857 |
858 | /**
859 | * Determine whether an element has any jQuery data associated with it.
860 | *
861 | * @param element A DOM element to be checked for data.
862 | */
863 | hasData(element: Element): boolean;
864 |
865 | /**
866 | * Show the queue of functions to be executed on the matched element.
867 | *
868 | * @param element A DOM element to inspect for an attached queue.
869 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
870 | */
871 | queue(element: Element, queueName?: string): any[];
872 | /**
873 | * Manipulate the queue of functions to be executed on the matched element.
874 | *
875 | * @param element A DOM element where the array of queued functions is attached.
876 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
877 | * @param newQueue An array of functions to replace the current queue contents.
878 | */
879 | queue(element: Element, queueName: string, newQueue: Function[]): JQuery;
880 | /**
881 | * Manipulate the queue of functions to be executed on the matched element.
882 | *
883 | * @param element A DOM element on which to add a queued function.
884 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
885 | * @param callback The new function to add to the queue.
886 | */
887 | queue(element: Element, queueName: string, callback: Function): JQuery;
888 |
889 | /**
890 | * Remove a previously-stored piece of data.
891 | *
892 | * @param element A DOM element from which to remove data.
893 | * @param name A string naming the piece of data to remove.
894 | */
895 | removeData(element: Element, name?: string): JQuery;
896 |
897 | /**
898 | * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.
899 | *
900 | * @param beforeStart A function that is called just before the constructor returns.
901 | */
902 | Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred;
903 |
904 | /**
905 | * Effects
906 | */
907 | fx: {
908 | tick: () => void;
909 | /**
910 | * The rate (in milliseconds) at which animations fire.
911 | */
912 | interval: number;
913 | stop: () => void;
914 | speeds: { slow: number; fast: number; };
915 | /**
916 | * Globally disable all animations.
917 | */
918 | off: boolean;
919 | step: any;
920 | };
921 |
922 | /**
923 | * Takes a function and returns a new one that will always have a particular context.
924 | *
925 | * @param fnction The function whose context will be changed.
926 | * @param context The object to which the context (this) of the function should be set.
927 | * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
928 | */
929 | proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any;
930 | /**
931 | * Takes a function and returns a new one that will always have a particular context.
932 | *
933 | * @param context The object to which the context (this) of the function should be set.
934 | * @param name The name of the function whose context will be changed (should be a property of the context object).
935 | * @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
936 | */
937 | proxy(context: Object, name: string, ...additionalArguments: any[]): any;
938 |
939 | Event: JQueryEventConstructor;
940 |
941 | /**
942 | * Takes a string and throws an exception containing it.
943 | *
944 | * @param message The message to send out.
945 | */
946 | error(message: any): JQuery;
947 |
948 | expr: any;
949 | fn: any; //TODO: Decide how we want to type this
950 |
951 | isReady: boolean;
952 |
953 | // Properties
954 | support: JQuerySupport;
955 |
956 | /**
957 | * Check to see if a DOM element is a descendant of another DOM element.
958 | *
959 | * @param container The DOM element that may contain the other element.
960 | * @param contained The DOM element that may be contained by (a descendant of) the other element.
961 | */
962 | contains(container: Element, contained: Element): boolean;
963 |
964 | /**
965 | * 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.
966 | *
967 | * @param collection The object or array to iterate over.
968 | * @param callback The function that will be executed on every object.
969 | */
970 | each(
971 | collection: T[],
972 | callback: (indexInArray: number, valueOfElement: T) => any
973 | ): any;
974 |
975 | /**
976 | * 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.
977 | *
978 | * @param collection The object or array to iterate over.
979 | * @param callback The function that will be executed on every object.
980 | */
981 | each(
982 | collection: any,
983 | callback: (indexInArray: any, valueOfElement: any) => any
984 | ): any;
985 |
986 | /**
987 | * Merge the contents of two or more objects together into the first object.
988 | *
989 | * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument.
990 | * @param object1 An object containing additional properties to merge in.
991 | * @param objectN Additional objects containing properties to merge in.
992 | */
993 | extend(target: any, object1?: any, ...objectN: any[]): any;
994 | /**
995 | * Merge the contents of two or more objects together into the first object.
996 | *
997 | * @param deep If true, the merge becomes recursive (aka. deep copy).
998 | * @param target The object to extend. It will receive the new properties.
999 | * @param object1 An object containing additional properties to merge in.
1000 | * @param objectN Additional objects containing properties to merge in.
1001 | */
1002 | extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any;
1003 |
1004 | /**
1005 | * Execute some JavaScript code globally.
1006 | *
1007 | * @param code The JavaScript code to execute.
1008 | */
1009 | globalEval(code: string): any;
1010 |
1011 | /**
1012 | * Finds the elements of an array which satisfy a filter function. The original array is not affected.
1013 | *
1014 | * @param array The array to search through.
1015 | * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.
1016 | * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.
1017 | */
1018 | grep(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[];
1019 |
1020 | /**
1021 | * Search for a specified value within an array and return its index (or -1 if not found).
1022 | *
1023 | * @param value The value to search for.
1024 | * @param array An array through which to search.
1025 | * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array.
1026 | */
1027 | inArray(value: T, array: T[], fromIndex?: number): number;
1028 |
1029 | /**
1030 | * Determine whether the argument is an array.
1031 | *
1032 | * @param obj Object to test whether or not it is an array.
1033 | */
1034 | isArray(obj: any): boolean;
1035 | /**
1036 | * Check to see if an object is empty (contains no enumerable properties).
1037 | *
1038 | * @param obj The object that will be checked to see if it's empty.
1039 | */
1040 | isEmptyObject(obj: any): boolean;
1041 | /**
1042 | * Determine if the argument passed is a Javascript function object.
1043 | *
1044 | * @param obj Object to test whether or not it is a function.
1045 | */
1046 | isFunction(obj: any): boolean;
1047 | /**
1048 | * Determines whether its argument is a number.
1049 | *
1050 | * @param obj The value to be tested.
1051 | */
1052 | isNumeric(value: any): boolean;
1053 | /**
1054 | * Check to see if an object is a plain object (created using "{}" or "new Object").
1055 | *
1056 | * @param obj The object that will be checked to see if it's a plain object.
1057 | */
1058 | isPlainObject(obj: any): boolean;
1059 | /**
1060 | * Determine whether the argument is a window.
1061 | *
1062 | * @param obj Object to test whether or not it is a window.
1063 | */
1064 | isWindow(obj: any): boolean;
1065 | /**
1066 | * Check to see if a DOM node is within an XML document (or is an XML document).
1067 | *
1068 | * @param node he DOM node that will be checked to see if it's in an XML document.
1069 | */
1070 | isXMLDoc(node: Node): boolean;
1071 |
1072 | /**
1073 | * Convert an array-like object into a true JavaScript array.
1074 | *
1075 | * @param obj Any object to turn into a native Array.
1076 | */
1077 | makeArray(obj: any): any[];
1078 |
1079 | /**
1080 | * Translate all items in an array or object to new array of items.
1081 | *
1082 | * @param array The Array to translate.
1083 | * @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.
1084 | */
1085 | map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
1086 | /**
1087 | * Translate all items in an array or object to new array of items.
1088 | *
1089 | * @param arrayOrObject The Array or Object to translate.
1090 | * @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.
1091 | */
1092 | map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any;
1093 |
1094 | /**
1095 | * Merge the contents of two arrays together into the first array.
1096 | *
1097 | * @param first The first array to merge, the elements of second added.
1098 | * @param second The second array to merge into the first, unaltered.
1099 | */
1100 | merge(first: T[], second: T[]): T[];
1101 |
1102 | /**
1103 | * An empty function.
1104 | */
1105 | noop(): any;
1106 |
1107 | /**
1108 | * Return a number representing the current time.
1109 | */
1110 | now(): number;
1111 |
1112 | /**
1113 | * Takes a well-formed JSON string and returns the resulting JavaScript object.
1114 | *
1115 | * @param json The JSON string to parse.
1116 | */
1117 | parseJSON(json: string): any;
1118 |
1119 | /**
1120 | * Parses a string into an XML document.
1121 | *
1122 | * @param data a well-formed XML string to be parsed
1123 | */
1124 | parseXML(data: string): XMLDocument;
1125 |
1126 | /**
1127 | * Remove the whitespace from the beginning and end of a string.
1128 | *
1129 | * @param str Remove the whitespace from the beginning and end of a string.
1130 | */
1131 | trim(str: string): string;
1132 |
1133 | /**
1134 | * Determine the internal JavaScript [[Class]] of an object.
1135 | *
1136 | * @param obj Object to get the internal JavaScript [[Class]] of.
1137 | */
1138 | type(obj: any): string;
1139 |
1140 | /**
1141 | * 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.
1142 | *
1143 | * @param array The Array of DOM elements.
1144 | */
1145 | unique(array: Element[]): Element[];
1146 |
1147 | /**
1148 | * Parses a string into an array of DOM nodes.
1149 | *
1150 | * @param data HTML string to be parsed
1151 | * @param context DOM element to serve as the context in which the HTML fragment will be created
1152 | * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
1153 | */
1154 | parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
1155 |
1156 | /**
1157 | * Parses a string into an array of DOM nodes.
1158 | *
1159 | * @param data HTML string to be parsed
1160 | * @param context DOM element to serve as the context in which the HTML fragment will be created
1161 | * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
1162 | */
1163 | parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
1164 | }
1165 |
1166 | /**
1167 | * The jQuery instance members
1168 | */
1169 | interface JQuery {
1170 |
1171 | /**
1172 | * Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
1173 | *
1174 | * @param handler The function to be invoked.
1175 | */
1176 | ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery;
1177 | /**
1178 | * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
1179 | *
1180 | * @param handler The function to be invoked.
1181 | */
1182 | ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery;
1183 | /**
1184 | * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
1185 | *
1186 | * @param handler The function to be invoked.
1187 | */
1188 | ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
1189 | /**
1190 | * Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
1191 | *
1192 | * @param handler The function to be invoked.
1193 | */
1194 | ajaxStart(handler: () => any): JQuery;
1195 | /**
1196 | * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
1197 | *
1198 | * @param handler The function to be invoked.
1199 | */
1200 | ajaxStop(handler: () => any): JQuery;
1201 | /**
1202 | * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
1203 | *
1204 | * @param handler The function to be invoked.
1205 | */
1206 | ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
1207 |
1208 | /**
1209 | * Load data from the server and place the returned HTML into the matched element.
1210 | *
1211 | * @param url A string containing the URL to which the request is sent.
1212 | * @param data A plain object or string that is sent to the server with the request.
1213 | * @param complete A callback function that is executed when the request completes.
1214 | */
1215 | load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery;
1216 |
1217 | /**
1218 | * Encode a set of form elements as a string for submission.
1219 | */
1220 | serialize(): string;
1221 | /**
1222 | * Encode a set of form elements as an array of names and values.
1223 | */
1224 | serializeArray(): JQuerySerializeArrayElement[];
1225 |
1226 | /**
1227 | * Adds the specified class(es) to each of the set of matched elements.
1228 | *
1229 | * @param className One or more space-separated classes to be added to the class attribute of each matched element.
1230 | */
1231 | addClass(className: string): JQuery;
1232 | /**
1233 | * Adds the specified class(es) to each of the set of matched elements.
1234 | *
1235 | * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set.
1236 | */
1237 | addClass(func: (index: number, className: string) => string): JQuery;
1238 |
1239 | /**
1240 | * Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
1241 | */
1242 | addBack(selector?: string): JQuery;
1243 |
1244 | /**
1245 | * Get the value of an attribute for the first element in the set of matched elements.
1246 | *
1247 | * @param attributeName The name of the attribute to get.
1248 | */
1249 | attr(attributeName: string): string;
1250 | /**
1251 | * Set one or more attributes for the set of matched elements.
1252 | *
1253 | * @param attributeName The name of the attribute to set.
1254 | * @param value A value to set for the attribute.
1255 | */
1256 | attr(attributeName: string, value: string|number): JQuery;
1257 | /**
1258 | * Set one or more attributes for the set of matched elements.
1259 | *
1260 | * @param attributeName The name of the attribute to set.
1261 | * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments.
1262 | */
1263 | attr(attributeName: string, func: (index: number, attr: any) => any): JQuery;
1264 | /**
1265 | * Set one or more attributes for the set of matched elements.
1266 | *
1267 | * @param attributes An object of attribute-value pairs to set.
1268 | */
1269 | attr(attributes: Object): JQuery;
1270 |
1271 | /**
1272 | * Determine whether any of the matched elements are assigned the given class.
1273 | *
1274 | * @param className The class name to search for.
1275 | */
1276 | hasClass(className: string): boolean;
1277 |
1278 | /**
1279 | * Get the HTML contents of the first element in the set of matched elements.
1280 | */
1281 | html(): string;
1282 | /**
1283 | * Set the HTML contents of each element in the set of matched elements.
1284 | *
1285 | * @param htmlString A string of HTML to set as the content of each matched element.
1286 | */
1287 | html(htmlString: string): JQuery;
1288 | /**
1289 | * Set the HTML contents of each element in the set of matched elements.
1290 | *
1291 | * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
1292 | */
1293 | html(func: (index: number, oldhtml: string) => string): JQuery;
1294 | /**
1295 | * Set the HTML contents of each element in the set of matched elements.
1296 | *
1297 | * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
1298 | */
1299 |
1300 | /**
1301 | * Get the value of a property for the first element in the set of matched elements.
1302 | *
1303 | * @param propertyName The name of the property to get.
1304 | */
1305 | prop(propertyName: string): any;
1306 | /**
1307 | * Set one or more properties for the set of matched elements.
1308 | *
1309 | * @param propertyName The name of the property to set.
1310 | * @param value A value to set for the property.
1311 | */
1312 | prop(propertyName: string, value: string|number|boolean): JQuery;
1313 | /**
1314 | * Set one or more properties for the set of matched elements.
1315 | *
1316 | * @param properties An object of property-value pairs to set.
1317 | */
1318 | prop(properties: Object): JQuery;
1319 | /**
1320 | * Set one or more properties for the set of matched elements.
1321 | *
1322 | * @param propertyName The name of the property to set.
1323 | * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
1324 | */
1325 | prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery;
1326 |
1327 | /**
1328 | * Remove an attribute from each element in the set of matched elements.
1329 | *
1330 | * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
1331 | */
1332 | removeAttr(attributeName: string): JQuery;
1333 |
1334 | /**
1335 | * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
1336 | *
1337 | * @param className One or more space-separated classes to be removed from the class attribute of each matched element.
1338 | */
1339 | removeClass(className?: string): JQuery;
1340 | /**
1341 | * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
1342 | *
1343 | * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments.
1344 | */
1345 | removeClass(func: (index: number, className: string) => string): JQuery;
1346 |
1347 | /**
1348 | * Remove a property for the set of matched elements.
1349 | *
1350 | * @param propertyName The name of the property to remove.
1351 | */
1352 | removeProp(propertyName: string): JQuery;
1353 |
1354 | /**
1355 | * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
1356 | *
1357 | * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
1358 | * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
1359 | */
1360 | toggleClass(className: string, swtch?: boolean): JQuery;
1361 | /**
1362 | * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
1363 | *
1364 | * @param swtch A boolean value to determine whether the class should be added or removed.
1365 | */
1366 | toggleClass(swtch?: boolean): JQuery;
1367 | /**
1368 | * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
1369 | *
1370 | * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments.
1371 | * @param swtch A boolean value to determine whether the class should be added or removed.
1372 | */
1373 | toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery;
1374 |
1375 | /**
1376 | * Get the current value of the first element in the set of matched elements.
1377 | */
1378 | val(): any;
1379 | /**
1380 | * Set the value of each element in the set of matched elements.
1381 | *
1382 | * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
1383 | */
1384 | val(value: string|string[]): JQuery;
1385 | /**
1386 | * Set the value of each element in the set of matched elements.
1387 | *
1388 | * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
1389 | */
1390 | val(func: (index: number, value: string) => string): JQuery;
1391 |
1392 |
1393 | /**
1394 | * Get the value of style properties for the first element in the set of matched elements.
1395 | *
1396 | * @param propertyName A CSS property.
1397 | */
1398 | css(propertyName: string): string;
1399 | /**
1400 | * Set one or more CSS properties for the set of matched elements.
1401 | *
1402 | * @param propertyName A CSS property name.
1403 | * @param value A value to set for the property.
1404 | */
1405 | css(propertyName: string, value: string|number): JQuery;
1406 | /**
1407 | * Set one or more CSS properties for the set of matched elements.
1408 | *
1409 | * @param propertyName A CSS property name.
1410 | * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
1411 | */
1412 | css(propertyName: string, value: (index: number, value: string) => string|number): JQuery;
1413 | /**
1414 | * Set one or more CSS properties for the set of matched elements.
1415 | *
1416 | * @param properties An object of property-value pairs to set.
1417 | */
1418 | css(properties: Object): JQuery;
1419 |
1420 | /**
1421 | * Get the current computed height for the first element in the set of matched elements.
1422 | */
1423 | height(): number;
1424 | /**
1425 | * Set the CSS height of every matched element.
1426 | *
1427 | * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
1428 | */
1429 | height(value: number|string): JQuery;
1430 | /**
1431 | * Set the CSS height of every matched element.
1432 | *
1433 | * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set.
1434 | */
1435 | height(func: (index: number, height: number) => number|string): JQuery;
1436 |
1437 | /**
1438 | * Get the current computed height for the first element in the set of matched elements, including padding but not border.
1439 | */
1440 | innerHeight(): number;
1441 |
1442 | /**
1443 | * Sets the inner height on elements in the set of matched elements, including padding but not border.
1444 | *
1445 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1446 | */
1447 | innerHeight(height: number|string): JQuery;
1448 |
1449 | /**
1450 | * Get the current computed width for the first element in the set of matched elements, including padding but not border.
1451 | */
1452 | innerWidth(): number;
1453 |
1454 | /**
1455 | * Sets the inner width on elements in the set of matched elements, including padding but not border.
1456 | *
1457 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1458 | */
1459 | innerWidth(width: number|string): JQuery;
1460 |
1461 | /**
1462 | * Get the current coordinates of the first element in the set of matched elements, relative to the document.
1463 | */
1464 | offset(): JQueryCoordinates;
1465 | /**
1466 | * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
1467 | *
1468 | * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
1469 | */
1470 | offset(coordinates: JQueryCoordinates): JQuery;
1471 | /**
1472 | * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
1473 | *
1474 | * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties.
1475 | */
1476 | offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery;
1477 |
1478 | /**
1479 | * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
1480 | *
1481 | * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
1482 | */
1483 | outerHeight(includeMargin?: boolean): number;
1484 |
1485 | /**
1486 | * Sets the outer height on elements in the set of matched elements, including padding and border.
1487 | *
1488 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1489 | */
1490 | outerHeight(height: number|string): JQuery;
1491 |
1492 | /**
1493 | * Get the current computed width for the first element in the set of matched elements, including padding and border.
1494 | *
1495 | * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
1496 | */
1497 | outerWidth(includeMargin?: boolean): number;
1498 |
1499 | /**
1500 | * Sets the outer width on elements in the set of matched elements, including padding and border.
1501 | *
1502 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1503 | */
1504 | outerWidth(width: number|string): JQuery;
1505 |
1506 | /**
1507 | * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
1508 | */
1509 | position(): JQueryCoordinates;
1510 |
1511 | /**
1512 | * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element.
1513 | */
1514 | scrollLeft(): number;
1515 | /**
1516 | * Set the current horizontal position of the scroll bar for each of the set of matched elements.
1517 | *
1518 | * @param value An integer indicating the new position to set the scroll bar to.
1519 | */
1520 | scrollLeft(value: number): JQuery;
1521 |
1522 | /**
1523 | * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.
1524 | */
1525 | scrollTop(): number;
1526 | /**
1527 | * Set the current vertical position of the scroll bar for each of the set of matched elements.
1528 | *
1529 | * @param value An integer indicating the new position to set the scroll bar to.
1530 | */
1531 | scrollTop(value: number): JQuery;
1532 |
1533 | /**
1534 | * Get the current computed width for the first element in the set of matched elements.
1535 | */
1536 | width(): number;
1537 | /**
1538 | * Set the CSS width of each element in the set of matched elements.
1539 | *
1540 | * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1541 | */
1542 | width(value: number|string): JQuery;
1543 | /**
1544 | * Set the CSS width of each element in the set of matched elements.
1545 | *
1546 | * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set.
1547 | */
1548 | width(func: (index: number, width: number) => number|string): JQuery;
1549 |
1550 | /**
1551 | * Remove from the queue all items that have not yet been run.
1552 | *
1553 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1554 | */
1555 | clearQueue(queueName?: string): JQuery;
1556 |
1557 | /**
1558 | * Store arbitrary data associated with the matched elements.
1559 | *
1560 | * @param key A string naming the piece of data to set.
1561 | * @param value The new data value; it can be any Javascript type including Array or Object.
1562 | */
1563 | data(key: string, value: any): JQuery;
1564 | /**
1565 | * Store arbitrary data associated with the matched elements.
1566 | *
1567 | * @param obj An object of key-value pairs of data to update.
1568 | */
1569 | data(obj: { [key: string]: any; }): JQuery;
1570 | /**
1571 | * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
1572 | *
1573 | * @param key Name of the data stored.
1574 | */
1575 | data(key: string): any;
1576 | /**
1577 | * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
1578 | */
1579 | data(): any;
1580 |
1581 | /**
1582 | * Execute the next function on the queue for the matched elements.
1583 | *
1584 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1585 | */
1586 | dequeue(queueName?: string): JQuery;
1587 |
1588 | /**
1589 | * Remove a previously-stored piece of data.
1590 | *
1591 | * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
1592 | */
1593 | removeData(name: string): JQuery;
1594 | /**
1595 | * Remove a previously-stored piece of data.
1596 | *
1597 | * @param list An array of strings naming the pieces of data to delete.
1598 | */
1599 | removeData(list: string[]): JQuery;
1600 |
1601 | /**
1602 | * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
1603 | *
1604 | * @param type The type of queue that needs to be observed. (default: fx)
1605 | * @param target Object onto which the promise methods have to be attached
1606 | */
1607 | promise(type?: string, target?: Object): JQueryPromise;
1608 |
1609 | /**
1610 | * Perform a custom animation of a set of CSS properties.
1611 | *
1612 | * @param properties An object of CSS properties and values that the animation will move toward.
1613 | * @param duration A string or number determining how long the animation will run.
1614 | * @param complete A function to call once the animation is complete.
1615 | */
1616 | animate(properties: Object, duration?: string|number, complete?: Function): JQuery;
1617 | /**
1618 | * Perform a custom animation of a set of CSS properties.
1619 | *
1620 | * @param properties An object of CSS properties and values that the animation will move toward.
1621 | * @param duration A string or number determining how long the animation will run.
1622 | * @param easing A string indicating which easing function to use for the transition. (default: swing)
1623 | * @param complete A function to call once the animation is complete.
1624 | */
1625 | animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery;
1626 | /**
1627 | * Perform a custom animation of a set of CSS properties.
1628 | *
1629 | * @param properties An object of CSS properties and values that the animation will move toward.
1630 | * @param options A map of additional options to pass to the method.
1631 | */
1632 | animate(properties: Object, options: JQueryAnimationOptions): JQuery;
1633 |
1634 | /**
1635 | * Set a timer to delay execution of subsequent items in the queue.
1636 | *
1637 | * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
1638 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1639 | */
1640 | delay(duration: number, queueName?: string): JQuery;
1641 |
1642 | /**
1643 | * Display the matched elements by fading them to opaque.
1644 | *
1645 | * @param duration A string or number determining how long the animation will run.
1646 | * @param complete A function to call once the animation is complete.
1647 | */
1648 | fadeIn(duration?: number|string, complete?: Function): JQuery;
1649 | /**
1650 | * Display the matched elements by fading them to opaque.
1651 | *
1652 | * @param duration A string or number determining how long the animation will run.
1653 | * @param easing A string indicating which easing function to use for the transition.
1654 | * @param complete A function to call once the animation is complete.
1655 | */
1656 | fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery;
1657 | /**
1658 | * Display the matched elements by fading them to opaque.
1659 | *
1660 | * @param options A map of additional options to pass to the method.
1661 | */
1662 | fadeIn(options: JQueryAnimationOptions): JQuery;
1663 |
1664 | /**
1665 | * Hide the matched elements by fading them to transparent.
1666 | *
1667 | * @param duration A string or number determining how long the animation will run.
1668 | * @param complete A function to call once the animation is complete.
1669 | */
1670 | fadeOut(duration?: number|string, complete?: Function): JQuery;
1671 | /**
1672 | * Hide the matched elements by fading them to transparent.
1673 | *
1674 | * @param duration A string or number determining how long the animation will run.
1675 | * @param easing A string indicating which easing function to use for the transition.
1676 | * @param complete A function to call once the animation is complete.
1677 | */
1678 | fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery;
1679 | /**
1680 | * Hide the matched elements by fading them to transparent.
1681 | *
1682 | * @param options A map of additional options to pass to the method.
1683 | */
1684 | fadeOut(options: JQueryAnimationOptions): JQuery;
1685 |
1686 | /**
1687 | * Adjust the opacity of the matched elements.
1688 | *
1689 | * @param duration A string or number determining how long the animation will run.
1690 | * @param opacity A number between 0 and 1 denoting the target opacity.
1691 | * @param complete A function to call once the animation is complete.
1692 | */
1693 | fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery;
1694 | /**
1695 | * Adjust the opacity of the matched elements.
1696 | *
1697 | * @param duration A string or number determining how long the animation will run.
1698 | * @param opacity A number between 0 and 1 denoting the target opacity.
1699 | * @param easing A string indicating which easing function to use for the transition.
1700 | * @param complete A function to call once the animation is complete.
1701 | */
1702 | fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery;
1703 |
1704 | /**
1705 | * Display or hide the matched elements by animating their opacity.
1706 | *
1707 | * @param duration A string or number determining how long the animation will run.
1708 | * @param complete A function to call once the animation is complete.
1709 | */
1710 | fadeToggle(duration?: number|string, complete?: Function): JQuery;
1711 | /**
1712 | * Display or hide the matched elements by animating their opacity.
1713 | *
1714 | * @param duration A string or number determining how long the animation will run.
1715 | * @param easing A string indicating which easing function to use for the transition.
1716 | * @param complete A function to call once the animation is complete.
1717 | */
1718 | fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
1719 | /**
1720 | * Display or hide the matched elements by animating their opacity.
1721 | *
1722 | * @param options A map of additional options to pass to the method.
1723 | */
1724 | fadeToggle(options: JQueryAnimationOptions): JQuery;
1725 |
1726 | /**
1727 | * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
1728 | *
1729 | * @param queue The name of the queue in which to stop animations.
1730 | */
1731 | finish(queue?: string): JQuery;
1732 |
1733 | /**
1734 | * Hide the matched elements.
1735 | *
1736 | * @param duration A string or number determining how long the animation will run.
1737 | * @param complete A function to call once the animation is complete.
1738 | */
1739 | hide(duration?: number|string, complete?: Function): JQuery;
1740 | /**
1741 | * Hide the matched elements.
1742 | *
1743 | * @param duration A string or number determining how long the animation will run.
1744 | * @param easing A string indicating which easing function to use for the transition.
1745 | * @param complete A function to call once the animation is complete.
1746 | */
1747 | hide(duration?: number|string, easing?: string, complete?: Function): JQuery;
1748 | /**
1749 | * Hide the matched elements.
1750 | *
1751 | * @param options A map of additional options to pass to the method.
1752 | */
1753 | hide(options: JQueryAnimationOptions): JQuery;
1754 |
1755 | /**
1756 | * Display the matched elements.
1757 | *
1758 | * @param duration A string or number determining how long the animation will run.
1759 | * @param complete A function to call once the animation is complete.
1760 | */
1761 | show(duration?: number|string, complete?: Function): JQuery;
1762 | /**
1763 | * Display the matched elements.
1764 | *
1765 | * @param duration A string or number determining how long the animation will run.
1766 | * @param easing A string indicating which easing function to use for the transition.
1767 | * @param complete A function to call once the animation is complete.
1768 | */
1769 | show(duration?: number|string, easing?: string, complete?: Function): JQuery;
1770 | /**
1771 | * Display the matched elements.
1772 | *
1773 | * @param options A map of additional options to pass to the method.
1774 | */
1775 | show(options: JQueryAnimationOptions): JQuery;
1776 |
1777 | /**
1778 | * Display the matched elements with a sliding motion.
1779 | *
1780 | * @param duration A string or number determining how long the animation will run.
1781 | * @param complete A function to call once the animation is complete.
1782 | */
1783 | slideDown(duration?: number|string, complete?: Function): JQuery;
1784 | /**
1785 | * Display the matched elements with a sliding motion.
1786 | *
1787 | * @param duration A string or number determining how long the animation will run.
1788 | * @param easing A string indicating which easing function to use for the transition.
1789 | * @param complete A function to call once the animation is complete.
1790 | */
1791 | slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery;
1792 | /**
1793 | * Display the matched elements with a sliding motion.
1794 | *
1795 | * @param options A map of additional options to pass to the method.
1796 | */
1797 | slideDown(options: JQueryAnimationOptions): JQuery;
1798 |
1799 | /**
1800 | * Display or hide the matched elements with a sliding motion.
1801 | *
1802 | * @param duration A string or number determining how long the animation will run.
1803 | * @param complete A function to call once the animation is complete.
1804 | */
1805 | slideToggle(duration?: number|string, complete?: Function): JQuery;
1806 | /**
1807 | * Display or hide the matched elements with a sliding motion.
1808 | *
1809 | * @param duration A string or number determining how long the animation will run.
1810 | * @param easing A string indicating which easing function to use for the transition.
1811 | * @param complete A function to call once the animation is complete.
1812 | */
1813 | slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
1814 | /**
1815 | * Display or hide the matched elements with a sliding motion.
1816 | *
1817 | * @param options A map of additional options to pass to the method.
1818 | */
1819 | slideToggle(options: JQueryAnimationOptions): JQuery;
1820 |
1821 | /**
1822 | * Hide the matched elements with a sliding motion.
1823 | *
1824 | * @param duration A string or number determining how long the animation will run.
1825 | * @param complete A function to call once the animation is complete.
1826 | */
1827 | slideUp(duration?: number|string, complete?: Function): JQuery;
1828 | /**
1829 | * Hide the matched elements with a sliding motion.
1830 | *
1831 | * @param duration A string or number determining how long the animation will run.
1832 | * @param easing A string indicating which easing function to use for the transition.
1833 | * @param complete A function to call once the animation is complete.
1834 | */
1835 | slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery;
1836 | /**
1837 | * Hide the matched elements with a sliding motion.
1838 | *
1839 | * @param options A map of additional options to pass to the method.
1840 | */
1841 | slideUp(options: JQueryAnimationOptions): JQuery;
1842 |
1843 | /**
1844 | * Stop the currently-running animation on the matched elements.
1845 | *
1846 | * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
1847 | * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
1848 | */
1849 | stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
1850 | /**
1851 | * Stop the currently-running animation on the matched elements.
1852 | *
1853 | * @param queue The name of the queue in which to stop animations.
1854 | * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
1855 | * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
1856 | */
1857 | stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
1858 |
1859 | /**
1860 | * Display or hide the matched elements.
1861 | *
1862 | * @param duration A string or number determining how long the animation will run.
1863 | * @param complete A function to call once the animation is complete.
1864 | */
1865 | toggle(duration?: number|string, complete?: Function): JQuery;
1866 | /**
1867 | * Display or hide the matched elements.
1868 | *
1869 | * @param duration A string or number determining how long the animation will run.
1870 | * @param easing A string indicating which easing function to use for the transition.
1871 | * @param complete A function to call once the animation is complete.
1872 | */
1873 | toggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
1874 | /**
1875 | * Display or hide the matched elements.
1876 | *
1877 | * @param options A map of additional options to pass to the method.
1878 | */
1879 | toggle(options: JQueryAnimationOptions): JQuery;
1880 | /**
1881 | * Display or hide the matched elements.
1882 | *
1883 | * @param showOrHide A Boolean indicating whether to show or hide the elements.
1884 | */
1885 | toggle(showOrHide: boolean): JQuery;
1886 |
1887 | /**
1888 | * Attach a handler to an event for the elements.
1889 | *
1890 | * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
1891 | * @param eventData An object containing data that will be passed to the event handler.
1892 | * @param handler A function to execute each time the event is triggered.
1893 | */
1894 | bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
1895 | /**
1896 | * Attach a handler to an event for the elements.
1897 | *
1898 | * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
1899 | * @param handler A function to execute each time the event is triggered.
1900 | */
1901 | bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
1902 | /**
1903 | * Attach a handler to an event for the elements.
1904 | *
1905 | * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
1906 | * @param eventData An object containing data that will be passed to the event handler.
1907 | * @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.
1908 | */
1909 | bind(eventType: string, eventData: any, preventBubble: boolean): JQuery;
1910 | /**
1911 | * Attach a handler to an event for the elements.
1912 | *
1913 | * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
1914 | * @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.
1915 | */
1916 | bind(eventType: string, preventBubble: boolean): JQuery;
1917 | /**
1918 | * Attach a handler to an event for the elements.
1919 | *
1920 | * @param events An object containing one or more DOM event types and functions to execute for them.
1921 | */
1922 | bind(events: any): JQuery;
1923 |
1924 | /**
1925 | * Trigger the "blur" event on an element
1926 | */
1927 | blur(): JQuery;
1928 | /**
1929 | * Bind an event handler to the "blur" JavaScript event
1930 | *
1931 | * @param handler A function to execute each time the event is triggered.
1932 | */
1933 | blur(handler: (eventObject: JQueryEventObject) => any): JQuery;
1934 | /**
1935 | * Bind an event handler to the "blur" JavaScript event
1936 | *
1937 | * @param eventData An object containing data that will be passed to the event handler.
1938 | * @param handler A function to execute each time the event is triggered.
1939 | */
1940 | blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
1941 |
1942 | /**
1943 | * Trigger the "change" event on an element.
1944 | */
1945 | change(): JQuery;
1946 | /**
1947 | * Bind an event handler to the "change" JavaScript event
1948 | *
1949 | * @param handler A function to execute each time the event is triggered.
1950 | */
1951 | change(handler: (eventObject: JQueryEventObject) => any): JQuery;
1952 | /**
1953 | * Bind an event handler to the "change" JavaScript event
1954 | *
1955 | * @param eventData An object containing data that will be passed to the event handler.
1956 | * @param handler A function to execute each time the event is triggered.
1957 | */
1958 | change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
1959 |
1960 | /**
1961 | * Trigger the "click" event on an element.
1962 | */
1963 | click(): JQuery;
1964 | /**
1965 | * Bind an event handler to the "click" JavaScript event
1966 | *
1967 | * @param eventData An object containing data that will be passed to the event handler.
1968 | */
1969 | click(handler: (eventObject: JQueryEventObject) => any): JQuery;
1970 | /**
1971 | * Bind an event handler to the "click" JavaScript event
1972 | *
1973 | * @param eventData An object containing data that will be passed to the event handler.
1974 | * @param handler A function to execute each time the event is triggered.
1975 | */
1976 | click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
1977 |
1978 | /**
1979 | * Trigger the "dblclick" event on an element.
1980 | */
1981 | dblclick(): JQuery;
1982 | /**
1983 | * Bind an event handler to the "dblclick" JavaScript event
1984 | *
1985 | * @param handler A function to execute each time the event is triggered.
1986 | */
1987 | dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery;
1988 | /**
1989 | * Bind an event handler to the "dblclick" JavaScript event
1990 | *
1991 | * @param eventData An object containing data that will be passed to the event handler.
1992 | * @param handler A function to execute each time the event is triggered.
1993 | */
1994 | dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
1995 |
1996 | delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
1997 | delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
1998 |
1999 | /**
2000 | * Trigger the "focus" event on an element.
2001 | */
2002 | focus(): JQuery;
2003 | /**
2004 | * Bind an event handler to the "focus" JavaScript event
2005 | *
2006 | * @param handler A function to execute each time the event is triggered.
2007 | */
2008 | focus(handler: (eventObject: JQueryEventObject) => any): JQuery;
2009 | /**
2010 | * Bind an event handler to the "focus" JavaScript event
2011 | *
2012 | * @param eventData An object containing data that will be passed to the event handler.
2013 | * @param handler A function to execute each time the event is triggered.
2014 | */
2015 | focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2016 |
2017 | /**
2018 | * Bind an event handler to the "focusin" JavaScript event
2019 | *
2020 | * @param handler A function to execute each time the event is triggered.
2021 | */
2022 | focusin(handler: (eventObject: JQueryEventObject) => any): JQuery;
2023 | /**
2024 | * Bind an event handler to the "focusin" JavaScript event
2025 | *
2026 | * @param eventData An object containing data that will be passed to the event handler.
2027 | * @param handler A function to execute each time the event is triggered.
2028 | */
2029 | focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2030 |
2031 | /**
2032 | * Bind an event handler to the "focusout" JavaScript event
2033 | *
2034 | * @param handler A function to execute each time the event is triggered.
2035 | */
2036 | focusout(handler: (eventObject: JQueryEventObject) => any): JQuery;
2037 | /**
2038 | * Bind an event handler to the "focusout" JavaScript event
2039 | *
2040 | * @param eventData An object containing data that will be passed to the event handler.
2041 | * @param handler A function to execute each time the event is triggered.
2042 | */
2043 | focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2044 |
2045 | /**
2046 | * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
2047 | *
2048 | * @param handlerIn A function to execute when the mouse pointer enters the element.
2049 | * @param handlerOut A function to execute when the mouse pointer leaves the element.
2050 | */
2051 | hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery;
2052 | /**
2053 | * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
2054 | *
2055 | * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element.
2056 | */
2057 | hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;
2058 |
2059 | /**
2060 | * Trigger the "keydown" event on an element.
2061 | */
2062 | keydown(): JQuery;
2063 | /**
2064 | * Bind an event handler to the "keydown" JavaScript event
2065 | *
2066 | * @param handler A function to execute each time the event is triggered.
2067 | */
2068 | keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
2069 | /**
2070 | * Bind an event handler to the "keydown" JavaScript event
2071 | *
2072 | * @param eventData An object containing data that will be passed to the event handler.
2073 | * @param handler A function to execute each time the event is triggered.
2074 | */
2075 | keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
2076 |
2077 | /**
2078 | * Trigger the "keypress" event on an element.
2079 | */
2080 | keypress(): JQuery;
2081 | /**
2082 | * Bind an event handler to the "keypress" JavaScript event
2083 | *
2084 | * @param handler A function to execute each time the event is triggered.
2085 | */
2086 | keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
2087 | /**
2088 | * Bind an event handler to the "keypress" JavaScript event
2089 | *
2090 | * @param eventData An object containing data that will be passed to the event handler.
2091 | * @param handler A function to execute each time the event is triggered.
2092 | */
2093 | keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
2094 |
2095 | /**
2096 | * Trigger the "keyup" event on an element.
2097 | */
2098 | keyup(): JQuery;
2099 | /**
2100 | * Bind an event handler to the "keyup" JavaScript event
2101 | *
2102 | * @param handler A function to execute each time the event is triggered.
2103 | */
2104 | keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
2105 | /**
2106 | * Bind an event handler to the "keyup" JavaScript event
2107 | *
2108 | * @param eventData An object containing data that will be passed to the event handler.
2109 | * @param handler A function to execute each time the event is triggered.
2110 | */
2111 | keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
2112 |
2113 | /**
2114 | * Bind an event handler to the "load" JavaScript event.
2115 | *
2116 | * @param handler A function to execute when the event is triggered.
2117 | */
2118 | load(handler: (eventObject: JQueryEventObject) => any): JQuery;
2119 | /**
2120 | * Bind an event handler to the "load" JavaScript event.
2121 | *
2122 | * @param eventData An object containing data that will be passed to the event handler.
2123 | * @param handler A function to execute when the event is triggered.
2124 | */
2125 | load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2126 |
2127 | /**
2128 | * Trigger the "mousedown" event on an element.
2129 | */
2130 | mousedown(): JQuery;
2131 | /**
2132 | * Bind an event handler to the "mousedown" JavaScript event.
2133 | *
2134 | * @param handler A function to execute when the event is triggered.
2135 | */
2136 | mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2137 | /**
2138 | * Bind an event handler to the "mousedown" JavaScript event.
2139 | *
2140 | * @param eventData An object containing data that will be passed to the event handler.
2141 | * @param handler A function to execute when the event is triggered.
2142 | */
2143 | mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2144 |
2145 | /**
2146 | * Trigger the "mouseenter" event on an element.
2147 | */
2148 | mouseenter(): JQuery;
2149 | /**
2150 | * Bind an event handler to be fired when the mouse enters an element.
2151 | *
2152 | * @param handler A function to execute when the event is triggered.
2153 | */
2154 | mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2155 | /**
2156 | * Bind an event handler to be fired when the mouse enters an element.
2157 | *
2158 | * @param eventData An object containing data that will be passed to the event handler.
2159 | * @param handler A function to execute when the event is triggered.
2160 | */
2161 | mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2162 |
2163 | /**
2164 | * Trigger the "mouseleave" event on an element.
2165 | */
2166 | mouseleave(): JQuery;
2167 | /**
2168 | * Bind an event handler to be fired when the mouse leaves an element.
2169 | *
2170 | * @param handler A function to execute when the event is triggered.
2171 | */
2172 | mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2173 | /**
2174 | * Bind an event handler to be fired when the mouse leaves an element.
2175 | *
2176 | * @param eventData An object containing data that will be passed to the event handler.
2177 | * @param handler A function to execute when the event is triggered.
2178 | */
2179 | mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2180 |
2181 | /**
2182 | * Trigger the "mousemove" event on an element.
2183 | */
2184 | mousemove(): JQuery;
2185 | /**
2186 | * Bind an event handler to the "mousemove" JavaScript event.
2187 | *
2188 | * @param handler A function to execute when the event is triggered.
2189 | */
2190 | mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2191 | /**
2192 | * Bind an event handler to the "mousemove" JavaScript event.
2193 | *
2194 | * @param eventData An object containing data that will be passed to the event handler.
2195 | * @param handler A function to execute when the event is triggered.
2196 | */
2197 | mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2198 |
2199 | /**
2200 | * Trigger the "mouseout" event on an element.
2201 | */
2202 | mouseout(): JQuery;
2203 | /**
2204 | * Bind an event handler to the "mouseout" JavaScript event.
2205 | *
2206 | * @param handler A function to execute when the event is triggered.
2207 | */
2208 | mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2209 | /**
2210 | * Bind an event handler to the "mouseout" JavaScript event.
2211 | *
2212 | * @param eventData An object containing data that will be passed to the event handler.
2213 | * @param handler A function to execute when the event is triggered.
2214 | */
2215 | mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2216 |
2217 | /**
2218 | * Trigger the "mouseover" event on an element.
2219 | */
2220 | mouseover(): JQuery;
2221 | /**
2222 | * Bind an event handler to the "mouseover" JavaScript event.
2223 | *
2224 | * @param handler A function to execute when the event is triggered.
2225 | */
2226 | mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2227 | /**
2228 | * Bind an event handler to the "mouseover" JavaScript event.
2229 | *
2230 | * @param eventData An object containing data that will be passed to the event handler.
2231 | * @param handler A function to execute when the event is triggered.
2232 | */
2233 | mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2234 |
2235 | /**
2236 | * Trigger the "mouseup" event on an element.
2237 | */
2238 | mouseup(): JQuery;
2239 | /**
2240 | * Bind an event handler to the "mouseup" JavaScript event.
2241 | *
2242 | * @param handler A function to execute when the event is triggered.
2243 | */
2244 | mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2245 | /**
2246 | * Bind an event handler to the "mouseup" JavaScript event.
2247 | *
2248 | * @param eventData An object containing data that will be passed to the event handler.
2249 | * @param handler A function to execute when the event is triggered.
2250 | */
2251 | mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2252 |
2253 | /**
2254 | * Remove an event handler.
2255 | */
2256 | off(): JQuery;
2257 | /**
2258 | * Remove an event handler.
2259 | *
2260 | * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
2261 | * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
2262 | * @param handler A handler function previously attached for the event(s), or the special value false.
2263 | */
2264 | off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2265 | /**
2266 | * Remove an event handler.
2267 | *
2268 | * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
2269 | * @param handler A handler function previously attached for the event(s), or the special value false.
2270 | */
2271 | off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2272 | /**
2273 | * Remove an event handler.
2274 | *
2275 | * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s).
2276 | * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
2277 | */
2278 | off(events: { [key: string]: any; }, selector?: string): JQuery;
2279 |
2280 | /**
2281 | * Attach an event handler function for one or more events to the selected elements.
2282 | *
2283 | * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2284 | * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax).
2285 | */
2286 | on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
2287 | /**
2288 | * Attach an event handler function for one or more events to the selected elements.
2289 | *
2290 | * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2291 | * @param data Data to be passed to the handler in event.data when an event is triggered.
2292 | * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
2293 | */
2294 | on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
2295 | /**
2296 | * Attach an event handler function for one or more events to the selected elements.
2297 | *
2298 | * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2299 | * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
2300 | * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
2301 | */
2302 | on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
2303 | /**
2304 | * Attach an event handler function for one or more events to the selected elements.
2305 | *
2306 | * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2307 | * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
2308 | * @param data Data to be passed to the handler in event.data when an event is triggered.
2309 | * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
2310 | */
2311 | on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
2312 | /**
2313 | * Attach an event handler function for one or more events to the selected elements.
2314 | *
2315 | * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
2316 | * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
2317 | * @param data Data to be passed to the handler in event.data when an event occurs.
2318 | */
2319 | on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
2320 | /**
2321 | * Attach an event handler function for one or more events to the selected elements.
2322 | *
2323 | * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
2324 | * @param data Data to be passed to the handler in event.data when an event occurs.
2325 | */
2326 | on(events: { [key: string]: any; }, data?: any): JQuery;
2327 |
2328 | /**
2329 | * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2330 | *
2331 | * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
2332 | * @param handler A function to execute at the time the event is triggered.
2333 | */
2334 | one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2335 | /**
2336 | * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2337 | *
2338 | * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
2339 | * @param data An object containing data that will be passed to the event handler.
2340 | * @param handler A function to execute at the time the event is triggered.
2341 | */
2342 | one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2343 |
2344 | /**
2345 | * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2346 | *
2347 | * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2348 | * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
2349 | * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
2350 | */
2351 | one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2352 | /**
2353 | * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2354 | *
2355 | * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2356 | * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
2357 | * @param data Data to be passed to the handler in event.data when an event is triggered.
2358 | * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
2359 | */
2360 | one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
2361 |
2362 | /**
2363 | * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2364 | *
2365 | * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
2366 | * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
2367 | * @param data Data to be passed to the handler in event.data when an event occurs.
2368 | */
2369 | one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
2370 |
2371 | /**
2372 | * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2373 | *
2374 | * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
2375 | * @param data Data to be passed to the handler in event.data when an event occurs.
2376 | */
2377 | one(events: { [key: string]: any; }, data?: any): JQuery;
2378 |
2379 |
2380 | /**
2381 | * Specify a function to execute when the DOM is fully loaded.
2382 | *
2383 | * @param handler A function to execute after the DOM is ready.
2384 | */
2385 | ready(handler: Function): JQuery;
2386 |
2387 | /**
2388 | * Trigger the "resize" event on an element.
2389 | */
2390 | resize(): JQuery;
2391 | /**
2392 | * Bind an event handler to the "resize" JavaScript event.
2393 | *
2394 | * @param handler A function to execute each time the event is triggered.
2395 | */
2396 | resize(handler: (eventObject: JQueryEventObject) => any): JQuery;
2397 | /**
2398 | * Bind an event handler to the "resize" JavaScript event.
2399 | *
2400 | * @param eventData An object containing data that will be passed to the event handler.
2401 | * @param handler A function to execute each time the event is triggered.
2402 | */
2403 | resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2404 |
2405 | /**
2406 | * Trigger the "scroll" event on an element.
2407 | */
2408 | scroll(): JQuery;
2409 | /**
2410 | * Bind an event handler to the "scroll" JavaScript event.
2411 | *
2412 | * @param handler A function to execute each time the event is triggered.
2413 | */
2414 | scroll(handler: (eventObject: JQueryEventObject) => any): JQuery;
2415 | /**
2416 | * Bind an event handler to the "scroll" JavaScript event.
2417 | *
2418 | * @param eventData An object containing data that will be passed to the event handler.
2419 | * @param handler A function to execute each time the event is triggered.
2420 | */
2421 | scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2422 |
2423 | /**
2424 | * Trigger the "select" event on an element.
2425 | */
2426 | select(): JQuery;
2427 | /**
2428 | * Bind an event handler to the "select" JavaScript event.
2429 | *
2430 | * @param handler A function to execute each time the event is triggered.
2431 | */
2432 | select(handler: (eventObject: JQueryEventObject) => any): JQuery;
2433 | /**
2434 | * Bind an event handler to the "select" JavaScript event.
2435 | *
2436 | * @param eventData An object containing data that will be passed to the event handler.
2437 | * @param handler A function to execute each time the event is triggered.
2438 | */
2439 | select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2440 |
2441 | /**
2442 | * Trigger the "submit" event on an element.
2443 | */
2444 | submit(): JQuery;
2445 | /**
2446 | * Bind an event handler to the "submit" JavaScript event
2447 | *
2448 | * @param handler A function to execute each time the event is triggered.
2449 | */
2450 | submit(handler: (eventObject: JQueryEventObject) => any): JQuery;
2451 | /**
2452 | * Bind an event handler to the "submit" JavaScript event
2453 | *
2454 | * @param eventData An object containing data that will be passed to the event handler.
2455 | * @param handler A function to execute each time the event is triggered.
2456 | */
2457 | submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2458 |
2459 | /**
2460 | * Execute all handlers and behaviors attached to the matched elements for the given event type.
2461 | *
2462 | * @param eventType A string containing a JavaScript event type, such as click or submit.
2463 | * @param extraParameters Additional parameters to pass along to the event handler.
2464 | */
2465 | trigger(eventType: string, extraParameters?: any[]|Object): JQuery;
2466 | /**
2467 | * Execute all handlers and behaviors attached to the matched elements for the given event type.
2468 | *
2469 | * @param event A jQuery.Event object.
2470 | * @param extraParameters Additional parameters to pass along to the event handler.
2471 | */
2472 | trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery;
2473 |
2474 | /**
2475 | * Execute all handlers attached to an element for an event.
2476 | *
2477 | * @param eventType A string containing a JavaScript event type, such as click or submit.
2478 | * @param extraParameters An array of additional parameters to pass along to the event handler.
2479 | */
2480 | triggerHandler(eventType: string, ...extraParameters: any[]): Object;
2481 |
2482 | /**
2483 | * Remove a previously-attached event handler from the elements.
2484 | *
2485 | * @param eventType A string containing a JavaScript event type, such as click or submit.
2486 | * @param handler The function that is to be no longer executed.
2487 | */
2488 | unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2489 | /**
2490 | * Remove a previously-attached event handler from the elements.
2491 | *
2492 | * @param eventType A string containing a JavaScript event type, such as click or submit.
2493 | * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
2494 | */
2495 | unbind(eventType: string, fls: boolean): JQuery;
2496 | /**
2497 | * Remove a previously-attached event handler from the elements.
2498 | *
2499 | * @param evt A JavaScript event object as passed to an event handler.
2500 | */
2501 | unbind(evt: any): JQuery;
2502 |
2503 | /**
2504 | * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2505 | */
2506 | undelegate(): JQuery;
2507 | /**
2508 | * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2509 | *
2510 | * @param selector A selector which will be used to filter the event results.
2511 | * @param eventType A string containing a JavaScript event type, such as "click" or "keydown"
2512 | * @param handler A function to execute at the time the event is triggered.
2513 | */
2514 | undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2515 | /**
2516 | * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2517 | *
2518 | * @param selector A selector which will be used to filter the event results.
2519 | * @param events An object of one or more event types and previously bound functions to unbind from them.
2520 | */
2521 | undelegate(selector: string, events: Object): JQuery;
2522 | /**
2523 | * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2524 | *
2525 | * @param namespace A string containing a namespace to unbind all events from.
2526 | */
2527 | undelegate(namespace: string): JQuery;
2528 |
2529 | /**
2530 | * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
2531 | *
2532 | * @param handler A function to execute when the event is triggered.
2533 | */
2534 | unload(handler: (eventObject: JQueryEventObject) => any): JQuery;
2535 | /**
2536 | * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
2537 | *
2538 | * @param eventData A plain object of data that will be passed to the event handler.
2539 | * @param handler A function to execute when the event is triggered.
2540 | */
2541 | unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2542 |
2543 | /**
2544 | * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10)
2545 | */
2546 | context: Element;
2547 |
2548 | jquery: string;
2549 |
2550 | /**
2551 | * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
2552 | *
2553 | * @param handler A function to execute when the event is triggered.
2554 | */
2555 | error(handler: (eventObject: JQueryEventObject) => any): JQuery;
2556 | /**
2557 | * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
2558 | *
2559 | * @param eventData A plain object of data that will be passed to the event handler.
2560 | * @param handler A function to execute when the event is triggered.
2561 | */
2562 | error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
2563 |
2564 | /**
2565 | * Add a collection of DOM elements onto the jQuery stack.
2566 | *
2567 | * @param elements An array of elements to push onto the stack and make into a new jQuery object.
2568 | */
2569 | pushStack(elements: any[]): JQuery;
2570 | /**
2571 | * Add a collection of DOM elements onto the jQuery stack.
2572 | *
2573 | * @param elements An array of elements to push onto the stack and make into a new jQuery object.
2574 | * @param name The name of a jQuery method that generated the array of elements.
2575 | * @param arguments The arguments that were passed in to the jQuery method (for serialization).
2576 | */
2577 | pushStack(elements: any[], name: string, arguments: any[]): JQuery;
2578 |
2579 | /**
2580 | * Insert content, specified by the parameter, after each element in the set of matched elements.
2581 | *
2582 | * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
2583 | * 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.
2584 | */
2585 | after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
2586 | /**
2587 | * Insert content, specified by the parameter, after each element in the set of matched elements.
2588 | *
2589 | * 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.
2590 | */
2591 | after(func: (index: number) => any): JQuery;
2592 |
2593 | /**
2594 | * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
2595 | *
2596 | * 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.
2597 | * 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.
2598 | */
2599 | append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
2600 | /**
2601 | * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
2602 | *
2603 | * 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.
2604 | */
2605 | append(func: (index: number, html: string) => any): JQuery;
2606 |
2607 | /**
2608 | * Insert every element in the set of matched elements to the end of the target.
2609 | *
2610 | * @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.
2611 | */
2612 | appendTo(target: JQuery|any[]|Element|string): JQuery;
2613 |
2614 | /**
2615 | * Insert content, specified by the parameter, before each element in the set of matched elements.
2616 | *
2617 | * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
2618 | * 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.
2619 | */
2620 | before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
2621 | /**
2622 | * Insert content, specified by the parameter, before each element in the set of matched elements.
2623 | *
2624 | * 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.
2625 | */
2626 | before(func: (index: number) => any): JQuery;
2627 |
2628 | /**
2629 | * Create a deep copy of the set of matched elements.
2630 | *
2631 | * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
2632 | * 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).
2633 | */
2634 | clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery;
2635 |
2636 | /**
2637 | * Remove the set of matched elements from the DOM.
2638 | *
2639 | * param selector A selector expression that filters the set of matched elements to be removed.
2640 | */
2641 | detach(selector?: string): JQuery;
2642 |
2643 | /**
2644 | * Remove all child nodes of the set of matched elements from the DOM.
2645 | */
2646 | empty(): JQuery;
2647 |
2648 | /**
2649 | * Insert every element in the set of matched elements after the target.
2650 | *
2651 | * 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.
2652 | */
2653 | insertAfter(target: JQuery|any[]|Element|Text|string): JQuery;
2654 |
2655 | /**
2656 | * Insert every element in the set of matched elements before the target.
2657 | *
2658 | * 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.
2659 | */
2660 | insertBefore(target: JQuery|any[]|Element|Text|string): JQuery;
2661 |
2662 | /**
2663 | * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
2664 | *
2665 | * 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.
2666 | * 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.
2667 | */
2668 | prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
2669 | /**
2670 | * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
2671 | *
2672 | * 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.
2673 | */
2674 | prepend(func: (index: number, html: string) => any): JQuery;
2675 |
2676 | /**
2677 | * Insert every element in the set of matched elements to the beginning of the target.
2678 | *
2679 | * @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.
2680 | */
2681 | prependTo(target: JQuery|any[]|Element|string): JQuery;
2682 |
2683 | /**
2684 | * Remove the set of matched elements from the DOM.
2685 | *
2686 | * @param selector A selector expression that filters the set of matched elements to be removed.
2687 | */
2688 | remove(selector?: string): JQuery;
2689 |
2690 | /**
2691 | * Replace each target element with the set of matched elements.
2692 | *
2693 | * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
2694 | */
2695 | replaceAll(target: JQuery|any[]|Element|string): JQuery;
2696 |
2697 | /**
2698 | * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
2699 | *
2700 | * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
2701 | */
2702 | replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery;
2703 | /**
2704 | * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
2705 | *
2706 | * param func A function that returns content with which to replace the set of matched elements.
2707 | */
2708 | replaceWith(func: () => any): JQuery;
2709 |
2710 | /**
2711 | * Get the combined text contents of each element in the set of matched elements, including their descendants.
2712 | */
2713 | text(): string;
2714 | /**
2715 | * Set the content of each element in the set of matched elements to the specified text.
2716 | *
2717 | * @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.
2718 | */
2719 | text(text: string|number|boolean): JQuery;
2720 | /**
2721 | * Set the content of each element in the set of matched elements to the specified text.
2722 | *
2723 | * @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.
2724 | */
2725 | text(func: (index: number, text: string) => string): JQuery;
2726 |
2727 | /**
2728 | * Retrieve all the elements contained in the jQuery set, as an array.
2729 | */
2730 | toArray(): any[];
2731 |
2732 | /**
2733 | * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
2734 | */
2735 | unwrap(): JQuery;
2736 |
2737 | /**
2738 | * Wrap an HTML structure around each element in the set of matched elements.
2739 | *
2740 | * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
2741 | */
2742 | wrap(wrappingElement: JQuery|Element|string): JQuery;
2743 | /**
2744 | * Wrap an HTML structure around each element in the set of matched elements.
2745 | *
2746 | * @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.
2747 | */
2748 | wrap(func: (index: number) => any): JQuery;
2749 |
2750 | /**
2751 | * Wrap an HTML structure around all elements in the set of matched elements.
2752 | *
2753 | * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
2754 | */
2755 | wrapAll(wrappingElement: JQuery|Element|string): JQuery;
2756 |
2757 | /**
2758 | * Wrap an HTML structure around the content of each element in the set of matched elements.
2759 | *
2760 | * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
2761 | */
2762 | wrapInner(wrappingElement: JQuery|Element|string): JQuery;
2763 | /**
2764 | * Wrap an HTML structure around the content of each element in the set of matched elements.
2765 | *
2766 | * @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.
2767 | */
2768 | wrapInner(func: (index: number) => any): JQuery;
2769 |
2770 | /**
2771 | * Iterate over a jQuery object, executing a function for each matched element.
2772 | *
2773 | * @param func A function to execute for each matched element.
2774 | */
2775 | each(func: (index: number, elem: Element) => any): JQuery;
2776 |
2777 | /**
2778 | * Retrieve one of the elements matched by the jQuery object.
2779 | *
2780 | * @param index A zero-based integer indicating which element to retrieve.
2781 | */
2782 | get(index: number): HTMLElement;
2783 | /**
2784 | * Retrieve the elements matched by the jQuery object.
2785 | */
2786 | get(): any[];
2787 |
2788 | /**
2789 | * Search for a given element from among the matched elements.
2790 | */
2791 | index(): number;
2792 | /**
2793 | * Search for a given element from among the matched elements.
2794 | *
2795 | * @param selector A selector representing a jQuery collection in which to look for an element.
2796 | */
2797 | index(selector: string|JQuery|Element): number;
2798 |
2799 | /**
2800 | * The number of elements in the jQuery object.
2801 | */
2802 | length: number;
2803 | /**
2804 | * A selector representing selector passed to jQuery(), if any, when creating the original set.
2805 | * version deprecated: 1.7, removed: 1.9
2806 | */
2807 | selector: string;
2808 | [index: string]: any;
2809 | [index: number]: HTMLElement;
2810 |
2811 | /**
2812 | * Add elements to the set of matched elements.
2813 | *
2814 | * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements.
2815 | * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
2816 | */
2817 | add(selector: string, context?: Element): JQuery;
2818 | /**
2819 | * Add elements to the set of matched elements.
2820 | *
2821 | * @param elements One or more elements to add to the set of matched elements.
2822 | */
2823 | add(...elements: Element[]): JQuery;
2824 | /**
2825 | * Add elements to the set of matched elements.
2826 | *
2827 | * @param html An HTML fragment to add to the set of matched elements.
2828 | */
2829 | add(html: string): JQuery;
2830 | /**
2831 | * Add elements to the set of matched elements.
2832 | *
2833 | * @param obj An existing jQuery object to add to the set of matched elements.
2834 | */
2835 | add(obj: JQuery): JQuery;
2836 |
2837 | /**
2838 | * Get the children of each element in the set of matched elements, optionally filtered by a selector.
2839 | *
2840 | * @param selector A string containing a selector expression to match elements against.
2841 | */
2842 | children(selector?: string): JQuery;
2843 |
2844 | /**
2845 | * 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.
2846 | *
2847 | * @param selector A string containing a selector expression to match elements against.
2848 | */
2849 | closest(selector: string): JQuery;
2850 | /**
2851 | * 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.
2852 | *
2853 | * @param selector A string containing a selector expression to match elements against.
2854 | * @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.
2855 | */
2856 | closest(selector: string, context?: Element): JQuery;
2857 | /**
2858 | * 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.
2859 | *
2860 | * @param obj A jQuery object to match elements against.
2861 | */
2862 | closest(obj: JQuery): JQuery;
2863 | /**
2864 | * 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.
2865 | *
2866 | * @param element An element to match elements against.
2867 | */
2868 | closest(element: Element): JQuery;
2869 |
2870 | /**
2871 | * Get an array of all the elements and selectors matched against the current element up through the DOM tree.
2872 | *
2873 | * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object).
2874 | * @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.
2875 | */
2876 | closest(selectors: any, context?: Element): any[];
2877 |
2878 | /**
2879 | * Get the children of each element in the set of matched elements, including text and comment nodes.
2880 | */
2881 | contents(): JQuery;
2882 |
2883 | /**
2884 | * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
2885 | */
2886 | end(): JQuery;
2887 |
2888 | /**
2889 | * Reduce the set of matched elements to the one at the specified index.
2890 | *
2891 | * @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.
2892 | *
2893 | */
2894 | eq(index: number): JQuery;
2895 |
2896 | /**
2897 | * Reduce the set of matched elements to those that match the selector or pass the function's test.
2898 | *
2899 | * @param selector A string containing a selector expression to match the current set of elements against.
2900 | */
2901 | filter(selector: string): JQuery;
2902 | /**
2903 | * Reduce the set of matched elements to those that match the selector or pass the function's test.
2904 | *
2905 | * @param func A function used as a test for each element in the set. this is the current DOM element.
2906 | */
2907 | filter(func: (index: number, element: Element) => any): JQuery;
2908 | /**
2909 | * Reduce the set of matched elements to those that match the selector or pass the function's test.
2910 | *
2911 | * @param element An element to match the current set of elements against.
2912 | */
2913 | filter(element: Element): JQuery;
2914 | /**
2915 | * Reduce the set of matched elements to those that match the selector or pass the function's test.
2916 | *
2917 | * @param obj An existing jQuery object to match the current set of elements against.
2918 | */
2919 | filter(obj: JQuery): JQuery;
2920 |
2921 | /**
2922 | * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
2923 | *
2924 | * @param selector A string containing a selector expression to match elements against.
2925 | */
2926 | find(selector: string): JQuery;
2927 | /**
2928 | * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
2929 | *
2930 | * @param element An element to match elements against.
2931 | */
2932 | find(element: Element): JQuery;
2933 | /**
2934 | * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
2935 | *
2936 | * @param obj A jQuery object to match elements against.
2937 | */
2938 | find(obj: JQuery): JQuery;
2939 |
2940 | /**
2941 | * Reduce the set of matched elements to the first in the set.
2942 | */
2943 | first(): JQuery;
2944 |
2945 | /**
2946 | * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
2947 | *
2948 | * @param selector A string containing a selector expression to match elements against.
2949 | */
2950 | has(selector: string): JQuery;
2951 | /**
2952 | * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
2953 | *
2954 | * @param contained A DOM element to match elements against.
2955 | */
2956 | has(contained: Element): JQuery;
2957 |
2958 | /**
2959 | * 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.
2960 | *
2961 | * @param selector A string containing a selector expression to match elements against.
2962 | */
2963 | is(selector: string): boolean;
2964 | /**
2965 | * 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.
2966 | *
2967 | * @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.
2968 | */
2969 | is(func: (index: number) => any): boolean;
2970 | /**
2971 | * 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.
2972 | *
2973 | * @param obj An existing jQuery object to match the current set of elements against.
2974 | */
2975 | is(obj: JQuery): boolean;
2976 | /**
2977 | * 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.
2978 | *
2979 | * @param elements One or more elements to match the current set of elements against.
2980 | */
2981 | is(elements: any): boolean;
2982 |
2983 | /**
2984 | * Reduce the set of matched elements to the final one in the set.
2985 | */
2986 | last(): JQuery;
2987 |
2988 | /**
2989 | * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
2990 | *
2991 | * @param callback A function object that will be invoked for each element in the current set.
2992 | */
2993 | map(callback: (index: number, domElement: Element) => any): JQuery;
2994 |
2995 | /**
2996 | * 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.
2997 | *
2998 | * @param selector A string containing a selector expression to match elements against.
2999 | */
3000 | next(selector?: string): JQuery;
3001 |
3002 | /**
3003 | * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
3004 | *
3005 | * @param selector A string containing a selector expression to match elements against.
3006 | */
3007 | nextAll(selector?: string): JQuery;
3008 |
3009 | /**
3010 | * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
3011 | *
3012 | * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements.
3013 | * @param filter A string containing a selector expression to match elements against.
3014 | */
3015 | nextUntil(selector?: string, filter?: string): JQuery;
3016 | /**
3017 | * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
3018 | *
3019 | * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements.
3020 | * @param filter A string containing a selector expression to match elements against.
3021 | */
3022 | nextUntil(element?: Element, filter?: string): JQuery;
3023 | /**
3024 | * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
3025 | *
3026 | * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements.
3027 | * @param filter A string containing a selector expression to match elements against.
3028 | */
3029 | nextUntil(obj?: JQuery, filter?: string): JQuery;
3030 |
3031 | /**
3032 | * Remove elements from the set of matched elements.
3033 | *
3034 | * @param selector A string containing a selector expression to match elements against.
3035 | */
3036 | not(selector: string): JQuery;
3037 | /**
3038 | * Remove elements from the set of matched elements.
3039 | *
3040 | * @param func A function used as a test for each element in the set. this is the current DOM element.
3041 | */
3042 | not(func: (index: number) => any): JQuery;
3043 | /**
3044 | * Remove elements from the set of matched elements.
3045 | *
3046 | * @param elements One or more DOM elements to remove from the matched set.
3047 | */
3048 | not(...elements: Element[]): JQuery;
3049 | /**
3050 | * Remove elements from the set of matched elements.
3051 | *
3052 | * @param obj An existing jQuery object to match the current set of elements against.
3053 | */
3054 | not(obj: JQuery): JQuery;
3055 |
3056 | /**
3057 | * Get the closest ancestor element that is positioned.
3058 | */
3059 | offsetParent(): JQuery;
3060 |
3061 | /**
3062 | * Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
3063 | *
3064 | * @param selector A string containing a selector expression to match elements against.
3065 | */
3066 | parent(selector?: string): JQuery;
3067 |
3068 | /**
3069 | * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
3070 | *
3071 | * @param selector A string containing a selector expression to match elements against.
3072 | */
3073 | parents(selector?: string): JQuery;
3074 |
3075 | /**
3076 | * 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.
3077 | *
3078 | * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements.
3079 | * @param filter A string containing a selector expression to match elements against.
3080 | */
3081 | parentsUntil(selector?: string, filter?: string): JQuery;
3082 | /**
3083 | * 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.
3084 | *
3085 | * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements.
3086 | * @param filter A string containing a selector expression to match elements against.
3087 | */
3088 | parentsUntil(element?: Element, filter?: string): JQuery;
3089 | /**
3090 | * 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.
3091 | *
3092 | * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements.
3093 | * @param filter A string containing a selector expression to match elements against.
3094 | */
3095 | parentsUntil(obj?: JQuery, filter?: string): JQuery;
3096 |
3097 | /**
3098 | * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
3099 | *
3100 | * @param selector A string containing a selector expression to match elements against.
3101 | */
3102 | prev(selector?: string): JQuery;
3103 |
3104 | /**
3105 | * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
3106 | *
3107 | * @param selector A string containing a selector expression to match elements against.
3108 | */
3109 | prevAll(selector?: string): JQuery;
3110 |
3111 | /**
3112 | * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
3113 | *
3114 | * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements.
3115 | * @param filter A string containing a selector expression to match elements against.
3116 | */
3117 | prevUntil(selector?: string, filter?: string): JQuery;
3118 | /**
3119 | * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
3120 | *
3121 | * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
3122 | * @param filter A string containing a selector expression to match elements against.
3123 | */
3124 | prevUntil(element?: Element, filter?: string): JQuery;
3125 | /**
3126 | * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
3127 | *
3128 | * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
3129 | * @param filter A string containing a selector expression to match elements against.
3130 | */
3131 | prevUntil(obj?: JQuery, filter?: string): JQuery;
3132 |
3133 | /**
3134 | * Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
3135 | *
3136 | * @param selector A string containing a selector expression to match elements against.
3137 | */
3138 | siblings(selector?: string): JQuery;
3139 |
3140 | /**
3141 | * Reduce the set of matched elements to a subset specified by a range of indices.
3142 | *
3143 | * @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.
3144 | * @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.
3145 | */
3146 | slice(start: number, end?: number): JQuery;
3147 |
3148 | /**
3149 | * Show the queue of functions to be executed on the matched elements.
3150 | *
3151 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
3152 | */
3153 | queue(queueName?: string): any[];
3154 | /**
3155 | * Manipulate the queue of functions to be executed, once for each matched element.
3156 | *
3157 | * @param newQueue An array of functions to replace the current queue contents.
3158 | */
3159 | queue(newQueue: Function[]): JQuery;
3160 | /**
3161 | * Manipulate the queue of functions to be executed, once for each matched element.
3162 | *
3163 | * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
3164 | */
3165 | queue(callback: Function): JQuery;
3166 | /**
3167 | * Manipulate the queue of functions to be executed, once for each matched element.
3168 | *
3169 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
3170 | * @param newQueue An array of functions to replace the current queue contents.
3171 | */
3172 | queue(queueName: string, newQueue: Function[]): JQuery;
3173 | /**
3174 | * Manipulate the queue of functions to be executed, once for each matched element.
3175 | *
3176 | * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
3177 | * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
3178 | */
3179 | queue(queueName: string, callback: Function): JQuery;
3180 | }
3181 | declare module "jquery" {
3182 | export = $;
3183 | }
3184 | declare var jQuery: JQueryStatic;
3185 | declare var $: JQueryStatic;
3186 |
--------------------------------------------------------------------------------