DevExpress / devextreme-react

React UI and data visualization components
https://js.devexpress.com/Demos/
MIT License
161 stars 65 forks source link

Fix Options types generation #861

Closed IlyaKhD closed 1 year ago

IlyaKhD commented 1 year ago

Fixes extension components

Adds IHtmlOptions to extension components options which is required for React.PropsWithChildren

Diff

import dxValidator, {
-    Properties as IValidatorOptions
+    Properties
} from "devextreme/ui/validator";

 import * as PropTypes from "prop-types";
 import { ExtensionComponent as BaseComponent } from "./core/extension-component";
+import { IHtmlOptions } from "./core/component";
 import NestedOption from "./core/nested-option";

+type IValidatorOptions = React.PropsWithChildren<Properties & IHtmlOptions>

Affects

Beautifies other component options

Removes unnecessary empty object from components options without extra fields

Before

type IBulletOptions = React.PropsWithChildren<ReplaceFieldTypes<Properties, IBulletOptionsNarrowedEvents> & IHtmlOptions & {
}>

After

type IBulletOptions = React.PropsWithChildren<ReplaceFieldTypes<Properties, IBulletOptionsNarrowedEvents> & IHtmlOptions>

Affects