devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
1,402 lines (1,390 loc) • 1.3 MB
TypeScript
/**
* DevExtreme (dx.all.d.ts)
* Version: 21.2.4
* Build date: Mon Dec 06 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
declare global {
interface JQuery<TElement = HTMLElement> {}
interface JQueryEventObject {}
interface JQueryPromise<T> {}
}
declare module DevExpress {
/**
* Defines animation properties.
*/
export type AnimationConfig = {
/**
* A function called after animation is completed.
*/
complete?: (
$element: DevExpress.core.DxElement,
config: AnimationConfig
) => void;
/**
* 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 an initial animation state. Use the to property to specify the final state.
*/
from?: DevExpress.animation.AnimationState;
/**
* 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: AnimationConfig
) => void;
/**
* Specifies a final animation state. Use the from property to specify an initial state.
*/
to?: DevExpress.animation.AnimationState;
/**
* A string value specifying the animation type.
*/
type?:
| 'css'
| 'fade'
| 'fadeIn'
| 'fadeOut'
| 'pop'
| 'slide'
| 'slideIn'
| 'slideOut';
};
/**
* A repository of animations.
*/
export const 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): AnimationConfig;
/**
* 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;
};
/**
* A base class for all components and UI components.
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export class Component<TProperties> {
constructor(options?: TProperties);
/**
* Prevents the UI component from refreshing until the endUpdate() method is called.
*/
beginUpdate(): void;
/**
* Refreshes the UI component after a call of the beginUpdate() method.
*/
endUpdate(): void;
/**
* Gets the UI component's instance. Use it to access other methods of the UI component.
*/
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: { [key: string]: Function }): this;
/**
* Gets all UI component properties.
*/
option(): TProperties;
/**
* Gets the value of a single property.
*/
option<TPropertyName extends string, TValue = unknown>(
optionName: TPropertyName
): TPropertyName extends keyof TProperties
? TProperties[TPropertyName]
: TValue;
/**
* Updates the value of a single property.
*/
option<TPropertyName extends string, TValue = unknown>(
optionName: TPropertyName,
optionValue: TPropertyName extends keyof TProperties
? TProperties[TPropertyName]
: TValue
): void;
/**
* Updates the values of several properties.
*/
option(options: Partial<TProperties>): void;
/**
* Resets a property to its default value.
*/
resetOption(optionName: string): void;
}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface ComponentOptions<
TDisposingEvent,
TInitializedEvent,
TOptionChangedEvent
> {
/**
* A function that is executed before the UI component is disposed of.
*/
onDisposing?: (e: TDisposingEvent) => void;
/**
* A function used in JavaScript frameworks to save the UI component instance.
*/
onInitialized?: (e: TInitializedEvent) => void;
/**
* A function that is executed after a UI component property is changed.
*/
onOptionChanged?: (e: TOptionChangedEvent) => void;
}
/**
* Gets the current global configuration.
*/
export function config(): globalConfig;
/**
* Configures your application before its launch.
*/
export function config(config: globalConfig): void;
/**
*
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export class DataHelperMixin {
/**
* Gets the DataSource instance.
*/
getDataSource(): DevExpress.data.DataSource;
}
/**
* The device object defines the device on which the application is running.
*/
export type 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' | '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>;
};
/**
*
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export const devices: DevicesObject;
/**
* 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: DevExpress.core.EventName): this;
/**
* Detaches a particular event handler from a single event.
*/
off(eventName: DevExpress.core.EventName, eventHandler: Function): this;
/**
* Subscribes to an event.
*/
on(eventName: DevExpress.core.EventName, eventHandler: Function): this;
/**
* Subscribes to events.
*/
on(events: { [key in DevExpress.core.EventName]?: Function }): this;
/**
* Returns the current device orientation.
*/
orientation(): 'portrait' | 'landscape' | undefined;
/**
* Returns real information about the current device regardless of the value passed to the DevExpress.devices.current(deviceName) method.
*/
real(): Device;
isSimulator(): boolean;
}
/**
* A base class for all components.
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export class DOMComponent<
TProperties = DevExpress.DOMComponent.Properties
> extends Component<TProperties> {
_templateManager: DevExpress.core.TemplateManager;
_cancelOptionChange?: string;
constructor(
element: DevExpress.core.UserDefinedElement,
options?: TProperties
);
/**
* Gets the instance of a UI component found using its DOM node.
*/
static getInstance(
element: DevExpress.core.UserDefinedElement
): DOMComponent<DevExpress.DOMComponent.Properties>;
/**
* Specifies the device-dependent default configuration properties for this component.
*/
static defaultOptions<TProperties = DevExpress.DOMComponent.Properties>(
rule: DevExpress.core.DefaultOptionsRule<TProperties>
): void;
/**
* Disposes of all the resources allocated to the widget instance.
*/
dispose(): void;
/**
* Gets the root UI component element.
*/
element(): DevExpress.core.DxElement;
$element(): DevExpress.core.UserDefinedElement;
_getTemplate(template: unknown): DevExpress.core.FunctionTemplate;
_invalidate(): void;
_refresh(): void;
_notifyOptionChanged(
fullName: string,
value: unknown,
previousValue: unknown
): void;
_createElement(element: HTMLElement): void;
}
module DOMComponent {
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
interface DOMComponentInstance extends DOMComponent<Properties> {}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
type OptionChangedEventInfo<TComponent> =
DevExpress.events.EventInfo<TComponent> &
DevExpress.events.ChangedOptionInfo;
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
type Properties = DOMComponentOptions<DOMComponentInstance>;
}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface DOMComponentOptions<TComponent>
extends ComponentOptions<
DevExpress.events.EventInfo<TComponent>,
DevExpress.events.InitializedEventInfo<TComponent>,
DevExpress.DOMComponent.OptionChangedEventInfo<TComponent>
> {
/**
*
*/
bindingOptions?: { [key: string]: any };
/**
* Specifies the global attributes to be attached to the UI component's container element.
*/
elementAttr?: { [key: string]: any };
/**
* Specifies the UI component's height.
*/
height?: number | string | (() => number | string);
/**
* A function that is executed before the UI component is disposed of.
*/
onDisposing?: (e: DevExpress.events.EventInfo<TComponent>) => void;
/**
* A function that is executed after a UI component property is changed.
*/
onOptionChanged?: (
e: DevExpress.DOMComponent.OptionChangedEventInfo<TComponent>
) => void;
/**
* Switches the UI component to a right-to-left representation.
*/
rtlEnabled?: boolean;
/**
* Specifies the UI component's width.
*/
width?: number | string | (() => number | string);
}
/**
* A time zone object.
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface dxSchedulerTimeZone {
/**
* A time zone text string from the IANA database.
*/
id: string;
/**
* A GMT offset.
*/
offset: number;
/**
* A time zone in the following format: `(GMT ±[hh]:[mm]) [id]`.
*/
title: string;
}
/**
* 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;
}
/**
* Configures the load panel.
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface ExportLoadPanel {
/**
* Specifies whether the load panel is enabled.
*/
enabled?: boolean;
/**
* Specifies text displayed on the load panel.
*/
text?: string;
/**
* Specifies the width of the load panel in pixels.
*/
width?: number;
/**
* Specifies the height of the load panel in pixels.
*/
height?: number;
/**
* Specifies whether to show the loading indicator.
*/
showIndicator?: boolean;
/**
* Specifies a URL pointing to an image to be used as a loading indicator.
*/
indicatorSrc?: string;
/**
* Specifies whether to show the pane of the load panel.
*/
showPane?: boolean;
/**
* Specifies whether to shade the UI component when the load panel is shown.
*/
shading?: boolean;
/**
* Specifies the shading color. Applies only if shading is true.
*/
shadingColor?: string;
}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
type ExternalFormat = any;
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface FormatObject {
/**
* Specifies a 3-letter ISO 4217 code for currency. Applies only if the type is 'currency'.
*/
currency?: string;
/**
* A function that converts numeric or date-time values to a string.
*/
formatter?: (value: number | Date) => string;
/**
* Parses string values into numeric or date-time values. Should be used with formatter or one of the predefined formats.
*/
parser?: (value: string) => number | Date;
/**
* Specifies a precision for values of numeric or currency format types.
*/
precision?: number;
/**
* Specifies a predefined format. Does not apply if you have specified the formatter function.
*/
type?: PredefinedFormat | string;
}
/**
* An object that serves as a namespace for the methods that are used to animate UI elements.
*/
export const fx: {
/**
* Animates an element.
*/
animate(
element: Element,
config: AnimationConfig
): DevExpress.core.utils.DxPromise<void>;
/**
* Checks whether an element is being animated.
*/
isAnimating(element: Element): boolean;
/**
* Stops an element's animation.
*/
stop(element: Element, jumpToEnd: boolean): void;
};
/**
* Specifies settings that affect all DevExtreme UI components.
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface globalConfig {
/**
* A decimal separator. No longer applies.
* @deprecated
*/
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';
/**
* Configures a Floating Action Button (FAB) that emits a stack of related actions (speed dial).
*/
floatingActionButtonConfig?: {
/**
* Specifies the icon the FAB displays when the speed dial is opened.
*/
closeIcon?: string;
/**
* Specifies the direction in which to open the speed dial menu.
*/
direction?: 'auto' | 'up' | 'down';
/**
* Specifies the icon the FAB displays when the speed dial is closed.
*/
icon?: string;
/**
* Specifies the text label displayed inside the FAB.
*/
label?: string;
/**
* Limits the number of speed dial actions.
*/
maxSpeedDialActionCount?: number;
/**
* Positions the FAB on the screen.
*/
position?:
| 'bottom'
| 'center'
| 'left'
| 'left bottom'
| 'left top'
| 'right'
| 'right bottom'
| 'right top'
| 'top'
| PositionConfig
| Function;
/**
* If true, the background should be shaded when the speed dial menu is open.
*/
shading?: boolean;
};
/**
* 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 UI components support a right-to-left representation. Available for individual UI components as well.
*/
rtlEnabled?: boolean;
/**
* The decimal separator that is used when submitting a value to the server.
*/
serverDecimalSeparator?: string;
/**
* A group separator. No longer applies.
* @deprecated
*/
thousandsSeparator?: string;
/**
*
*/
useLegacyStoreResult?: boolean;
/**
*
*/
useLegacyVisibleIndex?: boolean;
}
/**
* Hides the last displayed overlay UI component.
*/
export function hideTopOverlay(): boolean;
/**
* Configures the position of an overlay element.
*/
export interface PositionConfig {
/**
* Specifies the target element's side or corner where the overlay element should be positioned.
*/
at?:
| 'bottom'
| 'center'
| 'left'
| 'left bottom'
| 'left top'
| 'right'
| 'right bottom'
| 'right top'
| 'top'
| {
/**
* Specifies a position in the horizontal direction (for left, right, or center alignment).
*/
x?: 'center' | 'left' | 'right';
/**
* Specifies a position in the vertical direction (for top, bottom, or center alignment).
*/
y?: 'bottom' | 'center' | 'top';
};
/**
* A boundary element in which the overlay element must be positioned.
*/
boundary?: string | DevExpress.core.UserDefinedElement | Window;
/**
* Specifies the offset of boundaries from the boundary element.
*/
boundaryOffset?:
| string
| {
/**
* Specifies a horizontal offset.
*/
x?: number;
/**
* Specifies a vertical offset.
*/
y?: number;
};
/**
* Specifies how to resolve collisions - when the overlay element exceeds the boundary element.
*/
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'
| {
/**
* Specifies how to resolve horizontal collisions.
*/
x?: 'fit' | 'flip' | 'flipfit' | 'none';
/**
* Specifies how to resolve vertical collisions.
*/
y?: 'fit' | 'flip' | 'flipfit' | 'none';
};
/**
* Specifies the overlay element's side or corner to align with a target element.
*/
my?:
| 'bottom'
| 'center'
| 'left'
| 'left bottom'
| 'left top'
| 'right'
| 'right bottom'
| 'right top'
| 'top'
| {
/**
* Specifies a position in the horizontal direction (for left, right, or center alignment).
*/
x?: 'center' | 'left' | 'right';
/**
* Specifies a position in the vertical direction (for top, bottom, or center alignment).
*/
y?: 'bottom' | 'center' | 'top';
};
/**
* The target element relative to which the overlay element should be positioned.
*/
of?: string | DevExpress.core.UserDefinedElement | Window;
/**
* Specifies the overlay element's offset from a specified position.
*/
offset?:
| string
| {
/**
* Specifies a horizontal offset.
*/
x?: number;
/**
* Specifies a vertical offset.
*/
y?: number;
};
}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
type PredefinedFormat =
| 'billions'
| 'currency'
| 'day'
| 'decimal'
| 'exponential'
| 'fixedPoint'
| 'largeNumber'
| 'longDate'
| 'longTime'
| 'millions'
| 'millisecond'
| 'month'
| 'monthAndDay'
| 'monthAndYear'
| 'percent'
| 'quarter'
| 'quarterAndYear'
| 'shortDate'
| 'shortTime'
| 'thousands'
| 'trillions'
| 'year'
| 'dayOfWeek'
| 'hour'
| 'longDateLongTime'
| 'minute'
| 'second'
| 'shortDateShortTime';
/**
* Registers a new component in the DevExpress.ui namespace.
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export function registerComponent<TComponent>(
name: string,
componentClass: DevExpress.core.ComponentFactory<TComponent>
): void;
/**
* Registers a new component in the specified namespace.
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export function registerComponent<TComponent>(
name: string,
namespace: {
[key: string]: DevExpress.core.ComponentFactory<DOMComponent>;
},
componentClass: DevExpress.core.ComponentFactory<TComponent>
): void;
/**
* Sets a supported template engine to use when using jQuery.
*/
export function setTemplateEngine(templateEngineName: string): void;
/**
* Sets custom functions that compile and render templates.
*/
export function setTemplateEngine(templateEngineOptions: {
compile?: Function;
render?: Function;
}): 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: DevExpress.core.UserDefinedElementsArray,
animation: AnimationConfig | string
): void;
/**
* Registers a set of elements that should be animated as 'leaving' using the specified animation configuration.
*/
leave(
elements: DevExpress.core.UserDefinedElementsArray,
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(): DevExpress.core.utils.DxPromise<void>;
/**
* Stops all started animations.
*/
stop(): void;
}
/**
* 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.dxValidationGroup.ValidationResult;
/**
* Validates editors from a specific validation group.
*/
static validateGroup(
group: string | any
): DevExpress.ui.dxValidationGroup.ValidationResult;
/**
* Validates a view model.
*/
static validateModel(model: any): any;
}
}
declare module DevExpress.animation {
/**
* @deprecated Use the AnimationConfig type instead
*/
export type animationConfig = AnimationConfig;
/**
* Describes an animation state.
*/
export type AnimationState =
| string
| number
| {
/**
* Element opacity.
*/
opacity: number;
}
| {
/**
* A value that controls element size.
*/
scale: number;
}
| {
/**
* Element position.
*/
position: PositionConfig;
}
| {
/**
* A shortcut that positions the element's left side relative to the parent element.
*/
left: number;
}
| {
/**
* A shortcut that positions the element's top side relative to the parent element.
*/
top: number;
};
/**
* @deprecated Use the PositionConfig type instead
*/
export interface positionConfig extends PositionConfig {}
}
declare module DevExpress.core {
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
type ComponentFactory<TComponent> = {
new (
element: UserDefinedElement,
options?: Record<string, unknown>
): TComponent;
getInstance(element: UserDefinedElement): TComponent;
};
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface Condition {}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
interface Condition extends JQueryEventObject {}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type DeepPartial<T> = T extends object
? {
[P in keyof T]?: DeepPartial<T[P]>;
}
: T;
export type DefaultOptionsRule<T> = {
device?: Device | Device[] | ((device: Device) => boolean);
options: DeepPartial<T>;
};
/**
*
* @deprecated
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type dxElement = DxElement<HTMLElement>;
/**
*
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type DxElement<T extends Element = HTMLElement> = {} extends Condition
? T
: ElementWrapper<T>;
/**
*
* @deprecated
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type dxSVGElement = DxElement<SVGElement>;
/**
* A custom template's markup.
*/
export type dxTemplate = Template;
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface dxTemplateOptions {
/**
* Specifies the name of the template.
*/
name?: string;
}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface ElementsArrayWrapper<T extends Element> {}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
interface ElementsArrayWrapper<T extends Element> extends JQuery<T> {}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface ElementWrapper<T extends Element> {}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
interface ElementWrapper<T extends Element> extends JQuery<T> {}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
type EventName = 'orientationChanged';
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export class FunctionTemplate {
render(template: {
container: unknown;
model?: object;
transclude?: boolean;
}): DxElement;
}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface PromiseType<T> {}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
interface PromiseType<T> extends JQueryPromise<T> {}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type Skip<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
/**
* A template notation used to specify templates for UI component elements.
*/
export type template = string | Function | UserDefinedElement;
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export class Template {
constructor(options?: dxTemplateOptions);
}
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export class TemplateManager {
anonymousTemplateName: string;
addDefaultTemplates(templates: Record<string, unknown>): void;
}
/**
*
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type UserDefinedElement<T extends Element = Element> =
{} extends Condition ? T : ElementWrapper<T> | T;
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type UserDefinedElementsArray = {} extends Condition
? Array<Element>
: ElementsArrayWrapper<Element>;
}
declare module DevExpress.core.utils {
/**
*
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type DxPromise<T = void> = {} extends PromiseType<T>
? Promise<T>
: PromiseType<T>;
}
declare module DevExpress.data {
/**
* Applies an array of changes to a source data array.
*/
export function applyChanges(
data: Array<any>,
changes: Array<any>,
options?: { keyExpr?: string | Array<string>; immutable?: boolean }
): 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<TItem = any, TKey = any> extends Store<TItem, TKey> {
constructor(options?: DevExpress.data.ArrayStore.Options<TItem, TKey>);
/**
* Clears all the ArrayStore's associated data.
*/
clear(): void;
/**
* Creates a Query for the underlying array.
*/
createQuery(): Query;
}
module ArrayStore {
export type Options<TItem = any, TKey = any> = ArrayStoreOptions<
TItem,
TKey
>;
}
/**
* @deprecated Use Options instead
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface ArrayStoreOptions<TItem = any, TKey = any>
extends DevExpress.data.Store.Options<TItem, TKey> {
/**
* Specifies the store's associated array.
*/
data?: Array<TItem>;
}
/**
* Encodes a string or array of bytes in Base64.
*/
export function base64_encode(input: string | Array<number>): string;
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
type BaseGroupDescriptor<T> = {
selector: KeySelector<T>;
};
/**
* The CustomStore enables you to implement custom data access logic for consuming data from any source.
*/
export class CustomStore<TItem = any, TKey = any> extends Store<TItem, TKey> {
constructor(options?: DevExpress.data.CustomStore.Options<TItem, TKey>);
/**
* Deletes data from the cache. Takes effect only if the cacheRawData property is true.
*/
clearRawDataCache(): void;
}
module CustomStore {
export type GroupItem<TItem = any> = {
key: any | string | number;
items: Array<TItem> | Array<GroupItem> | null;
count?: number;
summary?: Array<any>;
};
export type Options<TItem = any, TKey = any> = CustomStoreOptions<
TItem,
TKey
>;
}
/**
* @deprecated Use Options instead
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface CustomStoreOptions<TItem = any, TKey = any>
extends DevExpress.data.Store.Options<TItem, TKey> {
/**
* Specifies a custom implementation of the byKey(key) method.
*/
byKey?: (key: TKey) => PromiseLike<TItem>;
/**
* 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: TItem) => PromiseLike<TItem>;
/**
* Specifies a custom implementation of the load(options) method.
*/
load: (options: LoadOptions<TItem>) =>
| DevExpress.core.utils.DxPromise<
| Array<TItem>
| Array<DevExpress.data.CustomStore.GroupItem>
| {
data: Array<TItem> | Array<DevExpress.data.CustomStore.GroupItem>;
totalCount?: number;
summary?: Array<any>;
groupCount?: number;
}
>
| Array<DevExpress.data.CustomStore.GroupItem>
| Array<TItem>;
/**
* Specifies how data returned by the load function is treated.
*/
loadMode?: 'processed' | 'raw';
/**
* Specifies a custom implementation of the remove(key) method.
*/
remove?: (key: TKey) => PromiseLike<void>;
/**
* Specifies a custom implementation of the totalCount(options) method.
*/
totalCount?: (loadOptions: {
filter?: FilterDescriptor | Array<FilterDescriptor>;
group?: GroupDescriptor<TItem> | Array<GroupDescriptor<TItem>>;
}) => PromiseLike<number>;
/**
* Specifies a custom implementation of the update(key, values) method.
*/
update?: (key: TKey, values: TItem) => PromiseLike<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 DataSource is an object that provides an API for processing data from an underlying store.
*/
export class DataSource<TItem = any, TKey = any> {
constructor(data: Array<TItem>);
constructor(
options:
| DevExpress.data.CustomStore.Options<TItem, TKey>
| DevExpress.data.DataSource.Options<any, any, TItem, TKey>
);
constructor(store: Store<TItem, TKey>);
constructor(url: string);
/**
* Cancels the load operation with a specific identifier.
*/
cancel(operationId: number): boolean;
/**
* Disposes of all the resources allocated to the DataSource instance.
*/
dispose(): void;
/**
* Gets the filter property's value.
*/
filter(): FilterDescriptor | Array<FilterDescriptor>;
/**
* Sets the filter property's value.
*/
filter(filterExpr: FilterDescriptor | Array<FilterDescriptor>): void;
/**
* Gets the group property's value.
*/
group(): GroupDescriptor<TItem> | Array<GroupDescriptor<TItem>>;
/**
* Sets the group property's value.
*/
group(
groupExpr: GroupDescriptor<TItem> | Array<GroupDescriptor<TItem>>
): 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 an array of data items on the current page.
*/
items(): Array<any>;
/**
* Gets the value of the underlying store's key property.
*/
key(): string | Array<string>;
/**
* Starts loading data.
*/
load(): DevExpress.core.utils.DxPromise<any>;
/**
* Gets an object with current data processing settings.
*/
loadOptions(): LoadOptions<TItem>;
/**
* Detaches all event handlers from a single event.
*/
off(eventName: DevExpress.data.DataSource.EventName): this;
/**
* Detaches a particular event handler from a single event.
*/
off(
eventName: DevExpress.data.DataSource.EventName,
eventHandler: Function
): this;
/**
* Subscribes to an event.
*/
on(
eventName: DevExpress.data.DataSource.EventName,
eventHandler: Function
): this;
/**
* Subscribes to events.
*/
on(
events: { [key in DevExpress.data.DataSource.EventName]?: Function }
): 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 property's value.
*/
paginate(): boolean;
/**
* Sets the paginate property's value.
*/
paginate(value: boolean): void;
/**
* Clears currently loaded DataSource items and calls the load() method.
*/
reload(): DevExpress.core.utils.DxPromise<any>;
/**
* Gets the requireTotalCount property's value.
*/
requireTotalCount(): boolean;
/**
* Sets the requireTotalCount property's value.
*/
requireTotalCount(value: boolean): void;
/**
* Gets the searchExpr property's value.
*/
searchExpr(): string & Function & Array<string | Function>;
/**
* Sets the searchExpr property's value.
*/
searchExpr(expr: string | Function | Array<string | Function>): void;
/**
* Gets the searchOperation property's value.
*/
searchOperation(): string;
/**
* Sets the searchOperation property's value.
*/
searchOperation(op: string): void;
/**
* Gets the searchValue property's value.
*/
searchValue(): any;
/**
* Sets the searchValue property's value.
*/
searchValue(value: any): void;
/**
* Gets the select property's value.
*/
select(): SelectDescriptor<TItem>;
/**
* Sets the select property's value.
*/
select(expr: SelectDescriptor<TItem>): void;
/**
* Gets the sort property's value.
*/
sort(): SortDescriptor<TItem> | Array<SortDescriptor<TItem>>;
/**
* Sets the sort property's value.
*/
sort(sortExpr: SortDescriptor<TItem> | Array<SortDescriptor<TItem>>): void;
/**
* Gets the instance of the store underlying the DataSource.
*/
store(): Store<TItem, TKey>;
/**
* 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;
}
module DataSource {
/**
*
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type DataSourceLike<TItem, TKey = any> =
| string
| Array<TItem>
| Store<TItem, TKey>
| DataSourceOptionsStub<any, any, TItem>
| DataSource<TItem, TKey>;
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
interface DataSourceOptionsStub<
TStoreItem = any,
TMappedItem = TStoreItem,
TItem = TMappedItem
> {
customQueryParams?: any;
expand?: Array<string> | string;
filter?: FilterDescriptor | Array<FilterDescriptor>;
group?: GroupDescriptor<TItem> | Array<GroupDescriptor<TItem>>;
map?: (dataItem: TStoreItem) => TMappedItem;
onChanged?: (e: { readonly changes?: Array<TMappedItem> }) => void;
onLoadError?: (error: { readonly message?: string }) => void;
onLoadingChanged?: (isLoading: boolean) => void;
pageSize?: number;
paginate