@ensembleapp/client-sdk 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +13 -8
- package/dist/index.js.map +1 -1
- package/dist/widget/widget.global.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -165,18 +165,23 @@ declare function createSDKWidget<TSchema extends FlexibleSchema, TEnriched exten
|
|
|
165
165
|
/**
|
|
166
166
|
* Type for customer's ReactDOM instance (supports React 16-18).
|
|
167
167
|
* Customers must provide their ReactDOM to enable cross-version widget rendering.
|
|
168
|
+
*
|
|
169
|
+
* This type is intentionally loose to accept ReactDOM from any React version
|
|
170
|
+
* without requiring customers to cast their imports.
|
|
171
|
+
*
|
|
172
|
+
* Note: We use `any` for render parameters to avoid TypeScript contravariance issues.
|
|
173
|
+
* Using `unknown` would require customers to cast their ReactDOM imports because
|
|
174
|
+
* @types/react-dom uses `ReactNode` (narrower) which isn't assignable to `unknown` (broader).
|
|
168
175
|
*/
|
|
169
|
-
|
|
170
|
-
render?: (element:
|
|
176
|
+
type CustomerReactDOM = {
|
|
177
|
+
render?: (element: any, container: HTMLElement, callback?: () => void) => any;
|
|
171
178
|
unmountComponentAtNode?: (container: HTMLElement) => boolean;
|
|
172
|
-
createRoot?: (container: HTMLElement, options?: {
|
|
173
|
-
|
|
174
|
-
onRecoverableError?: (error: Error) => void;
|
|
175
|
-
}) => {
|
|
176
|
-
render: (children: unknown) => void;
|
|
179
|
+
createRoot?: (container: HTMLElement, options?: Record<string, any>) => {
|
|
180
|
+
render: (children: any) => void;
|
|
177
181
|
unmount: () => void;
|
|
178
182
|
};
|
|
179
|
-
|
|
183
|
+
[key: string]: unknown;
|
|
184
|
+
};
|
|
180
185
|
/**
|
|
181
186
|
* Widget definition for customer-defined widgets.
|
|
182
187
|
* Customer widgets require `reactDOM` to enable cross-React version rendering.
|