From ca83e39b6f48f898189e44eb97daec04f7259f6b Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 13 Jul 2021 00:13:13 +0800 Subject: [PATCH] fix: update type --- src/types.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index aba7388a..0c1ce7a9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,8 +1,10 @@ import { Plugin as RollupPlugin } from 'rollup' +export type Thenable = T | Promise + export interface UnpluginHooks { transformInclude?: (id: string) => boolean; - transform?: (code: string, id: string) => string | { code: string; map: any; }; + transform?: (code: string, id: string) => Thenable; } export interface UnpluginOptions {