1 |
|
2 | import * as fs from 'fs';
|
3 | import { sync as mkdirp } from 'mkdirp';
|
4 | import * as prettier from 'prettier';
|
5 | import { MarkOptional } from 'ts-essentials';
|
6 | export interface Config {
|
7 | cwd: string;
|
8 | target: string;
|
9 | outDir?: string | undefined;
|
10 | prettier?: object | undefined;
|
11 | filesToProcess: string[];
|
12 | allFiles: string[];
|
13 | |
14 |
|
15 |
|
16 |
|
17 | inputDir: string;
|
18 | flags: CodegenConfig;
|
19 | }
|
20 | export interface CodegenConfig {
|
21 | alwaysGenerateOverloads: boolean;
|
22 | discriminateTypes: boolean;
|
23 | tsNocheck?: boolean;
|
24 | node16Modules?: boolean;
|
25 | environment: 'hardhat' | undefined;
|
26 | }
|
27 | export type PublicConfig = MarkOptional<Config, 'flags' | 'inputDir'>;
|
28 | export declare abstract class TypeChainTarget {
|
29 | readonly cfg: Config;
|
30 | abstract readonly name: string;
|
31 | constructor(cfg: Config);
|
32 | beforeRun(): Output | Promise<Output>;
|
33 | afterRun(): Output | Promise<Output>;
|
34 | abstract transformFile(file: FileDescription): Output | Promise<Output>;
|
35 | }
|
36 | export type Output = void | FileDescription | FileDescription[];
|
37 | export interface FileDescription {
|
38 | path: string;
|
39 | contents: string;
|
40 | }
|
41 | export interface Services {
|
42 | fs: typeof fs;
|
43 | prettier: typeof prettier;
|
44 | mkdirp: typeof mkdirp;
|
45 | }
|