Skip to content

Commit

Permalink
Generate union / enum types for properties (#25655)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpreyskurantov authored Sep 25, 2023
1 parent 80111d5 commit 47cbfea
Show file tree
Hide file tree
Showing 200 changed files with 2,311 additions and 2,000 deletions.
23 changes: 18 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@types/node": "^18.15.3",
"cheerio": "1.0.0-rc.10",
"codelyzer": "^6.0.2",
"devextreme-internal-tools": "12.0.0-beta.3",
"devextreme-internal-tools": "12.0.0-beta.4",
"eslint": "8.47.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "17.0.0",
Expand Down
7 changes: 4 additions & 3 deletions packages/devextreme-angular/src/ui/action-sheet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
export { ExplicitTypes } from 'devextreme/ui/action_sheet';

import DevExpress from 'devextreme/bundles/dx.all';
import { ButtonStyle, ButtonType } from 'devextreme/common';
import { UserDefinedElement } from 'devextreme/core/element';
import { Store } from 'devextreme/data';
import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source';
Expand Down Expand Up @@ -175,10 +176,10 @@ export class DxActionSheetComponent extends DxComponent implements OnDestroy, On
*/
@Input()
get items(): Array<string | any | { disabled?: boolean, icon?: string, onClick?: Function, stylingMode?: string, template?: any, text?: string, type?: string }> {
get items(): Array<string | any | { disabled?: boolean, icon?: string, onClick?: Function, stylingMode?: ButtonStyle, template?: any, text?: string, type?: ButtonType }> {
return this._getOption('items');
}
set items(value: Array<string | any | { disabled?: boolean, icon?: string, onClick?: Function, stylingMode?: string, template?: any, text?: string, type?: string }>) {
set items(value: Array<string | any | { disabled?: boolean, icon?: string, onClick?: Function, stylingMode?: ButtonStyle, template?: any, text?: string, type?: ButtonType }>) {
this._setOption('items', value);
}

Expand Down Expand Up @@ -432,7 +433,7 @@ export class DxActionSheetComponent extends DxComponent implements OnDestroy, On
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() itemsChange: EventEmitter<Array<string | any | { disabled?: boolean, icon?: string, onClick?: Function, stylingMode?: string, template?: any, text?: string, type?: string }>>;
@Output() itemsChange: EventEmitter<Array<string | any | { disabled?: boolean, icon?: string, onClick?: Function, stylingMode?: ButtonStyle, template?: any, text?: string, type?: ButtonType }>>;

/**
Expand Down
44 changes: 23 additions & 21 deletions packages/devextreme-angular/src/ui/autocomplete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ import {


import DevExpress from 'devextreme/bundles/dx.all';
import { EditorStyle, LabelMode, Mode, Position, SimplifiedSearchMode, ValidationMessageMode, ValidationStatus } from 'devextreme/common';
import { Store } from 'devextreme/data';
import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source';
import { ChangeEvent, ClosedEvent, ContentReadyEvent, CopyEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, OpenedEvent, OptionChangedEvent, PasteEvent, SelectionChangedEvent, ValueChangedEvent } from 'devextreme/ui/autocomplete';
import { DropDownPredefinedButton } from 'devextreme/ui/drop_down_editor/ui.drop_down_editor';
import { Properties as dxPopupOptions } from 'devextreme/ui/popup';

import DxAutocomplete from 'devextreme/ui/autocomplete';
Expand Down Expand Up @@ -125,10 +127,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get buttons(): Array<string | DevExpress.common.TextEditorButton> {
get buttons(): Array<DropDownPredefinedButton | DevExpress.common.TextEditorButton> {
return this._getOption('buttons');
}
set buttons(value: Array<string | DevExpress.common.TextEditorButton>) {
set buttons(value: Array<DropDownPredefinedButton | DevExpress.common.TextEditorButton>) {
this._setOption('buttons', value);
}

Expand Down Expand Up @@ -385,10 +387,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get labelMode(): string {
get labelMode(): LabelMode {
return this._getOption('labelMode');
}
set labelMode(value: string) {
set labelMode(value: LabelMode) {
this._setOption('labelMode', value);
}

Expand Down Expand Up @@ -528,10 +530,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get searchMode(): string {
get searchMode(): SimplifiedSearchMode {
return this._getOption('searchMode');
}
set searchMode(value: string) {
set searchMode(value: SimplifiedSearchMode) {
this._setOption('searchMode', value);
}

Expand Down Expand Up @@ -606,10 +608,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get stylingMode(): string {
get stylingMode(): EditorStyle {
return this._getOption('stylingMode');
}
set stylingMode(value: string) {
set stylingMode(value: EditorStyle) {
this._setOption('stylingMode', value);
}

Expand Down Expand Up @@ -684,10 +686,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get validationMessageMode(): string {
get validationMessageMode(): ValidationMessageMode {
return this._getOption('validationMessageMode');
}
set validationMessageMode(value: string) {
set validationMessageMode(value: ValidationMessageMode) {
this._setOption('validationMessageMode', value);
}

Expand All @@ -697,10 +699,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get validationMessagePosition(): string {
get validationMessagePosition(): Position | Mode {
return this._getOption('validationMessagePosition');
}
set validationMessagePosition(value: string) {
set validationMessagePosition(value: Position | Mode) {
this._setOption('validationMessagePosition', value);
}

Expand All @@ -710,10 +712,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get validationStatus(): string {
get validationStatus(): ValidationStatus {
return this._getOption('validationStatus');
}
set validationStatus(value: string) {
set validationStatus(value: ValidationStatus) {
this._setOption('validationStatus', value);
}

Expand Down Expand Up @@ -966,7 +968,7 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() buttonsChange: EventEmitter<Array<string | DevExpress.common.TextEditorButton>>;
@Output() buttonsChange: EventEmitter<Array<DropDownPredefinedButton | DevExpress.common.TextEditorButton>>;

/**
Expand Down Expand Up @@ -1106,7 +1108,7 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() labelModeChange: EventEmitter<string>;
@Output() labelModeChange: EventEmitter<LabelMode>;

/**
Expand Down Expand Up @@ -1183,7 +1185,7 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() searchModeChange: EventEmitter<string>;
@Output() searchModeChange: EventEmitter<SimplifiedSearchMode>;

/**
Expand Down Expand Up @@ -1225,7 +1227,7 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() stylingModeChange: EventEmitter<string>;
@Output() stylingModeChange: EventEmitter<EditorStyle>;

/**
Expand Down Expand Up @@ -1267,21 +1269,21 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() validationMessageModeChange: EventEmitter<string>;
@Output() validationMessageModeChange: EventEmitter<ValidationMessageMode>;

/**
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() validationMessagePositionChange: EventEmitter<string>;
@Output() validationMessagePositionChange: EventEmitter<Position | Mode>;

/**
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() validationStatusChange: EventEmitter<string>;
@Output() validationStatusChange: EventEmitter<ValidationStatus>;

/**
Expand Down
Loading

0 comments on commit 47cbfea

Please sign in to comment.