@kubb/core 1.0.0 → 1.0.2

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 CHANGED
@@ -1,5 +1,10 @@
1
+ import { Ora } from 'ora';
1
2
  import { DirectoryTreeOptions } from 'directory-tree';
2
3
 
4
+ declare function isPromise<T>(result: MaybePromise<T>): result is Promise<T>;
5
+
6
+ declare function write(data: string, path: string): Promise<void>;
7
+
3
8
  interface Cache<T extends object = object> {
4
9
  delete(id: keyof T): boolean;
5
10
  get(id: keyof T): T[keyof T] | null;
@@ -8,9 +13,274 @@ interface Cache<T extends object = object> {
8
13
  }
9
14
  declare function createPluginCache<T extends Record<string, [number, unknown]>>(cache: T): Cache<T>;
10
15
 
16
+ declare function getRelativePath(rootDir?: string | null, filePath?: string | null): string;
17
+ type PathMode = 'file' | 'directory';
18
+ declare function getPathMode(path: string | undefined | null): PathMode;
19
+ declare function read(path: string): Promise<string>;
20
+
21
+ declare function isURL(data: string): boolean;
22
+
23
+ type Data = string[][];
24
+ type Options$2 = {
25
+ typed?: boolean;
26
+ };
27
+ declare function objectToParameters(data: Data, options?: Options$2): string;
28
+
29
+ declare function nameSorter<T extends {
30
+ name: string;
31
+ }>(a: T, b: T): 1 | -1 | 0;
32
+
33
+ declare function createJSDocBlockText({ comments }: {
34
+ comments: Array<string>;
35
+ }): string;
36
+
37
+ declare function getUniqueName(originalName: string, data: Record<string, number>): string;
38
+
39
+ declare function timeout(ms: number): Promise<unknown>;
40
+
41
+ type QueueTask<T = unknown> = {
42
+ (...args: unknown[]): Promise<T>;
43
+ };
44
+ declare class Queue {
45
+ private readonly queue;
46
+ workerCount: number;
47
+ private maxParallel;
48
+ constructor(maxParallel: number);
49
+ run<T>(task: QueueTask<T>): Promise<T>;
50
+ private work;
51
+ }
52
+
53
+ declare function getEncodedText(text?: string): string;
54
+
55
+ declare function renderTemplate<TData extends Record<string, string> = Record<string, string>>(template: string, data?: TData | undefined): string;
56
+
57
+ declare function clean(path: string): Promise<boolean>;
58
+
59
+ type TreeNodeOptions = DirectoryTreeOptions;
60
+ declare class TreeNode<T = unknown> {
61
+ data: T;
62
+ parent?: TreeNode<T>;
63
+ children: Array<TreeNode<T>>;
64
+ constructor(data: T, parent?: TreeNode<T>);
65
+ addChild(data: T): TreeNode<T>;
66
+ find(data: T): {} | null;
67
+ leaves(): TreeNode<T>[];
68
+ root(): TreeNode<T>;
69
+ forEach(callback: (treeNode: TreeNode<T>) => void): this;
70
+ static build<T = unknown>(path: string, options?: TreeNodeOptions): TreeNode<T> | null;
71
+ }
72
+
73
+ declare function transformReservedWord(word?: string | null): string | null | undefined;
74
+
75
+ declare function getStackTrace(belowFn?: Function): NodeJS.CallSite[];
76
+
77
+ type Import = {
78
+ name: string | string[];
79
+ path: string;
80
+ isTypeOnly?: boolean;
81
+ };
82
+ type Export = {
83
+ name?: string | string[];
84
+ path: string;
85
+ isTypeOnly?: boolean;
86
+ asAlias?: boolean;
87
+ };
88
+ type File = {
89
+ /**
90
+ * Name to be used to dynamicly create the fileName(based on input.path)
91
+ */
92
+ fileName: string;
93
+ /**
94
+ * Path will be full qualified path to a specified file
95
+ */
96
+ path: string;
97
+ source: string;
98
+ imports?: Import[];
99
+ exports?: Export[];
100
+ /**
101
+ * This will call fileManager.add instead of fileManager.addOrAppend, adding the source when the files already exists
102
+ * @default `false`
103
+ */
104
+ override?: boolean;
105
+ meta?: {
106
+ pluginName?: string;
107
+ };
108
+ };
109
+ type UUID = string;
110
+ type CacheStore = {
111
+ id: UUID;
112
+ file: File;
113
+ status: Status;
114
+ };
115
+ type Status = 'new' | 'success' | 'removed';
116
+
117
+ declare class FileManager {
118
+ private cache;
119
+ private task?;
120
+ private queue?;
121
+ constructor(options?: {
122
+ queue: Queue;
123
+ task: QueueTask<unknown>;
124
+ });
125
+ private getCache;
126
+ getCacheByPath(path: string | undefined): CacheStore | undefined;
127
+ get files(): File[];
128
+ add(file: File): Promise<File>;
129
+ addOrAppend(file: File): Promise<File>;
130
+ setStatus(id: UUID, status: Status): void;
131
+ get(id: UUID): File | undefined;
132
+ remove(id: UUID): void;
133
+ write(...params: Parameters<typeof write>): Promise<void>;
134
+ read(...params: Parameters<typeof read>): Promise<string>;
135
+ }
136
+
137
+ declare function writeIndexes(root: string, options: TreeNodeOptions): File[] | undefined;
138
+ declare function combineFiles(files: Array<File | null>): File[];
139
+ declare function getFileSource(file: File): string;
140
+
141
+ /**
142
+ * Get the type of the first argument in a function.
143
+ * @example Arg0<(a: string, b: number) => void> -> string
144
+ */
145
+ type Argument0<H extends keyof PluginLifecycle> = Parameters<PluginLifecycle[H]>[0];
146
+ type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookReduceArg0' | 'hookSeq';
147
+ type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
148
+ strategy: Strategy;
149
+ hookName: H;
150
+ plugin: KubbPlugin;
151
+ };
152
+ type OnExecute<H extends PluginLifecycleHooks = PluginLifecycleHooks> = (this: PluginManager, executer: Executer<H> | undefined) => void;
153
+
154
+ type KubbPluginFactory<T extends PluginFactoryOptions = PluginFactoryOptions> = (options: T['options']) => T['nested'] extends true ? Array<KubbPlugin<T>> : KubbPlugin<T>;
155
+ declare function createPlugin<T extends PluginFactoryOptions = PluginFactoryOptions>(factory: KubbPluginFactory<T>): (options: T['options']) => T["nested"] extends true ? KubbPlugin<T>[] : KubbPlugin<T>;
156
+ type Options$1 = {
157
+ config: PluginContext['config'];
158
+ fileManager: FileManager;
159
+ resolvePath: PluginContext['resolvePath'];
160
+ resolveName: PluginContext['resolveName'];
161
+ load: PluginContext['load'];
162
+ getExecuter: () => Executer<PluginLifecycleHooks> | undefined;
163
+ };
164
+ type CorePluginOptions = PluginFactoryOptions<Options$1, false, PluginContext>;
165
+ declare const name: "core";
166
+
167
+ declare const hooks: [keyof PluginLifecycle<PluginFactoryOptions<unknown, false, any, Record<string, any>>>];
168
+ type Options = {
169
+ task: QueueTask;
170
+ onExecute?: OnExecute<PluginLifecycleHooks>;
171
+ };
172
+ declare class PluginManager {
173
+ plugins: KubbPlugin[];
174
+ readonly fileManager: FileManager;
175
+ private readonly onExecute?;
176
+ readonly core: KubbPlugin<CorePluginOptions>;
177
+ queue: Queue;
178
+ executer: Executer | undefined;
179
+ executed: Executer[];
180
+ constructor(config: KubbConfig, options: Options);
181
+ getExecuter(): Executer | undefined;
182
+ resolvePath: (params: ResolvePathParams) => OptionalPath;
183
+ resolveName: (params: ResolveNameParams) => string | null;
184
+ load: (id: string) => Promise<TransformResult>;
185
+ /**
186
+ *
187
+ * Run only hook for a specific plugin name
188
+ */
189
+ hookForPlugin<H extends PluginLifecycleHooks>({ pluginName, hookName, parameters, }: {
190
+ pluginName: string;
191
+ hookName: H;
192
+ parameters: Parameters<PluginLifecycle[H]>;
193
+ }): Promise<ReturnType<PluginLifecycle[H]> | null> | null;
194
+ hookForPluginSync<H extends PluginLifecycleHooks>({ pluginName, hookName, parameters, }: {
195
+ pluginName: string;
196
+ hookName: H;
197
+ parameters: Parameters<PluginLifecycle[H]>;
198
+ }): ReturnType<PluginLifecycle[H]> | null;
199
+ /**
200
+ *
201
+ * Chains, first non-null result stops and returns
202
+ */
203
+ hookFirst<H extends PluginLifecycleHooks>({ hookName, parameters, skipped, }: {
204
+ hookName: H;
205
+ parameters: Parameters<PluginLifecycle[H]>;
206
+ skipped?: ReadonlySet<KubbPlugin> | null;
207
+ }): Promise<ReturnType<PluginLifecycle[H]>>;
208
+ /**
209
+ *
210
+ * Chains, first non-null result stops and returns
211
+ */
212
+ hookFirstSync<H extends PluginLifecycleHooks>({ hookName, parameters, skipped, }: {
213
+ hookName: H;
214
+ parameters: Parameters<PluginLifecycle[H]>;
215
+ skipped?: ReadonlySet<KubbPlugin> | null;
216
+ }): ReturnType<PluginLifecycle[H]>;
217
+ hookParallel<H extends PluginLifecycleHooks, TOuput = void>({ hookName, parameters, }: {
218
+ hookName: H;
219
+ parameters?: Parameters<PluginLifecycle[H]> | undefined;
220
+ }): Promise<Awaited<TOuput>[]>;
221
+ hookReduceArg0<H extends PluginLifecycleHooks>({ hookName, parameters, reduce, }: {
222
+ hookName: H;
223
+ parameters: Parameters<PluginLifecycle[H]>;
224
+ reduce: (reduction: Argument0<H>, result: ReturnType<PluginLifecycle[H]>, plugin: KubbPlugin) => MaybePromise<Argument0<H> | null>;
225
+ }): Promise<Argument0<H>>;
226
+ hookSeq<H extends PluginLifecycleHooks>({ hookName, parameters }: {
227
+ hookName: H;
228
+ parameters?: Parameters<PluginLifecycle[H]>;
229
+ }): Promise<void>;
230
+ private getSortedPlugins;
231
+ private getPlugin;
232
+ private addExecuter;
233
+ /**
234
+ * Run an async plugin hook and return the result.
235
+ * @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
236
+ * @param args Arguments passed to the plugin hook.
237
+ * @param plugin The actual pluginObject to run.
238
+ */
239
+ private execute;
240
+ /**
241
+ * Run a sync plugin hook and return the result.
242
+ * @param hookName Name of the plugin hook. Must be in `PluginHooks`.
243
+ * @param args Arguments passed to the plugin hook.
244
+ * @param plugin The acutal plugin
245
+ * @param replaceContext When passed, the plugin context can be overridden.
246
+ */
247
+ private executeSync;
248
+ private catcher;
249
+ }
250
+
251
+ declare class ValidationPluginError extends Error {
252
+ }
253
+ declare function validatePlugins(plugins: KubbPlugin[], dependedPluginNames: string | string[]): true;
254
+
255
+ declare class PluginError extends Error {
256
+ pluginManager: PluginManager;
257
+ constructor(message: string, options: {
258
+ cause?: Error;
259
+ pluginManager: PluginManager;
260
+ });
261
+ }
262
+
263
+ declare class ParallelPluginError extends Error {
264
+ errors: PluginError[];
265
+ pluginManager: PluginManager;
266
+ constructor(message: string, options: {
267
+ cause?: Error;
268
+ errors: PluginError[];
269
+ pluginManager: PluginManager;
270
+ });
271
+ }
272
+
11
273
  interface Register {
12
274
  }
