UNPKG

cis-api-tool

Version:

根据 swagger/yapi/apifox 的接口定义生成 TypeScript/JavaScript 的接口类型及其请求函数代码。

26 lines (24 loc) 2.48 kB
import { AnyArray, AsyncOrSync, Buildable, DeepNonNullable as NonNullableDeep, DeepNullable as NullableDeep, DeepOmit as OmitDeep, DeepPartial as PartialDeep, DeepReadonly as ReadonlyDeep, DeepRequired as RequiredDeep, DeepWritable as WritableDeep, ElementOf, Head, MarkOptional as PartialBy, MarkRequired as RequiredBy, Merge, OmitProperties as OmitBy, OptionalKeys, PickProperties as PickBy, ReadonlyKeys, RequiredKeys, StrictOmit as OmitStrict, Tail, ValueOf, Writable, WritableKeys, XOR } from "ts-essentials"; import { AsyncReturnType, Asyncify, CamelCase, Class, DelimiterCase, Finite, FixedLengthArray, Integer, JsonArray, JsonObject, JsonValue, KebabCase, LiteralUnion, Negative, NegativeInfinity, NegativeInteger, NonNegative, NonNegativeInteger, PackageJson, PascalCase, PositiveInfinity, RequireAllOrNone, RequireAtLeastOne, RequireExactlyOne, ScreamingSnakeCase as ConstantCase, SetRequiredDeep as RequiredDeepBy, Simplify, SnakeCase, TsConfigJson, UnionToIntersection, UnionToTuple } from "type-fest"; //#region src/vutils/type.d.ts /** * @description 去除类型 T 中的 undefined。 * @public * @example * ```typescript * type X = string | undefined * type Y = Defined<X> // => string * ``` */ type Defined<T> = Exclude<T, undefined>; /** * @description 同 `T | T[]`。 * @public * @example * ```typescript * type X = OneOrMore<number> // => number | number[] * ``` */ type OneOrMore<T> = T | T[]; //#endregion export { type AnyArray, type AsyncOrSync, type AsyncReturnType, type Asyncify, type Buildable, type CamelCase, type Class, type ConstantCase, Defined, type DelimiterCase, type ElementOf, type Finite, type FixedLengthArray, type Head, type Integer, type JsonArray, type JsonObject, type JsonValue, type KebabCase, type LiteralUnion, type Merge, type Negative, type NegativeInfinity, type NegativeInteger, type NonNegative, type NonNegativeInteger, type NonNullableDeep, type NullableDeep, type OmitBy, type OmitDeep, type OmitStrict, OneOrMore, type OptionalKeys, type PackageJson, type PartialBy, type PartialDeep, type PascalCase, type PickBy, type PositiveInfinity, type ReadonlyDeep, type ReadonlyKeys, type RequireAllOrNone, type RequireAtLeastOne, type RequireExactlyOne, type RequiredBy, type RequiredDeep, type RequiredDeepBy, type RequiredKeys, type Simplify, type SnakeCase, type Tail, type TsConfigJson, type UnionToIntersection, type UnionToTuple, type ValueOf, type Writable, type WritableDeep, type WritableKeys, type XOR };