@kubb/react-fabric 0.1.1 → 0.1.3

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.cts CHANGED
@@ -4,75 +4,196 @@ import * as react1 from "react";
4
4
  import React, { ReactNode } from "react";
5
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
6
6
 
7
+ //#region ../fabric-core/src/plugins/types.d.ts
8
+ type Plugin<TOptions$1 = any[], TAppExtension$1 extends Record<string, any> = {}> = {
9
+ name: string;
10
+ type: 'plugin';
11
+ scope?: 'write' | 'read' | (string & {});
12
+ install: Install<TOptions$1> | Promise<Install<TOptions$1>>;
13
+ /**
14
+ * Runtime app overrides or extensions.
15
+ * Merged into the app instance after install.
16
+ */
17
+ override?: Override<TOptions$1, TAppExtension$1>;
18
+ };
19
+ //#endregion
20
+ //#region ../fabric-core/src/parsers/types.d.ts
21
+ type PrintOptions = {
22
+ extname?: Extname;
23
+ };
24
+ type Parser<TOptions$1 = any[], TMeta$1 extends object = any> = {
25
+ name: string;
26
+ type: 'parser';
27
+ /**
28
+ * Undefined is being used for the defaultParser
29
+ */
30
+ extNames: Array<Extname> | undefined;
31
+ install: Install<TOptions$1>;
32
+ /**
33
+ * Convert a file to string
34
+ */
35
+ parse(file: ResolvedFile<TMeta$1>, options: PrintOptions): Promise<string>;
36
+ };
37
+ //#endregion
38
+ //#region ../fabric-core/src/utils/AsyncEventEmitter.d.ts
39
+ declare class AsyncEventEmitter<TEvents extends Record<string, any>> {
40
+ #private;
41
+ constructor(maxListener?: number);
42
+ emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArgs: TEvents[TEventName]): Promise<void>;
43
+ on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
44
+ off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
45
+ removeAll(): void;
46
+ }
47
+ //#endregion
7
48
  //#region ../fabric-core/src/FileProcessor.d.ts
8
-
9
49
  type ProcessFilesProps = {
50
+ parsers?: Set<Parser>;
10
51
  extension?: Record<Extname, Extname | ''>;
11
52
  dryRun?: boolean;
12
53
  };
54
+ type GetParseOptions = {
55
+ parsers?: Set<Parser>;
56
+ extension?: Record<Extname, Extname | ''>;
57
+ };
58
+ type Options$1 = {
59
+ events?: AsyncEventEmitter<AppEvents>;
60
+ };
61
+ declare class FileProcessor {
62
+ #private;
63
+ events: AsyncEventEmitter<AppEvents>;
64
+ constructor({
65
+ events
66
+ }?: Options$1);
67
+ parse(file: ResolvedFile, {
68
+ parsers,
69
+ extension
70
+ }?: GetParseOptions): Promise<string>;
71
+ run(files: Array<ResolvedFile>, {
72
+ parsers,
73
+ dryRun,
74
+ extension
75
+ }?: ProcessFilesProps): Promise<ResolvedFile[]>;
76
+ }
13
77
  //#endregion
14
78
  //#region ../fabric-core/src/FileManager.d.ts
79
+ type Options = {
80
+ events?: AsyncEventEmitter<AppEvents>;
81
+ };
15
82
  declare class FileManager {
16
83
  #private;
17
- constructor();
84
+ processor: FileProcessor;
85
+ constructor({
86
+ events
87
+ }?: Options);
18
88
  add(...files: Array<File$1>): Promise<ResolvedFile<object>[]>;
19
89
  flush(): void;
20
90
  getByPath(path: Path): ResolvedFile | null;
21
91
  deleteByPath(path: Path): void;
22
92
  clear(): void;
23
93
  get files(): Array<ResolvedFile>;
24
- get processor(): {
25
- run(options: ProcessFilesProps): Promise<ResolvedFile<object>[]>;
26
- };
94
+ write(options: ProcessFilesProps): Promise<ResolvedFile[]>;
27
95
  }
28
96
  //#endregion
