From 7b247f7cd03fad4865b9b35d2a645063ab42e419 Mon Sep 17 00:00:00 2001 From: Lucas Dohmen Date: Mon, 19 May 2025 09:29:58 +0200 Subject: [PATCH] added the types necessary to build a plugin This does not run any TS on this project itself. --- lib/types.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/types.ts diff --git a/lib/types.ts b/lib/types.ts new file mode 100644 index 0000000..4a982ea --- /dev/null +++ b/lib/types.ts @@ -0,0 +1,26 @@ +export interface FaucetPlugin { + (config: T[], assetManager: AssetManager, options: FaucetPluginOptions): FaucetPluginFunc +} + +export interface FaucetPluginFunc { + (filepaths: string[]): Promise +} + +export interface FaucetPluginOptions { + sourcemaps: boolean, + compact: boolean +} + +export interface AssetManager { + resolvePath: (path: string, opts?: ResolvePathOpts) => string + writeFile: (targetPath: string, content: Buffer, options: WriteFileOpts) => Promise +} + +export interface ResolvePathOpts { + enforceRelative?: boolean +} + +export interface WriteFileOpts { + targetDir: string, + fingerprint?: boolean +}