From dc1d2b4cc430c2492ad939d599008b3b8bdd8f73 Mon Sep 17 00:00:00 2001 From: r17x Date: Sat, 12 Oct 2024 12:50:05 +0700 Subject: [PATCH] chore: update type definitions --- packages/unplugin-flag/src/core/index.ts | 2 +- packages/unplugin-flag/src/core/types.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/unplugin-flag/src/core/index.ts b/packages/unplugin-flag/src/core/index.ts index 418b10a..3d35926 100644 --- a/packages/unplugin-flag/src/core/index.ts +++ b/packages/unplugin-flag/src/core/index.ts @@ -20,7 +20,7 @@ const defaultFactory: CoreType.Data["factory"] = { // * dead-code elimination by value of record `options` // * handle function as value when return promise binary value // * handle function as value when return binary value -const createFactory = (_options: CoreType.PluginOption) => defaultFactory; +const createFactory: CoreType.CreateFactory = (_options) => defaultFactory; const getOptionsR = (opt: CoreType.PluginOption) => R.fromExecution(() => option.parse(opt)); diff --git a/packages/unplugin-flag/src/core/types.ts b/packages/unplugin-flag/src/core/types.ts index d7b2183..c66d147 100644 --- a/packages/unplugin-flag/src/core/types.ts +++ b/packages/unplugin-flag/src/core/types.ts @@ -24,6 +24,8 @@ export type PluginOption = Record; export type UnpluginEnvironmentFactory = UnpluginFactory; +export type CreateFactory = (options: PluginOption) => UnpluginOptions; + export type Data = { options: PluginOption; factory: UnpluginOptions;