From c0d20e00f5b522070ad5ecb39ce76b478cb67b47 Mon Sep 17 00:00:00 2001 From: Alex David Date: Mon, 13 Nov 2023 10:16:08 -0800 Subject: [PATCH] Experiment 2 --- ts/project.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ts/project.ts b/ts/project.ts index 5f985915..f9a025dc 100644 --- a/ts/project.ts +++ b/ts/project.ts @@ -22,8 +22,8 @@ export type ProjectData = { defaultExecutable?: Executable; }; -export type Plugin = ( - project: Project +export type Plugin = ( + project: Dependencies ) => Additions; type ProjectHelpers = { @@ -84,7 +84,7 @@ type ProjectHelpers = { */ add( this: T, - fn: Plugin, + fn: T extends infer Dependencies ? Plugin : never, ): Omit & Additions; /** @@ -221,7 +221,7 @@ const proxyEnvironmentHelpers = (): ProjectHelpers => ({ add( this: T, - fn: Plugin + fn: T extends infer Dependencies ? Plugin : never, ): Omit & Additions { return { ...this,