devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
843 lines (838 loc) • 604 kB
TypeScript
/**
* DevExtreme (dx.all.d.ts)
* Version: 18.2.18
* Build date: Tue Oct 18 2022
*
* Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
declare global {
interface JQuery {
}
interface JQueryPromise<T> {
}
interface JQueryCallback {
}
interface JQueryEventObject {
cancel?: boolean;
}
interface PromiseLike<T> {
}
interface Promise<T> {
then<TResult1 = T, TResult2 = never>(
onfulfilled?: ((value: T, extraParameters: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null
): Promise<TResult1 | TResult2>;
}
}
declare module DevExpress {
export class DataHelperMixin {
/** Gets the DataSource instance. */
getDataSource(): DevExpress.data.DataSource;
}
export function eventsHandler(event: dxEvent, extraParameters: any): boolean;
/** Describes dxEvent, a counterpart of the jQuery.Event to be used without jQuery. */
export class dxEvent {
/** The DOM element that initiated the event. */
target: Element;
/** The DOM element within the current event propagation stage. */
currentTarget: Element;
/** The DOM element to which the currently-called event handler was attached. */
delegateTarget: Element;
/** Data passed to the event handler. */
data: any;
/** Checks if the preventDefault() method was called on this event object. */
isDefaultPrevented(): boolean;
/** Checks if the stopImmediatePropagation() method was called on this event object. */
isImmediatePropagationStopped(): boolean;
/** Checks if the stopPropagation() method was called on this event object. */
isPropagationStopped(): boolean;
/** Prevents the event's default action from triggering. */
preventDefault(): void;
/** Stops the event's propagation up the DOM tree, preventing the rest of the handlers from being executed. */
stopImmediatePropagation(): void;
/** Stops the event's propagation up the DOM tree, keeping parent handlers unnotified of the event. */
stopPropagation(): void;
}
export type event = dxEvent | JQueryEventObject;
/** An object that serves as a namespace for the methods that are used to localize an application. */
export class localization {
/** Converts a Date object to a string using the specified format. */
static formatDate(value: Date, format: DevExpress.ui.format): string;
/** Substitutes the provided value(s) for placeholders in a message that the key specifies. */
static formatMessage(key: string, value: string | Array<string>): string;
/** Converts a numeric value to a string using the specified format. */
static formatNumber(value: number, format: DevExpress.ui.format): string;
/** Loads localized messages. */
static loadMessages(messages: any): void;
/** Gets the current locale identifier. */
static locale(): string;
/** Sets the current locale identifier. */
static locale(locale: string): void;
/** Parses a string into a Date object. */
static parseDate(text: string, format: DevExpress.ui.format): Date;
/** Parses a string into a numeric value. */
static parseNumber(text: string, format: DevExpress.ui.format): number;
}
/** Defines animation options. */
export interface animationConfig {
/** A function called after animation is completed. */
complete?: (($element: DevExpress.core.dxElement, config: any) => any);
/** A number specifying wait time before animation execution. */
delay?: number;
/** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */
direction?: 'bottom' | 'left' | 'right' | 'top';
/** A number specifying the time in milliseconds spent on animation. */
duration?: number;
/** A string specifying the easing function for animation. */
easing?: string;
/** Specifies the initial animation state. */
from?: number | string | any;
/** A number specifying the time period to wait before the animation of the next stagger item starts. */
staggerDelay?: number;
/** A function called before animation is started. */
start?: (($element: DevExpress.core.dxElement, config: any) => any);
/** Specifies a final animation state. */
to?: number | string | any;
/** A string value specifying the animation type. */
type?: 'css' | 'fade' | 'fadeIn' | 'fadeOut' | 'pop' | 'slide' | 'slideIn' | 'slideOut';
}
/** The position object specifies the widget positioning options. */
export interface positionConfig {
/** The target element position that the widget is positioned against. */
at?: 'bottom' | 'center' | 'left' | 'left bottom' | 'left top' | 'right' | 'right bottom' | 'right top' | 'top' | { x?: 'center' | 'left' | 'right', y?: 'bottom' | 'center' | 'top' };
/** The element within which the widget is positioned. */
boundary?: string | Element | JQuery | Window;
/** Specifies the horizontal and vertical offset from the window's boundaries. */
boundaryOffset?: string | { x?: number, y?: number };
/** Specifies how to move the widget if it overflows the screen. */
collision?: 'fit' | 'fit flip' | 'fit flipfit' | 'fit none' | 'flip' | 'flip fit' | 'flip none' | 'flipfit' | 'flipfit fit' | 'flipfit none' | 'none' | 'none fit' | 'none flip' | 'none flipfit' | { x?: 'fit' | 'flip' | 'flipfit' | 'none', y?: 'fit' | 'flip' | 'flipfit' | 'none' };
/** The position of the widget to align against the target element. */
my?: 'bottom' | 'center' | 'left' | 'left bottom' | 'left top' | 'right' | 'right bottom' | 'right top' | 'top' | { x?: 'center' | 'left' | 'right', y?: 'bottom' | 'center' | 'top' };
/** The target element that the widget is positioned against. */
of?: string | Element | JQuery | Window;
/** Specifies horizontal and vertical offset in pixels. */
offset?: string | { x?: number, y?: number };
}
/** A repository of animations. */
export class animationPresets {
/** Applies the changes made in the animation repository. */
applyChanges(): void;
/** Removes all animations from the repository. */
clear(): void;
/** Deletes an animation with a specific name. */
clear(name: string): void;
/** Gets the configuration of an animation with a specific name. */
getPreset(name: string): any;
/** Registers predefined animations in the animation repository. */
registerDefaultPresets(): void;
/** Adds an animation with a specific name to the animation repository. */
registerPreset(name: string, config: { animation?: animationConfig, device?: Device }): void;
/** Deletes all custom animations. */
resetToDefaults(): void;
}
/** The manager that performs several specified animations at a time. */
export class TransitionExecutor {
/** Registers the set of elements that should be animated as "entering" using the specified animation configuration. */
enter(elements: JQuery, animation: animationConfig | string): void;
/** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */
leave(elements: JQuery, animation: animationConfig | string): void;
/** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */
reset(): void;
/** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */
start(): Promise<void> & JQueryPromise<void>;
/** Stops all started animations. */
stop(): void;
}
export interface ComponentOptions<T = Component> {
/** A function that is executed before the widget is disposed of. */
onDisposing?: ((e: { component?: T }) => any);
/** A function that is executed only once, after the widget is initialized. */
onInitialized?: ((e: { component?: T, element?: DevExpress.core.dxElement }) => any);
/** A function that is executed after a widget option is changed. */
onOptionChanged?: ((e: { component?: T, name?: string, fullName?: string, value?: any }) => any);
}
/** A base class for all components and widgets. */
export class Component {
constructor(options?: ComponentOptions);
/** Prevents the widget from refreshing until the endUpdate() method is called. */
beginUpdate(): void;
/** Refreshes the widget after a call of the beginUpdate() method. */
endUpdate(): void;
/** Gets the widget's instance. Use it to access other methods of the widget. */
instance(): this;
/** Detaches all event handlers from a single event. */
off(eventName: string): this;
/** Detaches a particular event handler from a single event. */
off(eventName: string, eventHandler: Function): this;
/** Subscribes to an event. */
on(eventName: string, eventHandler: Function): this;
/** Subscribes to events. */
on(events: any): this;
/** Gets all widget options. */
option(): any;
/** Gets the value of a single option. */
option(optionName: string): any;
/** Updates the value of a single option. */
option(optionName: string, optionValue: any): void;
/** Updates the values of several options. */
option(options: any): void;
}
/** Registers a new component in the DevExpress.ui namespace. */
export function registerComponent(name: string, componentClass: any): void;
/** Registers a new component in the specified namespace. */
export function registerComponent(name: string, namespace: any, componentClass: any): void;
/** Specifies settings that affect all DevExtreme widgets. */
export interface globalConfig {
/** A decimal separator. Applies only if you do not use the Globalize or Intl library. */
decimalSeparator?: string;
/** The default currency. Accepts a 3-letter ISO 4217 code. */
defaultCurrency?: string;
/** Specifies how editors' text fields are styled in your application. */
editorStylingMode?: 'outlined' | 'underlined' | 'filled';
/** Specifies whether dates are parsed and serialized according to the ISO 8601 standard in all browsers. */
forceIsoDateParsing?: boolean;
/** Specifies whether to convert string values to lowercase in filter and search requests to OData services. Applies to the following operations: "startswith", "endswith", "contains", and "notcontains". */
oDataFilterToLower?: boolean;
/** Specifies whether the widgets support a right-to-left representation. Available for individual widgets as well. */
rtlEnabled?: boolean;
/** The decimal separator that is used when submitting a value to the server. */
serverDecimalSeparator?: string;
/** A group separator. Applies only if you do not use the Globalize or Intl library. */
thousandsSeparator?: string;
useLegacyStoreResult?: boolean;
useLegacyVisibleIndex?: boolean;
}
/** Gets the current global configuration. */
export function config(): globalConfig;
/** Configures your application before its launch. */
export function config(config: globalConfig): void;
/** The device object defines the device on which the application is running. */
export interface Device {
/** Indicates whether or not the device platform is Android. */
android?: boolean;
/** Specifies the type of the device on which the application is running. */
deviceType?: 'phone' | 'tablet' | 'desktop';
/** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */
generic?: boolean;
/** Specifies a performance grade of the current device. */
grade?: 'A' | 'B' | 'C';
/** Indicates whether or not the device platform is iOS. */
ios?: boolean;
/** Indicates whether or not the device type is 'phone'. */
phone?: boolean;
/** Specifies the platform of the device on which the application is running. */
platform?: 'android' | 'ios' | 'win' | 'generic';
/** Indicates whether or not the device type is 'tablet'. */
tablet?: boolean;
/** Specifies an array with the major and minor versions of the device platform. */
version?: Array<number>;
/** Indicates whether or not the device platform is Windows. */
win?: boolean;
}
/** An object that serves as a namespace for the methods and events specifying information on the current device. */
export class DevicesObject {
constructor(options: { window?: Window });
/** Gets information on the current device. */
current(): Device;
/** Overrides actual device information to force the application to operate as if it was running on a specified device. */
current(deviceName: string | Device): void;
/** Detaches all event handlers from a single event. */
off(eventName: string): this;
/** Detaches a particular event handler from a single event. */
off(eventName: string, eventHandler: Function): this;
/** Subscribes to an event. */
on(eventName: string, eventHandler: Function): this;
/** Subscribes to events. */
on(events: any): this;
/** Returns the current device orientation. */
orientation(): string;
/** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */
real(): Device;
}
export var devices: DevicesObject;
export interface DOMComponentOptions<T = DOMComponent> extends ComponentOptions<T> {
bindingOptions?: any;
/** Specifies the attributes to be attached to the widget's root element. */
elementAttr?: any;
/** Specifies the widget's height. */
height?: number | string | (() => number | string);
/** A function that is executed before the widget is disposed of. */
onDisposing?: ((e: { component?: T, element?: DevExpress.core.dxElement, model?: any }) => any);
/** A function that is executed after a widget option is changed. */
onOptionChanged?: ((e: { component?: T, element?: DevExpress.core.dxElement, model?: any, name?: string, fullName?: string, value?: any }) => any);
/** Switches the widget to a right-to-left representation. */
rtlEnabled?: boolean;
/** Specifies the widget's width. */
width?: number | string | (() => number | string);
}
/** A base class for all components. */
export class DOMComponent extends Component {
constructor(element: Element | JQuery, options?: DOMComponentOptions);
/** Specifies the device-dependent default configuration options for this component. */
static defaultOptions(rule: { device?: Device | Array<Device> | Function, options?: any }): void;
/** Disposes of all the resources allocated to the widget instance. */
dispose(): void;
/** Gets the root widget element. */
element(): DevExpress.core.dxElement;
/** Gets the instance of a widget found using its DOM node. */
static getInstance(element: Element | JQuery): DOMComponent;
}
/** The EndpointSelector is an object for managing OData endpoints in your application. */
export class EndpointSelector {
constructor(options: any);
/** Gets an endpoint with a specific key. */
urlFor(key: string): string;
}
/** An object that serves as a namespace for the methods required to perform validation. */
export class validationEngine {
/** Gets the default validation group. */
static getGroupConfig(): any;
/** Gets a validation group with a specific key. */
static getGroupConfig(group: string | any): any;
/** Registers all the Validator objects extending fields of the specified ViewModel. */
static registerModelForValidation(model: any): void;
/** Resets the values and validation result of the editors that belong to the default validation group. */
static resetGroup(): void;
/** Resets the values and validation result of the editors that belong to the specified validation group. */
static resetGroup(group: string | any): void;
/** Unregisters all the Validator objects extending fields of the specified ViewModel. */
static unregisterModelForValidation(model: any): void;
/** Validates editors from the default validation group. */
static validateGroup(): DevExpress.ui.dxValidationGroupResult;
/** Validates editors from a specific validation group. */
static validateGroup(group: string | any): DevExpress.ui.dxValidationGroupResult;
/** Validates a view model. */
static validateModel(model: any): any;
}
/** Hides the last displayed overlay widget. */
export function hideTopOverlay(): boolean;
/** Processes the hardware back button click. */
export function processHardwareBackButton(): void;
/** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */
export class ui {
/** Creates a toast message. */
static notify(message: string, type?: string, displayTime?: number): void;
/** Creates a toast message. */
static notify(options: any, type?: string, displayTime?: number): void;
/** Sets a template engine. */
static setTemplateEngine(templateEngineName: string): void;
/** Sets a custom template engine defined via custom compile and render functions. */
static setTemplateEngine(templateEngineOptions: { compile?: Function, render?: Function }): void;
}
/** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */
export class viz {
/** Changes the current palette for all data visualization widgets on the page. */
static currentPalette(paletteName: string): void;
/** Gets the current theme's name. */
static currentTheme(): string;
/** Changes the current theme for all data visualization widgets on the page. The color scheme is defined separately. */
static currentTheme(platform: string, colorScheme: string): void;
/** Changes the current theme for all data visualization widgets on the page. */
static currentTheme(theme: string): void;
/** Allows you to export widgets using their SVG markup. */
static exportFromMarkup(markup: string, options: { fileName?: string, format?: string, backgroundColor?: string, proxyUrl?: string, width?: number, height?: number, onExporting?: Function, onExported?: Function, onFileSaving?: Function, margin?: number }): void;
/** Gets the SVG markup of specific widgets for their subsequent export. */
static getMarkup(widgetInstances: Array<DOMComponent>): string;
/** Gets the color sets of a predefined or registered palette. */
static getPalette(paletteName: string): any;
/** Gets a predefined or registered theme's settings. */
static getTheme(theme: string): any;
/** The method to be called every time the active entry in the browser history is modified without reloading the current page. */
static refreshPaths(): void;
/** Refreshes the current theme and palette in all data visualization widgets on the page. */
static refreshTheme(): void;
/** Registers a new palette. */
static registerPalette(paletteName: string, palette: any): void;
/** Registers a new theme based on the existing one. */
static registerTheme(customTheme: any, baseTheme: string): void;
}
}
declare module DevExpress.data {
/** The Guid is an object used to generate and contain a GUID. */
export class Guid {
constructor();
constructor(value: string);
/** Gets the GUID. Works identically to the valueOf() method. */
toString(): string;
/** Gets the GUID. Works identically to the toString() method. */
valueOf(): string;
}
export interface StoreOptions<T = Store> {
/** Specifies the function that is executed when the store throws an error. */
errorHandler?: Function;
/** Specifies the key property (or properties) used to access data items. */
key?: string | Array<string>;
/** A function that is executed after a data item is added to the store. */
onInserted?: ((values: any, key: any | string | number) => any);
/** A function that is executed before a data item is added to the store. */
onInserting?: ((values: any) => any);
/** A function that is executed after data is loaded to the store. */
onLoaded?: ((result: Array<any>) => any);
/** A function that is executed before data is loaded to the store. */
onLoading?: ((loadOptions: LoadOptions) => any);
/** A function that is executed after a data item is added, updated, or removed from the store. */
onModified?: Function;
/** A function that is executed before a data item is added, updated, or removed from the store. */
onModifying?: Function;
/** The function executed before changes are pushed to the store. */
onPush?: ((changes: Array<any>) => any);
/** A function that is executed after a data item is removed from the store. */
onRemoved?: ((key: any | string | number) => any);
/** A function that is executed before a data item is removed from the store. */
onRemoving?: ((key: any | string | number) => any);
/** A function that is executed after a data item is updated in the store. */
onUpdated?: ((key: any | string | number, values: any) => any);
/** A function that is executed before a data item is updated in the store. */
onUpdating?: ((key: any | string | number, values: any) => any);
}
/** The base class for all Stores. */
export class Store {
constructor(options?: StoreOptions)
/** Gets a data item with a specific key. */
byKey(key: any | string | number): Promise<any> & JQueryPromise<any>;
/** Adds a data item to the store. */
insert(values: any): Promise<any> & JQueryPromise<any>;
/** Gets the key property (or properties) as specified in the key option. */
key(): any;
/** Gets a data item's key value. */
keyOf(obj: any): any;
/** Starts loading data. */
load(): Promise<any> & JQueryPromise<any>;
/** Starts loading data. */
load(options: LoadOptions): Promise<any> & JQueryPromise<any>;
/** Detaches all event handlers from a single event. */
off(eventName: string): this;
/** Detaches a particular event handler from a single event. */
off(eventName: string, eventHandler: Function): this;
/** Subscribes to an event. */
on(eventName: string, eventHandler: Function): this;
/** Subscribes to events. */
on(events: any): this;
/** Pushes data changes to the store and notifies the DataSource. */
push(changes: Array<any>): void;
/** Removes a data item with a specific key from the store. */
remove(key: any | string | number): Promise<void> & JQueryPromise<void>;
/** Gets the total count of items the load() function returns. */
totalCount(obj: { filter?: any, group?: any }): Promise<number> & JQueryPromise<number>;
/** Updates a data item with a specific key. */
update(key: any | string | number, values: any): Promise<any> & JQueryPromise<any>;
}
export interface ArrayStoreOptions<T = ArrayStore> extends StoreOptions<T> {
/** Specifies the store's associated array. */
data?: Array<any>;
}
/** The ArrayStore is a store that provides an interface for loading and editing an in-memory array and handling related events. */
export class ArrayStore extends Store {
constructor(options?: ArrayStoreOptions)
/** Clears all the ArrayStore's associated data. */
clear(): void;
/** Creates a Query for the underlying array. */
createQuery(): any;
}
/** This section describes the loadOptions object's fields. */
export interface LoadOptions {
/** An object for storing additional settings that should be sent to the server. Relevant to the ODataStore only. */
customQueryParams?: any;
/** An array of strings that represent the names of navigation properties to be loaded simultaneously with the ODataStore. */
expand?: any;
/** A filter expression. */
filter?: any;
/** A group expression. */
group?: any;
/** A group summary expression. Used with the group setting. */
groupSummary?: any;
/** Indicates whether a top-level group count is required. Used in conjunction with the filter, take, skip, requireTotalCount, and group settings. */
requireGroupCount?: boolean;
/** Indicates whether the total count of data objects is needed. */
requireTotalCount?: boolean;
/** A data field or expression whose value is compared to the search value. */
searchExpr?: string | Function | Array<string | Function>;
/** A comparison operation. Can have one of the following values: "=", "<>", ">", ">=", "<", "<=", "startswith", "endswith", "contains", "notcontains", "isblank" and "isnotblank". */
searchOperation?: string;
/** The current search value. */
searchValue?: any;
/** A select expression. */
select?: any;
/** The number of data objects to be skipped from the result set's start. In conjunction with take, used to implement paging. */
skip?: number;
/** A sort expression. */
sort?: any;
/** The number of data objects to be loaded. In conjunction with skip, used to implement paging. */
take?: number;
/** A total summary expression. */
totalSummary?: any;
/** An object for storing additional settings that should be sent to the server. */
userData?: any;
}
export interface CustomStoreOptions extends StoreOptions<CustomStore> {
/** Specifies a custom implementation of the byKey(key) method. */
byKey?: ((key: any | string | number) => Promise<any> | JQueryPromise<any>);
/** Specifies whether raw data should be saved in the cache. Applies only if loadMode is "raw". */
cacheRawData?: boolean;
/** Specifies a custom implementation of the insert(values) method. */
insert?: ((values: any) => Promise<any> | JQueryPromise<any>);
/** Specifies a custom implementation of the load(options) method. */
load?: ((options: LoadOptions) => Promise<any> | JQueryPromise<any> | Array<any>);
/** Specifies how data returned by the load function is treated. */
loadMode?: 'processed' | 'raw';
/** Specifies a custom implementation of the remove(key) method. */
remove?: ((key: any | string | number) => Promise<void> | JQueryPromise<void>);
/** Specifies a custom implementation of the totalCount(options) method. */
totalCount?: ((loadOptions: { filter?: any, group?: any }) => Promise<number> | JQueryPromise<number>);
/** Specifies a custom implementation of the update(key, values) method. */
update?: ((key: any | string | number, values: any) => Promise<any> | JQueryPromise<any>);
/** Specifies whether the store combines the search and filter expressions. Defaults to true if the loadMode is "raw" and false if it is "processed". */
useDefaultSearch?: boolean;
}
/** The CustomStore enables you to implement custom data access logic for consuming data from any source. */
export class CustomStore extends Store {
constructor(options?: CustomStoreOptions)
/** Deletes data from the cache. Takes effect only if the cacheRawData option is true. */
clearRawDataCache(): void;
}
export interface DataSourceOptions {
/** Custom parameters that should be passed to an OData service with the load query. Available only for the ODataStore. */
customQueryParams?: any;
/** Specifies the navigation properties to be loaded with the OData entity. Available only for the ODataStore. */
expand?: Array<string> | string;
/** Specifies data filtering conditions. */
filter?: string | Array<any> | Function;
/** Specifies data grouping options. */
group?: string | Array<any> | Function;
/** Specifies an item mapping function. */
map?: ((dataItem: any) => any);
/** A function that is executed after data is loaded. */
onChanged?: ((e: { changes?: Array<any> }) => any);
/** A function that is executed when data loading fails. */
onLoadError?: ((error: { message?: string }) => any);
/** A function that is executed when the data loading status changes. */
onLoadingChanged?: ((isLoading: boolean) => any);
/** Specifies the maximum number of data items per page. Applies only if paginate is true. */
pageSize?: number;
/** Specifies whether the DataSource loads data items by pages or all at once. Defaults to false if group is set; otherwise, true. */
paginate?: boolean;
/** Specifies a post processing function. */
postProcess?: ((data: Array<any>) => Array<any>);
/** Specifies the period (in milliseconds) when changes are aggregated before pushing them to the DataSource. */
pushAggregationTimeout?: number;
/** Specifies whether the DataSource requests the total count of data items in the storage. */
requireTotalCount?: boolean;
/** Specifies whether to reapply sorting, filtering, grouping, and other data processing operations after receiving a push. */
reshapeOnPush?: boolean;
/** Specifies the fields to search. */
searchExpr?: string | Function | Array<string | Function>;
/** Specifies the comparison operation used in searching. The following values are accepted: "=", "<>", ">", ">=", "<", "<=", "startswith", "endswith", "contains", "notcontains". */
searchOperation?: string;
/** Specifies the value to which the search expression is compared. */
searchValue?: any;
/** Specifies the fields to select from data objects. */
select?: string | Array<any> | Function;
/** Specifies data sorting options. */
sort?: string | Array<any> | Function;
/** Configures the store underlying the DataSource. */
store?: Store | StoreOptions | Array<any> | any;
}
/** The DataSource is an object that provides an API for processing data from an underlying store. */
export class DataSource {
constructor(url: string);
constructor(data: Array<any>);
constructor(store: Store);
constructor(options: CustomStoreOptions | DataSourceOptions);
/** Cancels the load operation with a specific identifier. */
cancel(): boolean;
/** Disposes of all the resources allocated to the DataSource instance. */
dispose(): void;
/** Gets the filter option's value. */
filter(): any;
/** Sets the filter option's value. */
filter(filterExpr: any): void;
/** Gets the group option's value. */
group(): any;
/** Sets the group option's value. */
group(groupExpr: any): void;
/** Checks whether the count of items on the current page is less than the pageSize. Takes effect only with enabled paging. */
isLastPage(): boolean;
/** Checks whether data is loaded in the DataSource. */
isLoaded(): boolean;
/** Checks whether data is being loaded in the DataSource. */
isLoading(): boolean;
/** Gets data items the DataSource performs operations on. */
items(): Array<any>;
/** Gets the value of the underlying store's key option. */
key(): any & string & number;
/** Starts loading data. */
load(): Promise<any> & JQueryPromise<any>;
/** Gets an object with current data processing settings. */
loadOptions(): any;
/** Detaches all event handlers from a single event. */
off(eventName: string): this;
/** Detaches a particular event handler from a single event. */
off(eventName: string, eventHandler: Function): this;
/** Subscribes to an event. */
on(eventName: string, eventHandler: Function): this;
/** Subscribes to events. */
on(events: any): this;
/** Gets the current page index. */
pageIndex(): number;
/** Sets the index of the page that should be loaded on the next load() method call. */
pageIndex(newIndex: number): void;
/** Gets the page size. */
pageSize(): number;
/** Sets the page size. */
pageSize(value: number): void;
/** Gets the paginate option's value. */
paginate(): boolean;
/** Sets the paginate option's value. */
paginate(value: boolean): void;
/** Clears currently loaded DataSource items and calls the load() method. */
reload(): Promise<any> & JQueryPromise<any>;
/** Gets the requireTotalCount option's value. */
requireTotalCount(): boolean;
/** Sets the requireTotalCount option's value. */
requireTotalCount(value: boolean): void;
/** Gets the searchExpr option's value. */
searchExpr(): string & Function & Array<string | Function>;
/** Sets the searchExpr option's value. */
searchExpr(expr: string | Function | Array<string | Function>): void;
/** Gets the searchOperation option's value. */
searchOperation(): string;
/** Sets the searchOperation option's value. */
searchOperation(op: string): void;
/** Gets the searchValue option's value. */
searchValue(): any;
/** Sets the searchValue option's value. */
searchValue(value: any): void;
/** Gets the select option's value. */
select(): any;
/** Sets the select option's value. */
select(expr: any): void;
/** Gets the sort option's value. */
sort(): any;
/** Sets the sort option's value. */
sort(sortExpr: any): void;
/** Gets the instance of the store underlying the DataSource. */
store(): any;
/** Gets the number of data items in the store after the last load() operation without paging. Takes effect only if requireTotalCount is true */
totalCount(): number;
}
export interface LocalStoreOptions extends ArrayStoreOptions<LocalStore> {
/** Specifies a delay in milliseconds between when data changes and the moment these changes are saved in the local storage. Applies only if immediate is false. */
flushInterval?: number;
/** Specifies whether the LocalStore saves changes in the local storage immediately. */
immediate?: boolean;
/** Specifies the name under which data should be saved in the local storage. The `dx-data-localStore-` prefix will be added to the name. */
name?: string;
}
/** The LocalStore is a store that provides an interface for loading and editing data from HTML Web Storage (also known as window.localStorage) and handling related events. */
export class LocalStore extends ArrayStore {
constructor(options?: LocalStoreOptions)
/** Removes data from the local storage. */
clear(): void;
}
/** The Query is an object that provides a chainable interface for making data queries. */
export class Query {
/** Calculates a custom summary for all data items. */
aggregate(seed: any, step: Function, finalize: Function): Promise<any> & JQueryPromise<any>;
/** Calculates a custom summary for all data items. */
aggregate(step: Function): Promise<any> & JQueryPromise<any>;
/** Calculates the average of all values. Applies only to numeric arrays. */
avg(): Promise<number> & JQueryPromise<number>;
/** Calculates the average of all values found using a getter. */
avg(getter: any): Promise<number> & JQueryPromise<number>;
/** Calculates the number of data items. */
count(): Promise<number> & JQueryPromise<number>;
/** Executes the Query. This is an asynchronous alternative to the toArray() method. */
enumerate(): Promise<any> & JQueryPromise<any>;
/** Filters data items using a filter expression. */
filter(criteria: Array<any>): Query;
/** Filters data items using a custom function. */
filter(predicate: Function): Query;
/** Groups data items by the specified getter. */
groupBy(getter: any): Query;
/** Calculates the maximum value. Applies only to numeric arrays. */
max(): Promise<number | Date> & JQueryPromise<number | Date>;
/** Calculates the maximum of all values found using a getter. */
max(getter: any): Promise<number | Date> & JQueryPromise<number | Date>;
/** Calculates the minimum value. Applies only to numeric arrays. */
min(): Promise<number | Date> & JQueryPromise<number | Date>;
/** Calculates the minumum of all values found using a getter. */
min(getter: any): Promise<number | Date> & JQueryPromise<number | Date>;
/** Selects individual fields from data objects. */
select(getter: any): Query;
/** Gets a specified number of data items starting from a given index. */
slice(skip: number, take?: number): Query;
/** Sorts data items by the specified getter in ascending order. */
sortBy(getter: any): Query;
/** Sorts data items by the specified getter in the specified sorting order. */
sortBy(getter: any, desc: boolean): Query;
/** Calculates the sum of all values. */
sum(): Promise<number> & JQueryPromise<number>;
/** Calculates the sum of all values found using a getter. */
sum(getter: any): Promise<number> & JQueryPromise<number>;
/** Sorts data items by one more getter in ascending order. */
thenBy(getter: any): Query;
/** Sorts data items by one more getter in the specified sorting order. */
thenBy(getter: any, desc: boolean): Query;
/** Gets data items associated with the Query. This is a synchronous alternative to the enumerate() method. */
toArray(): Array<any>;
}
export interface ODataContextOptions {
/** Specifies a function that customizes the request before it is sent to the server. */
beforeSend?: ((options: { url?: string, async?: boolean, method?: string, timeout?: number, params?: any, payload?: any, headers?: any }) => any);
/** Specifies whether stores in the ODataContext serialize/parse date-time values. */
deserializeDates?: boolean;
/** Specifies entity collections to be accessed. */
entities?: any;
/** Specifies a function that is executed when the ODataContext throws an error. */
errorHandler?: ((e: { httpStatus?: number, errorDetails?: any, requestOptions?: any }) => any);
/** Specifies whether to convert string values to lowercase in filter and search requests. Applies to the following operations: "startswith", "endswith", "contains", and "notcontains". */
filterToLower?: boolean;
/** Specifies whether data should be sent using JSONP. */
jsonp?: boolean;
/** Specifies the URL of an OData service. */
url?: string;
/** Specifies the OData version. */
version?: number;
/** Specifies whether to send cookies, authorization headers, and client certificates in a cross-origin request. */
withCredentials?: boolean;
}
/** The ODataContent is an object that provides access to an entire OData service. */
export class ODataContext {
constructor(options?: ODataContextOptions)
/** Invokes an OData operation that returns a value. */
get(operationName: string, params: any): Promise<any> & JQueryPromise<any>;
/** Invokes an OData operation that returns nothing. */
invoke(operationName: string, params: any, httpMethod: any): Promise<void> & JQueryPromise<void>;
/** Gets a link to an entity with a specific key. */
objectLink(entityAlias: string, key: any | string | number): any;
}
export interface ODataStoreOptions extends StoreOptions<ODataStore> {
/** Specifies a function that customizes the request before it is sent to the server. */
beforeSend?: ((options: { url?: string, async?: boolean, method?: string, timeout?: number, params?: any, payload?: any, headers?: any }) => any);
/** Specifies whether the store serializes/parses date-time values. */
deserializeDates?: boolean;
/** Specifies a function that is executed when the ODataStore throws an error. */
errorHandler?: ((e: { httpStatus?: number, errorDetails?: any, requestOptions?: any }) => any);
/** Specifies the data field types. Accepts the following types: "String", "Int32", "Int64", "Boolean", "Single", "Decimal" and "Guid". */
fieldTypes?: any;
/** Specifies whether to convert string values to lowercase in filter and search requests. Applies to the following operations: "startswith", "endswith", "contains", and "notcontains". */
filterToLower?: boolean;
/** Specifies whether data should be sent using JSONP. */
jsonp?: boolean;
/** Specifies the type of the key property or properties. */
keyType?: 'String' | 'Int32' | 'Int64' | 'Guid' | 'Boolean' | 'Single' | 'Decimal' | any;
/** A function that is executed before data is loaded to the store. */
onLoading?: ((loadOptions: LoadOptions) => any);
/** Specifies the URL of an OData entity collection. */
url?: string;
/** Specifies the OData version. */
version?: number;
/** Specifies whether to send cookies, authorization headers, and client certificates in a cross-origin request. */
withCredentials?: boolean;
}
/** The ODataStore is a store that provides an interface for loading and editing data from an individual OData entity collection and handling related events. */
export class ODataStore extends Store {
constructor(options?: ODataStoreOptions)
/** Gets a data item with a specific key. */
byKey(key: any | string | number): Promise<any> & JQueryPromise<any>;
/** Gets an entity with a specific key. */
byKey(key: any | string | number, extraOptions: { expand?: string | Array<string>, select?: string | Array<string> }): Promise<any> & JQueryPromise<any>;
/** Creates a Query for the OData endpoint. */
createQuery(loadOptions: any): any;
}
/** The EdmLiteral is an object for working with primitive data types from the OData's Abstract Type System that are not supported in JavaScript. */
export class EdmLiteral {
constructor(value: string);
/** Gets the EdmLiteral's value converted to a string. */
valueOf(): string;
}
export interface PivotGridDataSourceOptions {
/** Configures pivot grid fields. */
fields?: Array<PivotGridDataSourceField>;
/** Specifies data filtering conditions. Cannot be used with an XmlaStore. */
filter?: string | Array<any> | Function;
/** A function that is executed after data is successfully loaded. */
onChanged?: Function;
/** A function that is executed when all fields are loaded from the store and they are ready to be displayed in the PivotGrid. */
onFieldsPrepared?: ((fields: Array<PivotGridDataSourceField>) => any);
/** A function that is executed when data loading fails. */
onLoadError?: ((error: any) => any);
/** A function that is executed when the data loading status changes. */
onLoadingChanged?: ((isLoading: boolean) => any);
/** Specifies whether the data processing operations (filtering, grouping, summary calculation) should be performed on the server. */
remoteOperations?: boolean;
/** Specifies whether to auto-generate pivot grid fields from the store's data. */
retrieveFields?: boolean;
/** Configures the DataSource's underlying store. */
store?: Store | StoreOptions | XmlaStore | XmlaStoreOptions | Array<{ type?: 'array' | 'local' | 'odata' | 'xmla' }> | { type?: 'array' | 'local' | 'odata' | 'xmla' };
}
/** The PivotGridDataSource is an object that provides an API for processing data from an underlying store. This object is used in the PivotGrid widget. */
export class PivotGridDataSource {
constructor(options?: PivotGridDataSourceOptions)
/** Collapses all header items of a field with the specified identifier. */
collapseAll(id: number | string): void;
/** Collapses a specific header item. */
collapseHeaderItem(area: string, path: Array<string | number | Date>): void;
/** Provides access to the facts that were used to calculate a specific summary value. */
createDrillDownDataSource(options: { columnPath?: Array<string | number | Date>, rowPath?: Array<string | number | Date>, dataIndex?: number, maxRowCount?: number, customColumns?: Array<string> }): DataSource;
/** Disposes of all the resources allocated to the PivotGridDataSource instance. */
dispose(): void;
/** Expands all the header items of a field with the specified identifier. */
expandAll(id: number | string): void;
/** Expands a specific header item. */
expandHeaderItem(area: string, path: Array<any>): void;
/** Gets all the options of a field with the specified identifier. */
field(id: number | string): any;
/** Updates field options' values. */
field(id: number | string, options: any): void;
/** Gets all the fields including those generated automatically. */
fields(): Array<PivotGridDataSourceField>;
/** Specifies a new fields collection. */
fields(fields: Array<PivotGridDataSourceField>): void;
/** Gets the filter option's value. Does not affect an XmlaStore. */
filter(): any;
/** Sets the filter option's value. Does not affect an XmlaStore. */
filter(filterExpr: any): void;
/** Gets all the fields within an area. */
getAreaFields(area: string, collectGroups: boolean): Array<PivotGridDataSourceField>;
/** Gets the loaded data. Another data portion is loaded every time a header item is expanded. */
getData(): any;
/** Checks whether the PivotGridDataSource is loading data. */
isLoading(): boolean;
/** Starts loading data. */
load(): Promise<any> & JQueryPromise<any>;
/** Detaches all event handlers from a single event. */
off(eventName: string): this;
/** Detaches a particular event handler from a single event. */
off(eventName: string, eventHandler: Function): this;
/** Subscribes to an event. */
on(eventName: string, eventHandler: Function): this;
/** Subscribes to events. */
on(events: any): this;
/** Clears the loaded PivotGridDataSource data and calls the load() method. */
reload(): Promise<any> & JQueryPromise<any>;
/** Gets the current PivotGridDataSource state. */
state(): any;
/** Sets the PivotGridDataSource state. */
state(state: any): void;
}
export interface XmlaStoreOptions {
/** Specifies a function that customizes the request before it is sent to the server. */
beforeSend?: ((options: { url?: string, method?: string, headers?: any, xhrFields?: any, data?: string, dataType?: string }) => any);
/** Specifies the database (or initial catalog) that contains the OLAP cube to use. */
catalog?: string;
/** Specifies the name of the OLAP cube to use from the catalog. */
cube?: string;
/** Specifies the OLAP server's URL. */
url?: string;
}
/** The XmlaStore is a store that provides an interface for accessing an OLAP cube according to the XMLA standard. */
export class XmlaStore {
constructor(options?: XmlaStoreOptions)
}
/** Specifies the function that is executed when a data layer object throws an error. */
export function errorHandler(e: Error): void;
/** Creates a Query instance. */
export function query(array: Array<any>): Query;
/** Creates a Query instance that accesses a remote data service usi