From 7fe4bc0ac127b50a8d3bcc5545bf9a8648017844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=89=A7=E6=AF=85?= Date: Thu, 13 Aug 2020 00:13:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E4=BD=8E=E4=BB=A3=E7=A0=81=E5=8D=8F=E8=AE=AE=E6=96=87=E6=A1=A3?= =?UTF-8?q?,=20=E5=AE=8C=E5=96=84UtilsMap=E7=9A=84=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/types/src/utils.ts | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/packages/types/src/utils.ts b/packages/types/src/utils.ts index f4a925f3b..26c2e6d45 100644 --- a/packages/types/src/utils.ts +++ b/packages/types/src/utils.ts @@ -1,13 +1,21 @@ import { NpmInfo } from './npm'; +import { JSExpression, JSFunction } from './value-type'; -export type UtilsMap = Array< -| { - name: string; - type: 'npm'; - content: NpmInfo; - } -| { - name: string; - type: ''; - } ->; +export type UtilItem = + | { + name: string; + type: 'npm'; + content: NpmInfo; + } + | { + name: string; + type: 'tnpm'; + content: NpmInfo; + } + | { + name: string; + type: 'function'; + content: JSFunction | JSExpression; + }; + +export type UtilsMap = UtilItem[];