@kubb/core 0.37.9 → 0.37.11

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,4 +1,4 @@
1
- import EventEmitter from 'events';
1
+ import EventEmitter from 'eventemitter3';
2
2
  import { DirectoryTreeOptions } from 'directory-tree';
3
3
 
4
4
  interface Cache<TCache = any> {
@@ -171,18 +171,13 @@ type LogLevel = LogType | 'silent';
171
171
 
172
172
  declare const isPromise: <T>(result: MaybePromise<T>) => result is Promise<T>;
173
173
 
174
- type WriteOptions = {
175
- format: boolean;
176
- };
177
- declare const write: (data: string, path: string, options?: WriteOptions) => Promise<void>;
178
- declare const clean: (path: string) => Promise<void>;
179
-
180
- declare const format: (text: string) => string;
174
+ declare const write: (data: string, path: string) => Promise<void>;
175
+ declare const clean: (path: string) => Promise<unknown>;
181
176
 
182
177
  declare const getRelativePath: (root?: string | null, file?: string | null) => string;
183
178
  type PathMode = 'file' | 'directory';
184
179
  declare const getPathMode: (path: string | undefined | null) => PathMode | undefined;
185
- declare const read: (path: string, encoding?: string) => Promise<string>;
180
+ declare const read: (path: string) => Promise<Buffer>;
186
181
 
187
182
  /**
188
183
  * @deprecated Use userFile instead
@@ -228,7 +223,7 @@ type Status = 'new' | 'success' | 'removed';
228
223
 
229
224
  declare class FileManager {
230
225
  private cache;
231
- emitter: EventEmitter;
226
+ emitter: EventEmitter<string | symbol, any>;
232
227
  events: {
233
228
  emitFile: (id: string, file: File) => void;
234
229
  emitStatusChange: (file: File) => void;
@@ -252,7 +247,7 @@ declare class FileManager {
252
247
  get(id: UUID): File | undefined;
253
248
  remove(id: UUID): void;
254
249
  write(...params: Parameters<typeof write>): Promise<void>;
255
- read(...params: Parameters<typeof read>): Promise<string>;
250
+ read(...params: Parameters<typeof read>): Promise<Buffer>;
256
251
  }
257
252
 
258
253
  declare class TreeNode<T = unknown> {
@@ -380,4 +375,4 @@ declare abstract class SchemaGenerator<TOptions extends object, TInput, TOutput>
380
375
  abstract build(schema: TInput, name: string, description?: string): TOutput;
381
376
  }
382
377
 
383
- export { Argument0, CLIOptions, Cache, CacheStore, CorePluginOptions, EmittedFile, File, FileManager, FileName, Generator, KubbBuild, KubbConfig, KubbJSONPlugin, KubbPlugin, KubbPluginKind, KubbUserConfig, LogLevel, LogType, Logger, MaybePromise, OptionalPath, Path, PathMode, PluginContext, PluginFactoryOptions, PluginLifecycle, PluginLifecycleHooks, PluginManager, ResolveIdParams, SchemaGenerator, Status, Strategy, TransformResult, TreeNode, UUID, ValidationPluginError, build, clean, createPlugin, createPluginCache, build as default, defineConfig, format, getPathMode, getRelativePath, hooks, isPromise, read, validatePlugins, write };
378
+ export { Argument0, CLIOptions, Cache, CacheStore, CorePluginOptions, EmittedFile, File, FileManager, FileName, Generator, KubbBuild, KubbConfig, KubbJSONPlugin, KubbPlugin, KubbPluginKind, KubbUserConfig, LogLevel, LogType, Logger, MaybePromise, OptionalPath, Path, PathMode, PluginContext, PluginFactoryOptions, PluginLifecycle, PluginLifecycleHooks, PluginManager, ResolveIdParams, SchemaGenerator, Status, Strategy, TransformResult, TreeNode, UUID, ValidationPluginError, build, clean, createPlugin, createPluginCache, build as default, defineConfig, getPathMode, getRelativePath, hooks, isPromise, read, validatePlugins, write };