devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
141 lines (124 loc) • 4.25 kB
TypeScript
/**
* DevExtreme (ui/toast.d.ts)
* Version: 21.1.4
* Build date: Mon Jun 21 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
animationConfig
} from '../animation/fx';
import {
positionConfig
} from '../animation/position';
import {
UserDefinedElement
} from '../core/element';
import {
DxEvent,
Cancelable,
EventInfo,
InitializedEventInfo,
ChangedOptionInfo
} from '../events/index';
import dxOverlay, {
dxOverlayAnimation,
dxOverlayOptions
} from './overlay';
export type ContentReadyEvent = EventInfo<dxToast>;
export type DisposingEvent = EventInfo<dxToast>;
export type HidingEvent = Cancelable & EventInfo<dxToast>;
export type HiddenEvent = EventInfo<dxToast>;
export type InitializedEvent = InitializedEventInfo<dxToast>;
export type OptionChangedEvent = EventInfo<dxToast> & ChangedOptionInfo;
export type ShowingEvent = EventInfo<dxToast>;
export type ShownEvent = EventInfo<dxToast>;
/**
* @deprecated use Properties 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 dxToastOptions extends dxOverlayOptions<dxToast> {
/**
*
*/
animation?: dxToastAnimation;
/**
* A Boolean value specifying whether or not the toast is closed if a user clicks it.
*/
closeOnClick?: boolean;
/**
*
*/
closeOnOutsideClick?: boolean | ((event: DxEvent) => boolean);
/**
* A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries.
*/
closeOnSwipe?: boolean;
/**
* The time span in milliseconds during which the Toast UI component is visible.
*/
displayTime?: number;
/**
*
*/
height?: number | string | (() => number | string);
/**
*
*/
maxWidth?: number | string | (() => number | string);
/**
* The Toast message text.
*/
message?: string;
/**
*
*/
minWidth?: number | string | (() => number | string);
/**
*
*/
position?: positionConfig | string;
/**
*
*/
shading?: boolean;
/**
* Specifies the Toast UI component type.
*/
type?: 'custom' | 'error' | 'info' | 'success' | 'warning';
/**
*
*/
width?: number | string | (() => 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}.
*/
export interface dxToastAnimation extends dxOverlayAnimation {
/**
* An object that defines the animation properties used when the UI component is being hidden.
*/
hide?: animationConfig;
/**
* An object that defines the animation properties used when the UI component is being shown.
*/
show?: animationConfig;
}
/**
* The Toast is a UI component that provides pop-up notifications.
*/
export default class dxToast extends dxOverlay {
constructor(element: UserDefinedElement, options?: dxToastOptions)
}
export type Properties = dxToastOptions;
/**
* @deprecated use Properties 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 type Options = dxToastOptions;
/**
* @deprecated use Properties 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 type IOptions = dxToastOptions;