UNPKG

jsdk-offical

Version:

JSDK is the most comprehensive TypeScript framework, like JDK.

1,097 lines (1,089 loc) 379 kB
// Type definitions for jquery 3.3 // Project: https://jquery.com // Definitions by: Leonard Thieu <https://github.com/leonard-thieu> // Boris Yankov <https://github.com/borisyankov> // Christian Hoffmeister <https://github.com/choffmeister> // Steve Fenton <https://github.com/Steve-Fenton> // Diullei Gomes <https://github.com/Diullei> // Tass Iliopoulos <https://github.com/tasoili> // Jason Swearingen <https://github.com/jasons-novaleaf> // Sean Hill <https://github.com/seanski> // Guus Goossens <https://github.com/Guuz> // Kelly Summerlin <https://github.com/ksummerlin> // Basarat Ali Syed <https://github.com/basarat> // Nicholas Wolverson <https://github.com/nwolverson> // Derek Cicerone <https://github.com/derekcicerone> // Andrew Gaspar <https://github.com/AndrewGaspar> // Seikichi Kondo <https://github.com/seikichi> // Benjamin Jackman <https://github.com/benjaminjackman> // Poul Sorensen <https://github.com/s093294> // Josh Strobl <https://github.com/JoshStrobl> // John Reilly <https://github.com/johnnyreilly> // Dick van den Brink <https://github.com/DickvdBrink> // Thomas Schulz <https://github.com/King2500> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 declare module 'jquery' { export = jQuery; } declare module 'jquery/dist/jquery.slim' { export = jQuery; } declare const jQuery: JQueryStatic; declare const $: JQueryStatic; // Used by JQuery.Event type _Event = Event; // Used by JQuery.Promise3 and JQuery.Promise type _Promise<T> = Promise<T>; interface JQueryStatic<TElement extends Node = HTMLElement> { /** * @see {@link http://api.jquery.com/jquery.ajax/#jQuery-ajax1} * @deprecated Use jQuery.ajaxSetup(options) */ ajaxSettings: JQuery.AjaxSettings; /** * A factory 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. * * @param beforeStart A function that is called just before the constructor returns. * @see {@link https://api.jquery.com/jQuery.Deferred/} * @since 1.5 */ Deferred: JQuery.DeferredStatic; Event: JQuery.EventStatic<TElement>; /** * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize * CSS property naming, or create custom properties. * * @see {@link https://api.jquery.com/jQuery.cssHooks/} * @since 1.4.3 */ cssHooks: JQuery.PlainObject<JQuery.CSSHook<TElement>>; /** * An object containing all CSS properties that may be used without a unit. The .css() method uses this * object to see if it may append px to unitless values. * * @see {@link https://api.jquery.com/jQuery.cssNumber/} * @since 1.4.3 */ cssNumber: JQuery.PlainObject<boolean>; readonly fn: JQuery<TElement>; fx: { /** * The rate (in milliseconds) at which animations fire. * * @see {@link https://api.jquery.com/jQuery.fx.interval/} * @since 1.4.3 * @deprecated 3.0 */ interval: number; /** * Globally disable all animations. * * @see {@link https://api.jquery.com/jQuery.fx.off/} * @since 1.3 */ off: boolean; step: JQuery.PlainObject<JQuery.AnimationHook<Node>>; }; /** * A Promise-like object (or "thenable") that resolves when the document is ready. * * @see {@link https://api.jquery.com/jQuery.ready/} * @since 1.8 */ ready: JQuery.Thenable<JQueryStatic<TElement>>; /** * A collection of properties that represent the presence of different browser features or bugs. * Intended for jQuery's internal use; specific properties may be removed when they are no longer * needed internally to improve page startup performance. For your own project's feature-detection * needs, we strongly recommend the use of an external library such as Modernizr instead of dependency * on properties in jQuery.support. * * @see {@link https://api.jquery.com/jQuery.support/} * @since 1.3 * @deprecated 1.9 */ support: JQuery.PlainObject; valHooks: JQuery.PlainObject<JQuery.ValHook<TElement>>; /** * Creates DOM elements on the fly from the provided string of raw HTML. * * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. * A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>). * @param ownerDocument_attributes A document in which the new elements will be created. * An object of attributes, events, and methods to call on the newly-created element. * @see {@link https://api.jquery.com/jQuery/} * @since 1.0 * @since 1.4 */ (html: JQuery.htmlString, ownerDocument_attributes: Document | JQuery.PlainObject): JQuery<TElement>; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param selector A string containing a selector expression * @param context A DOM Element, Document, or jQuery to use as context * @see {@link https://api.jquery.com/jQuery/} * @since 1.0 */ (selector: JQuery.Selector, context: Element | Document | JQuery | undefined): JQuery<TElement>; // HACK: This is the factory function returned when importing jQuery without a DOM. Declaring it separately breaks using the type parameter on JQueryStatic. // HACK: The discriminator parameter handles the edge case of passing a Window object to JQueryStatic. It doesn't actually exist on the factory function. <FElement extends Node = HTMLElement>(window: Window, discriminator: boolean): JQueryStatic<FElement>; /** * Creates DOM elements on the fly from the provided string of raw HTML. * * Binds a function to be executed when the DOM has finished loading. * * @param selector_object_callback A string containing a selector expression * A DOM element to wrap in a jQuery object. * An array containing a set of DOM elements to wrap in a jQuery object. * A plain object to wrap in a jQuery object. * An existing jQuery object to clone. * The function to execute when the DOM is ready. * @see {@link https://api.jquery.com/jQuery/} * @since 1.0 * @since 1.4 */ (selector_object_callback?: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray<Element> | JQuery | JQuery.PlainObject | ((this: Document, $: JQueryStatic<TElement>) => void)): JQuery<TElement>; /** * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. * * @param flags An optional list of space-separated flags that change how the callback list behaves. * @see {@link https://api.jquery.com/jQuery.Callbacks/} * @since 1.7 */ Callbacks<T extends Function>(flags?: string): JQuery.Callbacks<T>; /** * Perform an asynchronous HTTP (Ajax) request. * * @param url A string containing the URL to which the request is sent. * @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(). See jQuery.ajax( settings ) below for a complete list of all settings. * @see {@link https://api.jquery.com/jQuery.ajax/} * @since 1.5 */ ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR; /** * Perform an asynchronous HTTP (Ajax) request. * * @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(). * @see {@link https://api.jquery.com/jQuery.ajax/} * @since 1.0 */ ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR; /** * Handle custom Ajax options or modify existing options before each request is sent and before they * are processed by $.ajax(). * * @param dataTypes An optional string containing one or more space-separated dataTypes * @param handler A handler to set default values for future Ajax requests. * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} * @since 1.5 */ ajaxPrefilter(dataTypes: string, handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; /** * Handle custom Ajax options or modify existing options before each request is sent and before they * are processed by $.ajax(). * * @param handler A handler to set default values for future Ajax requests. * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} * @since 1.5 */ ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; /** * Set default values for future Ajax requests. Its use is not recommended. * * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. * @see {@link https://api.jquery.com/jQuery.ajaxSetup/} * @since 1.1 */ ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings; /** * Creates an object that handles the actual transmission of Ajax data. * * @param dataType A string identifying the data type to use * @param handler A handler to return the new transport object to use with the data type provided in the first argument. * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} * @since 1.5 */ ajaxTransport(dataType: string, handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void; /** * @deprecated 3.3 */ camelCase(value: string): string; /** * Check to see if a DOM element is a descendant of another DOM element. * * @param container The DOM element that may contain the other element. * @param contained The DOM element that may be contained by (a descendant of) the other element. * @see {@link https://api.jquery.com/jQuery.contains/} * @since 1.4 */ contains(container: Element, contained: Element): boolean; css(elem: Element, unknown: any): any; /** * 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. * * @param element The DOM element to query for the data. * @param key Name of the data stored. * @see {@link https://api.jquery.com/jQuery.data/} * @since 1.2.3 */ data(element: Element, key: string, undefined: undefined): any; // tslint:disable-line:unified-signatures /** * Store arbitrary data associated with the specified element. Returns the value that was set. * * @param element The DOM element to associate with the data. * @param key A string naming the piece of data to set. * @param value The new data value; this can be any Javascript type except undefined. * @see {@link https://api.jquery.com/jQuery.data/} * @since 1.2.3 */ data<T>(element: Element, key: string, value: T): T; /** * 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. * * @param element The DOM element to query for the data. * @param key Name of the data stored. * @see {@link https://api.jquery.com/jQuery.data/} * @since 1.2.3 * @since 1.4 */ data(element: Element, key?: string): any; /** * Execute the next function on the queue for the matched element. * * @param element A DOM element from which to remove and execute a queued function. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @see {@link https://api.jquery.com/jQuery.dequeue/} * @since 1.3 */ dequeue(element: Element, queueName?: string): void; /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. * Arrays and array-like objects with a length property (such as a function's arguments object) are * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param array The array to iterate over. * @param callback The function that will be executed on every object. * @see {@link https://api.jquery.com/jQuery.each/} * @since 1.0 */ each<T>(array: ArrayLike<T>, callback: (this: T, indexInArray: number, value: T) => false | any): ArrayLike<T>; /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. * Arrays and array-like objects with a length property (such as a function's arguments object) are * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param obj The object to iterate over. * @param callback The function that will be executed on every object. * @see {@link https://api.jquery.com/jQuery.each/} * @since 1.0 */ each<T, K extends keyof T>(obj: T, callback: (this: T[K], propertyName: K, valueOfProperty: T[K]) => false | any): T; /** * Takes a string and throws an exception containing it. * * @param message The message to send out. * @see {@link https://api.jquery.com/jQuery.error/} * @since 1.4.1 */ error(message: string): any; /** * Escapes any character that has a special meaning in a CSS selector. * * @param selector A string containing a selector expression to escape. * @see {@link https://api.jquery.com/jQuery.escapeSelector/} * @since 3.0 */ escapeSelector(selector: JQuery.Selector): JQuery.Selector; /** * Merge the contents of two or more objects together into the first object. * * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. * @param target The object to extend. It will receive the new properties. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.1.4 */ extend<T, U, V, W, X, Y, Z>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; /** * Merge the contents of two or more objects together into the first object. * * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. * @param target The object to extend. It will receive the new properties. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.1.4 */ extend<T, U, V, W, X, Y>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; /** * Merge the contents of two or more objects together into the first object. * * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. * @param target The object to extend. It will receive the new properties. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.1.4 */ extend<T, U, V, W, X>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; /** * Merge the contents of two or more objects together into the first object. * * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. * @param target The object to extend. It will receive the new properties. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.1.4 */ extend<T, U, V, W>(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W; /** * Merge the contents of two or more objects together into the first object. * * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. * @param target The object to extend. It will receive the new properties. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.1.4 */ extend<T, U, V>(deep: true, target: T, object1: U, object2: V): T & U & V; /** * Merge the contents of two or more objects together into the first object. * * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. * @param target The object to extend. It will receive the new properties. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.1.4 */ extend<T, U>(deep: true, target: T, object1: U): T & U; /** * Merge the contents of two or more objects together into the first object. * * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. * @param target The object to extend. It will receive the new properties. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.1.4 */ extend(deep: true, target: any, object1: any, ...objects: any[]): any; /** * Merge the contents of two or more objects together into the first object. * * @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. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.0 */ extend<T, U, V, W, X, Y, Z>(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; /** * Merge the contents of two or more objects together into the first object. * * @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. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.0 */ extend<T, U, V, W, X, Y>(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; /** * Merge the contents of two or more objects together into the first object. * * @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. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.0 */ extend<T, U, V, W, X>(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; /** * Merge the contents of two or more objects together into the first object. * * @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. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.0 */ extend<T, U, V, W>(target: T, object1: U, object2: V, object3: W): T & U & V & W; /** * Merge the contents of two or more objects together into the first object. * * @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. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.0 */ extend<T, U, V>(target: T, object1: U, object2: V): T & U & V; /** * Merge the contents of two or more objects together into the first object. * * @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. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.0 */ extend<T, U>(target: T, object1: U): T & U; /** * Merge the contents of two or more objects together into the first object. * * @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. * @see {@link https://api.jquery.com/jQuery.extend/} * @since 1.0 */ extend(target: any, object1: any, ...objects: any[]): any; /** * Load data from the server using a HTTP GET request. * * @param url A string containing the URL to which the request is sent. * @param data A plain object or string that is sent to the server with the request. * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but * you can use null or jQuery.noop as a placeholder. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). * @see {@link https://api.jquery.com/jQuery.get/} * @since 1.0 */ get(url: string, data: JQuery.PlainObject | string, success: JQuery.jqXHR.DoneCallback | null, dataType?: string): JQuery.jqXHR; /** * Load data from the server using a HTTP GET request. * * @param url A string containing the URL to which the request is sent. * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but * you can use null or jQuery.noop as a placeholder. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). * @see {@link https://api.jquery.com/jQuery.get/} * @since 1.0 */ get(url: string, success: JQuery.jqXHR.DoneCallback | null, dataType: string): JQuery.jqXHR; /** * Load data from the server using a HTTP GET request. * * @param url A string containing the URL to which the request is sent. * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but * you can use null or jQuery.noop as a placeholder. * A plain object or string that is sent to the server with the request. * @see {@link https://api.jquery.com/jQuery.get/} * @since 1.0 */ get(url: string, success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; /** * Load data from the server using a HTTP GET request. * * @param url_settings A string containing the URL to which the request is sent. * A set of key/value pairs that configure the Ajax request. All properties except for url are * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a * complete list of all settings. The type option will automatically be set to GET. * @see {@link https://api.jquery.com/jQuery.get/} * @since 1.0 * @since 1.12 * @since 2.2 */ get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * * @param url A string containing the URL to which the request is sent. * @param data A plain object or string that is sent to the server with the request. * @param success A callback function that is executed if the request succeeds. * @see {@link https://api.jquery.com/jQuery.getJSON/} * @since 1.0 */ getJSON(url: string, data: JQuery.PlainObject | string, success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * * @param url A string containing the URL to which the request is sent. * @param success_data A callback function that is executed if the request succeeds. * A plain object or string that is sent to the server with the request. * @see {@link https://api.jquery.com/jQuery.getJSON/} * @since 1.0 */ getJSON(url: string, success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; /** * Load a JavaScript file from the server using a GET HTTP request, then execute it. * * @param url A string containing the URL to which the request is sent. * @param success A callback function that is executed if the request succeeds. * @see {@link https://api.jquery.com/jQuery.getScript/} * @since 1.0 */ getScript(url: string, success?: JQuery.jqXHR.DoneCallback<string | undefined>): JQuery.jqXHR<string | undefined>; /** * Execute some JavaScript code globally. * * @param code The JavaScript code to execute. * @see {@link https://api.jquery.com/jQuery.globalEval/} * @since 1.0.4 */ globalEval(code: string): void; /** * Finds the elements of an array which satisfy a filter function. The original array is not affected. * * @param array The array-like object to search through. * @param fn 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. * @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. * @see {@link https://api.jquery.com/jQuery.grep/} * @since 1.0 */ grep<T>(array: ArrayLike<T>, fn: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; /** * Determine whether an element has any jQuery data associated with it. * * @param element A DOM element to be checked for data. * @see {@link https://api.jquery.com/jQuery.hasData/} * @since 1.5 */ hasData(element: Element): boolean; /** * Holds or releases the execution of jQuery's ready event. * * @param hold Indicates whether the ready hold is being requested or released * @see {@link https://api.jquery.com/jQuery.holdReady/} * @since 1.6 * @deprecated 3.2 */ holdReady(hold: boolean): void; /** * Modify and filter HTML strings passed through jQuery manipulation methods. * * @param html The HTML string on which to operate. * @see {@link https://api.jquery.com/jQuery.htmlPrefilter/} * @since 1.12/2.2 */ htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString; /** * Search for a specified value within an array and return its index (or -1 if not found). * * @param value The value to search for. * @param array An array through which to search. * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. * @see {@link https://api.jquery.com/jQuery.inArray/} * @since 1.2 */ inArray<T>(value: T, array: T[], fromIndex?: number): number; /** * Determine whether the argument is an array. * * @param obj Object to test whether or not it is an array. * @see {@link https://api.jquery.com/jQuery.isArray/} * @since 1.3 * @deprecated 3.2 */ isArray(obj: any): obj is any[]; /** * Check to see if an object is empty (contains no enumerable properties). * * @param obj The object that will be checked to see if it's empty. * @see {@link https://api.jquery.com/jQuery.isEmptyObject/} * @since 1.4 */ isEmptyObject(obj: any): boolean; /** * Determine if the argument passed is a JavaScript function object. * * @param obj Object to test whether or not it is a function. * @see {@link https://api.jquery.com/jQuery.isFunction/} * @since 1.2 * @deprecated 3.3 */ isFunction(obj: any): obj is Function; /** * Determines whether its argument represents a JavaScript number. * * @param value The value to be tested. * @see {@link https://api.jquery.com/jQuery.isNumeric/} * @since 1.7 * @deprecated 3.3 */ isNumeric(value: any): value is number; /** * Check to see if an object is a plain object (created using "{}" or "new Object"). * * @param obj The object that will be checked to see if it's a plain object. * @see {@link https://api.jquery.com/jQuery.isPlainObject/} * @since 1.4 */ isPlainObject(obj: any): obj is JQuery.PlainObject; /** * Determine whether the argument is a window. * * @param obj Object to test whether or not it is a window. * @see {@link https://api.jquery.com/jQuery.isWindow/} * @since 1.4.3 * @deprecated 3.3 */ isWindow(obj: any): obj is Window; /** * Check to see if a DOM node is within an XML document (or is an XML document). * * @param node The DOM node that will be checked to see if it's in an XML document. * @see {@link https://api.jquery.com/jQuery.isXMLDoc/} * @since 1.1.4 */ isXMLDoc(node: Node): boolean; /** * Convert an array-like object into a true JavaScript array. * * @param obj Any object to turn into a native Array. * @see {@link https://api.jquery.com/jQuery.makeArray/} * @since 1.2 */ makeArray<T>(obj: ArrayLike<T>): T[]; /** * Translate all items in an array or object to new array of items. * * @param array The Array to translate. * @param callback The function to process each item against. The first argument to the function is the array item, the * second argument is the index in array The function can return any value. A returned array will be * flattened into the resulting array. Within the function, this refers to the global (window) object. * @see {@link https://api.jquery.com/jQuery.map/} * @since 1.0 */ map<T, R>(array: T[], callback: (elementOfArray: T, indexInArray: number) => R): R[]; /** * Translate all items in an array or object to new array of items. * * @param obj The Object to translate. * @param callback The function to process each item against. The first argument to the function is the value; the * second argument is the key of the 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. * @see {@link https://api.jquery.com/jQuery.map/} * @since 1.6 */ map<T, K extends keyof T, R>(obj: T, callback: (propertyOfObject: T[K], key: K) => R): R[]; /** * Merge the contents of two arrays together into the first array. * * @param first The first array-like object to merge, the elements of second added. * @param second The second array-like object to merge into the first, unaltered. * @see {@link https://api.jquery.com/jQuery.merge/} * @since 1.0 */ merge<T, U>(first: ArrayLike<T>, second: ArrayLike<U>): Array<T | U>; /** * Relinquish jQuery's control of the $ variable. * * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). * @see {@link https://api.jquery.com/jQuery.noConflict/} * @since 1.0 */ noConflict(removeAll?: boolean): this; /** * An empty function. * * @see {@link https://api.jquery.com/jQuery.noop/} * @since 1.4 */ noop(): undefined; /** * Return a number representing the current time. * * @see {@link https://api.jquery.com/jQuery.now/} * @since 1.4.3 * @deprecated 3.3 Use Date.now(). */ now(): number; /** * Create a serialized representation of an array, a plain object, or a jQuery object suitable for use * in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input * elements with name/value properties. * * @param obj An array, a plain object, or a jQuery object to serialize. * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. * @see {@link https://api.jquery.com/jQuery.param/} * @since 1.2 * @since 1.4 */ param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string; /** * Parses a string into an array of DOM nodes. * * @param data HTML string to be parsed * @param context Document element to serve as the context in which the HTML fragment will be created * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string * @see {@link https://api.jquery.com/jQuery.parseHTML/} * @since 1.8 */ parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[]; /** * Parses a string into an array of DOM nodes. * * @param data HTML string to be parsed * @param context_keepScripts Document element to serve as the context in which the HTML fragment will be created * A Boolean indicating whether to include scripts passed in the HTML string * @see {@link https://api.jquery.com/jQuery.parseHTML/} * @since 1.8 */ parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[]; /** * Takes a well-formed JSON string and returns the resulting JavaScript value. * * @param json The JSON string to parse. * @see {@link https://api.jquery.com/jQuery.parseJSON/} * @since 1.4.1 * @deprecated 3.0 */ parseJSON(json: string): any; /** * Parses a string into an XML document. * * @param data a well-formed XML string to be parsed * @see {@link https://api.jquery.com/jQuery.parseXML/} * @since 1.5 */ parseXML(data: string): XMLDocument; /** * Load data from the server using a HTTP POST request. * * @param url A string containing the URL to which the request is sent. * @param data A plain object or string that is sent to the server with the request. * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but * can be null in that case. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). * @see {@link https://api.jquery.com/jQuery.post/} * @since 1.0 */ post(url: string, data: JQuery.PlainObject | string, success: JQuery.jqXHR.DoneCallback | null, dataType?: string): JQuery.jqXHR; /** * Load data from the server using a HTTP POST request. * * @param url A string containing the URL to which the request is sent. * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but * can be null in that case. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). * @see {@link https://api.jquery.com/jQuery.post/} * @since 1.0 */ post(url: string, success: JQuery.jqXHR.DoneCallback | null, dataType: string): JQuery.jqXHR; /** * Load data from the server using a HTTP POST request. * * @param url A string containing the URL to which the request is sent. * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but * can be null in that case. * A plain object or string that is sent to the server with the request. * @see {@link https://api.jquery.com/jQuery.post/} * @since 1.0 */ post(url: string, success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; /** * Load data from the server using a HTTP POST request. * * @param url_settings A string containing the URL to which the request is sent. * A set of key/value pairs that configure the Ajax request. All properties except for url are * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a * complete list of all settings. Type will automatically be set to POST. * @see {@link https://api.jquery.com/jQuery.post/} * @since 1.0 * @since 1.12 * @since 2.2 */ post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; // region proxy // region (fn, null | undefined) // region 0 to 7 arguments // region 0 parameters /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, E, F, G>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, E, F>(fn: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, E>(fn: (a: A, b: B, c: C, d: D, e: E) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D, e: E): () => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D>(fn: (a: A, b: B, c: C, d: D) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D): () => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C>(fn: (a: A, b: B, c: C) => TReturn, context: null | undefined, a: A, b: B, c: C): () => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B>(fn: (a: A, b: B) => TReturn, context: null | undefined, a: A, b: B): () => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4` * @since 1.6 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A>(fn: (a: A) => TReturn, context: null | undefined, a: A): () => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn>(fn: () => TReturn, context: null | undefined): () => TReturn; // endregion // region 1 parameters /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, E, F, G, T>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: T) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, E, F, T>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, t: T) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, E, T>(fn: (a: A, b: B, c: C, d: D, e: E, t: T) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, T>(fn: (a: A, b: B, c: C, d: D, t: T) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D): (t: T) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, T>(fn: (a: A, b: B, c: C, t: T) => TReturn, context: null | undefined, a: A, b: B, c: C): (t: T) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, T>(fn: (a: A, b: B, t: T) => TReturn, context: null | undefined, a: A, b: B): (t: T) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, T>(fn: (a: A, t: T) => TReturn, context: null | undefined, a: A): (t: T) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, T>(fn: (t: T) => TReturn, context: null | undefined): (t: T) => TReturn; // endregion // region 2 parameters /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, E, F, G, T, U>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: T, u: U) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, E, F, T, U>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, t: T, u: U) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, E, T, U>(fn: (a: A, b: B, c: C, d: D, e: E, t: T, u: U) => TReturn, context: null | undefined, a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn; /** * Takes a function and returns a new one that will always have a particular context. * * @param fn The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 * @deprecated 3.3 Use Function#bind. */ proxy<TReturn, A, B, C, D, T, U>(fn: (a: A, b: B, c: C, d: D, t: T, u: U) => TReturn,