@cesdk/engine 1.32.0-rc.2 → 1.33.0-rc.0
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/assets/core/{cesdk-v1.32.0-rc.2-C2XIG4OM.wasm → cesdk-v1.33.0-rc.0-EL2JNDZM.wasm} +0 -0
- package/assets/core/{worker-host-v1.32.0-rc.2-UDLIHWU4.js → worker-host-v1.33.0-rc.0-7WBDZQDM.js} +1 -1
- package/index.d.ts +119 -94
- package/index.js +1 -1
- package/integrations/react.d.ts +52 -58
- package/package.json +13 -1
- /package/assets/core/{cesdk-v1.32.0-rc.2-46BMFTP2.data → cesdk-v1.33.0-rc.0-46BMFTP2.data} +0 -0
package/integrations/react.d.ts
CHANGED
|
@@ -1,28 +1,6 @@
|
|
|
1
1
|
import type CreativeEngine from '@cesdk/engine';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* A type helper for writing components that use the withEngine decorator.
|
|
5
|
-
*
|
|
6
|
-
* Makes it easier to export the props of your component without the `engine`
|
|
7
|
-
* prop that is already handled by the decorator.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* import withEngine, { type WithEngine } from '@cesdk/engine/integrations/react'
|
|
12
|
-
*
|
|
13
|
-
* export interface MyProps {
|
|
14
|
-
* blockId: number;
|
|
15
|
-
* }
|
|
16
|
-
*
|
|
17
|
-
* const MyComponent = withEngine(function MyComponent({blockId, engine}: WithEngine<MyProps>) {
|
|
18
|
-
* return <div>Block {blockId} is of type {engine.block.getType(blockId)}</div>
|
|
19
|
-
* });
|
|
20
|
-
*
|
|
21
|
-
* export default Mycomponent;
|
|
22
|
-
*
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export type WithEngine<T> = T & { engine: CreativeEngine };
|
|
2
|
+
import type * as React_2 from 'react';
|
|
3
|
+
import type { Reaction } from '@cesdk/engine';
|
|
26
4
|
|
|
27
5
|
/**
|
|
28
6
|
* Takes a selector function and returns its result. The selector function will
|
|
@@ -55,10 +33,7 @@ export type WithEngine<T> = T & { engine: CreativeEngine };
|
|
|
55
33
|
*
|
|
56
34
|
* @public
|
|
57
35
|
*/
|
|
58
|
-
export declare function useEngineSelector<T>(
|
|
59
|
-
engine: CreativeEngine,
|
|
60
|
-
selector: (engine: CreativeEngine) => T,
|
|
61
|
-
options?: {
|
|
36
|
+
export declare function useEngineSelector<T>(engine: CreativeEngine, selector: (engine: CreativeEngine) => T, options?: {
|
|
62
37
|
/** A string that is used internally for debugging */
|
|
63
38
|
debugName?: string;
|
|
64
39
|
/**
|
|
@@ -66,12 +41,10 @@ export declare function useEngineSelector<T>(
|
|
|
66
41
|
* and returns true if they are considered equal.
|
|
67
42
|
*/
|
|
68
43
|
equals?: (value: T, lastValue: T | undefined) => boolean;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
selector: (engine: CreativeEngine | undefined) => T,
|
|
74
|
-
options?: {
|
|
44
|
+
}): T;
|
|
45
|
+
|
|
46
|
+
/** @public */
|
|
47
|
+
export declare function useEngineSelector<T>(engine: CreativeEngine | undefined, selector: (engine: CreativeEngine | undefined) => T, options?: {
|
|
75
48
|
/** A string that is used internally for debugging */
|
|
76
49
|
debugName?: string;
|
|
77
50
|
/**
|
|
@@ -79,8 +52,34 @@ export declare function useEngineSelector<T>(
|
|
|
79
52
|
* and returns true if they are considered equal.
|
|
80
53
|
*/
|
|
81
54
|
equals?: (value: T, lastValue: T | undefined) => boolean;
|
|
82
|
-
|
|
83
|
-
|
|
55
|
+
}): T | undefined;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A type helper for writing components that use the withEngine decorator.
|
|
59
|
+
*
|
|
60
|
+
* Makes it easier to export the props of your component without the `engine`
|
|
61
|
+
* prop that is already handled by the decorator.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* import withEngine, { type WithEngine } from '@cesdk/engine/integrations/react'
|
|
66
|
+
*
|
|
67
|
+
* export interface MyProps {
|
|
68
|
+
* blockId: number;
|
|
69
|
+
* }
|
|
70
|
+
*
|
|
71
|
+
* const MyComponent = withEngine(function MyComponent({blockId, engine}: WithEngine<MyProps>) {
|
|
72
|
+
* return <div>Block {blockId} is of type {engine.block.getType(blockId)}</div>
|
|
73
|
+
* });
|
|
74
|
+
*
|
|
75
|
+
* export default Mycomponent;
|
|
76
|
+
*
|
|
77
|
+
* ```
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
export declare type WithEngine<T> = T & {
|
|
81
|
+
engine: CreativeEngine;
|
|
82
|
+
};
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
85
|
* Higher-order component for use with ReactJS
|
|
@@ -162,27 +161,22 @@ export declare function useEngineSelector<T>(
|
|
|
162
161
|
*
|
|
163
162
|
* @public
|
|
164
163
|
*/
|
|
165
|
-
export function withEngine<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
Component: React.ForwardRefRenderFunction<R, P>,
|
|
171
|
-
options?: O
|
|
172
|
-
): O extends { useEngine: () => CreativeEngine }
|
|
173
|
-
? React.ForwardRefRenderFunction<R, Omit<P, 'engine'>>
|
|
174
|
-
: React.ForwardRefRenderFunction<R, P>;
|
|
175
|
-
export function withEngine<
|
|
176
|
-
P extends { engine?: CreativeEngine },
|
|
177
|
-
O extends WithEngineOptions
|
|
178
|
-
>(
|
|
179
|
-
Component: React.FunctionComponent<P>,
|
|
180
|
-
options?: O
|
|
181
|
-
): O extends { useEngine: () => CreativeEngine }
|
|
182
|
-
? React.FunctionComponent<Omit<P, 'engine'>>
|
|
183
|
-
: React.FunctionComponent<P>;
|
|
164
|
+
export declare function withEngine<P extends {
|
|
165
|
+
engine?: CreativeEngine;
|
|
166
|
+
}, O extends WithEngineOptions, R>(Component: React_2.ForwardRefRenderFunction<R, P>, options?: O): O extends {
|
|
167
|
+
useEngine: () => CreativeEngine;
|
|
168
|
+
} ? React_2.ForwardRefRenderFunction<R, Omit<P, 'engine'>> : React_2.ForwardRefRenderFunction<R, P>;
|
|
184
169
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
170
|
+
/** @public */
|
|
171
|
+
export declare function withEngine<P extends {
|
|
172
|
+
engine?: CreativeEngine;
|
|
173
|
+
}, O extends WithEngineOptions>(Component: React_2.FunctionComponent<P>, options?: O): O extends {
|
|
174
|
+
useEngine: () => CreativeEngine;
|
|
175
|
+
} ? React_2.FunctionComponent<Omit<P, 'engine'>> : React_2.FunctionComponent<P>;
|
|
176
|
+
|
|
177
|
+
declare interface WithEngineOptions<E = CreativeEngine> {
|
|
178
|
+
debugName?: string;
|
|
179
|
+
useEngine?: () => E;
|
|
188
180
|
}
|
|
181
|
+
|
|
182
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cesdk/engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0-rc.0",
|
|
4
4
|
"main": "./index.js",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./index.d.ts",
|
|
8
|
+
"import": "./index.js",
|
|
9
|
+
"module": "./index.js"
|
|
10
|
+
},
|
|
11
|
+
"./integrations/react": {
|
|
12
|
+
"types": "./integrations/react.d.ts",
|
|
13
|
+
"import": "./integrations/react.js",
|
|
14
|
+
"module": "./integrations/react.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
5
17
|
"type": "module",
|
|
6
18
|
"types": "./index.d.ts",
|
|
7
19
|
"homepage": "https://www.img.ly",
|
|
File without changes
|