13
275
  type MaybePromise<T> = Promise<T> | T;
276
+ /**
277
+ * Config used in `kubb.config.js`
278
+ *
279
+ * @example import { defineConfig } from '@kubb/core'
280
+ * export default defineConfig({
281
+ * ...
282
+ * })
283
+ */
14
284
  type KubbUserConfig = Omit<KubbConfig, 'root' | 'plugins'> & {
15
285
  /**
16
286
  * Project root directory. Can be an absolute path, or a path relative from
@@ -79,9 +349,26 @@ type KubbConfig = {
79
349
  logLevel?: LogLevel;
80
350
  };
81
351
  type CLIOptions = {
352
+ /**
353
+ * Path to `kubb.config.js`
354
+ */
82
355
  config?: string;
356
+ /**
357
+ * Enable debug mode
358
+ */
83
359
  debug?: boolean;
360
+ /**
361
+ * Watch changes on input
362
+ */
84
363
  watch?: string;
364
+ /**
365
+ * Override input defined in `kubb.config.js`
366
+ */
367
+ input?: string;
368
+ };
369
+ type BuildOutput = {
370
+ files: FileManager['files'];
371
+ pluginManager: PluginManager;
85
372
  };
86
373
  type KubbPluginKind = 'schema' | 'controller';
87
374
  type KubbJSONPlugin = [plugin: keyof Register | string, options: Register[keyof Register] | object];
