Skip to content

Commit 7b247f7

Browse files
committed
added the types necessary to build a plugin
This does not run any TS on this project itself.
1 parent 2a19f94 commit 7b247f7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

lib/types.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export interface FaucetPlugin<T> {
2+
(config: T[], assetManager: AssetManager, options: FaucetPluginOptions): FaucetPluginFunc
3+
}
4+
5+
export interface FaucetPluginFunc {
6+
(filepaths: string[]): Promise<unknown>
7+
}
8+
9+
export interface FaucetPluginOptions {
10+
sourcemaps: boolean,
11+
compact: boolean
12+
}
13+
14+
export interface AssetManager {
15+
resolvePath: (path: string, opts?: ResolvePathOpts) => string
16+
writeFile: (targetPath: string, content: Buffer, options: WriteFileOpts) => Promise<unknown>
17+
}
18+
19+
export interface ResolvePathOpts {
20+
enforceRelative?: boolean
21+
}
22+
23+
export interface WriteFileOpts {
24+
targetDir: string,
25+
fingerprint?: boolean
26+
}

0 commit comments

Comments
 (0)