From 39429f391ba0b5e0f3aeae9786a3e0ccee7e5904 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Fri, 9 Jan 2026 19:03:23 +0200 Subject: [PATCH 1/8] d.ts (try with generics, keep tags type object vs any) --- packages/devextreme/js/common.d.ts | 48 +++++++++++++++++------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/packages/devextreme/js/common.d.ts b/packages/devextreme/js/common.d.ts index 7d8a176c4123..82da08ad12ce 100644 --- a/packages/devextreme/js/common.d.ts +++ b/packages/devextreme/js/common.d.ts @@ -29,7 +29,7 @@ export type ApplyValueMode = 'instantly' | 'useButtons'; * @namespace DevExpress.common * @type object */ -export type AsyncRule = { +export type AsyncRule = { /** * @docid * @default false @@ -57,16 +57,9 @@ export type AsyncRule = { /** * @docid * @type_function_return Promise - * @type_function_param1 options:object - * @type_function_param1_field value:string|number - * @type_function_param1_field rule:object - * @type_function_param1_field validator:object - * @type_function_param1_field data:object - * @type_function_param1_field column:object - * @type_function_param1_field formItem:object * @public */ - validationCallback?: ((options: ValidationCallbackData) => PromiseLike); + validationCallback?: ((options: ValidationCallbackData) => PromiseLike); }; /** @@ -132,7 +125,7 @@ export type ComparisonOperator = '!=' | '!==' | '<' | '<=' | '==' | '===' | '>' * @type object * @namespace DevExpress.common */ -export type CustomRule = { +export type CustomRule = { /** * @docid * @default false @@ -159,16 +152,9 @@ export type CustomRule = { type: 'custom'; /** * @docid - * @type_function_param1 options:object - * @type_function_param1_field value:string|number - * @type_function_param1_field rule:object - * @type_function_param1_field validator:object - * @type_function_param1_field data:object - * @type_function_param1_field column:object - * @type_function_param1_field formItem:object * @public */ - validationCallback?: ((options: ValidationCallbackData) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); }; /** @@ -812,15 +798,37 @@ export type ToolbarItemLocation = 'after' | 'before' | 'center'; export type TooltipShowMode = 'always' | 'onHover'; /** + * @docid * @public * @namespace DevExpress.common */ -export type ValidationCallbackData = { - value?: any; +export type ValidationCallbackData = { + /** @docid */ + value?: TValue; + /** + * @docid + * @type object + */ rule: any; + /** + * @docid + * @type object + */ validator: any; + /** + * @docid + * @type object + */ data?: any; + /** + * @docid + * @type object + */ column?: any; + /** + * @docid + * @type object + */ formItem?: any; }; From 7c8d54819e254adf5ad1be93de4f577351ba09f8 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Fri, 9 Jan 2026 19:03:38 +0200 Subject: [PATCH 2/8] d.ts (try with generics, keep tags type object vs any): re-generate --- .../src/ui/card-view/nested/async-rule-dxi.ts | 6 ++-- .../ui/card-view/nested/custom-rule-dxi.ts | 6 ++-- .../card-view/nested/validation-rule-dxi.ts | 6 ++-- .../src/ui/data-grid/nested/async-rule-dxi.ts | 6 ++-- .../ui/data-grid/nested/custom-rule-dxi.ts | 6 ++-- .../data-grid/nested/validation-rule-dxi.ts | 6 ++-- .../src/ui/form/nested/async-rule-dxi.ts | 6 ++-- .../src/ui/form/nested/custom-rule-dxi.ts | 6 ++-- .../src/ui/form/nested/validation-rule-dxi.ts | 6 ++-- .../src/ui/scheduler/nested/async-rule-dxi.ts | 6 ++-- .../ui/scheduler/nested/custom-rule-dxi.ts | 6 ++-- .../scheduler/nested/validation-rule-dxi.ts | 6 ++-- .../src/ui/tree-list/nested/async-rule-dxi.ts | 6 ++-- .../ui/tree-list/nested/custom-rule-dxi.ts | 6 ++-- .../tree-list/nested/validation-rule-dxi.ts | 6 ++-- .../src/ui/validator/nested/async-rule-dxi.ts | 6 ++-- .../ui/validator/nested/custom-rule-dxi.ts | 6 ++-- .../validator/nested/validation-rule-dxi.ts | 6 ++-- packages/devextreme/ts/dx.all.d.ts | 35 +++++++++++++++---- 19 files changed, 83 insertions(+), 60 deletions(-) diff --git a/packages/devextreme-angular/src/ui/card-view/nested/async-rule-dxi.ts b/packages/devextreme-angular/src/ui/card-view/nested/async-rule-dxi.ts index dc3f6264612f..da94ffabdf9b 100644 --- a/packages/devextreme-angular/src/ui/card-view/nested/async-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/card-view/nested/async-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiCardViewAsyncRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any) { + get validationCallback(): ((options: ValidationCallbackData) => any) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)) { + set validationCallback(value: ((options: ValidationCallbackData) => any)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/card-view/nested/custom-rule-dxi.ts b/packages/devextreme-angular/src/ui/card-view/nested/custom-rule-dxi.ts index 9daa43a07bb2..c6610f839c20 100644 --- a/packages/devextreme-angular/src/ui/card-view/nested/custom-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/card-view/nested/custom-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiCardViewCustomRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/card-view/nested/validation-rule-dxi.ts b/packages/devextreme-angular/src/ui/card-view/nested/validation-rule-dxi.ts index b2ee2b0894f6..7642cf0f1439 100644 --- a/packages/devextreme-angular/src/ui/card-view/nested/validation-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/card-view/nested/validation-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType, ComparisonOperator } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData, ComparisonOperator } from 'devextreme/common'; import { DxIntegrationModule, @@ -94,10 +94,10 @@ export class DxiCardViewValidationRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/data-grid/nested/async-rule-dxi.ts b/packages/devextreme-angular/src/ui/data-grid/nested/async-rule-dxi.ts index d989a9137f40..fc60806a0c9f 100644 --- a/packages/devextreme-angular/src/ui/data-grid/nested/async-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/data-grid/nested/async-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiDataGridAsyncRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any) { + get validationCallback(): ((options: ValidationCallbackData) => any) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)) { + set validationCallback(value: ((options: ValidationCallbackData) => any)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/data-grid/nested/custom-rule-dxi.ts b/packages/devextreme-angular/src/ui/data-grid/nested/custom-rule-dxi.ts index 7ac8006d2202..ffa38eaa37c7 100644 --- a/packages/devextreme-angular/src/ui/data-grid/nested/custom-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/data-grid/nested/custom-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiDataGridCustomRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/data-grid/nested/validation-rule-dxi.ts b/packages/devextreme-angular/src/ui/data-grid/nested/validation-rule-dxi.ts index bd00be3f1976..4d60d705ed94 100644 --- a/packages/devextreme-angular/src/ui/data-grid/nested/validation-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/data-grid/nested/validation-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType, ComparisonOperator } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData, ComparisonOperator } from 'devextreme/common'; import { DxIntegrationModule, @@ -94,10 +94,10 @@ export class DxiDataGridValidationRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/form/nested/async-rule-dxi.ts b/packages/devextreme-angular/src/ui/form/nested/async-rule-dxi.ts index 171ea03357b2..e07e8a4f8a02 100644 --- a/packages/devextreme-angular/src/ui/form/nested/async-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/form/nested/async-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiFormAsyncRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any) { + get validationCallback(): ((options: ValidationCallbackData) => any) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)) { + set validationCallback(value: ((options: ValidationCallbackData) => any)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/form/nested/custom-rule-dxi.ts b/packages/devextreme-angular/src/ui/form/nested/custom-rule-dxi.ts index bcc0078ff120..e49d3eb53e6d 100644 --- a/packages/devextreme-angular/src/ui/form/nested/custom-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/form/nested/custom-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiFormCustomRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/form/nested/validation-rule-dxi.ts b/packages/devextreme-angular/src/ui/form/nested/validation-rule-dxi.ts index beec413534e8..8c5d3902ecaa 100644 --- a/packages/devextreme-angular/src/ui/form/nested/validation-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/form/nested/validation-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType, ComparisonOperator } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData, ComparisonOperator } from 'devextreme/common'; import { DxIntegrationModule, @@ -94,10 +94,10 @@ export class DxiFormValidationRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/scheduler/nested/async-rule-dxi.ts b/packages/devextreme-angular/src/ui/scheduler/nested/async-rule-dxi.ts index 13f5b942527a..8d10c206e148 100644 --- a/packages/devextreme-angular/src/ui/scheduler/nested/async-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/scheduler/nested/async-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiSchedulerAsyncRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any) { + get validationCallback(): ((options: ValidationCallbackData) => any) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)) { + set validationCallback(value: ((options: ValidationCallbackData) => any)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/scheduler/nested/custom-rule-dxi.ts b/packages/devextreme-angular/src/ui/scheduler/nested/custom-rule-dxi.ts index b678fe6c1017..d3604ba16a1a 100644 --- a/packages/devextreme-angular/src/ui/scheduler/nested/custom-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/scheduler/nested/custom-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiSchedulerCustomRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/scheduler/nested/validation-rule-dxi.ts b/packages/devextreme-angular/src/ui/scheduler/nested/validation-rule-dxi.ts index 5eb9e017ef09..d30e7f9d10a0 100644 --- a/packages/devextreme-angular/src/ui/scheduler/nested/validation-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/scheduler/nested/validation-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType, ComparisonOperator } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData, ComparisonOperator } from 'devextreme/common'; import { DxIntegrationModule, @@ -94,10 +94,10 @@ export class DxiSchedulerValidationRuleComponent extends CollectionNestedOption } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/tree-list/nested/async-rule-dxi.ts b/packages/devextreme-angular/src/ui/tree-list/nested/async-rule-dxi.ts index ab3881617768..965b912ebb30 100644 --- a/packages/devextreme-angular/src/ui/tree-list/nested/async-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/tree-list/nested/async-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiTreeListAsyncRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any) { + get validationCallback(): ((options: ValidationCallbackData) => any) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)) { + set validationCallback(value: ((options: ValidationCallbackData) => any)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/tree-list/nested/custom-rule-dxi.ts b/packages/devextreme-angular/src/ui/tree-list/nested/custom-rule-dxi.ts index a818667bc673..5c4c0f0ee4e9 100644 --- a/packages/devextreme-angular/src/ui/tree-list/nested/custom-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/tree-list/nested/custom-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiTreeListCustomRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/tree-list/nested/validation-rule-dxi.ts b/packages/devextreme-angular/src/ui/tree-list/nested/validation-rule-dxi.ts index 91f9e2e0296d..82641586669a 100644 --- a/packages/devextreme-angular/src/ui/tree-list/nested/validation-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/tree-list/nested/validation-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType, ComparisonOperator } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData, ComparisonOperator } from 'devextreme/common'; import { DxIntegrationModule, @@ -94,10 +94,10 @@ export class DxiTreeListValidationRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/validator/nested/async-rule-dxi.ts b/packages/devextreme-angular/src/ui/validator/nested/async-rule-dxi.ts index 548c67fe5caf..1c97dde7c212 100644 --- a/packages/devextreme-angular/src/ui/validator/nested/async-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/validator/nested/async-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiValidatorAsyncRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any) { + get validationCallback(): ((options: ValidationCallbackData) => any) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)) { + set validationCallback(value: ((options: ValidationCallbackData) => any)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/validator/nested/custom-rule-dxi.ts b/packages/devextreme-angular/src/ui/validator/nested/custom-rule-dxi.ts index 2160b06bc493..bf2607706c14 100644 --- a/packages/devextreme-angular/src/ui/validator/nested/custom-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/validator/nested/custom-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData } from 'devextreme/common'; import { DxIntegrationModule, @@ -70,10 +70,10 @@ export class DxiValidatorCustomRuleComponent extends CollectionNestedOption { } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme-angular/src/ui/validator/nested/validation-rule-dxi.ts b/packages/devextreme-angular/src/ui/validator/nested/validation-rule-dxi.ts index e41604da4d18..eaa4d924b601 100644 --- a/packages/devextreme-angular/src/ui/validator/nested/validation-rule-dxi.ts +++ b/packages/devextreme-angular/src/ui/validator/nested/validation-rule-dxi.ts @@ -12,7 +12,7 @@ import { -import { ValidationRuleType, ComparisonOperator } from 'devextreme/common'; +import { ValidationRuleType, ValidationCallbackData, ComparisonOperator } from 'devextreme/common'; import { DxIntegrationModule, @@ -94,10 +94,10 @@ export class DxiValidatorValidationRuleComponent extends CollectionNestedOption } @Input() - get validationCallback(): ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean) { + get validationCallback(): ((options: ValidationCallbackData) => boolean) { return this._getOption('validationCallback'); } - set validationCallback(value: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)) { + set validationCallback(value: ((options: ValidationCallbackData) => boolean)) { this._setOption('validationCallback', value); } diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index 4a7bc64f3a1c..242ff5808f2c 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -1168,7 +1168,7 @@ declare module DevExpress.common { /** * [descr:AsyncRule] */ - export type AsyncRule = { + export type AsyncRule = { /** * [descr:AsyncRule.ignoreEmptyValue] */ @@ -1188,7 +1188,9 @@ declare module DevExpress.common { /** * [descr:AsyncRule.validationCallback] */ - validationCallback?: (options: ValidationCallbackData) => PromiseLike; + validationCallback?: ( + options: ValidationCallbackData + ) => PromiseLike; }; export type ButtonStyle = 'text' | 'outlined' | 'contained'; export type ButtonType = 'danger' | 'default' | 'normal' | 'success'; @@ -1229,7 +1231,7 @@ declare module DevExpress.common { /** * [descr:CustomRule] */ - export type CustomRule = { + export type CustomRule = { /** * [descr:CustomRule.ignoreEmptyValue] */ @@ -1249,7 +1251,7 @@ declare module DevExpress.common { /** * [descr:CustomRule.validationCallback] */ - validationCallback?: (options: ValidationCallbackData) => boolean; + validationCallback?: (options: ValidationCallbackData) => boolean; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. @@ -1724,12 +1726,33 @@ declare module DevExpress.common { | 'dxTextBox'; export type ToolbarItemLocation = 'after' | 'before' | 'center'; export type TooltipShowMode = 'always' | 'onHover'; - export type ValidationCallbackData = { - value?: any; + /** + * [descr:ValidationCallbackData] + */ + export type ValidationCallbackData = { + /** + * [descr:ValidationCallbackData.value] + */ + value?: TValue; + /** + * [descr:ValidationCallbackData.rule] + */ rule: any; + /** + * [descr:ValidationCallbackData.validator] + */ validator: any; + /** + * [descr:ValidationCallbackData.data] + */ data?: any; + /** + * [descr:ValidationCallbackData.column] + */ column?: any; + /** + * [descr:ValidationCallbackData.formItem] + */ formItem?: any; }; export type ValidationMessageMode = 'always' | 'auto'; From 7e1ee962a35ee672237647b3b23fb684ac3e1e87 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Fri, 9 Jan 2026 19:24:54 +0200 Subject: [PATCH 3/8] d.ts (try with generics, keep tags type object vs any): re-generate, react --- packages/devextreme-react/src/card-view.ts | 8 ++++---- packages/devextreme-react/src/data-grid.ts | 8 ++++---- packages/devextreme-react/src/form.ts | 8 ++++---- packages/devextreme-react/src/scheduler.ts | 8 ++++---- packages/devextreme-react/src/tree-list.ts | 8 ++++---- packages/devextreme-react/src/validator.ts | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/devextreme-react/src/card-view.ts b/packages/devextreme-react/src/card-view.ts index 9b09a7734199..6c778c27d5d1 100644 --- a/packages/devextreme-react/src/card-view.ts +++ b/packages/devextreme-react/src/card-view.ts @@ -11,7 +11,7 @@ import NestedOption from "./core/nested-option"; import type { CardClickEvent, CardDblClickEvent, CardInsertedEvent, CardInsertingEvent, CardPreparedEvent, CardRemovedEvent, CardRemovingEvent, CardUpdatedEvent, CardUpdatingEvent, ContextMenuPreparingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, FieldCaptionClickEvent, FieldCaptionDblClickEvent, FieldCaptionPreparedEvent, FieldValueClickEvent, FieldValueDblClickEvent, FieldValuePreparedEvent, InitNewCardEvent, SavedEvent, SavingEvent, CardTemplateData, CardHeaderItem as CardViewCardHeaderItem, CardHeaderPredefinedItem, FieldTemplateData, ColumnTemplateData, EditingTexts as CardViewEditingTexts, PredefinedToolbarItem, dxCardViewToolbarItem } from "devextreme/ui/card_view"; import type { AnimationConfig, CollisionResolution, PositionConfig, AnimationState, AnimationType, CollisionResolutionCombination } from "devextreme/common/core/animation"; -import type { ValidationRuleType, HorizontalAlignment, VerticalAlignment, ButtonStyle, template, ButtonType, ToolbarItemLocation, ToolbarItemComponent, SearchMode, SingleMultipleOrNone, SelectAllMode, DataType, Format as CommonFormat, SortOrder, ComparisonOperator, DragHighlight, Mode, Direction, PositionAlignment, DisplayMode, ScrollbarMode, TabsIconPosition, TabsStyle, Position as CommonPosition } from "devextreme/common"; +import type { ValidationRuleType, ValidationCallbackData, HorizontalAlignment, VerticalAlignment, ButtonStyle, template, ButtonType, ToolbarItemLocation, ToolbarItemComponent, SearchMode, SingleMultipleOrNone, SelectAllMode, DataType, Format as CommonFormat, SortOrder, ComparisonOperator, DragHighlight, Mode, Direction, PositionAlignment, DisplayMode, ScrollbarMode, TabsIconPosition, TabsStyle, Position as CommonPosition } from "devextreme/common"; import type { dxButtonOptions, ClickEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, OptionChangedEvent } from "devextreme/ui/button"; import type { FormItemType, FormPredefinedButtonItem, ContentReadyEvent as FormContentReadyEvent, DisposingEvent as FormDisposingEvent, InitializedEvent as FormInitializedEvent, OptionChangedEvent as FormOptionChangedEvent, dxFormSimpleItem, dxFormOptions, dxFormGroupItem, dxFormTabbedItem, dxFormEmptyItem, dxFormButtonItem, LabelLocation, FormLabelMode, EditorEnterKeyEvent, FieldDataChangedEvent, SmartPastedEvent, SmartPastingEvent, FormItemComponent } from "devextreme/ui/form"; import type { ContentReadyEvent as FilterBuilderContentReadyEvent, DisposingEvent as FilterBuilderDisposingEvent, InitializedEvent as FilterBuilderInitializedEvent, OptionChangedEvent as FilterBuilderOptionChangedEvent, dxFilterBuilderField, FieldInfo, FilterBuilderOperation, dxFilterBuilderCustomOperation, GroupOperation, EditorPreparedEvent, EditorPreparingEvent, ValueChangedEvent } from "devextreme/ui/filter_builder"; @@ -217,7 +217,7 @@ type IAsyncRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any); + validationCallback?: ((options: ValidationCallbackData) => any); }> const _componentAsyncRule = (props: IAsyncRuleProps) => { return React.createElement(NestedOption, { @@ -933,7 +933,7 @@ type ICustomRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); }> const _componentCustomRule = (props: ICustomRuleProps) => { return React.createElement(NestedOption, { @@ -2818,7 +2818,7 @@ type IValidationRuleProps = React.PropsWithChildren<{ max?: Date | number | string; min?: Date | number | string; reevaluate?: boolean; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); comparisonTarget?: (() => any); comparisonType?: ComparisonOperator; pattern?: RegExp | string; diff --git a/packages/devextreme-react/src/data-grid.ts b/packages/devextreme-react/src/data-grid.ts index dffb2a8ec387..e19e749437d8 100644 --- a/packages/devextreme-react/src/data-grid.ts +++ b/packages/devextreme-react/src/data-grid.ts @@ -11,7 +11,7 @@ import NestedOption from "./core/nested-option"; import type { dxDataGridColumn, AdaptiveDetailRowPreparingEvent, AIColumnRequestCreatingEvent, CellClickEvent, CellDblClickEvent, CellPreparedEvent, ContentReadyEvent, ContextMenuPreparingEvent, DataErrorOccurredEvent, DisposingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, EditorPreparedEvent, EditorPreparingEvent, ExportingEvent, FocusedCellChangingEvent, FocusedRowChangingEvent, InitializedEvent, InitNewRowEvent, KeyDownEvent, RowClickEvent, RowCollapsedEvent, RowCollapsingEvent, RowDblClickEvent, RowExpandedEvent, RowExpandingEvent, RowInsertedEvent, RowInsertingEvent, RowPreparedEvent, RowRemovedEvent, RowRemovingEvent, RowUpdatedEvent, RowUpdatingEvent, RowValidatingEvent, SavedEvent, SavingEvent, ToolbarPreparingEvent, dxDataGridRowObject, DataGridPredefinedColumnButton, ColumnButtonClickEvent, dxDataGridColumnButton, DataGridCommandColumnType, SelectionSensitivity, DataGridExportFormat, DataGridPredefinedToolbarItem, DataGridScrollMode, dxDataGridToolbarItem } from "devextreme/ui/data_grid"; import type { DataChange, AIColumnMode, DataChangeType, ColumnAIOptions, FilterOperation, FilterType, FixedPosition, ColumnHeaderFilter as GridsColumnHeaderFilter, SelectedFilterOperation, ColumnChooserMode, ColumnChooserSearchConfig, ColumnChooserSelectionConfig, HeaderFilterGroupInterval, ColumnHeaderFilterSearchConfig, HeaderFilterSearchConfig, HeaderFilterTexts, SelectionColumnDisplayMode, GridsEditMode, NewRowPosition, GridsEditRefreshMode, StartEditAction, FilterPanel as GridsFilterPanel, FilterPanelTexts as GridsFilterPanelTexts, ApplyFilterMode, GroupExpandMode, SummaryType, EnterKeyAction, EnterKeyDirection, PagerPageSize, GridBase, DataRenderMode, StateStoreType } from "devextreme/common/grids"; -import type { Mode, ValidationRuleType, HorizontalAlignment, VerticalAlignment, template, TextEditorButtonLocation, DataType, Format as CommonFormat, SortOrder, SearchMode, ComparisonOperator, SingleMultipleOrNone, SelectAllMode, TextBoxPredefinedButton, TextEditorButton, LabelMode, MaskMode, EditorStyle, ValidationMessageMode, Position as CommonPosition, ValidationStatus, PositionAlignment, Direction, ToolbarItemLocation, ToolbarItemComponent, ButtonStyle, ButtonType, DisplayMode, DragDirection, DragHighlight, ScrollbarMode } from "devextreme/common"; +import type { Mode, ValidationRuleType, ValidationCallbackData, HorizontalAlignment, VerticalAlignment, template, TextEditorButtonLocation, DataType, Format as CommonFormat, SortOrder, SearchMode, ComparisonOperator, SingleMultipleOrNone, SelectAllMode, TextBoxPredefinedButton, TextEditorButton, LabelMode, MaskMode, EditorStyle, ValidationMessageMode, Position as CommonPosition, ValidationStatus, PositionAlignment, Direction, ToolbarItemLocation, ToolbarItemComponent, ButtonStyle, ButtonType, DisplayMode, DragDirection, DragHighlight, ScrollbarMode } from "devextreme/common"; import type { ContentReadyEvent as TextBoxContentReadyEvent, DisposingEvent as TextBoxDisposingEvent, InitializedEvent as TextBoxInitializedEvent, KeyDownEvent as TextBoxKeyDownEvent, dxTextBoxOptions, TextBoxType, ChangeEvent, CopyEvent, CutEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InputEvent, KeyUpEvent, OptionChangedEvent, PasteEvent, ValueChangedEvent } from "devextreme/ui/text_box"; import type { ContentReadyEvent as FilterBuilderContentReadyEvent, DisposingEvent as FilterBuilderDisposingEvent, EditorPreparedEvent as FilterBuilderEditorPreparedEvent, EditorPreparingEvent as FilterBuilderEditorPreparingEvent, InitializedEvent as FilterBuilderInitializedEvent, dxFilterBuilderField, FieldInfo, OptionChangedEvent as FilterBuilderOptionChangedEvent, ValueChangedEvent as FilterBuilderValueChangedEvent, FilterBuilderOperation, dxFilterBuilderCustomOperation, GroupOperation } from "devextreme/ui/filter_builder"; import type { ContentReadyEvent as FormContentReadyEvent, DisposingEvent as FormDisposingEvent, InitializedEvent as FormInitializedEvent, dxFormSimpleItem, dxFormOptions, OptionChangedEvent as FormOptionChangedEvent, dxFormGroupItem, dxFormTabbedItem, dxFormEmptyItem, dxFormButtonItem, LabelLocation, FormLabelMode, EditorEnterKeyEvent, FieldDataChangedEvent, SmartPastedEvent, SmartPastingEvent, FormItemComponent, FormItemType } from "devextreme/ui/form"; @@ -286,7 +286,7 @@ type IAsyncRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any); + validationCallback?: ((options: ValidationCallbackData) => any); }> const _componentAsyncRule = (props: IAsyncRuleProps) => { return React.createElement(NestedOption, { @@ -936,7 +936,7 @@ type ICustomRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); }> const _componentCustomRule = (props: ICustomRuleProps) => { return React.createElement(NestedOption, { @@ -3296,7 +3296,7 @@ type IValidationRuleProps = React.PropsWithChildren<{ max?: Date | number | string; min?: Date | number | string; reevaluate?: boolean; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); comparisonTarget?: (() => any); comparisonType?: ComparisonOperator; pattern?: RegExp | string; diff --git a/packages/devextreme-react/src/form.ts b/packages/devextreme-react/src/form.ts index be8396f2ebe8..afcfa38ade31 100644 --- a/packages/devextreme-react/src/form.ts +++ b/packages/devextreme-react/src/form.ts @@ -11,7 +11,7 @@ import NestedOption from "./core/nested-option"; import type { ContentReadyEvent, DisposingEvent, EditorEnterKeyEvent, InitializedEvent, SmartPastedEvent, SmartPastingEvent, FormItemType, FormPredefinedButtonItem, dxFormButtonItem, dxFormEmptyItem, dxFormGroupItem, dxFormSimpleItem, dxFormTabbedItem, FormItemComponent, LabelLocation } from "devextreme/ui/form"; import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, ClickEvent, OptionChangedEvent } from "devextreme/ui/button"; import type { ContentReadyEvent as TabPanelContentReadyEvent, DisposingEvent as TabPanelDisposingEvent, InitializedEvent as TabPanelInitializedEvent, OptionChangedEvent as TabPanelOptionChangedEvent, dxTabPanelOptions, dxTabPanelItem, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, SelectionChangedEvent, SelectionChangingEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from "devextreme/ui/tab_panel"; -import type { ValidationRuleType, HorizontalAlignment, VerticalAlignment, ButtonStyle, template, ButtonType, ComparisonOperator, TabsIconPosition, TabsStyle, Position } from "devextreme/common"; +import type { ValidationRuleType, ValidationCallbackData, HorizontalAlignment, VerticalAlignment, ButtonStyle, template, ButtonType, ComparisonOperator, TabsIconPosition, TabsStyle, Position } from "devextreme/common"; import type { CollectionWidgetItem } from "devextreme/ui/collection/ui.collection_widget.base"; import type { DataSourceOptions } from "devextreme/data/data_source"; import type { Store } from "devextreme/data/store"; @@ -114,7 +114,7 @@ type IAsyncRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any); + validationCallback?: ((options: ValidationCallbackData) => any); }> const _componentAsyncRule = (props: IAsyncRuleProps) => { return React.createElement(NestedOption, { @@ -270,7 +270,7 @@ type ICustomRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); }> const _componentCustomRule = (props: ICustomRuleProps) => { return React.createElement(NestedOption, { @@ -977,7 +977,7 @@ type IValidationRuleProps = React.PropsWithChildren<{ max?: Date | number | string; min?: Date | number | string; reevaluate?: boolean; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); comparisonTarget?: (() => any); comparisonType?: ComparisonOperator; pattern?: RegExp | string; diff --git a/packages/devextreme-react/src/scheduler.ts b/packages/devextreme-react/src/scheduler.ts index 4dd95fc178dd..ae4ef7c942c5 100644 --- a/packages/devextreme-react/src/scheduler.ts +++ b/packages/devextreme-react/src/scheduler.ts @@ -14,7 +14,7 @@ import type { ContentReadyEvent as FormContentReadyEvent, DisposingEvent as Form import type { ContentReadyEvent as ButtonGroupContentReadyEvent, DisposingEvent as ButtonGroupDisposingEvent, InitializedEvent as ButtonGroupInitializedEvent, OptionChangedEvent as ButtonGroupOptionChangedEvent, dxButtonGroupItem, ItemClickEvent, SelectionChangedEvent } from "devextreme/ui/button_group"; import type { ContentReadyEvent as TabPanelContentReadyEvent, DisposingEvent as TabPanelDisposingEvent, InitializedEvent as TabPanelInitializedEvent, OptionChangedEvent as TabPanelOptionChangedEvent, dxTabPanelOptions, ItemClickEvent as TabPanelItemClickEvent, SelectionChangedEvent as TabPanelSelectionChangedEvent, dxTabPanelItem, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, SelectionChangingEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from "devextreme/ui/tab_panel"; import type { event } from "devextreme/events/events.types"; -import type { ValidationRuleType, HorizontalAlignment, VerticalAlignment, ButtonStyle, template, ButtonType, ComparisonOperator, Mode, ToolbarItemLocation, ToolbarItemComponent, SingleMultipleOrNone, ScrollMode, TabsIconPosition, TabsStyle, Position, FirstDayOfWeek, Orientation } from "devextreme/common"; +import type { ValidationRuleType, ValidationCallbackData, HorizontalAlignment, VerticalAlignment, ButtonStyle, template, ButtonType, ComparisonOperator, Mode, ToolbarItemLocation, ToolbarItemComponent, SingleMultipleOrNone, ScrollMode, TabsIconPosition, TabsStyle, Position, FirstDayOfWeek, Orientation } from "devextreme/common"; import type { AIIntegration } from "devextreme/common/ai-integration"; import type { CollectionWidgetItem } from "devextreme/ui/collection/ui.collection_widget.base"; import type { LocateInMenuMode, ShowTextMode } from "devextreme/ui/toolbar"; @@ -215,7 +215,7 @@ type IAsyncRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any); + validationCallback?: ((options: ValidationCallbackData) => any); }> const _componentAsyncRule = (props: IAsyncRuleProps) => { return React.createElement(NestedOption, { @@ -371,7 +371,7 @@ type ICustomRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); }> const _componentCustomRule = (props: ICustomRuleProps) => { return React.createElement(NestedOption, { @@ -1416,7 +1416,7 @@ type IValidationRuleProps = React.PropsWithChildren<{ max?: Date | number | string; min?: Date | number | string; reevaluate?: boolean; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); comparisonTarget?: (() => any); comparisonType?: ComparisonOperator; pattern?: RegExp | string; diff --git a/packages/devextreme-react/src/tree-list.ts b/packages/devextreme-react/src/tree-list.ts index 42c8d3772b6f..484059d69ee9 100644 --- a/packages/devextreme-react/src/tree-list.ts +++ b/packages/devextreme-react/src/tree-list.ts @@ -17,7 +17,7 @@ import type { ContentReadyEvent as FormContentReadyEvent, DisposingEvent as Form import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, OptionChangedEvent as ButtonOptionChangedEvent, ClickEvent } from "devextreme/ui/button"; import type { AIIntegration } from "devextreme/common/ai-integration"; import type { AnimationConfig, CollisionResolution, PositionConfig, AnimationState, AnimationType, CollisionResolutionCombination } from "devextreme/common/core/animation"; -import type { ValidationRuleType, HorizontalAlignment, VerticalAlignment, template, TextEditorButtonLocation, DataType, Format as CommonFormat, SortOrder, SearchMode, ComparisonOperator, TextBoxPredefinedButton, TextEditorButton, LabelMode, MaskMode, EditorStyle, ValidationMessageMode, Position as CommonPosition, ValidationStatus, PositionAlignment, Mode, Direction, ToolbarItemLocation, ToolbarItemComponent, ButtonStyle, ButtonType, DisplayMode, DragDirection, DragHighlight, ScrollMode, ScrollbarMode, SingleMultipleOrNone } from "devextreme/common"; +import type { ValidationRuleType, ValidationCallbackData, HorizontalAlignment, VerticalAlignment, template, TextEditorButtonLocation, DataType, Format as CommonFormat, SortOrder, SearchMode, ComparisonOperator, TextBoxPredefinedButton, TextEditorButton, LabelMode, MaskMode, EditorStyle, ValidationMessageMode, Position as CommonPosition, ValidationStatus, PositionAlignment, Mode, Direction, ToolbarItemLocation, ToolbarItemComponent, ButtonStyle, ButtonType, DisplayMode, DragDirection, DragHighlight, ScrollMode, ScrollbarMode, SingleMultipleOrNone } from "devextreme/common"; import type { event } from "devextreme/events/events.types"; import type { Format as LocalizationFormat } from "devextreme/common/core/localization"; import type { DataSourceOptions } from "devextreme/data/data_source"; @@ -258,7 +258,7 @@ type IAsyncRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any); + validationCallback?: ((options: ValidationCallbackData) => any); }> const _componentAsyncRule = (props: IAsyncRuleProps) => { return React.createElement(NestedOption, { @@ -892,7 +892,7 @@ type ICustomRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); }> const _componentCustomRule = (props: ICustomRuleProps) => { return React.createElement(NestedOption, { @@ -2899,7 +2899,7 @@ type IValidationRuleProps = React.PropsWithChildren<{ max?: Date | number | string; min?: Date | number | string; reevaluate?: boolean; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); comparisonTarget?: (() => any); comparisonType?: ComparisonOperator; pattern?: RegExp | string; diff --git a/packages/devextreme-react/src/validator.ts b/packages/devextreme-react/src/validator.ts index 9f618f16cd71..730f5cc387b0 100644 --- a/packages/devextreme-react/src/validator.ts +++ b/packages/devextreme-react/src/validator.ts @@ -10,7 +10,7 @@ import { IHtmlOptions, ComponentRef, NestedComponentMeta } from "./core/componen import NestedOption from "./core/nested-option"; import type { DisposingEvent, InitializedEvent, ValidatedEvent } from "devextreme/ui/validator"; -import type { ValidationRuleType, ComparisonOperator } from "devextreme/common"; +import type { ValidationRuleType, ValidationCallbackData, ComparisonOperator } from "devextreme/common"; type ReplaceFieldTypes = { [P in keyof TSource]: P extends keyof TReplacement ? TReplacement[P] : TSource[P]; @@ -105,7 +105,7 @@ type IAsyncRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any); + validationCallback?: ((options: ValidationCallbackData) => any); }> const _componentAsyncRule = (props: IAsyncRuleProps) => { return React.createElement(NestedOption, { @@ -157,7 +157,7 @@ type ICustomRuleProps = React.PropsWithChildren<{ message?: string; reevaluate?: boolean; type?: ValidationRuleType; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); }> const _componentCustomRule = (props: ICustomRuleProps) => { return React.createElement(NestedOption, { @@ -337,7 +337,7 @@ type IValidationRuleProps = React.PropsWithChildren<{ max?: Date | number | string; min?: Date | number | string; reevaluate?: boolean; - validationCallback?: ((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); comparisonTarget?: (() => any); comparisonType?: ComparisonOperator; pattern?: RegExp | string; From 62cba84f584e260830b61b7a014e69c602c26a12 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Fri, 9 Jan 2026 19:44:10 +0200 Subject: [PATCH 4/8] d.ts (try with generics, keep tags type object vs any): re-generate, vue --- packages/devextreme-vue/src/card-view.ts | 7 ++++--- packages/devextreme-vue/src/data-grid.ts | 7 ++++--- packages/devextreme-vue/src/form.ts | 7 ++++--- packages/devextreme-vue/src/scheduler.ts | 7 ++++--- packages/devextreme-vue/src/tree-list.ts | 7 ++++--- packages/devextreme-vue/src/validator.ts | 7 ++++--- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/packages/devextreme-vue/src/card-view.ts b/packages/devextreme-vue/src/card-view.ts index e5ce4ce63aad..31dbd402f1e7 100644 --- a/packages/devextreme-vue/src/card-view.ts +++ b/packages/devextreme-vue/src/card-view.ts @@ -49,6 +49,7 @@ import { import { Mode, ValidationRuleType, + ValidationCallbackData, HorizontalAlignment, VerticalAlignment, ButtonStyle, @@ -548,7 +549,7 @@ const DxAsyncRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => any)> } }; @@ -1301,7 +1302,7 @@ const DxCustomRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; @@ -3259,7 +3260,7 @@ const DxValidationRuleConfig = { reevaluate: Boolean, trim: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; diff --git a/packages/devextreme-vue/src/data-grid.ts b/packages/devextreme-vue/src/data-grid.ts index 544afb7ae229..50394590a457 100644 --- a/packages/devextreme-vue/src/data-grid.ts +++ b/packages/devextreme-vue/src/data-grid.ts @@ -112,6 +112,7 @@ import { import { Mode, ValidationRuleType, + ValidationCallbackData, HorizontalAlignment, VerticalAlignment, TextEditorButtonLocation, @@ -756,7 +757,7 @@ const DxAsyncRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => any)> } }; @@ -1435,7 +1436,7 @@ const DxCustomRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; @@ -4043,7 +4044,7 @@ const DxValidationRuleConfig = { reevaluate: Boolean, trim: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; diff --git a/packages/devextreme-vue/src/form.ts b/packages/devextreme-vue/src/form.ts index 490d20de2144..4e2aa4394227 100644 --- a/packages/devextreme-vue/src/form.ts +++ b/packages/devextreme-vue/src/form.ts @@ -9,6 +9,7 @@ import { import { Mode, ValidationRuleType, + ValidationCallbackData, HorizontalAlignment, VerticalAlignment, ButtonStyle, @@ -274,7 +275,7 @@ const DxAsyncRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => any)> } }; @@ -458,7 +459,7 @@ const DxCustomRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; @@ -1153,7 +1154,7 @@ const DxValidationRuleConfig = { reevaluate: Boolean, trim: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; diff --git a/packages/devextreme-vue/src/scheduler.ts b/packages/devextreme-vue/src/scheduler.ts index 169bd798a952..659009c89201 100644 --- a/packages/devextreme-vue/src/scheduler.ts +++ b/packages/devextreme-vue/src/scheduler.ts @@ -47,6 +47,7 @@ import { import { FirstDayOfWeek, ValidationRuleType, + ValidationCallbackData, HorizontalAlignment, VerticalAlignment, ButtonStyle, @@ -471,7 +472,7 @@ const DxAsyncRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => any)> } }; @@ -655,7 +656,7 @@ const DxCustomRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; @@ -1739,7 +1740,7 @@ const DxValidationRuleConfig = { reevaluate: Boolean, trim: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; diff --git a/packages/devextreme-vue/src/tree-list.ts b/packages/devextreme-vue/src/tree-list.ts index b00325909386..f450e9f87866 100644 --- a/packages/devextreme-vue/src/tree-list.ts +++ b/packages/devextreme-vue/src/tree-list.ts @@ -106,6 +106,7 @@ import { Mode, DataStructure, ValidationRuleType, + ValidationCallbackData, HorizontalAlignment, VerticalAlignment, TextEditorButtonLocation, @@ -744,7 +745,7 @@ const DxAsyncRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => any)> } }; @@ -1409,7 +1410,7 @@ const DxCustomRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; @@ -3655,7 +3656,7 @@ const DxValidationRuleConfig = { reevaluate: Boolean, trim: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; diff --git a/packages/devextreme-vue/src/validator.ts b/packages/devextreme-vue/src/validator.ts index 612f10eeb77d..03ddd7ff7e7b 100644 --- a/packages/devextreme-vue/src/validator.ts +++ b/packages/devextreme-vue/src/validator.ts @@ -10,6 +10,7 @@ import { } from "devextreme/ui/validator"; import { ValidationRuleType, + ValidationCallbackData, ComparisonOperator, } from "devextreme/common"; import * as CommonTypes from "devextreme/common"; @@ -133,7 +134,7 @@ const DxAsyncRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => any)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => any)> } }; @@ -191,7 +192,7 @@ const DxCustomRuleConfig = { message: String, reevaluate: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; @@ -396,7 +397,7 @@ const DxValidationRuleConfig = { reevaluate: Boolean, trim: Boolean, type: String as PropType, - validationCallback: Function as PropType<((options: { column: Record, data: Record, formItem: Record, rule: Record, validator: Record, value: string | number }) => boolean)> + validationCallback: Function as PropType<((options: ValidationCallbackData) => boolean)> } }; From 1f63a4e65ff282bd8003c1043b5a5a5eb3a7dd4f Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Sun, 11 Jan 2026 19:07:11 +0200 Subject: [PATCH 5/8] demos: use generic data type for ts, keep js / jquery as is --- .../CardView/DataValidation/Angular/app/app.component.ts | 3 ++- apps/demos/Demos/CardView/DataValidation/React/App.tsx | 4 ++-- apps/demos/Demos/CardView/DataValidation/ReactJs/App.js | 2 +- apps/demos/Demos/CardView/DataValidation/Vue/App.vue | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/demos/Demos/CardView/DataValidation/Angular/app/app.component.ts b/apps/demos/Demos/CardView/DataValidation/Angular/app/app.component.ts index 676f6d0a582c..38734abbbd54 100644 --- a/apps/demos/Demos/CardView/DataValidation/Angular/app/app.component.ts +++ b/apps/demos/Demos/CardView/DataValidation/Angular/app/app.component.ts @@ -2,6 +2,7 @@ import { bootstrapApplication } from '@angular/platform-browser'; import { HttpClient, provideHttpClient, withFetch } from '@angular/common/http'; import { Component, enableProdMode, provideZoneChangeDetection } from '@angular/core'; import { DxCardViewModule, DxTextAreaModule } from 'devextreme-angular'; +import type { ValidationCallbackData } from 'devextreme-angular/common'; import { lastValueFrom } from 'rxjs'; import { Employee, Service } from './app.service'; @@ -65,7 +66,7 @@ export class AppComponent { return result; }; - hireDateValidationCallback = (params) => new Date(params.value) > new Date(params.data.birthDate); + hireDateValidationCallback = (params: ValidationCallbackData) => params.value > new Date(params.data.birthDate); } bootstrapApplication(AppComponent, { diff --git a/apps/demos/Demos/CardView/DataValidation/React/App.tsx b/apps/demos/Demos/CardView/DataValidation/React/App.tsx index ae77b7391743..cf3732666ec8 100644 --- a/apps/demos/Demos/CardView/DataValidation/React/App.tsx +++ b/apps/demos/Demos/CardView/DataValidation/React/App.tsx @@ -35,8 +35,8 @@ async function emailValidationCallback(options: ValidationCallbackData): Promise return response.json(); } -function hireDateValidationCallback(options: ValidationCallbackData): boolean { - return new Date(options.value) > new Date(options.data.birthDate); +function hireDateValidationCallback(options: ValidationCallbackData): boolean { + return options.value > new Date(options.data.birthDate); } const App = () => ( diff --git a/apps/demos/Demos/CardView/DataValidation/ReactJs/App.js b/apps/demos/Demos/CardView/DataValidation/ReactJs/App.js index 69dbfc51045e..b4e1955587da 100644 --- a/apps/demos/Demos/CardView/DataValidation/ReactJs/App.js +++ b/apps/demos/Demos/CardView/DataValidation/ReactJs/App.js @@ -38,7 +38,7 @@ async function emailValidationCallback(options) { return response.json(); } function hireDateValidationCallback(options) { - return new Date(options.value) > new Date(options.data.birthDate); + return options.value > new Date(options.data.birthDate); } const App = () => ( new Date(params.value) > new Date(params.data.birthDate); + params: ValidationCallbackData, +): boolean => params.value > new Date(params.data.birthDate); From 97165c5844c0de28f31f7596a2dffcde6f072f04 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Sun, 11 Jan 2026 20:02:31 +0200 Subject: [PATCH 6/8] d.ts (no more generic): could not assign demos' event handler to wrappers props' without generic signature --- .../DataValidation/Angular/app/app.component.ts | 2 +- .../Demos/CardView/DataValidation/React/App.tsx | 4 ++-- .../Demos/CardView/DataValidation/ReactJs/App.js | 2 +- .../Demos/CardView/DataValidation/Vue/App.vue | 4 ++-- packages/devextreme/js/common.d.ts | 12 ++++++------ packages/devextreme/ts/dx.all.d.ts | 14 ++++++-------- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/apps/demos/Demos/CardView/DataValidation/Angular/app/app.component.ts b/apps/demos/Demos/CardView/DataValidation/Angular/app/app.component.ts index 38734abbbd54..b5313c5650cc 100644 --- a/apps/demos/Demos/CardView/DataValidation/Angular/app/app.component.ts +++ b/apps/demos/Demos/CardView/DataValidation/Angular/app/app.component.ts @@ -66,7 +66,7 @@ export class AppComponent { return result; }; - hireDateValidationCallback = (params: ValidationCallbackData) => params.value > new Date(params.data.birthDate); + hireDateValidationCallback = (params: ValidationCallbackData) => new Date(params.value) > new Date(params.data.birthDate); } bootstrapApplication(AppComponent, { diff --git a/apps/demos/Demos/CardView/DataValidation/React/App.tsx b/apps/demos/Demos/CardView/DataValidation/React/App.tsx index cf3732666ec8..ae77b7391743 100644 --- a/apps/demos/Demos/CardView/DataValidation/React/App.tsx +++ b/apps/demos/Demos/CardView/DataValidation/React/App.tsx @@ -35,8 +35,8 @@ async function emailValidationCallback(options: ValidationCallbackData): Promise return response.json(); } -function hireDateValidationCallback(options: ValidationCallbackData): boolean { - return options.value > new Date(options.data.birthDate); +function hireDateValidationCallback(options: ValidationCallbackData): boolean { + return new Date(options.value) > new Date(options.data.birthDate); } const App = () => ( diff --git a/apps/demos/Demos/CardView/DataValidation/ReactJs/App.js b/apps/demos/Demos/CardView/DataValidation/ReactJs/App.js index b4e1955587da..69dbfc51045e 100644 --- a/apps/demos/Demos/CardView/DataValidation/ReactJs/App.js +++ b/apps/demos/Demos/CardView/DataValidation/ReactJs/App.js @@ -38,7 +38,7 @@ async function emailValidationCallback(options) { return response.json(); } function hireDateValidationCallback(options) { - return options.value > new Date(options.data.birthDate); + return new Date(options.value) > new Date(options.data.birthDate); } const App = () => ( , -): boolean => params.value > new Date(params.data.birthDate); + params: ValidationCallbackData, +): boolean => new Date(params.value) > new Date(params.data.birthDate); diff --git a/packages/devextreme/js/common.d.ts b/packages/devextreme/js/common.d.ts index 82da08ad12ce..701d3ff2fa01 100644 --- a/packages/devextreme/js/common.d.ts +++ b/packages/devextreme/js/common.d.ts @@ -29,7 +29,7 @@ export type ApplyValueMode = 'instantly' | 'useButtons'; * @namespace DevExpress.common * @type object */ -export type AsyncRule = { +export type AsyncRule = { /** * @docid * @default false @@ -59,7 +59,7 @@ export type AsyncRule = { * @type_function_return Promise * @public */ - validationCallback?: ((options: ValidationCallbackData) => PromiseLike); + validationCallback?: ((options: ValidationCallbackData) => PromiseLike); }; /** @@ -125,7 +125,7 @@ export type ComparisonOperator = '!=' | '!==' | '<' | '<=' | '==' | '===' | '>' * @type object * @namespace DevExpress.common */ -export type CustomRule = { +export type CustomRule = { /** * @docid * @default false @@ -154,7 +154,7 @@ export type CustomRule = { * @docid * @public */ - validationCallback?: ((options: ValidationCallbackData) => boolean); + validationCallback?: ((options: ValidationCallbackData) => boolean); }; /** @@ -802,9 +802,9 @@ export type TooltipShowMode = 'always' | 'onHover'; * @public * @namespace DevExpress.common */ -export type ValidationCallbackData = { +export type ValidationCallbackData = { /** @docid */ - value?: TValue; + value?: any; /** * @docid * @type object diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index 242ff5808f2c..5291c4c7318e 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -1168,7 +1168,7 @@ declare module DevExpress.common { /** * [descr:AsyncRule] */ - export type AsyncRule = { + export type AsyncRule = { /** * [descr:AsyncRule.ignoreEmptyValue] */ @@ -1188,9 +1188,7 @@ declare module DevExpress.common { /** * [descr:AsyncRule.validationCallback] */ - validationCallback?: ( - options: ValidationCallbackData - ) => PromiseLike; + validationCallback?: (options: ValidationCallbackData) => PromiseLike; }; export type ButtonStyle = 'text' | 'outlined' | 'contained'; export type ButtonType = 'danger' | 'default' | 'normal' | 'success'; @@ -1231,7 +1229,7 @@ declare module DevExpress.common { /** * [descr:CustomRule] */ - export type CustomRule = { + export type CustomRule = { /** * [descr:CustomRule.ignoreEmptyValue] */ @@ -1251,7 +1249,7 @@ declare module DevExpress.common { /** * [descr:CustomRule.validationCallback] */ - validationCallback?: (options: ValidationCallbackData) => boolean; + validationCallback?: (options: ValidationCallbackData) => boolean; }; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. @@ -1729,11 +1727,11 @@ declare module DevExpress.common { /** * [descr:ValidationCallbackData] */ - export type ValidationCallbackData = { + export type ValidationCallbackData = { /** * [descr:ValidationCallbackData.value] */ - value?: TValue; + value?: any; /** * [descr:ValidationCallbackData.rule] */ From 4ffb76742fb28a36ee0dc023f7306cb611a83af5 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Mon, 12 Jan 2026 15:56:44 +0200 Subject: [PATCH 7/8] demos: Form/Validation --- .../Form/Validation/Angular/app/app.component.ts | 12 ++++++------ apps/demos/Demos/Form/Validation/React/App.tsx | 12 ++++++------ apps/demos/Demos/Form/Validation/ReactJs/App.js | 10 +++++----- apps/demos/Demos/Form/Validation/Vue/App.vue | 11 ++++++----- apps/demos/Demos/Form/Validation/jQuery/index.js | 8 ++++---- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/apps/demos/Demos/Form/Validation/Angular/app/app.component.ts b/apps/demos/Demos/Form/Validation/Angular/app/app.component.ts index 851b65a6f4ec..4c4454202208 100644 --- a/apps/demos/Demos/Form/Validation/Angular/app/app.component.ts +++ b/apps/demos/Demos/Form/Validation/Angular/app/app.component.ts @@ -13,12 +13,12 @@ import { } from 'devextreme-angular'; import notify from 'devextreme/ui/notify'; import Validator from 'devextreme/ui/validator'; -import { AsyncRule } from 'devextreme-angular/common'; import { DxFormModule, DxFormComponent, DxFormTypes } from 'devextreme-angular/ui/form'; import { DxTextBoxTypes } from 'devextreme-angular/ui/text-box'; import { DxDateBoxTypes } from 'devextreme-angular/ui/date-box'; import { DxDateRangeBoxTypes } from 'devextreme-angular/ui/date-range-box'; import { DxButtonModule, DxButtonTypes } from 'devextreme-angular/ui/button'; +import type { ValidationCallbackData } from 'devextreme-angular/common'; import { Customer, Service } from './app.service'; type EditorOptions = DxTextBoxTypes.Properties; @@ -190,8 +190,8 @@ export class AppComponent { ); }; - validateVacationDatesRange({ value }) { - const [startDate, endDate] = value; + validateVacationDatesRange(params: ValidationCallbackData) { + const [startDate, endDate] = params.value; if (startDate === null || endDate === null) { return true; @@ -203,8 +203,8 @@ export class AppComponent { return daysDifference < 25; } - validateVacationDatesPresence({ value }) { - const [startDate, endDate] = value; + validateVacationDatesPresence(params: ValidationCallbackData) { + const [startDate, endDate] = params.value; if (startDate === null && endDate === null) { return true; @@ -213,7 +213,7 @@ export class AppComponent { return startDate !== null && endDate !== null; } - asyncValidation: AsyncRule['validationCallback'] = ({ value }) => sendRequest(value); + asyncValidation = (params: ValidationCallbackData) => sendRequest(params.value); onFormSubmit = (e: SubmitEvent) => { notify({ diff --git a/apps/demos/Demos/Form/Validation/React/App.tsx b/apps/demos/Demos/Form/Validation/React/App.tsx index d0189150f22a..1725709a4473 100644 --- a/apps/demos/Demos/Form/Validation/React/App.tsx +++ b/apps/demos/Demos/Form/Validation/React/App.tsx @@ -14,12 +14,12 @@ import Form, { CustomRule, } from 'devextreme-react/form'; import type { FormRef, FormTypes } from 'devextreme-react/form'; -import type { ButtonType } from 'devextreme-react/common'; import type { IAutocompleteOptions } from 'devextreme-react/autocomplete'; import type { ISelectBoxOptions } from 'devextreme-react/select-box'; import type { ITextBoxOptions } from 'devextreme-react/text-box'; import type { IDateBoxOptions } from 'devextreme-react/date-box'; import type { IDateRangeBoxOptions } from 'devextreme-react/date-range-box'; +import type { ButtonType, ValidationCallbackData } from 'devextreme-react/common'; import notify from 'devextreme/ui/notify'; import Validator from 'devextreme/ui/validator'; import 'devextreme-react/autocomplete'; @@ -100,10 +100,10 @@ const passwordComparison = (): string => customer.Password; const checkComparison = (): boolean => true; -const asyncValidation = ({ value }: { value: any; }): Promise => sendRequest(value); +const asyncValidation = (params: ValidationCallbackData): Promise => sendRequest(params.value); -const validateVacationDatesRange = ({ value }: { value: any; }): boolean => { - const [startDate, endDate] = value; +const validateVacationDatesRange = (params: ValidationCallbackData): boolean => { + const [startDate, endDate] = params.value; if (startDate === null || endDate === null) { return true; @@ -115,8 +115,8 @@ const validateVacationDatesRange = ({ value }: { value: any; }): boolean => { return daysDifference < 25; }; -const validateVacationDatesPresence = ({ value }: { value: any }): boolean => { - const [startDate, endDate] = value; +const validateVacationDatesPresence = (params: ValidationCallbackData): boolean => { + const [startDate, endDate] = params.value; if (startDate === null && endDate === null) { return true; diff --git a/apps/demos/Demos/Form/Validation/ReactJs/App.js b/apps/demos/Demos/Form/Validation/ReactJs/App.js index 5db3ada32c5c..446c254d4347 100644 --- a/apps/demos/Demos/Form/Validation/ReactJs/App.js +++ b/apps/demos/Demos/Form/Validation/ReactJs/App.js @@ -78,9 +78,9 @@ function sendRequest(value) { } const passwordComparison = () => customer.Password; const checkComparison = () => true; -const asyncValidation = ({ value }) => sendRequest(value); -const validateVacationDatesRange = ({ value }) => { - const [startDate, endDate] = value; +const asyncValidation = (params) => sendRequest(params.value); +const validateVacationDatesRange = (params) => { + const [startDate, endDate] = params.value; if (startDate === null || endDate === null) { return true; } @@ -88,8 +88,8 @@ const validateVacationDatesRange = ({ value }) => { const daysDifference = Math.abs((endDate - startDate) / millisecondsPerDay); return daysDifference < 25; }; -const validateVacationDatesPresence = ({ value }) => { - const [startDate, endDate] = value; +const validateVacationDatesPresence = (params) => { + const [startDate, endDate] = params.value; if (startDate === null && endDate === null) { return true; } diff --git a/apps/demos/Demos/Form/Validation/Vue/App.vue b/apps/demos/Demos/Form/Validation/Vue/App.vue index 12c3b1d2e8f9..6ed92ca13569 100644 --- a/apps/demos/Demos/Form/Validation/Vue/App.vue +++ b/apps/demos/Demos/Form/Validation/Vue/App.vue @@ -181,6 +181,7 @@ import DxForm, { } from 'devextreme-vue/form'; import DxAutocomplete from 'devextreme-vue/autocomplete'; // for editor-type=dxAutocomplete import 'devextreme-vue/date-range-box'; +import type { ValidationCallbackData } from 'devextreme-vue/common'; import notify from 'devextreme/ui/notify'; import Validator from 'devextreme/ui/validator'; import service from './data.ts'; @@ -312,11 +313,11 @@ function passwordComparison() { function checkComparison() { return true; } -function asyncValidation(params: Record) { +function asyncValidation(params: ValidationCallbackData) { return sendRequest(params.value); } -function validateVacationDatesRange({ value }: Record) { - const [startDate, endDate] = value; +function validateVacationDatesRange(params: ValidationCallbackData) { + const [startDate, endDate] = params.value; if (startDate === null || endDate === null) { return true; @@ -327,8 +328,8 @@ function validateVacationDatesRange({ value }: Record) { return daysDifference < 25; } -function validateVacationDatesPresence({ value }: Record) { - const [startDate, endDate] = value; +function validateVacationDatesPresence(params: ValidationCallbackData) { + const [startDate, endDate] = params.value; if (startDate === null && endDate === null) { return true; diff --git a/apps/demos/Demos/Form/Validation/jQuery/index.js b/apps/demos/Demos/Form/Validation/jQuery/index.js index 9cd5955375d2..420da9c053b4 100644 --- a/apps/demos/Demos/Form/Validation/jQuery/index.js +++ b/apps/demos/Demos/Form/Validation/jQuery/index.js @@ -145,8 +145,8 @@ $(() => { }, validationRules: [{ type: 'custom', - validationCallback: ({ value }) => { - const [startDate, endDate] = value; + validationCallback: (params) => { + const [startDate, endDate] = params.value; if (startDate === null || endDate === null) { return true; @@ -160,8 +160,8 @@ $(() => { message: 'The vacation period must not exceed 25 days', }, { type: 'custom', - validationCallback: ({ value }) => { - const [startDate, endDate] = value; + validationCallback: (params) => { + const [startDate, endDate] = params.value; if (startDate === null && endDate === null) { return true; From efa3bf1aec7cd1ebf6751e4f82e2a8d80c9b6f52 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Mon, 12 Jan 2026 17:27:45 +0200 Subject: [PATCH 8/8] reset --- packages/devextreme-angular/project.json | 3 ++- packages/devextreme-react/project.json | 4 ++-- packages/devextreme-vue/project.json | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/devextreme-angular/project.json b/packages/devextreme-angular/project.json index fc37d8873cf0..00c4391e592b 100644 --- a/packages/devextreme-angular/project.json +++ b/packages/devextreme-angular/project.json @@ -418,7 +418,8 @@ "{projectRoot}/package.json", "{projectRoot}/metadata/**/*", "{workspaceRoot}/tsconfig.json", - "{workspaceRoot}/tools/generators-config.js" + "{workspaceRoot}/tools/generators-config.js", + "{workspaceRoot}/packages/devextreme-metadata/**/*" ], "test": [ "{projectRoot}/tests/**/*", diff --git a/packages/devextreme-react/project.json b/packages/devextreme-react/project.json index 5408a27a89c8..a1e44f6781e1 100644 --- a/packages/devextreme-react/project.json +++ b/packages/devextreme-react/project.json @@ -179,11 +179,11 @@ }, "namedInputs": { "default": [ - "{projectRoot}/devextreme-metadata/**/*", "{projectRoot}/src/**/*", "!{projectRoot}/src/**/__tests__/*", "{projectRoot}/tsconfig*", - "{workspaceRoot}/tsconfig.json" + "{workspaceRoot}/tsconfig.json", + "{workspaceRoot}/packages/devextreme-metadata/**/*" ], "test": [ "{projectRoot}/src/**/__tests__/*", diff --git a/packages/devextreme-vue/project.json b/packages/devextreme-vue/project.json index 60e97de52454..170f135100fe 100644 --- a/packages/devextreme-vue/project.json +++ b/packages/devextreme-vue/project.json @@ -201,11 +201,11 @@ }, "namedInputs": { "default": [ - "{projectRoot}/devextreme-metadata/**/*", "{projectRoot}/src/**/*", "!{projectRoot}/src/**/__tests__/*", "{projectRoot}/tsconfig*", - "{workspaceRoot}/tsconfig.json" + "{workspaceRoot}/tsconfig.json", + "{workspaceRoot}/packages/devextreme-metadata/**/*" ], "test": [ "{projectRoot}/src/**/__tests__/*",