export namespace SheetProxy { export enum Type { Insert = "insert", } export interface BaseData { api_key: string sheet_token: string range: string type: Type } export interface InsertData extends BaseData { type: Type.Insert values: string[][] } // 判断一个值是否是枚举中的值 export const isType = (value: any): value is Type => { return Object.values(Type).includes(value) } }