DevExtreme Vue - Syntax Elements

Aggregated Export

An aggregated export is a syntactic construction that DevExtreme uses to group several imports into one (for instance, component-specific types).

Our codebase includes the following lines (for example, in DateBox source code):

Code
  • import type * as DxDateBoxTypes from "devextreme/ui/date_box_types";
  • export { DxDateBoxTypes };

Here, import type is used to import only types from a module, not the actual code that runs during runtime. * as DxDateBoxTypes means "import everything" from the module "devextreme/ui/date_box_types" and collect it under the name DxDateBoxTypes.

The result is then exported, and this is the aggregated export that you can import in your application for every DevExtreme component.

Conditional Types

When navigating through DevExtreme sources, you can find conditional types like the following:

Code
  • export type DxEvent<TNativeEvent = Event> = {} extends EventType ? (EventObject & TNativeEvent) : EventType;
  •  
  • export type DxElement<T extends Element = HTMLElement> = {} extends Condition ? T : ElementWrapper<T>;

These conditional types enable integration with third-party libraries. You can ignore them.

They resolve to built-in browser types: a specific HTMLElement or a browser Event extended with DevExtreme’s EventObject mixin.