@player-ui/async-node-plugin 0.13.0 → 0.14.0-next.1

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.
Files changed (34) hide show
  1. package/dist/AsyncNodePlugin.native.js +467 -279
  2. package/dist/AsyncNodePlugin.native.js.map +1 -1
  3. package/dist/cjs/index.cjs +217 -20
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/index.legacy-esm.js +217 -18
  6. package/dist/index.mjs +217 -18
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +2 -2
  9. package/src/__tests__/__snapshots__/transform.test.ts.snap +1 -0
  10. package/src/__tests__/createAsyncTransform.test.ts +405 -0
  11. package/src/__tests__/index.test.ts +94 -13
  12. package/src/__tests__/transform.bench.ts +177 -0
  13. package/src/createAsyncTransform.ts +101 -0
  14. package/src/index.ts +93 -13
  15. package/src/transform.ts +5 -2
  16. package/src/types.ts +1 -0
  17. package/src/utils/__tests__/extractNodeFromPath.test.ts +181 -0
  18. package/src/utils/__tests__/requiresAssetWrapper.test.ts +63 -0
  19. package/src/utils/__tests__/traverseAndReplace.test.ts +182 -0
  20. package/src/utils/__tests__/unwrapAsset.test.ts +65 -0
  21. package/src/utils/extractNodeFromPath.ts +56 -0
  22. package/src/utils/index.ts +4 -0
  23. package/src/utils/requiresAssetWrapper.ts +14 -0
  24. package/src/utils/traverseAndReplace.ts +34 -0
  25. package/src/utils/unwrapAsset.ts +16 -0
  26. package/types/createAsyncTransform.d.ts +24 -0
  27. package/types/index.d.ts +16 -1
  28. package/types/transform.d.ts +2 -1
  29. package/types/types.d.ts +1 -1
  30. package/types/utils/extractNodeFromPath.d.ts +4 -0
  31. package/types/utils/index.d.ts +5 -0
  32. package/types/utils/requiresAssetWrapper.d.ts +3 -0
  33. package/types/utils/traverseAndReplace.d.ts +4 -0
  34. package/types/utils/unwrapAsset.d.ts +3 -0
