|
1 | 1 | // faucet-pipeline-core types |
2 | 2 | export interface FaucetPlugin<T> { |
3 | | - (config: T[], assetManager: AssetManager, options: FaucetPluginOptions): FaucetPluginFunc |
| 3 | + (config: T[], assetManager: AssetManager, options: FaucetPluginOptions): FaucetPluginFunc |
4 | 4 | } |
5 | 5 |
|
6 | 6 | export interface FaucetPluginFunc { |
7 | | - (filepaths: string[]): Promise<unknown> |
| 7 | + (filepaths: string[]): Promise<unknown> |
8 | 8 | } |
9 | 9 |
|
10 | 10 | export interface FaucetPluginOptions { |
11 | | - browsers?: string[], |
12 | | - sourcemaps?: boolean, |
13 | | - compact?: boolean |
| 11 | + browsers?: string[], |
| 12 | + sourcemaps?: boolean, |
| 13 | + compact?: boolean |
14 | 14 | } |
15 | 15 |
|
16 | 16 | export interface AssetManager { |
17 | | - resolvePath: (path: string, opts?: ResolvePathOpts) => string |
| 17 | + resolvePath: (path: string, opts?: ResolvePathOpts) => string |
18 | 18 | writeFile: (targetPath: string, content: Buffer, options: WriteFileOpts) => Promise<unknown> |
19 | 19 | } |
20 | 20 |
|
21 | 21 | export interface ResolvePathOpts { |
22 | | - enforceRelative?: boolean |
| 22 | + enforceRelative?: boolean |
23 | 23 | } |
24 | 24 |
|
25 | 25 | export interface WriteFileOpts { |
26 | | - targetDir: string, |
27 | | - fingerprint?: boolean |
| 26 | + targetDir: string, |
| 27 | + fingerprint?: boolean |
28 | 28 | } |
29 | 29 |
|
30 | 30 | // faucet-pipeline-static types |
31 | 31 | export interface Config { |
32 | | - source: string, |
33 | | - target: string, |
34 | | - targetDir: string, |
35 | | - fingerprint?: boolean, |
36 | | - compact?: CompactorMap, |
37 | | - assetManager: AssetManager, |
38 | | - filter?: (fileName: string) => boolean |
| 32 | + source: string, |
| 33 | + target: string, |
| 34 | + targetDir: string, |
| 35 | + fingerprint?: boolean, |
| 36 | + compact?: CompactorMap, |
| 37 | + assetManager: AssetManager, |
| 38 | + filter?: (fileName: string) => boolean |
39 | 39 | } |
40 | 40 |
|
41 | 41 | export interface CompactorMap { |
42 | | - [fileExtension: string]: Compactor |
| 42 | + [fileExtension: string]: Compactor |
43 | 43 | } |
44 | 44 |
|
45 | 45 | export interface Compactor { |
46 | | - (contact: Buffer): Promise<Buffer> |
| 46 | + (contact: Buffer): Promise<Buffer> |
47 | 47 | } |
48 | 48 |
|
49 | 49 | export interface ProcessFile { |
50 | | - source: string, |
51 | | - target: string, |
52 | | - targetDir: string, |
53 | | - fingerprint?: boolean, |
54 | | - compactors: CompactorMap, |
55 | | - assetManager: AssetManager, |
| 50 | + (fileName: string, opts: ProcessFileOpts): Promise<unknown> |
| 51 | +} |
| 52 | + |
| 53 | +export interface ProcessFileOpts { |
| 54 | + source: string, |
| 55 | + target: string, |
| 56 | + writeFileOptions: WriteFileOpts, |
| 57 | + assetManager: AssetManager, |
56 | 58 | } |
57 | 59 |
|
58 | 60 | export interface FileFinderOptions { |
59 | | - skipDotfiles: boolean, |
60 | | - filter?: (filename: string) => boolean |
| 61 | + skipDotfiles: boolean, |
| 62 | + filter?: (filename: string) => boolean |
61 | 63 | } |
0 commit comments