Skip to content

Commit cb58984

Browse files
Merge pull request #7 from DuckTieCorpMember/25.1.3+
add stronger typing
2 parents 7296c2a + f9498f4 commit cb58984

File tree

7 files changed

+127
-131
lines changed

7 files changed

+127
-131
lines changed

Angular/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Angular/src/app/app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
ViewChild,
44
} from '@angular/core';
55
import { HttpClient } from '@angular/common/http';
6-
76
import CustomStore from 'devextreme/data/custom_store';
87
import { DxTreeViewComponent, DxTreeViewTypes } from 'devextreme-angular/ui/tree-view';
98
import Popup from 'devextreme/ui/popup';

React/package-lock.json

Lines changed: 103 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

React/src/App.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import {
44
import './App.css';
55
import 'devextreme/dist/css/dx.material.blue.light.compact.css';
66
import DropDownBox from 'devextreme-react/drop-down-box';
7-
import TreeView from 'devextreme-react/tree-view';
8-
import TagBox from 'devextreme-react/tag-box';
7+
import TreeView, { type TreeViewTypes, type TreeViewRef } from 'devextreme-react/tree-view';
8+
import TagBox, { type TagBoxTypes } from 'devextreme-react/tag-box';
99
import CustomStore from 'devextreme/data/custom_store';
10-
import type { TreeViewRef } from 'devextreme-react/tree-view';
1110

1211
function makeAsyncDataSource(jsonFile: string): CustomStore {
1312
return new CustomStore({
@@ -39,17 +38,17 @@ function App(): JSX.Element {
3938
}
4039
}, []);
4140

42-
const onTreeViewContentReady = useCallback((e: any) => {
41+
const onTreeViewContentReady = useCallback((e: TreeViewTypes.ContentReadyEvent) => {
4342
const treeViewInstance = e.component;
4443
syncTreeViewSelection(treeViewInstance, selectedValues);
4544
}, [selectedValues, syncTreeViewSelection]);
4645

47-
const onTreeViewSelectionChanged = useCallback((e: any) => {
46+
const onTreeViewSelectionChanged = useCallback((e: TreeViewTypes.ItemSelectionChangedEvent) => {
4847
const selectedKeys = e.component.getSelectedNodeKeys();
4948
setSelectedValues(selectedKeys);
5049
}, []);
5150

52-
const onTagBoxValueChanged = useCallback((e: any) => {
51+
const onTagBoxValueChanged = useCallback((e: TagBoxTypes.ValueChangedEvent) => {
5352
setSelectedValues(e.value);
5453
const treeViewInstance = treeViewRef.current?.instance();
5554
syncTreeViewSelection(treeViewInstance, e.value);

Vue/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Vue/src/components/HomeContent.vue

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<script setup lang="ts">
22
import { ref } from 'vue';
33
import 'devextreme/dist/css/dx.material.blue.light.compact.css';
4-
import DxDropDownBox from 'devextreme-vue/drop-down-box';
5-
import DxTreeView from 'devextreme-vue/tree-view';
6-
import DxTagBox from 'devextreme-vue/tag-box';
4+
import DxDropDownBox, { type DxDropDownBoxTypes, type DxDropDownBox as DxDropDownBoxType } from 'devextreme-vue/drop-down-box';
5+
import DxTagBox, { type DxTagBoxTypes } from 'devextreme-vue/tag-box';
76
import DxTextBox from 'devextreme-vue/text-box';
8-
import type { DxTreeView as DxTreeViewType } from 'devextreme-vue/tree-view';
9-
import type { DxDropDownBox as DxDropDownBoxType } from 'devextreme-vue/drop-down-box';
7+
import DxTreeView, { type DxTreeView as DxTreeViewType, type DxTreeViewTypes } from 'devextreme-vue/tree-view';
108
import CustomStore from 'devextreme/data/custom_store';
119
1210
const treeViewRef = ref<DxTreeViewType | null>(null);
@@ -38,11 +36,11 @@ const syncTreeViewSelection = (treeViewInstance: any, value: string[]): void =>
3836
}
3937
};
4038
41-
function onDropDownBoxInitialized(e: any): void {
39+
function onDropDownBoxInitialized(e: DxDropDownBoxTypes.InitializedEvent): void {
4240
popup = e.component;
4341
}
4442
45-
function onTagBoxValueChanged(e: any): void {
43+
function onTagBoxValueChanged(e: DxTagBoxTypes.ValueChangedEvent): void {
4644
treeBoxValue.value = e.value;
4745
4846
if (dropDownBoxRef.value?.instance) {
@@ -59,12 +57,12 @@ function onTagBoxValueChanged(e: any): void {
5957
}
6058
}
6159
62-
function onTreeViewContentReady(e: any): void {
60+
function onTreeViewContentReady(e: DxTreeViewTypes.ContentReadyEvent): void {
6361
const value = (dropDownBoxRef.value?.instance?.option('value')) || treeBoxValue.value;
6462
syncTreeViewSelection(e.component, value);
6563
}
6664
67-
function onTreeViewItemSelectionChanged(e: any): void {
65+
function onTreeViewItemSelectionChanged(e: DxTreeViewTypes.ItemSelectionChangedEvent): void {
6866
const selectedKeys = e.component.getSelectedNodeKeys();
6967
treeBoxValue.value = selectedKeys;
7068

jQuery/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)