@@ -0,0 +1,181 @@
1
+ import { NodeType, Node } from "@player-ui/player";
2
+ import { describe, expect, it } from "vitest";
3
+ import { extractNodeFromPath } from "../extractNodeFromPath";
4
+
5
+ describe("extractNodeFromPath", () => {
6
+ it("should return any child with an exact match", () => {
7
+ const node: Node.Value = {
8
+ type: NodeType.Value,
9
+ value: {},
10
+ children: [
11
+ {
12
+ path: ["value", "asset"],
13
+ value: {
14
+ type: NodeType.Asset,
15
+ value: {
16
+ id: "id-1",
17
+ type: "type-1",
18
+ },
19
+ },
20
+ },
21
+ {
22
+ path: ["value"],
23
+ value: {
24
+ type: NodeType.Value,
25
+ value: {},
26
+ children: [
27
+ {
28
+ path: ["asset"],
29
+ value: {
30
+ type: NodeType.Asset,
31
+ value: {
32
+ id: "id-2",
33
+ type: "type-2",
34
+ },
35
+ },
36
+ },
37
+ ],
38
+ },
39
+ },
40
+ ],
41
+ };
42
+
43
+ const result = extractNodeFromPath(node, ["value", "asset"]);
44
+
45
+ expect(result).toStrictEqual({
46
+ type: NodeType.Asset,
47
+ value: {
48
+ id: "id-1",
49
+ type: "type-1",
50
+ },
51
+ });
52
+ });
53
+
54
+ it("should follow partial matches to find the path nested", () => {
55
+ const node: Node.Value = {
56
+ type: NodeType.Value,
57
+ value: {},
58
+ children: [
59
+ {
60
+ path: ["value"],
61
+ value: {
62
+ type: NodeType.Value,
63
+ value: {},
64
+ children: [
65
+ {
66
+ path: ["asset"],
67
+ value: {
68
+ type: NodeType.Asset,
69
+ value: {
70
+ id: "id-2",
71
+ type: "type-2",
72
+ },
73
+ },
74
+ },
75
+ ],
76
+ },
77
+ },
78
+ ],
79
+ };
80
+
81
+ const result = extractNodeFromPath(node, ["value", "asset"]);
82
+
83
+ expect(result).toStrictEqual({
84
+ type: NodeType.Asset,
85
+ value: {
86
+ id: "id-2",
87
+ type: "type-2",
88
+ },
89
+ });
90
+ });
91
+
92
+ const emptyPaths = [undefined, []];
93
+ it.each(emptyPaths)(
94
+ "should return the original node if the path is empty or undefined",
95
+ (path) => {
96
+ const node: Node.Value = {
97
+ type: NodeType.Value,
98
+ value: {},
99
+ children: [
100
+ {
101
+ path: ["value"],
102
+ value: {
103
+ type: NodeType.Value,
104
+ value: {},
105
+ children: [
106
+ {
107
+ path: ["asset"],
108
+ value: {
109
+ type: NodeType.Asset,
110
+ value: {
111
+ id: "id-2",
112
+ type: "type-2",
113
+ },
114
+ },
115
+ },
116
+ ],
117
+ },
118
+ },
119
+ ],
120
+ };
121
+
122
+ const result = extractNodeFromPath(node, path);
123
+
124
+ expect(result).toStrictEqual(node);
125
+ },
126
+ );
127
+
128
+ const noChildrenNodes: Node.Node[] = [
129
+ // No children property
130
+ {
131
+ id: "test",
132
+ type: NodeType.Async,
133
+ value: {
134
+ type: NodeType.Value,
135
+ value: {
136
+ id: "test",
137
+ },
138
+ },
139
+ },
140
+ // Children explicitly set to undefined
141
+ {
142
+ type: NodeType.Value,
143
+ value: {},
144
+ children: undefined,
145
+ },
146
+ ];
147
+
148
+ it.each(noChildrenNodes)(
149
+ "should return undefined if there are no children in the node",
150
+ (node) => {
151
+ const result = extractNodeFromPath(node, ["value", "asset"]);
152
+ expect(result).toBeUndefined();
153
+ },
154
+ );
155
+
156
+ it("should return undefined if there is no match", () => {
157
+ const node: Node.Value = {
158
+ type: NodeType.Value,
159
+ children: [
160
+ {
161
+ path: ["very", "long", "path"],
162
+ value: {
163
+ type: NodeType.Value,
164
+ value: {},
165
+ },
166
+ },
167
+ {
168
+ path: ["value", "not-asset"],
169
+ value: {
170
+ type: NodeType.Value,
171
+ value: {},
172
+ },
173
+ },
174
+ ],
175
+ value: {},
176
+ };
177
+
178
+ const result = extractNodeFromPath(node, ["value", "asset"]);
179
+ expect(result).toBeUndefined();
180
+ });
181
+ });
@@ -0,0 +1,63 @@
1
+ import { NodeType, Node } from "@player-ui/player";
2
+ import { describe, expect, it } from "vitest";
3
+ import { requiresAssetWrapper } from "../requiresAssetWrapper";
4
+
5
+ describe("requiresAssetWrapper", () => {
6
+ it("should return true for asset nodes", () => {
7
+ const node: Node.Asset = {
8
+ type: NodeType.Asset,
9
+ value: {
10
+ type: "text",
11
+ id: "id",
12
+ },
13
+ };
14
+
15
+ const result = requiresAssetWrapper(node);
16
+
17
+ expect(result).toBe(true);
18
+ });
19
+
20
+ it("should return true for applicability nodes containing asset nodes", () => {
21
+ const node: Node.Applicability = {
22
+ type: NodeType.Applicability,
23
+ expression: "",
24
+ value: {
25
+ type: NodeType.Asset,
26
+ value: {
27
+ type: "text",
28
+ id: "id",
29
+ },
30
+ },
31
+ };
32
+
33
+ const result = requiresAssetWrapper(node);
34
+
35
+ expect(result).toBe(true);
36
+ });
37
+
38
+ it("should return false for non-asset or non-applicability nodes", () => {
39
+ const node: Node.Value = {
40
+ type: NodeType.Value,
41
+ value: {},
42
+ };
43
+
44
+ const result = requiresAssetWrapper(node);
45
+
46
+ expect(result).toBe(false);
47
+ });
48
+
49
+ it("should return false for applicability nodes that do not contain an asset node", () => {
50
+ const node: Node.Applicability = {
51
+ type: NodeType.Applicability,
52
+ expression: "",
53
+ value: {
54
+ type: NodeType.Value,
55
+ value: {},
56
+ },
57
+ };
58
+
59
+ const result = requiresAssetWrapper(node);
60
+
61
+ expect(result).toBe(false);
62
+ });
63
+ });
@@ -0,0 +1,182 @@
1
+ import { describe, expect, it, vi } from "vitest";
2
+ import { Node, NodeType } from "@player-ui/player";
3
+ import { traverseAndReplace } from "../traverseAndReplace";
4
+
5
+ describe("traverseAndReplace", () => {
6
+ it("should call the replace function against the given node if it is not a multi-node", () => {
7
+ const node: Node.Value = {
8
+ type: NodeType.Value,
9
+ value: {
10
+ prop: "value",
11
+ },
12
+ };
13
+
14
+ const replaceFunction = vi.fn();
15
+ replaceFunction.mockReturnValue({
16
+ type: NodeType.Value,
17
+ value: {
18
+ prop: "new-value",
19
+ },
20
+ });
21
+
22
+ const result = traverseAndReplace(node, replaceFunction);
23
+
24
+ expect(result).toStrictEqual({
25
+ type: "value",
26
+ value: {
27
+ prop: "new-value",
28
+ },
29
+ });
30
+ expect(replaceFunction).toHaveBeenCalledOnce();
31
+ expect(replaceFunction).toHaveBeenCalledWith({
32
+ type: "value",
33
+ value: {
34
+ prop: "value",
35
+ },
36
+ });
37
+ });
38
+
39
+ it("should call the replace function once for each value in the multi-node", () => {
40
+ const node: Node.MultiNode = {
41
+ type: NodeType.MultiNode,
42
+ values: [
43
+ {
44
+ type: NodeType.Value,
45
+ value: {
46
+ prop: "value-1",
47
+ },
48
+ },
49
+ {
50
+ type: NodeType.Value,
51
+ value: {
52
+ prop: "value-2",
53
+ },
54
+ },
55
+ ],
56
+ };
57
+
58
+ const replaceFunction = vi.fn();
59
+ replaceFunction.mockReturnValue({
60
+ type: NodeType.Value,
61
+ value: {
62
+ prop: "new-value",
63
+ },
64
+ });
65
+
66
+ const result = traverseAndReplace(node, replaceFunction);
67
+
68
+ expect(result).toStrictEqual({
69
+ type: "multi-node",
70
+ values: [
71
+ {
72
+ type: NodeType.Value,
73
+ value: {
74
+ prop: "new-value",
75
+ },
76
+ },
77
+ {
78
+ type: NodeType.Value,
79
+ value: {
80
+ prop: "new-value",
81
+ },
82
+ },
83
+ ],
84
+ });
85
+ expect(replaceFunction).toHaveBeenCalledTimes(2);
86
+ expect(replaceFunction).toHaveBeenCalledWith({
87
+ type: "value",
88
+ value: {
89
+ prop: "value-1",
90
+ },
91
+ });
92
+ expect(replaceFunction).toHaveBeenCalledWith({
93
+ type: "value",
94
+ value: {
95
+ prop: "value-2",
96
+ },
97
+ });
98
+ });
99
+
100
+ it("should flatten multi-node values generated by the replace function if the top-level node is a multi-node", () => {
101
+ const node: Node.MultiNode = {
102
+ type: NodeType.MultiNode,
103
+ values: [
104
+ {
105
+ type: NodeType.Value,
106
+ value: {
107
+ prop: "first",
108
+ },
109
+ },
110
+ ],
111
+ };
112
+
113
+ const replaceFunction = vi.fn();
114
+ replaceFunction.mockImplementation((node: Node.Node) => {
115
+ if (node.type === NodeType.Value && node.value.prop === "first") {
116
+ return {
117
+ type: NodeType.MultiNode,
118
+ values: [
119
+ {
120
+ type: NodeType.Value,
121
+ value: {
122
+ prop: "second",
123
+ },
124
+ },
125
+ {
126
+ type: NodeType.Value,
127
+ value: {
128
+ prop: "third",
129
+ },
130
+ },
131
+ ],
132
+ };
133
+ }
134
+
135
+ return {
136
+ type: NodeType.Value,
137
+ value: {
138
+ prop: "new-value",
139
+ },
140
+ };
141
+ });
142
+
143
+ const result = traverseAndReplace(node, replaceFunction);
144
+
145
+ expect(result).toStrictEqual({
146
+ type: "multi-node",
147
+ values: [
148
+ {
149
+ type: NodeType.Value,
150
+ value: {
151
+ prop: "new-value",
152
+ },
153
+ },
154
+ {
155
+ type: NodeType.Value,
156
+ value: {
157
+ prop: "new-value",
158
+ },
159
+ },
160
+ ],
161
+ });
162
+ expect(replaceFunction).toHaveBeenCalledTimes(3);
163
+ expect(replaceFunction).toHaveBeenCalledWith({
164
+ type: "value",
165
+ value: {
166
+ prop: "first",
167
+ },
168
+ });
169
+ expect(replaceFunction).toHaveBeenCalledWith({
170
+ type: "value",
171
+ value: {
172
+ prop: "second",
173
+ },
174
+ });
175
+ expect(replaceFunction).toHaveBeenCalledWith({
176
+ type: "value",
177
+ value: {
178
+ prop: "third",
179
+ },
180
+ });
181
+ });
182
+ });
@@ -0,0 +1,65 @@
1
+ import { NodeType, Node } from "@player-ui/player";
2
+ import { describe, expect, it } from "vitest";
3
+ import { unwrapAsset } from "../unwrapAsset";
4
+
5
+ describe("unwrapAsseet", () => {
6
+ it("should return the original node if the current node is not a value node", () => {
7
+ const node: Node.MultiNode = {
8
+ type: NodeType.MultiNode,
9
+ values: [],
10
+ };
11
+
12
+ const result = unwrapAsset(node);
13
+ expect(result).toStrictEqual({
14
+ type: NodeType.MultiNode,
15
+ values: [],
16
+ });
17
+ });
18
+
19
+ const noAssetChildren = [undefined, []];
20
+ it.each(noAssetChildren)(
21
+ "should return the original node if it can't unwrap the asset",
22
+ (children) => {
23
+ const node: Node.Value = {
24
+ type: NodeType.Value,
25
+ value: {},
26
+ children,
27
+ };
28
+
29
+ const result = unwrapAsset(node);
30
+ expect(result).toStrictEqual({
31
+ type: NodeType.Value,
32
+ value: {},
33
+ children,
34
+ });
35
+ },
36
+ );
37
+
38
+ it("should unwrap and return the asset from a value node", () => {
39
+ const node: Node.Value = {
40
+ type: NodeType.Value,
41
+ value: {},
42
+ children: [
43
+ {
44
+ path: ["asset"],
45
+ value: {
46
+ type: NodeType.Asset,
47
+ value: {
48
+ id: "id",
49
+ type: "type",
50
+ },
51
+ },
52
+ },
53
+ ],
54
+ };
55
+
56
+ const result = unwrapAsset(node);
57
+ expect(result).toStrictEqual({
58
+ type: NodeType.Asset,
59
+ value: {
60
+ id: "id",
61
+ type: "type",
62
+ },
63
+ });
64
+ });
65
+ });
@@ -0,0 +1,56 @@
1
+ import type { Node } from "@player-ui/player";
2
+
3
+ /** Matches 2 segments where pathA matches or is a subset of pathB. Returns the number of matching segments */
4
+ const getMatchValue = (
5
+ pathA: Node.PathSegment[],
6
+ pathB: Node.PathSegment[],
7
+ ): number => {
8
+ if (pathA.length > pathB.length) {
9
+ return 0;
10
+ }
11
+
12
+ let matchCount = 0;
13
+ for (let i = 0; i < pathA.length; i++) {
14
+ if (pathA[i] === pathB[i]) {
15
+ matchCount++;
16
+ } else {
17
+ return 0;
18
+ }
19
+ }
20
+
21
+ return matchCount;
22
+ };
23
+
24
+ /** Follows the given path and returns the node. If there is no match, returns undefined */
25
+ export const extractNodeFromPath = (
26
+ node: Node.Node,
27
+ path?: string[],
28
+ ): Node.Node | undefined => {
29
+ if (path === undefined || path.length === 0) {
30
+ return node;
31
+ }
32
+
33
+ if (!("children" in node && node.children)) {
34
+ return undefined;
35
+ }
36
+
37
+ let matchResult = 0;
38
+ let bestMatch: Node.Child | undefined;
39
+ for (const child of node.children) {
40
+ const matchValue = getMatchValue(child.path, path);
41
+ if (matchValue > matchResult) {
42
+ matchResult = matchValue;
43
+ bestMatch = child;
44
+ }
45
+ }
46
+
47
+ if (!bestMatch) {
48
+ return undefined;
49
+ }
50
+
51
+ if (matchResult >= path.length) {
52
+ return bestMatch.value;
53
+ }
54
+
55
+ return extractNodeFromPath(bestMatch.value, path.slice(matchResult));
56
+ };
@@ -0,0 +1,4 @@
1
+ export * from "./extractNodeFromPath";
2
+ export * from "./traverseAndReplace";
3
+ export * from "./unwrapAsset";
4
+ export * from "./requiresAssetWrapper";
@@ -0,0 +1,14 @@
1
+ import { NodeType } from "@player-ui/player";
2
+ import type { Node } from "@player-ui/player";
3
+
4
+ export const requiresAssetWrapper = (node: Node.Node): boolean => {
5
+ if (node.type === NodeType.Asset) {
6
+ return true;
7
+ }
8
+
9
+ if (node.type !== NodeType.Applicability) {
10
+ return false;
11
+ }
12
+
13
+ return node.value.type === NodeType.Asset;
14
+ };
@@ -0,0 +1,34 @@
1
+ import { NodeType, Node } from "@player-ui/player";
2
+
3
+ /** Replaces a node using the given replace function. If the node is a multi-node it does this transformation to all of its values. */
4
+ export const traverseAndReplace = (
5
+ node: Node.Node,
6
+ replaceFn: (node: Node.Node) => Node.Node,
7
+ ): Node.Node => {
8
+ if (node.type === NodeType.MultiNode) {
9
+ let index = 0;
10
+ while (index < node.values.length) {
11
+ const child = node.values[index];
12
+ if (!child) {
13
+ index++;
14
+ continue;
15
+ }
16
+
17
+ const result = replaceFn(child);
18
+ if (result.type === NodeType.MultiNode) {
19
+ node.values = [
20
+ ...node.values.slice(0, index),
21
+ ...result.values,
22
+ ...node.values.slice(index + 1),
23
+ ];
24
+ } else {
25
+ node.values[index] = result;
26
+ index++;
27
+ }
28
+ }
29
+
30
+ return node;
31
+ }
32
+
33
+ return replaceFn(node);
34
+ };
@@ -0,0 +1,16 @@
1
+ import { NodeType, Node } from "@player-ui/player";
2
+
3
+ export const unwrapAsset = (node: Node.Node): Node.Node => {
4
+ if (node.type !== NodeType.Value) {
5
+ return node;
6
+ }
7
+ const child = node.children?.find(
8
+ (x) => x.path.length === 1 && x.path[0] === "asset",
9
+ );
10
+
11
+ if (!child) {
12
+ return node;
13
+ }
14
+
15
+ return child.value;
16
+ };
@@ -0,0 +1,24 @@
1
+ import { BeforeTransformFunction, Node } from "@player-ui/player";
2
+ export type AsyncTransformOptions = {
3
+ /** Whether or not to flatten the results into its container. Defaults to true */
4
+ flatten?: boolean;
5
+ /** The path to the array within the `wrapperAssetType` that will contain the async content. Defaults to ["values"] */
6
+ path?: string[];
7
+ /** The asset type that the transform is matching against. */
8
+ transformAssetType: string;
9
+ /** The asset type that will contain the async content. */
10
+ wrapperAssetType: string;
11
+ /** Function to get any nested asset that will need to be extracted and kept when creating the wrapper asset. */
12
+ getNestedAsset?: (node: Node.ViewOrAsset) => Node.Node | undefined;
13
+ /** Function to get the id for the async node being generated. Defaults to creating an id with the format of async-<ASSET.ID> */
14
+ getAsyncNodeId?: (node: Node.ViewOrAsset) => string;
15
+ };
16
+ /** Creates a BeforeTransformFunction that turns the given asset into a wrapper asset with an async node in it.
17
+ * By setting {@link AsyncTransformOptions.flatten} to true, you can chain multiple of the same asset type to create a flow of async content that
18
+ * exists within a single collection.
19
+ *
20
+ * @param options - Options for managing the transform
21
+ * @returns The {@link BeforeTransformFunction} that can be used for your asset.
22
+ */
23
+ export declare const createAsyncTransform: (options: AsyncTransformOptions) => BeforeTransformFunction;
24
+ //# sourceMappingURL=createAsyncTransform.d.ts.map
package/types/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { Player, PlayerPlugin, Node, ViewInstance, Parser, ViewPlugin, Reso
2
2
  import { AsyncParallelBailHook, SyncBailHook } from "tapable-ts";
3
3
  export * from "./types";
4
4
  export * from "./transform";
5
+ export * from "./createAsyncTransform";
5
6
  /** Object type for storing data related to a single `apply` of the `AsyncNodePluginPlugin`
6
7
  * This object should be setup once per ViewInstance to keep any cached info just for that view to avoid conflicts of shared async node ids across different view states.
7
8
  */
@@ -23,8 +24,13 @@ export interface AsyncNodeViewPlugin extends ViewPlugin {
23
24
  asyncNode: AsyncParallelBailHook<[Node.Async, (result: any) => void], any>;
24
25
  }
25
26
  export type AsyncHandler = (node: Node.Async, callback?: (result: any) => void) => Promise<any>;
27
+ export type AsyncContent = {
28
+ async: true;
29
+ flatten?: boolean;
30
+ [key: string]: unknown;
31
+ };
26
32
  /** Hook declaration for the AsyncNodePlugin */
27
- type AsyncNodeHooks = {
33
+ export type AsyncNodeHooks = {
28
34
  /** Async hook to get content for an async node */
29
35
  onAsyncNode: AsyncParallelBailHook<[Node.Async, (result: any) => void], any>;
30
36
  /** Sync hook to manage errors coming from the onAsyncNode hook. Return a fallback node or null to render a fallback. The first argument of passed in the call is the error thrown. */
@@ -71,6 +77,7 @@ export declare class AsyncNodePluginPlugin implements AsyncNodeViewPlugin {
71
77
  * @param view The view instance where the node resides. This can be undefined if the view is not currently active.
72
78
  */
73
79
  private handleAsyncUpdate;
80
+ private hasValidMapping;
74
81
  /**
75
82
  * Handles the asynchronous API integration for resolving nodes.
76
83
  * This method sets up a hook on the resolver's `beforeResolve` event to process async nodes.
@@ -78,6 +85,14 @@ export declare class AsyncNodePluginPlugin implements AsyncNodeViewPlugin {
78
85
  * @param view
79
86
  */
80
87
  applyResolver(resolver: Resolver, context: AsyncPluginContext): void;
88
+ /**
89
+ * Replaces child async nodes with their resolved content and flattens when necessary. Resolving the children directly helps manage the `parent` reference without needing as much work within the resolver itself.
90
+ * Handles async node chains as well to make sure all applicable nodes can get flattened.
91
+ * @param node - The node whose children need to be resolved.
92
+ * @param context - the async plugin context needed to reach into the cache
93
+ * @returns The same node but with async node children mapped to their resolved AST.
94
+ */
95
+ private resolveAsyncChildren;
81
96
  private runAsyncNode;
82
97
  private isAsync;
83
98
  private isDeterminedAsync;
@@ -1,10 +1,11 @@
1
1
  import type { AsyncTransformFunc } from "./types";
2
2
  /**
3
+ * @deprecated Use {@link createAsyncTransform} to create your before transform function.
3
4
  * Util function to generate transform function for async asset
4
5
  * @param asset - async asset to apply beforeResolve transform
5
- * @param transformedAssetType: transformed asset type for rendering
6
6
  * @param wrapperAssetType: container asset type
7
7
  * @param flatten: flatten the streamed in content
8
+ * @param path: property path to add the multinode containing the next async node to
8
9
  * @returns - wrapper asset with children of transformed asset and async node
9
10
  */
10
11
  export declare const asyncTransform: AsyncTransformFunc;