29
- //#region ../fabric-core/src/defineApp.d.ts
97
+ //#region ../fabric-core/src/App.d.ts
30
98
  type Component = any;
31
- type PluginInstallFunction<Options$1 = any[]> = Options$1 extends unknown[] ? (app: App$1, ...options: Options$1) => any : (app: App$1, options: Options$1) => any;
32
- type ObjectPlugin<Options$1 = any[]> = {
33
- install: PluginInstallFunction<Options$1>;
99
+ type AppEvents = {
100
+ /**
101
+ * Called in the beginning of the app lifecycle.
102
+ */
103
+ start: [{
104
+ app: App$1;
105
+ }];
106
+ /**
107
+ * Called in the end of the app lifecycle.
108
+ */
109
+ end: [{
110
+ app: App$1;
111
+ }];
112
+ /**
113
+ * Called when being rendered
114
+ */
115
+ render: [{
116
+ app: App$1;
117
+ }];
118
+ /**
119
+ * Called once before processing any files.
120
+ */
121
+ 'process:start': [{
122
+ files: ResolvedFile[];
123
+ }];
124
+ /**
125
+ * Called for each file when processing begins.
126
+ */
127
+ 'file:start': [{
128
+ file: ResolvedFile;
129
+ index: number;
130
+ total: number;
131
+ }];
132
+ /**
133
+ * Called for each file when processing finishes.
134
+ */
135
+ 'file:end': [{
136
+ file: ResolvedFile;
137
+ index: number;
138
+ total: number;
139
+ }];
140
+ /**
141
+ * Called periodically (or after each file) to indicate progress.
142
+ * Useful for progress bars or logging.
143
+ */
144
+ 'process:progress': [{
145
+ processed: number;
146
+ total: number;
147
+ percentage: number;
148
+ source: string;
149
+ file: ResolvedFile;
150
+ }];
151
+ /**
152
+ * Called once all files have been processed successfully.
153
+ */
154
+ 'process:end': [{
155
+ files: ResolvedFile[];
156
+ }];
34
157
  };
35
- type FunctionPlugin<Options$1 = any[]> = PluginInstallFunction<Options$1> & Partial<ObjectPlugin<Options$1>>;
36
- type AppContext<TOptions = unknown> = {
37
- options?: TOptions;
158
+ type AppContext<TOptions$1 = unknown> = {
159
+ options?: TOptions$1;
160
+ events: AsyncEventEmitter<AppEvents>;
38
161
  fileManager: FileManager;
39
- addFile(...files: Array<File$1>): Promise<void>;
40
- files: Array<ResolvedFile>;
41
- clear: () => void;
42
- };
43
- type Plugin<Options$1 = any[], P extends unknown[] = (Options$1 extends unknown[] ? Options$1 : [Options$1])> = FunctionPlugin<P> | ObjectPlugin<P>;
44
- type WriteOptions = {
45
- extension?: Record<Extname, Extname | ''>;
46
- dryRun?: boolean;
162
+ installedPlugins: Set<Plugin>;
163
+ installedParsers: Set<Parser>;
47
164
  };
165
+ type Install<TOptions$1 = any[] | object | undefined> = TOptions$1 extends any[] ? (app: App$1, context: AppContext, ...options: TOptions$1) => void : TOptions$1 extends object ? (app: App$1, context: AppContext, options?: TOptions$1) => void : (app: App$1, context: AppContext) => void;
166
+ type Override<TOptions$1 = any[] | object | undefined, TAppExtension$1 extends Record<string, any> = {}> = TOptions$1 extends any[] ? (app: App$1, context: AppContext, ...options: TOptions$1) => Partial<TAppExtension$1> : TOptions$1 extends object ? (app: App$1, context: AppContext, options?: TOptions$1) => Partial<TAppExtension$1> : (app: App$1, context: AppContext) => Partial<TAppExtension$1>;
48
167
  interface App$1 {
49
168
  _component: Component;
50
169
  render(): Promise<void>;
51
170
  renderToString(): Promise<string>;
52
171
  files: Array<ResolvedFile>;
53
- use<Options>(plugin: Plugin<Options>, options: NoInfer<Options>): this;
54
- write(options?: WriteOptions): Promise<void>;
172
+ use<TOptions extends any[] | object = any, TMeta extends object = object, TAppExtension extends Record<string, any> = {}>(pluginOrParser: Plugin<TOptions, TAppExtension> | Parser<TOptions, TMeta>, ...options: TOptions extends any[] ? NoInfer<TOptions> : [NoInfer<TOptions>]): this & TAppExtension;
173
+ use<TOptions extends any[] | object = any, TMeta extends object = object, TAppExtension extends Record<string, any> = {}>(pluginOrParser: Plugin<TOptions, TAppExtension> | Parser<TOptions, TMeta>): this & TAppExtension;
55
174
  addFile(...files: Array<File$1>): Promise<void>;
56
175
  waitUntilExit(): Promise<void>;
57
176
  }
177
+ //#endregion
178
+ //#region ../fabric-core/src/defineApp.d.ts
58
179
  type DefineApp<TContext extends AppContext> = (rootComponent?: Component, options?: TContext['options']) => App$1;
59
180
  //#endregion
60
181
  //#region src/components/App.d.ts
61
- type AppContextProps<TMeta = unknown> = {
182
+ type AppContextProps<TMeta$1 = unknown> = {
62
183
  /**
63
184
  * Exit (unmount)
64
185
  */
65
186
  readonly exit: (error?: Error) => void;
66
- readonly meta: TMeta;
187
+ readonly meta: TMeta$1;
67
188
  };
68
- type Props$4<TMeta = unknown> = {
189
+ type Props$4<TMeta$1 = unknown> = {
69
190
  readonly children?: KubbNode;
70
- readonly meta: TMeta;
191
+ readonly meta: TMeta$1;
71
192
  };
72
- declare function App<TMeta = unknown>({
193
+ declare function App<TMeta$1 = unknown>({
73
194
  meta,
74
195
  children
75
- }: Props$4<TMeta>): react_jsx_runtime0.JSX.Element;
196
+ }: Props$4<TMeta$1>): react_jsx_runtime0.JSX.Element;
76
197
  declare namespace App {
77
198
  var Context: react1.Context<AppContextProps<unknown> | undefined>;
78
199
  var displayName: string;
@@ -116,7 +237,7 @@ declare namespace Const {
116
237
  }
117
238
  //#endregion
118
239
  //#region src/components/File.d.ts
119
- type FileContextProps<TMeta extends object = object> = {
240
+ type FileContextProps<TMeta$1 extends object = object> = {
120
241
  /**
121
242
  * Name to be used to dynamicly create the baseName(based on input.path).
122
243
  * Based on UNIX basename
@@ -127,7 +248,7 @@ type FileContextProps<TMeta extends object = object> = {
127
248
  * Path will be full qualified path to a specified file.
128
249
  */
129
250
  path: Path;
130
- meta?: TMeta;
251
+ meta?: TMeta$1;
131
252
  };
132
253
  type BasePropsWithBaseName = {
133
254
  /**
@@ -149,17 +270,17 @@ type BasePropsWithoutBaseName = {
149
270
  path?: Path;
150
271
  };
151
272
  type BaseProps = BasePropsWithBaseName | BasePropsWithoutBaseName;
152
- type Props$2<TMeta> = BaseProps & {
273
+ type Props$2<TMeta$1> = BaseProps & {
153
274
  key?: Key;
154
- meta?: TMeta;
275
+ meta?: TMeta$1;
155
276
  banner?: string;
156
277
  footer?: string;
157
278
  children?: KubbNode;
158
279
  };
159
- declare function File<TMeta extends object = object>({
280
+ declare function File<TMeta$1 extends object = object>({
160
281
  children,
161
282
  ...rest
162
- }: Props$2<TMeta>): react_jsx_runtime0.JSX.Element;
283
+ }: Props$2<TMeta$1>): react_jsx_runtime0.JSX.Element;
163
284
  declare namespace File {
164
285
  var displayName: string;
165
286
  var Export: typeof FileExport;
@@ -341,7 +462,7 @@ declare const createApp: DefineApp<ReactAppContext>;
341
462
  /**
342
463
  * `useApp` will return the current App with plugin, pluginManager, fileManager and mode.
343
464
  */
344
- declare function useApp<TMeta = unknown>(): AppContextProps<TMeta>;
465
+ declare function useApp<TMeta$1 = unknown>(): AppContextProps<TMeta$1>;
345
466
  //#endregion
346
467
  //#region src/composables/useFile.d.ts
347
468
  /**
package/dist/index.d.ts CHANGED
@@ -4,75 +4,196 @@ import * as react1 from "react";
4
4
  import React, { ReactNode } from "react";
5
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
6
6
 
7
+ //#region ../fabric-core/src/plugins/types.d.ts
8
+ type Plugin<TOptions$1 = any[], TAppExtension$1 extends Record<string, any> = {}> = {
9
+ name: string;
10
+ type: 'plugin';
11
+ scope?: 'write' | 'read' | (string & {});
12
+ install: Install<TOptions$1> | Promise<Install<TOptions$1>>;
13
+ /**
14
+ * Runtime app overrides or extensions.
15
+ * Merged into the app instance after install.
16
+ */
17
+ override?: Override<TOptions$1, TAppExtension$1>;
18
+ };
19
+ //#endregion
20
+ //#region ../fabric-core/src/parsers/types.d.ts
21
+ type PrintOptions = {
22
+ extname?: Extname;
23
+ };
24
+ type Parser<TOptions$1 = any[], TMeta$1 extends object = any> = {
25
+ name: string;
26
+ type: 'parser';
27
+ /**
28
+ * Undefined is being used for the defaultParser
29
+ */
30
+ extNames: Array<Extname> | undefined;
31
+ install: Install<TOptions$1>;
32
+ /**
33
+ * Convert a file to string
34
+ */
35
+ parse(file: ResolvedFile<TMeta$1>, options: PrintOptions): Promise<string>;
36
+ };
37
+ //#endregion
38
+ //#region ../fabric-core/src/utils/AsyncEventEmitter.d.ts
39
+ declare class AsyncEventEmitter<TEvents extends Record<string, any>> {
40
+ #private;
41
+ constructor(maxListener?: number);
42
+ emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArgs: TEvents[TEventName]): Promise<void>;
43
+ on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
44
+ off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
45
+ removeAll(): void;
46
+ }
47
+ //#endregion
7
48
  //#region ../fabric-core/src/FileProcessor.d.ts
8
-
9
49
  type ProcessFilesProps = {
50
+ parsers?: Set<Parser>;
10
51
  extension?: Record<Extname, Extname | ''>;
11
52
  dryRun?: boolean;
12
53
  };
54
+ type GetParseOptions = {
55
+ parsers?: Set<Parser>;
56
+ extension?: Record<Extname, Extname | ''>;
57
+ };
58
+ type Options$1 = {
59
+ events?: AsyncEventEmitter<AppEvents>;
60
+ };
61
+ declare class FileProcessor {
62
+ #private;
63
+ events: AsyncEventEmitter<AppEvents>;
64
+ constructor({
65
+ events
66
+ }?: Options$1);
67
+ parse(file: ResolvedFile, {
68
+ parsers,
69
+ extension
70
+ }?: GetParseOptions): Promise<string>;
71
+ run(files: Array<ResolvedFile>, {
72
+ parsers,
73
+ dryRun,
74
+ extension
75
+ }?: ProcessFilesProps): Promise<ResolvedFile[]>;
76
+ }
13
77
  //#endregion
14
78
  //#region ../fabric-core/src/FileManager.d.ts
79
+ type Options = {
80
+ events?: AsyncEventEmitter<AppEvents>;
81
+ };
15
82
  declare class FileManager {
16
83
  #private;
17
- constructor();
84
+ processor: FileProcessor;
85
+ constructor({
86
+ events
87
+ }?: Options);
18
88
  add(...files: Array<File$1>): Promise<ResolvedFile<object>[]>;
19
89
  flush(): void;
20
90
  getByPath(path: Path): ResolvedFile | null;
21
91
  deleteByPath(path: Path): void;
22
92
  clear(): void;
23
93
  get files(): Array<ResolvedFile>;
24
- get processor(): {
25
- run(options: ProcessFilesProps): Promise<ResolvedFile<object>[]>;
26
- };
94
+ write(options: ProcessFilesProps): Promise<ResolvedFile[]>;
27
95
  }
28
96
  //#endregion
29
- //#region ../fabric-core/src/defineApp.d.ts
97
+ //#region ../fabric-core/src/App.d.ts
30
98
  type Component = any;
31
- type PluginInstallFunction<Options$1 = any[]> = Options$1 extends unknown[] ? (app: App$1, ...options: Options$1) => any : (app: App$1, options: Options$1) => any;
32
- type ObjectPlugin<Options$1 = any[]> = {
33
- install: PluginInstallFunction<Options$1>;
99
+ type AppEvents = {
100
+ /**
101
+ * Called in the beginning of the app lifecycle.
102
+ */
103
+ start: [{
104
+ app: App$1;
105
+ }];
106
+ /**
107
+ * Called in the end of the app lifecycle.
108
+ */
109
+ end: [{
110
+ app: App$1;
111
+ }];
112
+ /**
113
+ * Called when being rendered
114
+ */
115
+ render: [{
116
+ app: App$1;
117
+ }];
118
+ /**
119
+ * Called once before processing any files.
120
+ */
121
+ 'process:start': [{
122
+ files: ResolvedFile[];
123
+ }];
124
+ /**
125
+ * Called for each file when processing begins.
126
+ */
127
+ 'file:start': [{
128
+ file: ResolvedFile;
129
+ index: number;
130
+ total: number;
131
+ }];
132
+ /**
133
+ * Called for each file when processing finishes.
134
+ */
135
+ 'file:end': [{
136
+ file: ResolvedFile;
137
+ index: number;
138
+ total: number;
139
+ }];
140
+ /**
141
+ * Called periodically (or after each file) to indicate progress.
142
+ * Useful for progress bars or logging.
143
+ */
144
+ 'process:progress': [{
145
+ processed: number;
146
+ total: number;
147
+ percentage: number;
148
+ source: string;
149
+ file: ResolvedFile;
150
+ }];
151
+ /**
152
+ * Called once all files have been processed successfully.
153
+ */
154
+ 'process:end': [{
155
+ files: ResolvedFile[];
156
+ }];
34
157
  };
35
- type FunctionPlugin<Options$1 = any[]> = PluginInstallFunction<Options$1> & Partial<ObjectPlugin<Options$1>>;
36
- type AppContext<TOptions = unknown> = {
37
- options?: TOptions;
158
+ type AppContext<TOptions$1 = unknown> = {
159
+ options?: TOptions$1;
160
+ events: AsyncEventEmitter<AppEvents>;
38
161
  fileManager: FileManager;
39
- addFile(...files: Array<File$1>): Promise<void>;
40
- files: Array<ResolvedFile>;
41
- clear: () => void;
42
- };
43
- type Plugin<Options$1 = any[], P extends unknown[] = (Options$1 extends unknown[] ? Options$1 : [Options$1])> = FunctionPlugin<P> | ObjectPlugin<P>;
44
- type WriteOptions = {
45
- extension?: Record<Extname, Extname | ''>;
46
- dryRun?: boolean;
162
+ installedPlugins: Set<Plugin>;
163
+ installedParsers: Set<Parser>;
47
164
  };
165
+ type Install<TOptions$1 = any[] | object | undefined> = TOptions$1 extends any[] ? (app: App$1, context: AppContext, ...options: TOptions$1) => void : TOptions$1 extends object ? (app: App$1, context: AppContext, options?: TOptions$1) => void : (app: App$1, context: AppContext) => void;
166
+ type Override<TOptions$1 = any[] | object | undefined, TAppExtension$1 extends Record<string, any> = {}> = TOptions$1 extends any[] ? (app: App$1, context: AppContext, ...options: TOptions$1) => Partial<TAppExtension$1> : TOptions$1 extends object ? (app: App$1, context: AppContext, options?: TOptions$1) => Partial<TAppExtension$1> : (app: App$1, context: AppContext) => Partial<TAppExtension$1>;
48
167
  interface App$1 {
49
168
  _component: Component;
50
169
  render(): Promise<void>;
51
170
  renderToString(): Promise<string>;
52
171
  files: Array<ResolvedFile>;
53
- use<Options>(plugin: Plugin<Options>, options: NoInfer<Options>): this;
54
- write(options?: WriteOptions): Promise<void>;
172
+ use<TOptions extends any[] | object = any, TMeta extends object = object, TAppExtension extends Record<string, any> = {}>(pluginOrParser: Plugin<TOptions, TAppExtension> | Parser<TOptions, TMeta>, ...options: TOptions extends any[] ? NoInfer<TOptions> : [NoInfer<TOptions>]): this & TAppExtension;
173
+ use<TOptions extends any[] | object = any, TMeta extends object = object, TAppExtension extends Record<string, any> = {}>(pluginOrParser: Plugin<TOptions, TAppExtension> | Parser<TOptions, TMeta>): this & TAppExtension;
55
174
  addFile(...files: Array<File$1>): Promise<void>;
56
175
  waitUntilExit(): Promise<void>;
57
176
  }
177
+ //#endregion
178
+ //#region ../fabric-core/src/defineApp.d.ts
58
179
  type DefineApp<TContext extends AppContext> = (rootComponent?: Component, options?: TContext['options']) => App$1;
59
180
  //#endregion
60
181
  //#region src/components/App.d.ts
61
- type AppContextProps<TMeta = unknown> = {
182
+ type AppContextProps<TMeta$1 = unknown> = {
62
183
  /**
63
184
  * Exit (unmount)
64
185
  */
65
186
  readonly exit: (error?: Error) => void;
66
- readonly meta: TMeta;
187
+ readonly meta: TMeta$1;
67
188
  };
68
- type Props$4<TMeta = unknown> = {
189
+ type Props$4<TMeta$1 = unknown> = {
69
190
  readonly children?: KubbNode;
70
- readonly meta: TMeta;
191
+ readonly meta: TMeta$1;
71
192
  };
72
- declare function App<TMeta = unknown>({
193
+ declare function App<TMeta$1 = unknown>({
73
194
  meta,
74
195
  children
75
- }: Props$4<TMeta>): react_jsx_runtime0.JSX.Element;
196
+ }: Props$4<TMeta$1>): react_jsx_runtime0.JSX.Element;
76
197
  declare namespace App {
77
198
  var Context: react1.Context<AppContextProps<unknown> | undefined>;
78
199
  var displayName: string;
@@ -116,7 +237,7 @@ declare namespace Const {
116
237
  }
117
238
  //#endregion
118
239
  //#region src/components/File.d.ts
119
- type FileContextProps<TMeta extends object = object> = {
240
+ type FileContextProps<TMeta$1 extends object = object> = {
120
241
  /**
121
242
  * Name to be used to dynamicly create the baseName(based on input.path).
122
243
  * Based on UNIX basename
@@ -127,7 +248,7 @@ type FileContextProps<TMeta extends object = object> = {
127
248
  * Path will be full qualified path to a specified file.
128
249
  */
129
250
  path: Path;
130
- meta?: TMeta;
251
+ meta?: TMeta$1;
131
252
  };
132
253
  type BasePropsWithBaseName = {
133
254
  /**
@@ -149,17 +270,17 @@ type BasePropsWithoutBaseName = {
149
270
  path?: Path;
150
271
  };
151
272
  type BaseProps = BasePropsWithBaseName | BasePropsWithoutBaseName;
152
- type Props$2<TMeta> = BaseProps & {
273
+ type Props$2<TMeta$1> = BaseProps & {
153
274
  key?: Key;
154
- meta?: TMeta;
275
+ meta?: TMeta$1;
155
276
  banner?: string;
156
277
  footer?: string;
157
278
  children?: KubbNode;
158
279
  };
159
- declare function File<TMeta extends object = object>({
280
+ declare function File<TMeta$1 extends object = object>({
160
281
  children,
161
282
  ...rest
162
- }: Props$2<TMeta>): react_jsx_runtime0.JSX.Element;
283
+ }: Props$2<TMeta$1>): react_jsx_runtime0.JSX.Element;
163
284
  declare namespace File {
164
285
  var displayName: string;
165
286
  var Export: typeof FileExport;
@@ -341,7 +462,7 @@ declare const createApp: DefineApp<ReactAppContext>;
341
462
  /**
342
463
  * `useApp` will return the current App with plugin, pluginManager, fileManager and mode.
343
464
  */
344
- declare function useApp<TMeta = unknown>(): AppContextProps<TMeta>;
465
+ declare function useApp<TMeta$1 = unknown>(): AppContextProps<TMeta$1>;
345
466
  //#endregion
346
467
  //#region src/composables/useFile.d.ts
347
468
  /**
package/dist/index.js CHANGED
@@ -15546,7 +15546,7 @@ function processFiles(node, context) {
15546
15546
  footer: attributes.footer,
15547
15547
  banner: attributes.banner
15548
15548
  };
15549
- context.addFile(file);
15549
+ context.fileManager.add(file);
15550
15550
  }
15551
15551
  }
15552
15552
  }
@@ -15611,7 +15611,7 @@ var ReactTemplate = class {
15611
15611
  _defineProperty(this, "onRender", async () => {
15612
15612
  var _classPrivateFieldGet2$1, _classPrivateFieldGet3, _classPrivateFieldGet4, _classPrivateFieldGet5;
15613
15613
  if (_classPrivateFieldGet2(_isUnmounted, this)) return;
15614
- _classPrivateFieldGet2(_context, this).clear();
15614
+ _classPrivateFieldGet2(_context, this).fileManager.clear();
15615
15615
  processFiles(_classPrivateFieldGet2(_rootNode, this), _classPrivateFieldGet2(_context, this));
15616
15616
  if (!((_classPrivateFieldGet2$1 = _classPrivateFieldGet2(_context, this).options) === null || _classPrivateFieldGet2$1 === void 0 ? void 0 : _classPrivateFieldGet2$1.debug) && !((_classPrivateFieldGet3 = _classPrivateFieldGet2(_context, this).options) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.stdout)) return;
15617
15617
  const output = await _assertClassBrand(_ReactTemplate_brand, this, _getOutput).call(this, _classPrivateFieldGet2(_rootNode, this), _classPrivateFieldGet2(_context, this));
@@ -15684,7 +15684,7 @@ var ReactTemplate = class {
15684
15684
  });
15685
15685
  KubbRenderer.updateContainerSync(element, _classPrivateFieldGet2(_container, this), null, null);
15686
15686
  KubbRenderer.flushSyncWork();
15687
- _classPrivateFieldGet2(_context, this).clear();
15687
+ _classPrivateFieldGet2(_context, this).fileManager.clear();
15688
15688
  return _assertClassBrand(_ReactTemplate_brand, this, _getOutput).call(this, _classPrivateFieldGet2(_rootNode, this), _classPrivateFieldGet2(_context, this));
15689
15689
  }
15690
15690
  unmount(error) {
@@ -15711,20 +15711,20 @@ var ReactTemplate = class {
15711
15711
  };
15712
15712
  async function _getOutput(node, context) {
15713
15713
  const text = squashTextNodes(node);
15714
- const files = context.files;
15714
+ const files = context.fileManager.files;
15715
15715
  return files.length ? [...files].flatMap((file) => [...file.sources].map((item) => item.value)).filter(Boolean).join("\n\n") : text;
15716
15716
  }
15717
15717
 
15718
15718
  //#endregion
15719
15719
  //#region src/createApp.ts
15720
- const createApp = defineApp((app, context) => {
15720
+ const createApp = defineApp((App$1, context) => {
15721
15721
  const template = new ReactTemplate(context);
15722
15722
  return {
15723
15723
  render() {
15724
- template.render((0, import_react.createElement)(app));
15724
+ template.render((0, import_react.createElement)(App$1));
15725
15725
  },
15726
15726
  async renderToString() {
15727
- return template.renderToString((0, import_react.createElement)(app));
15727
+ return template.renderToString((0, import_react.createElement)(App$1));
15728
15728
  },
15729
15729
  waitUntilExit() {
15730
15730
  return template.waitUntilExit();