diff --git a/packages/devextreme/js/ui/data_grid.d.ts b/packages/devextreme/js/ui/data_grid.d.ts index bd141435d065..49f3899ee050 100644 --- a/packages/devextreme/js/ui/data_grid.d.ts +++ b/packages/devextreme/js/ui/data_grid.d.ts @@ -1907,7 +1907,13 @@ export type Toolbar = { * @deprecated Use Editing instead */ export type dxDataGridEditing = Editing; - +/** + * @public + */ +export type EditingOptions = { + component?: dxDataGrid; + row?: Row; +}; /** * @docid dxDataGridEditing * @public @@ -1928,7 +1934,7 @@ export type Editing = EditingBase & * @type_function_param1_field row:dxDataGridRowObject * @public */ - allowDeleting?: boolean | ((options: { component?: dxDataGrid; row?: Row }) => boolean); + allowDeleting?: boolean | ((options: EditingOptions) => boolean); /** * @docid dxDataGridOptions.editing.allowUpdating * @default false @@ -1937,7 +1943,7 @@ export type Editing = EditingBase & * @type_function_param1_field row:dxDataGridRowObject * @public */ - allowUpdating?: boolean | ((options: { component?: dxDataGrid; row?: Row }) => boolean); + allowUpdating?: boolean | ((options: EditingOptions) => boolean); /** * @docid dxDataGridOptions.editing.texts * @public @@ -2304,6 +2310,15 @@ export interface dxDataGridColumn extends ColumnBase type?: DataGridCommandColumnType; } +/** + * @public + */ +export type ColumnButtonOptions = { + component?: dxDataGrid; + row?: Row; + column?: Column; +}; + /** * @public */ @@ -2339,22 +2354,24 @@ export interface dxDataGridColumnButton extends Colu * @docid dxDataGridColumnButton.visible * @default true * @type boolean | function + * @type_function_param1 options: ColumnButtonOptions * @type_function_param1_field component:dxDataGrid * @type_function_param1_field row:dxDataGridRowObject * @type_function_param1_field column:dxDataGridColumn * @public */ - visible?: boolean | ((options: { component?: dxDataGrid; row?: Row; column?: Column }) => boolean); + visible?: boolean | ((options: ColumnButtonOptions) => boolean); /** * @docid dxDataGridColumnButton.disabled * @default false * @type boolean | function + * @type_function_param1 options: ColumnButtonOptions * @type_function_param1_field component:dxDataGrid * @type_function_param1_field row:dxDataGridRowObject * @type_function_param1_field column:dxDataGridColumn * @public */ - disabled?: boolean | ((options: { component?: dxDataGrid; row?: Row; column?: Column }) => boolean); + disabled?: boolean | ((options: ColumnButtonOptions) => boolean); } /** diff --git a/packages/devextreme/js/ui/tree_list.d.ts b/packages/devextreme/js/ui/tree_list.d.ts index 65c5509ce3ca..30067ed8f5f9 100644 --- a/packages/devextreme/js/ui/tree_list.d.ts +++ b/packages/devextreme/js/ui/tree_list.d.ts @@ -1149,7 +1149,13 @@ export type dxTreeListOptions = Omit = Editing; - +/** + * @public + */ +export type TreeListEditingOptions = { + component?: dxTreeList; + row?: Row; +}; /** * @docid dxTreeListEditing * @public @@ -1164,7 +1170,7 @@ export interface Editing extends EditingBase; readonly row?: Row }) => boolean); + allowAdding?: boolean | ((options: TreeListEditingOptions) => boolean); /** * @docid dxTreeListOptions.editing.allowDeleting * @default false @@ -1173,7 +1179,7 @@ export interface Editing extends EditingBase; readonly row?: Row }) => boolean); + allowDeleting?: boolean | ((options: TreeListEditingOptions) => boolean); /** * @docid dxTreeListOptions.editing.allowUpdating * @default false @@ -1182,7 +1188,7 @@ export interface Editing extends EditingBase; readonly row?: Row }) => boolean); + allowUpdating?: boolean | ((options: TreeListEditingOptions) => boolean); /** * @docid dxTreeListOptions.editing.texts * @type object @@ -1589,7 +1595,14 @@ export interface dxTreeListColumn extends ColumnBase * @public */ export type ColumnButton = dxTreeListColumnButton; - +/** + * @public + */ +export type TreeListColumnButtonOptions = { + component?: dxTreeList; + row?: Row; + column?: Column; +}; /** * @namespace DevExpress.ui * @deprecated Use the TreeList's ColumnButton type instead @@ -1625,12 +1638,13 @@ export interface dxTreeListColumnButton extends Colu * @docid dxTreeListColumnButton.visible * @default true * @type boolean | function - * @type_function_param1_field component:dxTreeList - * @type_function_param1_field row:dxTreeListRowObject - * @type_function_param1_field column:dxTreeListColumn + * @type_function_param1 options: TreeListColumnButtonOptions + * @type_function_param1_field component: dxTreeList + * @type_function_param1_field row: dxTreeListRowObject + * @type_function_param1_field column: dxTreeListColumn * @public */ - visible?: boolean | ((options: { readonly component: dxTreeList; readonly row?: Row; readonly column: Column }) => boolean); + visible?: boolean | ((options: TreeListColumnButtonOptions) => boolean); /** * @docid dxTreeListColumnButton.disabled * @default false @@ -1640,7 +1654,7 @@ export interface dxTreeListColumnButton extends Colu * @type_function_param1_field column:dxTreeListColumn * @public */ - disabled?: boolean | ((options: { readonly component: dxTreeList; readonly row?: Row; readonly column: Column }) => boolean); + disabled?: boolean | ((options: TreeListColumnButtonOptions) => boolean); } /**