@player-ui/async-node-plugin 0.7.4-next.4 → 0.7.5--canary.434.14868
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/AsyncNodePlugin.native.js +11323 -0
- package/dist/AsyncNodePlugin.native.js.map +1 -0
- package/dist/cjs/index.cjs +166 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/index.legacy-esm.js +130 -0
- package/dist/index.mjs +130 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +24 -60
- package/src/index.test.ts +453 -0
- package/src/index.ts +155 -77
- package/src/types.ts +2 -2
- package/types/index.d.ts +38 -0
- package/types/types.d.ts +3 -0
- package/dist/async-node-plugin.dev.js +0 -10687
- package/dist/async-node-plugin.prod.js +0 -2
- package/dist/index.cjs.js +0 -102
- package/dist/index.d.ts +0 -20
- package/dist/index.esm.js +0 -94
package/src/types.ts
CHANGED
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Player, PlayerPlugin, Node, ViewInstance, Parser, ViewPlugin, Resolver } from "@player-ui/player";
|
|
2
|
+
import { AsyncParallelBailHook } from "tapable-ts";
|
|
3
|
+
export * from "./types";
|
|
4
|
+
export interface AsyncNodePluginOptions {
|
|
5
|
+
/** A set of plugins to load */
|
|
6
|
+
plugins?: AsyncNodeViewPlugin[];
|
|
7
|
+
}
|
|
8
|
+
export interface AsyncNodeViewPlugin extends ViewPlugin {
|
|
9
|
+
/** Use this to tap into the async node plugin hooks */
|
|
10
|
+
applyPlugin: (asyncNodePlugin: AsyncNodePlugin) => void;
|
|
11
|
+
asyncNode: AsyncParallelBailHook<[Node.Async], any>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Async node plugin used to resolve async nodes in the content
|
|
15
|
+
* If an async node is present, allow users to provide a replacement node to be rendered when ready
|
|
16
|
+
*/
|
|
17
|
+
export declare class AsyncNodePlugin implements PlayerPlugin {
|
|
18
|
+
private plugins;
|
|
19
|
+
constructor(options: AsyncNodePluginOptions);
|
|
20
|
+
readonly hooks: {
|
|
21
|
+
onAsyncNode: AsyncParallelBailHook<[Node.Async], any, Record<string, any>>;
|
|
22
|
+
};
|
|
23
|
+
name: string;
|
|
24
|
+
apply(player: Player): void;
|
|
25
|
+
}
|
|
26
|
+
export declare class AsyncNodePluginPlugin implements AsyncNodeViewPlugin {
|
|
27
|
+
asyncNode: AsyncParallelBailHook<[Node.Async], any, Record<string, any>>;
|
|
28
|
+
private basePlugin;
|
|
29
|
+
name: string;
|
|
30
|
+
private resolvedMapping;
|
|
31
|
+
private currentView;
|
|
32
|
+
private isAsync;
|
|
33
|
+
applyParser(parser: Parser): void;
|
|
34
|
+
applyResolverHooks(resolver: Resolver): void;
|
|
35
|
+
apply(view: ViewInstance): void;
|
|
36
|
+
applyPlugin(asyncNodePlugin: AsyncNodePlugin): void;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
package/types/types.d.ts
ADDED