UNPKG

declarations

Version:

[![npm version](https://badge.fury.io/js/declarations.svg)](https://www.npmjs.com/package/declarations)

1,179 lines (1,064 loc) 165 kB
// Type definitions for Microsoft ASP.NET Ajax client side library // Project: http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx // Definitions by: Patrick Magee <https://github.com/pjmagee/> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped //#region Global Namespace /** * Global Namespace * This section includes members or types that extend the ECMAScript (JavaScript) Global object and other core objects. * @see {@link http://msdn.microsoft.com/en-us/library/bb310818(v=vs.100).aspx} */ //#region JavaScript Base Type Extensions /** * Provides extended reflection-like functionality to the base ECMAScript (JavaScript) Object object. * Object Type Extensions * @see {@link http://msdn.microsoft.com/en-us/library/bb397554(v=vs.100).aspx} */ interface ObjectConstructor { /** * Formats a number by using the invariant culture. */ getType(instance: any): Type; /** * Returns a string that identifies the run-time type name of an object. */ getTypeName(instance: any): string; } /** * Provides extensions to the base ECMAScript (JavaScript) Array functionality by adding static methods. * Array Type Extensions * @see {@link http://msdn.microsoft.com/en-us/library/bb383786(v=vs.100).aspx} */ interface ArrayConstructor { //#region Extensions /** * Adds an element to the end of an Array object. This function is static and is invoked without creating an instance of the object. * @param array * The array to add the item to. * @param item * */ add<T>(array: T[], element: T): void; /** * Copies all the elements of the specified array to the end of an Array object. */ addRange<T>(array: T[], items: T[]): void; /** * Removes all elements from an Array object. */ clear<T>(array: T[]): void; /** * Creates a shallow copy of an Array object. */ clone<T>(array: T[]): T[]; /** * Determines whether an element is in an Array object. */ contains<T>(array: T[], element: T): boolean; /** * Removes the first element from an Array object. */ dequeue<T>(array: T[]): T; /** * Adds an element to the end of an Array object. Use the add function instead of the Array.enqueue function. */ enqueue<T>(array: T[], element: T): void; /** * Performs a specified action on each element of an Array object. */ forEach<T>(array: T[], method: (element: T, index: number, array: T[]) => void, instance: any): void; /** * Searches for the specified element of an Array object and returns its index. */ indexOf<T>(array: T[], item: T, startIndex?: number): number; /** * Inserts a value at the specified location in an Array object. */ insert<T>(array: T[], index: number, item: T): void; /** * Creates an Array object from a string representation. */ parse<T>(value: string): T[]; /** * Removes the first occurrence of an element in an Array object. */ remove<T>(array: T[], item: T): boolean; /** * Removes an element at the specified location in an Array object. */ removeAt<T>(array: T[], index: number): void; //#endregion } /** * Extends the base ECMAScript (JavaScript) Number functionality with static and instance methods. * Number Type Extensions * @see {@link http://msdn.microsoft.com/en-us/library/bb310835(v=vs.100).aspx} */ interface Number { /** * Formats a number by using the invariant culture. */ format(format: string): string; /** * Formats a number by using the current culture. */ localeFormat(format: string): string; } interface NumberConstructor { /** * Returns a numeric value from a string representation of a number. This function is static and can be called without creating an instance of the object. */ parseInvariant(format: string): number; /** * Creates a numeric value from a locale-specific string. */ parseLocale(format: string): number; } /** * Provides extensions to the base ECMAScript (JavaScript) Date object. * Date Type Extensions * @see {@link http://msdn.microsoft.com/en-us/library/bb310850(v=vs.100).aspx} */ interface Date { /** * Formats a date by using the invariant (culture-independent) culture. */ format(format: string): string; /** * Formats a date by using the current culture. This function is static and can be invoked without creating an instance of the object. */ localeFormat(format: string): string; } interface DateConstructor { /** * Creates a date from a locale-specific string by using the current culture. This function is static and can be invoked without creating an instance of the object. * @exception (Debug) formats contains an invalid format. * @param value * A locale-specific string that represents a date. * @param formats * (Optional) An array of custom formats. */ parseLocale(value: string, formats?: string[]): Date; parseLocale(value: string, ...formats: string[]): Date; /** * Creates a date from a string by using the invariant culture. This function is static and can be invoked without creating an instance of the object. * @return If value is a valid string representation of a date in the invariant format, an object of type Date; otherwise, null. * @param value * A locale-specific string that represents a date. * @param formats * (Optional) An array of custom formats. */ parseInvariant(value: string, formats?: string[]): string; parseInvariant(value: string, ...formats: string[]): string; } /** * Provides static functions that extend the built-in ECMAScript (JavaScript) Function type by including exception * details and support for application-compilation modes (debug or release). * @see {@link http://msdn.microsoft.com/en-us/library/dd409270(v=vs.100).aspx} */ interface FunctionConstructor { //#region Extensions /** * Creates a delegate function that retains the context first used during an objects creation. * @see {@link http://msdn.microsoft.com/en-us/library/dd393582(v=vs.100).aspx } */ createCallback(method: Function, ...context: any[]): Function; /** * Creates a callback function that retains the parameter initially used during an object's creation. * @see {@link http://msdn.microsoft.com/en-us/library/dd409287(v=vs.100).aspx } */ createDelegate(instance: any, method: Function): Function; /** * A function that does nothing. * @see {@link http://msdn.microsoft.com/en-us/library/dd393667(v=vs.100).aspx } */ emptyMethod(): Function; /** * Validates the parameters to a method are as expected. * @see {@link http://msdn.microsoft.com/en-us/library/dd393712(v=vs.100).aspx } */ validateParameters(parameters: any, expectedParameters: Object[], validateParameterCount?: boolean): any; //#endregion } /** * Provides static functions that extend the built-in ECMAScript (JavaScript) Error type by including exception details and support for application-compilation modes (debug or release). * Error Type Extensions * @see {@link http://msdn.microsoft.com/en-us/library/bb310947(v=vs.100).aspx} */ interface ErrorConstructor { //#region Extensions /** * Creates an Error object that represents the Sys.ParameterCountException exception. */ parameterCount(message?: string): Error; /** * Creates an Error object that represents the Sys.NotImplementedException exception. */ notImplemented(message?: string): Error; /** * Creates an Error object that represents the Sys.ArgumentException exception. */ argument(paramName?: any, message?: string): Error; /** * Creates an Error object that represents the Sys.ArgumentNullException exception. */ argumentNull(paramName?: any, message?: string): Error; /** * Creates an Error object that represents the Sys.ArgumentOutOfRangeException exception. */ argumentOutOfRange(paramName?: string, actualValue?: any, message?: string): Error; /** * Creates an Error object that represents the Sys.ArgumentTypeException exception. */ argumentType(paramName?: string, actualType?: any, expectedType?: any, message?: string): Error; /** * Creates an Error object that represents the Sys.ArgumentUndefinedException exception. */ argumentUndefined(paramName?: string, message?: string): Error; /** * Creates an Error object that can contain additional error information. */ create(message?: string, errorInfo?: Object): Error; /** * Creates an Error object that represents the Sys.FormatException exception. */ format(message?: string): Error; /** * Creates an Error object that represents the Sys.InvalidOperationException exception. */ invalidOperation(message?: string): Error; //#endregion } interface String { //#region Extensions /** * Formats a number by using the invariant culture. * @returns true if the end of the String object matches suffix; otherwise, false. */ endsWith(suffix: string): boolean; /** * Removes leading and trailing white-space characters from a String object. * @returns A copy of the string with all white-space characters removed from the start and end of the string. */ trim(): string; /** * Removes trailing white-space characters from a String object. * @returns A copy of the string with all white-space characters removed from the end of the string. */ trimEnd(): string; /** * Removes leading white-space characters from a String object. * @returns A copy of the string with all white-space characters removed from the start of the string. */ trimStart(): string; //#endregion } /** * Provides extensions to the base ECMAScript (JavaScript) String object by including static and instance methods. * String Type Extensions * @see {@link http://msdn.microsoft.com/en-us/library/bb397472(v=vs.100).aspx} */ interface StringConstructor { /** * Replaces each format item in a String object with the text equivalent of a corresponding object's value. * @returns A copy of the string with the formatting applied. */ format(format: string, ...args: any[]): string; /** * Replaces the format items in a String object with the text equivalent of a corresponding object's value. The current culture is used to format dates and numbers. * @returns A copy of the string with the formatting applied. */ localeFormat(format: string, ...args: any[]): string; } /** * Provides extensions to the base ECMAScript (JavaScript) Boolean object. * Boolean Type Extensions * @see {@link http://msdn.microsoft.com/en-us/library/bb397557(v=vs.100).aspx} */ interface BooleanConstructor { //#region Extensions /** * Converts a string representation of a logical value to its Boolean object equivalent. */ parse(value: string): Boolean; //#endregion } //#endregion //#region ASP.NET Types /** * Provides a typing and type-reflection system for ECMAScript (JavaScript) object-oriented programming functionality. * Type Class * @see {@link http://msdn.microsoft.com/en-us/library/bb397568(v=vs.100).aspx} */ declare class Type { /** * Invokes a base method with specified arguments. * @returns A value of the class that the base method returns. If the base method does not return a value, no value is returned. */ callBaseMethod(instance: any, name: string, baseArguments?: any[]): any; /** * Creates a callback method, given the function to callback and the parameter to pass to it. * @return * The callback function. * * @param method * The function for which the callback method will be created. * @param context * The parameter to pass to the function. This parameter can be null, but it cannot be omitted. */ static createCallback(method: Function, context: Object): Function; /** * Creates a delegate function that keeps the context from its creation. The context defines the object instance to which the this keyword points. * @param instance * The object instance that will be the context for the function. This parameter can be null. * @param method * The function from which the delegate is created. * @return The delegate function. */ static createDelegate(instance: Object, method: Function): Function; /** * Returns the base implementation of a method from the base class of the specified instance. * @param instance * The instance for which the base method is requested. * @param name * The name of the method to retrieve as a reference. */ getBaseMethod(instance: Object, name: string): any; /** * Returns the base class of the instance. * Use the getBaseType method to retrieve the base class of the instance. */ getBaseType(): Type; /** * Returns an Array object that contains the list of interfaces that the type implements. * Use the getInterfaces function to return a list of objects that define the interfaces on a type object. * This enables you to enumerate the array to determine the object's interfaces. * * @return An Array object that contains the list of interfaces that the type implements. */ getInterfaces(): any[]; /** * Returns the name of the type of the instance. * @return A string representing the fully qualified name of the type of the instance. * @example Object.getType(c[i]).getName() */ getName(): string; /** * Returns an Array object containing references to all the root namespaces of the client application. This method is static and is invoked without creating an instance of the object. * Use the getRootNamespaces function to return an array containing references to all the root namespaces of the client application. * @return An object containing references to all the root namespaces of the client application. */ static getRootNamespaces(): any; /** * Determines whether a class implements a specified interface type. * @param interfaceType * The interface to test. * @return true if the class implements interfaceType; otherwise, false. */ implementsInterface(interfaceType: Type): boolean; /** * Determines whether an instance inherits from a specified class. * @param parentType * The fully qualified name of the class to test as a base class for the current instance. * @return true if the instance inherits from parentType; otherwise, false. */ inheritsFrom(parentType: string): boolean; /** * Initializes the base class and its members in the context of a given instance, which provides the model for inheritance and for initializing base members. * @param instance * The instance to initialize the base class for. Usually this. * @param baseArguments * (Optional) The arguments for the base constructor. Can be null. */ initializeBase(instance: any, baseArguments?: any[]): any; /** * Returns a value that indicates whether the specified type is a class. This method is static and can be invoked without creating an instance of the object. * @param type * The type to test. * @return true if the specified type is a class; otherwise, false. */ static isClass(type: any): boolean; /** * Indicates whether the specified type is an enumeration. * @param type * The type to test. * @return true if the type is an enumeration; otherwise, false. */ static isEnum(type: any): boolean; /** * Get a value that indicates whether the specified type is an integer of flags. * @param * The type to test. * @return true if the type is an integer of flags; otherwise, false. */ static isFlags(type: any): boolean; /** * Determines whether an instance implements an interface. * @param typeInstanceVar * The instance on which the interface is tested. * @return */ isImplementedBy(typeInstanceVar: any): boolean; /** * Returns a value that indicates whether an object is an instance of a specified class or of one of its derived classes. * @param instance * The object to test. * @return true if instance is an instance of the class; false if instance does not implement the interface, or if it is undefined or null. */ isInstanceOfType(instance: any): boolean; /** * Returns a value that indicates whether the specified type is an interface. This is a static member that is invoked directly without creating an instance of the class. * @param type * The type to test. * @return true if the specified type is an interface; otherwise, false. */ static isInterface(type: any): boolean; /** * Returns a value that indicates whether the specified object is a namespace. This is a static member that is invoked directly without creating an instance of the class. * @param object * The object to test. * @return true if the specified object is a namespace; otherwise, false. */ static isNamespace(object: any): boolean; /** * Returns an instance of the type specified by a type name. This is a static member that is invoked directly without creating an instance of its class. * @param typeName * A string that represents a fully qualified class name. Can be null. * @param ns * (Optional) The namespace that contains the class. * @return The class represented by typeName, or null if a class that matches typeName does not occur in the namespace. */ static parse(typeName: string, ns?: string): any; /** * Registers a class as defined by a constructor with an optional base type and interface type. * @param typeName * A string that represents the fully qualified name of the type. * @param baseType * (Optional) The base type. * @param interfaceTypes * (Optional) An unbounded array of interface type definitions that the type implements. * @return The registered type. */ registerClass(typeName: string, baseType?: any, interfaceTypes?: any[]): any; /** * Registers an enumeration. * @param name * The fully-qualified name of the enumeration. * @param flags * (Optional) true if the enumeration is a collection of flags; otherwise, false. */ registerEnum(name: string, flags?: boolean): void; /** * Registers an interface defined by a constructor. * @param typeName * A string that represents the fully qualified name of the class to be registered as an interface. * @return The registered interface. */ registerInterface(typeName: string): any; /** * Creates a namespace. This member is static and can be invoked without creating an instance of the class. * @param namespacePath * A string that represents the fully qualified namespace to register. */ static registerNamespace(namespacePath: string): void; /** * Copies members from the base class to the prototype associated with the derived class, and continues this process up the inheritance chain. This enables you to reflect on the inherited members of a derived type. * Use the resolveInheritance method to reflect on the inherited members of a derived type. * You invoke this method from the type that you want to reflect on. * The resolveInheritance method copies members from the base class to the prototype associated with the derived class, and continues this process up the inheritance chain. * If the derived type overrides a base type member, the base type member is not copied to the derived type's prototype. * After invoking a derived type's resolveInheritance method, you can examine the members of the derived type to discover all members, which includes inherited members. */ resolveInheritance(): void; } //#endregion //#region Shortcuts to commonly used APIs /** * Creates and initializes a component of the specified type. This method is static and can be called without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb397487(v=vs.100).aspx} * * @param type * The type of the component to create. * @param properties * (Optional) A JSON object that describes the properties and their values. * @param events * (Optional) A JSON object that describes the events and their handlers. * @param references * (Optional) A JSON object that describes the properties that are references to other components. * @param element * (Optional) The DOM element that the component should be attached to. * @returns A new instance of a component that uses the specified parameters. */ declare function $create(type: Type, properties?: any, events?: any, references?: any, element?: HTMLElement): Sys.Component; /** * Returns the specified Component object. This member is static and can be invoked without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb397441(v=vs.100).aspx} * @param id A string that contains the ID of the component to find. * @param parent (Optional) The component or element that contains the component to find. * @return A Component object that contains the component requested by ID, if found; otherwise, null. */ declare function $find(id: string, parent?: Sys.Component): Sys.Component; /** * Returns the specified Component object. This member is static and can be invoked without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb397441(v=vs.100).aspx} * @param id A string that contains the ID of the component to find. * @param parent (Optional) The component or element that contains the component to find. * @return A Component object that contains the component requested by ID, if found; otherwise, null. */ declare function $find(id: string, parent?: HTMLElement): Sys.Component; /* * Provides a shortcut to the addHandler method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb311019(v=vs.100).aspx} * @param element The DOM element that exposes the event. * @param eventName The name of the event. * @param handler The event handler to add. * @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed. */ declare function $addHandler(element: HTMLElement, eventName: string, handler: (e: Sys.UI.DomEvent) => void, autoRemove?: boolean): void; /** * Provides a shortcut to the addHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb384012(v=vs.100).aspx} * @param element The DOM element that exposes the event. * @param events A dictionary of events and their handlers. * @param handlerOwner (Optional) The object instance that is the context for the delegates that should be created from the handlers. * @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed. */ declare function $addHandlers(element: HTMLElement, events: { [event: string]: (e: Sys.UI.DomEvent) => void }, handlerOwner?: any, autoRemove?: boolean): void; /** * Provides a shortcut to the clearHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. * For details about the method that this shortcut represents, see Sys.UI.DomEvent clearHandlers Method. * @see {@link http://msdn.microsoft.com/en-us/library/bb310959(v=vs.100).aspx} * @param The DOM element that exposes the events. */ declare function $clearHandlers(element: HTMLElement): void; /** * Provides a shortcut to the getElementById method of the HTMLElement class. This member is static and can be invoked without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb397717(v=vs.100).aspx} * @param id * The ID of the DOM element to find. * @param element * The parent element to search. The default is the document element. * @return * The HTMLElement */ declare function $get(id: string, element?: HTMLElement): HTMLElement; /** * Provides a shortcut to the removeHandler method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb397510(v=vs.100).aspx} * @param element The DOM element that exposes the event. * @param eventName The name of the DOM event. * @param handler The event handler to remove. */ declare function $removeHandler(element: HTMLElement, eventName: string, handler: (e: Sys.UI.DomEvent) => void): void; //#endregion //#endregion //#region Sys Namespace /** * Represents the root namespace for the Microsoft Ajax Library, which contains all fundamental classes and base classes. * @see {@link http://msdn.microsoft.com/en-us/library/bb397702(v=vs.100).aspx} */ declare namespace Sys { //#region Classes /** * Provides a run-time object that exposes client events and manages client components that are registered with the application. * The members of this object are available globally after the client application has been initialized. * The members can be invoked without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb384161(v=vs.100).aspx} */ interface Application extends Component, IContainer { //#region Constructors constructor(): void; //#endregion //#region Events /** * Raised after all scripts have been loaded but before objects are created. */ add_init(handler: (sender: Application, eventArgs: EventArgs) => void): void; /** * Raised after all scripts have been loaded but before objects are created. */ remove_init(handler: (sender: Application, eventArgs: EventArgs) => void): void; /** * Raised after all scripts have been loaded and after the objects in the application have been created and initialized. */ add_load(handler: (sender: Application, eventArgs: ApplicationLoadEventArgs) => void): void; /** * Raised after all scripts have been loaded and after the objects in the application have been created and initialized. */ remove_load(handler: (sender: Application, eventArgs: ApplicationLoadEventArgs) => void): void; /** * Occurs when the user clicks the browser's Back or Forward button. */ add_navigate(handler: (sender: Application, eventArgs: HistoryEventArgs) => void): void; /** * Occurs when the user clicks the browser's Back or Forward button. */ remove_navigate(handler: (sender: Application, eventArgs: HistoryEventArgs) => void): void; /** * Raised before all objects in the client application are disposed, typically when the DOM window.unload event is raised. */ add_unload(handler: Function): void; /** * Raised before all objects in the client application are disposed, typically when the DOM window.unload event is raised. */ remove_unload(handler: Function): void; //#endregion //#region Methods /** * Registers a component with the application and initializes it if the component is not already initialized. */ addComponent(component: any): void; /** * Instructs the application to start creating components. */ beginCreateComponents(): void; /** * Creates a history point and adds it to the browser's history stack. */ addHistoryPoint(state: Object, title?: string): void; /** * Called by the Sys.Application.beginUpdate Method to indicate that the process of setting component properties of the application has begun. */ beginUpdate(): void; /** * Releases resources and dependencies held by the client application. */ dispose(): void; /** * Releases resources and dependencies associated with an element and its child nodes. * @param element * The element to dispose. * @param childNodesOnly * A boolean value used to determine whether to dispose of the element and its child nodes or to dispose only its child nodes. */ disposeElement(element: Element, childNodesOnly: boolean): void; /** * Instructs the application to finalize component creation. */ endCreateComponents(): void; /** * Called by the Sys.Application.endCreateComponents Method to indicate that the process of updating the application has completed. */ endUpdate(): void; /** * Returns the specified Component object. This member is static and can be invoked without creating an instance of the class. * @return A Component object that contains the component requested by ID, if found; otherwise, null. */ findComponent(id: string, parent?: Sys.Component): Sys.Component; /** * Returns the specified Component object. This member is static and can be invoked without creating an instance of the class. * @return A Component object that contains the component requested by ID, if found; otherwise, null. */ findComponent(id: string, parent?: HTMLElement): Sys.Component; /** * Returns an array of all components that have been registered with the application by using the addComponent method. This member is static and can be invoked without creating an instance of the class. */ getComponents(): Sys.Component[]; /** * This function supports the client-script infrastructure and is not intended to be used directly from your code. */ initialize(): void; /** * Called by a referenced script to indicate that it has been loaded. This API is obsolete. You no longer need to call this method in order to notify the Microsoft Ajax Library that the JavaScript file has been loaded. */ notifyScriptLoaded(): void; /** * Raises the load event. This member is static and can be invoked without creating an instance of the class. */ raiseLoad(): void; /** * Raises the Sys.INotifyPropertyChange.propertyChanged event. */ raisePropertyChanged(propertyName: string): void; /** * Registers with the application an object that will require disposing. This member is static and can be invoked without creating an instance of the class. */ registerDisposableObject(object: any): void; /** * Removes the object from the application and disposes the object if it is disposable. This member is static and can be invoked without creating an instance of the class. */ removeComponent(component: Component): void; /** * Unregisters a disposable object from the application. This member is static and can be invoked without creating an instance of the class. */ unregisterDisposableObject(object: any): void; /** * Called by the Sys.Application.endUpdate method as a placeholder for additional logic. */ updated(): void; //#endregion //#region Properties /** * Gets or sets a value that indicates whether the Web application supports history point management. */ get_enableHistory(): boolean; /** * Gets or sets a value that indicates whether the Web application supports history point management. * @param value * true to allow the Web application to support history points, or false to not allow history points. */ set_enableHistory(value: boolean): void; /** * Gets a value that indicates whether the application is in the process of creating components. This member is static and can be invoked without creating an instance of the class. */ get_isCreatingComponents(): boolean; /** * Gets a value that indicates whether the application is in the process of disposing its resources. This member is static and can be invoked without creating an instance of the class. */ get_isDisposing(): boolean; //#endregion } var Application: Application; /** * Provides information about the current Web browser. * The Sys.Browser object determines which browser is being used and provides some information about it. You can use this object to help customize your code to the unique requirements or capabilities of the browser. * @see {@link http://msdn.microsoft.com/en-us/library/cc679064(v=vs.100).aspx} */ interface Browser { //#region Fields /** * Gets an object that represents the user agent of the browser. */ agent: any; /** * Gets a value that indicates the document compatibility mode of the browser. * @return * */ documentMode: number; /* * Gets a value that indicates whether the browser supports debug statements. * @return * True if the browser supports debug statements */ hasDebuggerStatement: boolean; /** * Gets the name of the browser. * @return * The name of the browser */ name: string; /* * Gets the version number of the browser. * @return * The version of the browser */ version: number; //#endregion } export function Browser(): Sys.Browser; /** * Provides the base class for the Control and Behavior classes, and for any other object whose lifetime should be managed by the ASP.NET AJAX client library. * @see {@link http://msdn.microsoft.com/en-us/library/bb397516(v=vs.100).aspx} */ class Component { //#region Constructors /** * When overridden in a derived class, initializes an instance of that class and registers it with the application as a disposable object. */ constructor(); //#endregion //#region Events /** * Raised when the dispose method is called for a component. */ add_disposing(handler: Function): void; /** * Raised when the dispose method is called for a component. */ remove_disposing(handler: Function): void; /** * Raised when the raisePropertyChanged method of the current Component object is called. */ add_propertyChanged(handler: Function): void; /** * Raised when the raisePropertyChanged method of the current Component object is called. */ remove_propertyChanged(handler: Function): void; //#endregion //#region Methods /** * Called by the create method to indicate that the process of setting properties of a component instance has begun. */ beginUpdate(): void; /** * Creates and initializes a component of the specified type. This method is static and can be called without creating an instance of the class. * @param type * The type of the component to create. * @param properties * (Optional) A JSON object that describes the properties and their values. * @param events * (Optional) A JSON object that describes the events and their handlers. * @param references * (Optional) A JSON object that describes the properties that are references to other components. * @param element * (Optional) The DOM element that the component should be attached to. * * @returns A new instance of a component that uses the specified parameters. */ static create(type: Type, properties?: any, events?: any, references?: any, element?: HTMLElement): Sys.Component; /** * Called by the create method to indicate that the process of setting properties of a component instance has finished. * This method is called by the create method ($create). * Sets the isUpdating property of the current Component object to false, calls the initialize method if it has not already been called, and then calls the updated method. */ endUpdate(): void; /** * Initializes the current Component object. * The initialize method sets the isInitialized property of the current Component object to true. This function is called by the create method ($create) and overridden in derived classes to initialize the component. */ initialize(): void; /** * Raises the propertyChanged event for the specified property. * @param propertyName * The name of the property that changed. */ raisePropertyChanged(propertyName: string): void; /** * Called by the endUpdate method as a placeholder for additional logic in derived classes. * Override the updated method in a derived class to add custom post-update logic. */ updated(): void; /** * Raises the disposing event of the current Component and removes the component from the application. */ dispose(): void; //#endregion //#region Properties /** * Gets an EventHandlerList object that contains references to all the event handlers that are mapped to the current component's events. * This member supports the client-script infrastructure and is not intended to be used directly from your code. * @return * An EventHandlerList object that contains references to all the events and handlers for this component. */ get_events(): any; /** * Gets the ID of the current Component object. * @return * The id */ get_id(): string; /** * Sets the ID of the current Component object. * @param value A string that contains the ID of the component. */ set_id(value: string): void; /** * Gets a value indicating whether the current Component object is initialized. * @return * true if the current Component is initialized; otherwise, false. */ get_isInitialized(): boolean; /** * Gets a value indicating whether the current Component object is updating. * @return * true if the current Component object is updating; otherwise, false. */ get_isUpdating(): boolean; //#endregion } /** * Represents a culture definition that can be applied to objects that accept a culture-related setting. * @see {@link http://msdn.microsoft.com/en-us/library/bb384004(v=vs.100).aspx} */ class CultureInfo { //#region Constructors /** * Initializes a new instance of the Sys.CultureInfo class. * @param name * The culture value (locale) that represents a language and region. * @param numberFormat * A culture-sensitive numeric formatting string. * @param dateTimeFormat * A culture-sensitive date formatting string. */ constructor(name: string, numberFormat: string, dateTimeFormat: string); //#endregion //#region Properties /** * Gets an object that contains an array of culture-sensitive formatting and parsing strings values that can be applied to Number type extensions. * Use the numberFormat field to retrieve an object that contains an array of formatting strings that are based on the current culture or on the invariant culture. * Each formatting string can be used to specify how to format Number type extensions. * @return An object that contains an array of culture-sensitive formatting strings. */ numberFormat: string[]; /** * Gets the culture value (locale) that represents a language and region. * @return The culture value (locale) that represents a language and region. */ name: string; /** * Gets the globalization values of the invariant culture as sent by the server. This member is static and can be invoked without creating an instance of the class. * The InvariantCulture field contains the following fields associated with the invariant (culture-independent) culture: name, dateTimeFormat, and numberFormat. * @return A CultureInfo object. */ static InvariantCulture: CultureInfo; /** * Gets the globalization values of the current culture as sent by the server. This member is static and can be invoked without creating an instance of the class. * The CurrentCulture field contains the following fields associated with the current culture: name, dateTimeFormat, and numberFormat. * @return A Sys.CultureInfo object. */ static CurrentCulture: CultureInfo; /** * Gets an object that contains an array of culture-sensitive formatting and parsing string values that can be applied to Date type extensions. * Use the dateTimeFormat field to retrieve an object that contains an array of formatting strings that are based on the current culture or on the invariant culture. * Each formatting string can be used to specify how to format Date type extensions. * @return An object that contains an array of culture-sensitive formatting strings. */ dateTimeFormat: string[]; //#endregion } /** * Provides debugging and tracing functionality for client ECMAScript (JavaScript) code. This class is static and can be invoked directly without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb397422(v=vs.100).aspx} */ class Debug { //#region Constructors /** * Initializes a new instance of the Sys.Debug class. */ constructor(); //#endregion //#region Methods /** * Checks for a condition, and if the condition is false, displays a message and prompts the user to break into the debugger. * When you call the assert method in your code, express the success of an operation as true or false and use that value for condition. If the operation fails (if condition is false), the assert logic is executed. * The assert method should be used to catch developer errors. To respond to user errors and to run-time error conditions such as network errors or permission failures, throw an exception. * Debugging behavior, requirements, and the output of trace messages vary with different browsers. For more information, see Debugging and Tracing Ajax Applications Overview. * * @param condition * true to continue to execute code; false to display message and break into the debugger. * @param message * (Optional) The message to display. The default is an empty string (""). * @param displayCaller * (Optional) true to indicate that the name of the function that is calling assert should be displayed in the message. The default is false. */ static assert(condition: boolean, message?: string, displayCaller?: boolean): void; /** * Clears all trace messages from the trace console. */ static clearTrace(): void; /** * Displays a message in the debugger's output window and breaks into the debugger. * @param message * The message to display. */ static fail(message: string): void; /** * Appends a text line to the debugger console and to the trace console, if available. * @param text * The text to display. */ static trace(text: string): void; /** * Dumps an object to the debugger console and to the trace console, if available. * @param object * The object to dump. * @param name * (Optional) The name of the object. */ static traceDump(object: any, name?: string): void; //#endregion } /** * Describes a change in a collection. * @see {@link http://msdn.microsoft.com/en-us/library/dd393798(v=vs.100).aspx} */ class CollectionChange { //#region Constructors /** * Creates a CollectionChange object based on the supplied parameters. * @param action * A NotifyCollectionChangedAction enumeration value. * @param newItems * (Optional) The items that were added when the action is add or replace. * @param newStartingIndex * (Optional) An integer that represents the index where new items have been inserted. * @param oldItems * (Optional) The items that were removed when the action is remove or replace. * @param oldStartingIndex * (Optional) An integer that represents the index where old items have been removed. */ constructor(action: NotifyCollectionChangedAction, newItems: any[], newStartingIndex: number, oldItems: any[], oldStartingIndex: number); //#endregion //#region Fields /** * Gets a NotifyCollectionChangedAction object that contains the change action enumeration value. * @return A NotifyCollectionChangedAction object. */ action: NotifyCollectionChangedAction; /** * @return An array of items that were added. */ newItems: any[]; /** * The index where new items have been inserted. * @return An integer that represents the index where new items have been inserted. */ newStartingIndex: number; /** * The items that were removed when the NotifyCollectionChangedAction object is set to remove. * @return An array containing the items that were removed. */ oldItems: any[]; /** * Gets the index where old items have been removed. * @return An integer that represents the index where old items have been removed. */ oldStartingIndex: number; //#endregion } /** * Adds update and management functionality to target objects such as arrays, DOM elements, and objects. * The Sys.Observer class is based on the Observer pattern. The Sys.Observer class maintains a list of interested dependents (observers) in a separate object (the subject). * All methods that are contained in the Sys.Observer class are static. * In order to be used with the Sys.Observer class, an object must be an object, array, or DOM element. * @see {@link http://msdn.microsoft.com/en-us/library/dd393710(v=vs.100).aspx} */ class Observer { //#region Methods /** * Adds an item to the collection in an observable manner. * @param target * The array to which an item will be added. * @param item * The item to add. */ static add(target: any[], item: any): void; /** * Adds an event handler to the target. * @param target The array to which an event handler will be added. * @param handler The event handler. */ static addCollectionChanged(target: any, handler: Function): void; /** * Adds an observable event handler to the target. * @param eventName A string that contains the event name. * @param handler The added function. */ static addEventHandler(target: any, eventName: string, handler: Function): void; /** * Adds a propertyChanged event handler to the target. * @param target The object to observe. * @param handler The function handler to add. */ static addPropertyChanged(target: any, handler: Function): void; /** * Adds items to the collection in an observable manner. * @param target The array to which items will be added. * @param items The array of items to add. */ static addRange(target: any[], items: any[]): void; /** * Begins the process of updating the target object. * @param target The object to update. */ static beginUpdate(target: any): void; /** * Clears the array of its elements in an observable manner. * @param target The array to clear. */ static clear(target: any): void; /** * Ends the process of updating the target object. * @param ta