@@ -106,7 +393,7 @@ type KubbPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
106
393
  */
107
394
  api?: TOptions['api'];
108
395
  /**
109
- * Options set for a specific plugin(see kubb.config.ts)
396
+ * Options set for a specific plugin(see kubb.config.js)
110
397
  */
111
398
  options?: TOptions['options'];
112
399
  } & Partial<PluginLifecycle<TOptions>>;
@@ -190,7 +477,7 @@ type PluginContext<TOptions = Record<string, any>> = {
190
477
  fileManager: FileManager;
191
478
  addFile: (...file: File[]) => Promise<File[]>;
192
479
  resolvePath: (params: ResolvePathParams<TOptions>) => OptionalPath;
193
- resolveName: (params: ResolveNameParams) => string;
480
+ resolveName: (params: ResolveNameParams) => string | null | undefined;
194
481
  load: (id: string) => MaybePromise<TransformResult | void>;
195
482
  };
196
483
  type TransformResult = string | null;
@@ -203,265 +490,23 @@ type FileName = string | null | undefined;
203
490
  type LogType = 'error' | 'warn' | 'info';
204
491
  type LogLevel = LogType | 'silent';
205
492
 
206
- declare function isPromise<T>(result: MaybePromise<T>): result is Promise<T>;
207
-
208
- declare function write(data: string, path: string): Promise<void>;
209
-
210
- declare function getRelativePath(rootDir?: string | null, filePath?: string | null): string;
211
- type PathMode = 'file' | 'directory';
212
- declare function getPathMode(path: string | undefined | null): PathMode;
213
- declare function read(path: string): Promise<string>;
214
-
215
- declare function isURL(data: string): boolean;
216
-
217
- type Data = string[][];
218
- type Options$1 = {
219
- typed?: boolean;
220
- };
221
- declare function objectToParameters(data: Data, options?: Options$1): string;
222
-
223
- declare function nameSorter<T extends {
224
- name: string;
225
- }>(a: T, b: T): 1 | -1 | 0;
226
-
227
- declare function createJSDocBlockText({ comments }: {
228
- comments: Array<string>;
229
- }): string;
230
-
231
- declare function getUniqueName(originalName: string, data: Record<string, number>): string;
232
-
233
- declare function timeout(ms: number): Promise<unknown>;
234
-
235
- type QueueTask<T = unknown> = {
236
- (...args: unknown[]): Promise<T>;
237
- };
238
- declare class Queue {
239
- private readonly queue;
240
- workerCount: number;
241
- private maxParallel;
242
- constructor(maxParallel: number);
243
- run<T>(task: QueueTask<T>): Promise<T>;
244
- private work;
245
- }
246
-
247
- declare function getEncodedText(text?: string): string;
248
-
249
- declare function renderTemplate<TData extends Record<string, string> = Record<string, string>>(template: string, data?: TData | undefined): string;
250
-
251
- declare function clean(path: string): Promise<unknown>;
252
-
253
- type TreeNodeOptions = DirectoryTreeOptions;
254
- declare class TreeNode<T = unknown> {
255
- data: T;
256
- parent?: TreeNode<T>;
257
- children: Array<TreeNode<T>>;
258
- constructor(data: T, parent?: TreeNode<T>);
259
- addChild(data: T): TreeNode<T>;
260
- find(data: T): {} | null;
261
- leaves(): TreeNode<T>[];
262
- root(): TreeNode<T>;
263
- forEach(callback: (treeNode: TreeNode<T>) => void): this;
264
- static build<T = unknown>(path: string, options?: TreeNodeOptions): TreeNode<T> | null;
265
- }
266
-
267
- declare function transformReservedWord(word: string): string;
268
-
269
- type Import = {
270
- name: string | string[];
271
- path: string;
272
- isTypeOnly?: boolean;
273
- };
274
- type Export = {
275
- name?: string | string[];
276
- path: string;
277
- isTypeOnly?: boolean;
278
- asAlias?: boolean;
279
- };
280
- type File = {
281
- /**
282
- * Name to be used to dynamicly create the fileName(based on input.path)
283
- */
284
- fileName: string;
285
- /**
286
- * Path will be full qualified path to a specified file
287
- */
288
- path: string;
289
- source: string;
290
- imports?: Import[];
291
- exports?: Export[];
292
- /**
293
- * This will call fileManager.add instead of fileManager.addOrAppend, adding the source when the files already exists
294
- * @default `false`
295
- */
296
- override?: boolean;
297
- };
298
- type UUID = string;
299
- type CacheStore = {
300
- id: UUID;
301
- file: File;
302
- status: Status;
303
- };
304
- type Status = 'new' | 'success' | 'removed';
305
-
306
- declare class FileManager {
307
- private cache;
308
- private task?;
309
- private queue?;
310
- constructor(options?: {
311
- queue: Queue;
312
- task: QueueTask<unknown>;
313
- });
314
- private getCache;
315
- getCacheByPath(path: string | undefined): CacheStore | undefined;
316
- get files(): File[];
317
- add(file: File): Promise<File>;
318
- addOrAppend(file: File): Promise<File>;
319
- setStatus(id: UUID, status: Status): void;
320
- get(id: UUID): File | undefined;
321
- remove(id: UUID): void;
322
- write(...params: Parameters<typeof write>): Promise<void>;
323
- read(...params: Parameters<typeof read>): Promise<string>;
324
- }
325
-
326
- declare function writeIndexes(root: string, options: TreeNodeOptions): File[] | undefined;
327
- declare function combineFiles(files: Array<File | null>): File[];
328
- declare function getFileSource(file: File): string;
329
-
330
- type BuildOutput = {
331
- files: FileManager['files'];
332
- };
333
- type Spinner = {
334
- start: (text?: string) => Spinner;
335
- succeed: (text: string) => Spinner;
336
- fail: (text?: string) => Spinner;
337
- stopAndPersist: (options: {
338
- text: string;
339
- }) => Spinner;
340
- render: () => Spinner;
341
- text: string;
342
- info: (text: string) => Spinner;
343
- };
344
493
  type Logger = {
345
494
  log: (message: string, logLevel: LogLevel) => void;
346
- spinner?: Spinner;
495
+ spinner?: Ora;
347
496
  };
