feat(projects): 登录页面开始迁移

This commit is contained in:
Soybean
2022-01-04 19:09:00 +08:00
parent 035fa114c9
commit f5a36a05cb
30 changed files with 341 additions and 20 deletions

17
src/typings/common/util.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
declare namespace Util {
/** convert a union to an intersection: X | Y | Z ==> X & Y & Z */
type UnionToIntersection<T> = (T extends any ? (args: T) => any : never) extends (args: infer R) => any ? R : never;
/** returns true if the type is a union otherwise false */
type IsUnion<T> = [T] extends [UnionToIntersection<T>] ? false : true;
type LastInUnion<T> = UnionToIntersection<T extends any ? (arg: T) => any : never> extends (arg: infer R) => any
? R
: never;
type UnionToTuple<T, U = T> = [T] extends [never]
? []
: [LastInUnion<T>, ...UnionToTuple<Exclude<U, LastInUnion<T>>>];
type Inter = UnionToTuple<'1' | '2'>;
}