From 442f7a99b158603d6d3478b68b035d2addea06cd Mon Sep 17 00:00:00 2001 From: lamprose <2316892579@qq.com> Date: Thu, 17 Oct 2024 13:20:21 +0800 Subject: [PATCH] refactor: custom plugin supports adding custom parameters in `options` --- src/core/types.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/types.ts b/src/core/types.ts index be4acf5..42c6de1 100644 --- a/src/core/types.ts +++ b/src/core/types.ts @@ -70,7 +70,8 @@ export type BaseOptions = { getCache?: (cacheKey: string) => CacheData; setCache?: (cacheKey: string, cacheData: CacheData) => void; }; - +// @ts-ignore @typescript-eslint/no-empty-interface +export declare interface PluginOptions {} export type Options = BaseOptions & { defaultParams?: P; ready?: Ref | (() => boolean); @@ -82,7 +83,7 @@ export type Options = BaseOptions & { onError?: (error: Error, params: P) => void; onBefore?: (params: P) => void; onAfter?: (params: P) => void; -}; +} & PluginOptions; export type PluginImplementType = { (queryInstance: Query, config: Options): Partial<