Skip to content

Commit 90a235e

Browse files
authored
R1 - remove usage of @devextreme-generators/declaration package (#28883)
1 parent 8f9d4ee commit 90a235e

21 files changed

+41
-26
lines changed

packages/devextreme/js/__internal/core/r1/types.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
/* eslint-disable @typescript-eslint/ban-types */
12
import type * as CSS from 'csstype';
2-
import type { VNode } from 'inferno';
3+
import type { Component, StatelessComponent, VNode } from 'inferno';
34

45
import type { TemplateModel } from './template_wrapper';
56

@@ -23,3 +24,21 @@ export interface PropsWithStyles {
2324
export interface PropsWithChildren {
2425
children?: JSX.Element | (JSX.Element | undefined | false | null)[];
2526
}
27+
28+
// TODO: replace by import from inferno after update to inferno 8
29+
export type ComponentType<P = {}> = typeof Component<P> | StatelessComponent<P>;
30+
31+
export interface RefObject<T> {
32+
current: T | null;
33+
}
34+
35+
export type JSXTemplate<
36+
PropsType = {},
37+
RequiredProps extends keyof PropsType = Exclude<
38+
keyof PropsType,
39+
keyof PropsType
40+
>,
41+
> = ComponentType<
42+
Partial<Omit<PropsType, RequiredProps>> &
43+
Required<Pick<PropsType, RequiredProps>>
44+
>;

packages/devextreme/js/__internal/core/r1/widget.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import '@js/common/core/events/hover';
88
import {
99
createReRenderEffect, InfernoEffect, InfernoWrapperComponent,
1010
} from '@devextreme/runtime/inferno';
11-
import type { RefObject } from '@devextreme-generator/declarations';
1211
import {
1312
dxClick, focus, keyboard, resize, visibility,
1413
} from '@js/common/core/events/short';
@@ -21,6 +20,7 @@ import { isFunction } from '@js/core/utils/type';
2120
import type { ConfigContextValue } from '@ts/core/r1/config_context';
2221
import { ConfigContext } from '@ts/core/r1/config_context';
2322
import { ConfigProvider } from '@ts/core/r1/config_provider';
23+
import type { RefObject } from '@ts/core/r1/types';
2424
import type { EffectReturn } from '@ts/core/r1/utils/effect_return';
2525
import { combineClasses } from '@ts/core/r1/utils/render_utils';
2626
import { resolveRtlEnabled, resolveRtlEnabledDefinition } from '@ts/core/r1/utils/resolve_rtl';
@@ -96,10 +96,10 @@ export class Widget extends InfernoWrapperComponent<WidgetProps> {
9696
public refs: any = null;
9797

9898
// eslint-disable-next-line max-len
99-
public rootElementRef?: RefObject<HTMLDivElement> = infernoCreateRef() as RefObject<HTMLDivElement>;
99+
public rootElementRef?: RefObject<HTMLDivElement> = infernoCreateRef();
100100

101101
// eslint-disable-next-line max-len
102-
public widgetElementRef?: RefObject<HTMLDivElement> = infernoCreateRef() as RefObject<HTMLDivElement>;
102+
public widgetElementRef?: RefObject<HTMLDivElement> = infernoCreateRef();
103103

104104
public config?: ConfigContextValue;
105105

packages/devextreme/js/__internal/pagination/content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
33
import { InfernoComponent, InfernoEffect } from '@devextreme/runtime/inferno';
4-
import type { RefObject } from '@devextreme-generator/declarations';
54
import type { DisplayMode } from '@js/common';
5+
import type { RefObject } from '@ts/core/r1/types';
66
import { Widget } from '@ts/core/r1/widget';
77
import { createRef as infernoCreateRef } from 'inferno';
88

packages/devextreme/js/__internal/pagination/page_size/selector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* eslint-disable @typescript-eslint/no-explicit-any */
44
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
55
import { InfernoComponent, InfernoEffect } from '@devextreme/runtime/inferno';
6-
import type { RefObject } from '@devextreme-generator/declarations';
6+
import type { RefObject } from '@ts/core/r1/types';
77
import { createRef as infernoCreateRef } from 'inferno';
88

99
import { PAGINATION_PAGE_SIZES_CLASS } from '../common/consts';
@@ -36,7 +36,7 @@ export class PageSizeSelector extends InfernoComponent<PageSizeSelectorPropsType
3636

3737
public rootElementRef = infernoCreateRef() as RefObject<HTMLDivElement>;
3838

39-
public htmlRef = infernoCreateRef() as RefObject<HTMLElement>;
39+
public htmlRef = infernoCreateRef() as RefObject<HTMLDivElement>;
4040

4141
public __getterCache: any = {
4242
normalizedPageSizes: undefined,

packages/devextreme/js/__internal/pagination/resizable_container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-disable @typescript-eslint/no-explicit-any */
33
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
44
import { InfernoComponent, InfernoEffect } from '@devextreme/runtime/inferno';
5-
import type { JSXTemplate } from '@devextreme-generator/declarations';
5+
import type { JSXTemplate } from '@ts/core/r1/types';
66
import { createRef as infernoCreateRef } from 'inferno';
77

88
import resizeCallbacks from '../../core/utils/resize_callbacks';

packages/devextreme/js/__internal/scheduler/r1/components/base/all_day_panel_table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { InfernoEffect } from '@devextreme/runtime/inferno';
22
import { createReRenderEffect, InfernoWrapperComponent } from '@devextreme/runtime/inferno';
3-
import type { RefObject } from '@devextreme-generator/declarations';
3+
import type { RefObject } from '@ts/core/r1/types';
44
import { getTemplate } from '@ts/core/r1/utils/index';
55
import type { ViewCellData } from '@ts/scheduler/r1/types';
66

packages/devextreme/js/__internal/scheduler/r1/components/base/all_day_panel_table_body.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { PropsWithClassName } from '__internal/core/r1';
22
import { BaseInfernoComponent } from '@devextreme/runtime/inferno';
3-
import type { JSXTemplate } from '@devextreme-generator/declarations';
3+
import type { JSXTemplate } from '@ts/core/r1/types';
44
import { getTemplate } from '@ts/core/r1/utils/index';
55

66
import { combineClasses } from '../../../../core/r1/utils/render_utils';

packages/devextreme/js/__internal/scheduler/r1/components/base/date_header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BaseInfernoComponent } from '@devextreme/runtime/inferno';
2-
import type { JSXTemplate } from '@devextreme-generator/declarations';
2+
import type { JSXTemplate } from '@ts/core/r1/types';
33
import { getTemplate } from '@ts/core/r1/utils/index';
44

55
import type { DateHeaderData, Group, GroupOrientation } from '../../types';

packages/devextreme/js/__internal/scheduler/r1/components/base/date_header_cell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BaseInfernoComponent } from '@devextreme/runtime/inferno';
2-
import type { JSXTemplate } from '@devextreme-generator/declarations';
2+
import type { JSXTemplate } from '@ts/core/r1/types';
33
import { getTemplate } from '@ts/core/r1/utils/index';
44

55
import { combineClasses } from '../../../../core/r1/utils/render_utils';

packages/devextreme/js/__internal/scheduler/r1/components/base/date_table.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { InfernoEffect } from '@devextreme/runtime/inferno';
22
import { createReRenderEffect, InfernoWrapperComponent } from '@devextreme/runtime/inferno';
3-
import type { JSXTemplate, RefObject } from '@devextreme-generator/declarations';
3+
import type { JSXTemplate, RefObject } from '@ts/core/r1/types';
44
import { getTemplate } from '@ts/core/r1/utils/index';
55

66
import type { CellTemplateProps, DefaultProps } from '../types';
@@ -17,7 +17,6 @@ export interface DateTableProps extends LayoutProps {
1717

1818
export const DateTableDefaultProps: DefaultProps<DateTableProps> = {
1919
...LayoutDefaultProps,
20-
// @ts-expect-error Different types between React and Inferno
2120
cellTemplate: DateTableCellBase,
2221
};
2322

0 commit comments

Comments
 (0)