pluggable-codegen 0.2.2 → 0.3.0

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.
@@ -1,39 +0,0 @@
1
- declare class File {
2
- #private;
3
- readonly fullPath: string;
4
- readonly localPath: string;
5
- constructor(path: string, rootDir: string);
6
- buffer(): Promise<Buffer>;
7
- text(encoding?: BufferEncoding): Promise<string>;
8
- json(): Promise<any>;
9
- }
10
-
11
- type MaybePromise<T> = Promise<T> | T;
12
- type CodegenOptions = {
13
- rootDir?: string;
14
- cacheFile?: string | false;
15
- prettier?: boolean;
16
- eslint?: boolean;
17
- };
18
- type NormalizedCodegenOptions = {
19
- rootDir: string;
20
- cacheFile?: string;
21
- prettier: boolean;
22
- eslint: boolean;
23
- };
24
- type CodegenJob = {
25
- input: string | string[];
26
- output: string;
27
- generate: (files: File[], signal: AbortSignal) => MaybePromise<Buffer | string | null>;
28
- cacheBy?: 'files' | 'contents';
29
- prettier?: boolean;
30
- eslint?: boolean;
31
- };
32
- type CodegenJobGenerator = (rootDir: string) => MaybePromise<CodegenJob[] | CodegenJob>;
33
- type CodegenInput = CodegenJobGenerator | CodegenJob;
34
- type CodegenPresetOptions = Omit<CodegenJob, 'input' | 'output' | 'generate'>;
35
- declare function defineCodegen(job: CodegenInput, ...jobs: CodegenInput[]): [CodegenInput, ...CodegenInput[]];
36
- declare function defineCodegen(options: CodegenOptions, ...jobs: CodegenInput[]): [CodegenOptions, ...CodegenInput[]];
37
- declare function defineCodegen(optionsOrJob: CodegenOptions | CodegenInput, ...jobs: CodegenInput[]): [CodegenOptions | CodegenInput, ...CodegenInput[]];
38
-
39
- export { type CodegenJob as C, File as F, type NormalizedCodegenOptions as N, type CodegenInput as a, type CodegenOptions as b, type CodegenJobGenerator as c, type CodegenPresetOptions as d, defineCodegen as e };