348
497
  type BuildOptions = {
349
498
  config: PluginContext['config'];
350
499
  logger?: Logger;
351
500
  };
352
- type KubbBuild = (options: BuildOptions) => Promise<BuildOutput>;
353
501
  declare function build(options: BuildOptions): Promise<BuildOutput>;
354
502
 
355
503
  /**
356
- * Type helper to make it easier to use kubb.config.ts
504
+ * Type helper to make it easier to use kubb.config.js
357
505
  * accepts a direct {@link KubbConfig} object, or a function that returns it.
358
506
  * The function receives a {@link ConfigEnv} object that exposes two properties:
359
507
  */
360
508
  declare const defineConfig: (options: MaybePromise<KubbUserConfig> | ((cliOptions: CLIOptions) => MaybePromise<KubbUserConfig>)) => MaybePromise<KubbUserConfig> | ((cliOptions: CLIOptions) => MaybePromise<KubbUserConfig>);
361
509
 
362
- type KubbPluginFactory<T extends PluginFactoryOptions = PluginFactoryOptions> = (options: T['options']) => T['nested'] extends true ? Array<KubbPlugin<T>> : KubbPlugin<T>;
363
- declare function createPlugin<T extends PluginFactoryOptions = PluginFactoryOptions>(factory: KubbPluginFactory<T>): (options: T['options']) => T["nested"] extends true ? KubbPlugin<T>[] : KubbPlugin<T>;
364
- type Options = {
365
- config: PluginContext['config'];
366
- fileManager: FileManager;
367
- resolvePath: PluginContext['resolvePath'];
368
- resolveName: PluginContext['resolveName'];
369
- load: PluginContext['load'];
370
- };
371
- type CorePluginOptions = PluginFactoryOptions<Options, false, PluginContext>;
372
- declare const name: "core";
373
-
374
- /**
375
- * Get the type of the first argument in a function.
376
- * @example Arg0<(a: string, b: number) => void> -> string
377
- */
378
- type Argument0<H extends keyof PluginLifecycle> = Parameters<PluginLifecycle[H]>[0];
379
- type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookReduceArg0' | 'hookSeq';
380
-
381
- declare const hooks: [keyof PluginLifecycle<PluginFactoryOptions<unknown, false, any, Record<string, any>>>];
382
- declare class PluginManager {
383
- plugins: KubbPlugin[];
384
- readonly fileManager: FileManager;
385
- private readonly logger?;
386
- private readonly config;
387
- readonly core: KubbPlugin<CorePluginOptions>;
388
- queue: Queue;
389
- constructor(config: KubbConfig, options: {
390
- logger?: Logger;
391
- task: QueueTask;
392
- });
393
- resolvePath: (params: ResolvePathParams) => OptionalPath;
394
- resolveName: (params: ResolveNameParams) => string;
395
- load: (id: string) => Promise<TransformResult>;
396
- /**
397
- *
398
- * Run only hook for a specific plugin name
399
- */
400
- hookForPlugin<H extends PluginLifecycleHooks>({ pluginName, hookName, parameters, }: {
401
- pluginName: string;
402
- hookName: H;
403
- parameters: Parameters<PluginLifecycle[H]>;
404
- }): Promise<ReturnType<PluginLifecycle[H]> | null>;
405
- hookForPluginSync<H extends PluginLifecycleHooks>({ pluginName, hookName, parameters, }: {
406
- pluginName: string;
407
- hookName: H;
408
- parameters: Parameters<PluginLifecycle[H]>;
409
- }): ReturnType<PluginLifecycle[H]>;
410
- /**
411
- *
412
- * Chains, first non-null result stops and returns
413
- */
414
- hookFirst<H extends PluginLifecycleHooks>({ hookName, parameters, skipped, }: {
415
- hookName: H;
416
- parameters: Parameters<PluginLifecycle[H]>;
417
- skipped?: ReadonlySet<KubbPlugin> | null;
418
- }): Promise<ReturnType<PluginLifecycle[H]>>;
419
- /**
420
- *
421
- * Chains, first non-null result stops and returns
422
- */
423
- hookFirstSync<H extends PluginLifecycleHooks>({ hookName, parameters, skipped, }: {
424
- hookName: H;
425
- parameters: Parameters<PluginLifecycle[H]>;
426
- skipped?: ReadonlySet<KubbPlugin> | null;
427
- }): ReturnType<PluginLifecycle[H]>;
428
- hookParallel<H extends PluginLifecycleHooks, TOuput = void>({ hookName, parameters, }: {
429
- hookName: H;
430
- parameters?: Parameters<PluginLifecycle[H]> | undefined;
431
- }): Promise<Awaited<TOuput>[]>;
432
- hookReduceArg0<H extends PluginLifecycleHooks>({ hookName, parameters, reduce, }: {
433
- hookName: H;
434
- parameters: Parameters<PluginLifecycle[H]>;
435
- reduce: (reduction: Argument0<H>, result: ReturnType<PluginLifecycle[H]>, plugin: KubbPlugin) => MaybePromise<Argument0<H> | null>;
436
- }): Promise<Argument0<H>>;
437
- hookSeq<H extends PluginLifecycleHooks>({ hookName, parameters }: {
438
- hookName: H;
439
- parameters?: Parameters<PluginLifecycle[H]>;
440
- }): Promise<void>;
441
- private getSortedPlugins;
442
- private getPlugin;
443
- /**
444
- * Run an async plugin hook and return the result.
445
- * @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
446
- * @param args Arguments passed to the plugin hook.
447
- * @param plugin The actual pluginObject to run.
448
- */
449
- private run;
450
- /**
451
- * Run a sync plugin hook and return the result.
452
- * @param hookName Name of the plugin hook. Must be in `PluginHooks`.
453
- * @param args Arguments passed to the plugin hook.
454
- * @param plugin The acutal plugin
455
- * @param replaceContext When passed, the plugin context can be overridden.
456
- */
457
- private runSync;
458
- private catcher;
459
- }
460
-
461
- declare class ValidationPluginError extends Error {
462
- }
463
- declare function validatePlugins(plugins: KubbPlugin[], dependedPluginNames: string | string[]): true;
464
-
465
510
  /**
466
511
  * Abstract class that contains the building blocks for plugins to create their own Generator
467
512
  * @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
@@ -480,4 +525,4 @@ declare abstract class SchemaGenerator<TOptions extends object, TInput, TOutput>
480
525
  abstract build(schema: TInput, name: string, description?: string): TOutput;
481
526
  }
482
527
 
483
- export { Argument0, CLIOptions, Cache, CacheStore, CorePluginOptions, File, FileManager, FileName, Generator, KubbBuild, KubbConfig, KubbJSONPlugin, KubbObjectPlugin, KubbPlugin, KubbPluginKind, KubbUserConfig, LogLevel, LogType, Logger, MaybePromise, OptionalPath, Path, PathMode, PluginContext, PluginFactoryOptions, PluginLifecycle, PluginLifecycleHooks, PluginManager, Queue, QueueTask, Register, ResolveNameParams, ResolvePathParams, SchemaGenerator, Status, Strategy, TransformResult, TreeNode, TreeNodeOptions, UUID, ValidationPluginError, build, clean, combineFiles, createJSDocBlockText, createPlugin, createPluginCache, build as default, defineConfig, getEncodedText, getFileSource, getPathMode, getRelativePath, getUniqueName, hooks, isPromise, isURL, name, nameSorter, objectToParameters, read, renderTemplate, timeout, transformReservedWord, validatePlugins, write, writeIndexes };
528
+ export { Argument0, BuildOutput, CLIOptions, Cache, CacheStore, CorePluginOptions, Executer, File, FileManager, FileName, Generator, KubbConfig, KubbJSONPlugin, KubbObjectPlugin, KubbPlugin, KubbPluginKind, KubbUserConfig, LogLevel, LogType, Logger, MaybePromise, OnExecute, OptionalPath, ParallelPluginError, Path, PathMode, PluginContext, PluginError, PluginFactoryOptions, PluginLifecycle, PluginLifecycleHooks, PluginManager, Queue, QueueTask, Register, ResolveNameParams, ResolvePathParams, SchemaGenerator, Status, Strategy, TransformResult, TreeNode, TreeNodeOptions, UUID, ValidationPluginError, build, clean, combineFiles, createJSDocBlockText, createPlugin, createPluginCache, build as default, defineConfig, getEncodedText, getFileSource, getPathMode, getRelativePath, getStackTrace, getUniqueName, hooks, isPromise, isURL, name, nameSorter, objectToParameters, read, renderTemplate, timeout, transformReservedWord, validatePlugins, write, writeIndexes };