type FilterOptional = Pick ? K : never; }[keyof T],undefined> >; type FilterNotOptional = Pick ? never : K; }[keyof T],undefined> >; type PartialEither = { [P in Exclude, K>]-?: T[P] } & { [P in Exclude, K>]?: T[P] } & { [P in Extract]?: undefined }; type _Object = { [name: string]: any; }; declare namespace BSL { /** 运行时的环境变量 */ type Env = 'development' | 'production' | 'prerelease'; /** 状态类型 */ type RequestState = 'complete' | 'empty' | 'fail' | 'loading' | 'timeout' | 'undefined' | 'auth'; /** 响应码 */ type ResponseCode = ( /** 请求成功,对应complete状态 */ 200 | /** 未登录 */ 401 | /** 无权限 */ 403 | /** 数据为空,对应empty状态 */ 404 | /** 请求超时, 对应timeout状态 */ 408 | /** 请求失败,对应fail状态 */ 500 ); type ServerReponse = Omit, 'source'>; interface MutableRefObject { current: T | undefined; } /** 请求的响应结构 */ interface Response { data: T; code: ResponseCode; msg: string; /** 缓存数据的key */ cacheKey?: string; source: Source; } type Nullable = T | null | undefined; type PromiseReturnType any> = ReturnType extends Promise ? R : never; /** * 二选一 * a、b二选一,并且必须传递一个 type RequireOne = OneOfTwo< { a: number; b: string; }, 'a', 'b' >; a、b二选一,或者都不传 type RequireOneOrEmpty = OneOfTwo< { a?: number; b?: string; }, 'a', 'b' >; * */ export type OneOfTwo = ( PartialEither, L> | PartialEither, R> ) & Omit; } export default BSL;