Update app and tooling
This commit is contained in:
parent
3046531bdd
commit
e620ec7349
4950 changed files with 2975120 additions and 10 deletions
8
node_modules/json-schema-to-ts/lib/utils/and.d.ts
generated
vendored
Normal file
8
node_modules/json-schema-to-ts/lib/utils/and.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* Return `true` if `A` and `B` extend `true`, `false` otherwise
|
||||
*
|
||||
* @param A Type
|
||||
* @param B Type
|
||||
* @return Boolean
|
||||
*/
|
||||
export declare type And<A, B> = A extends true ? B extends true ? true : false : false;
|
||||
23
node_modules/json-schema-to-ts/lib/utils/concat.d.ts
generated
vendored
Normal file
23
node_modules/json-schema-to-ts/lib/utils/concat.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { Head } from "./head";
|
||||
import { Tail } from "./tail";
|
||||
import { Prepend } from "./prepend";
|
||||
import { Reverse } from "./reverse";
|
||||
/**
|
||||
* Concatenate the reverse of tuple `A` to tuple `B`
|
||||
*
|
||||
* @param A Tuple
|
||||
* @param B Tuple
|
||||
* @return Tuple
|
||||
*/
|
||||
export declare type ConcatReversed<A, B extends any[]> = {
|
||||
stop: B;
|
||||
continue: ConcatReversed<Tail<A>, Prepend<Head<A>, B>>;
|
||||
}[A extends [any, ...any[]] ? "continue" : "stop"];
|
||||
/**
|
||||
* Concatenate tuple `A` to tuple `B`
|
||||
*
|
||||
* @param A Tuple
|
||||
* @param B Tuple
|
||||
* @return Tuple
|
||||
*/
|
||||
export declare type Concat<A, B extends any[]> = A extends any[] ? ConcatReversed<Reverse<A>, B> : never;
|
||||
24
node_modules/json-schema-to-ts/lib/utils/extends.d.ts
generated
vendored
Normal file
24
node_modules/json-schema-to-ts/lib/utils/extends.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* Returns `true` if type `A` extends type `B`, `false` if not
|
||||
*
|
||||
* @param A Type
|
||||
* @param B Type
|
||||
* @return Boolean
|
||||
*/
|
||||
export declare type DoesExtend<A, B> = A extends B ? true : false;
|
||||
declare type ArrayKeys = keyof [];
|
||||
/**
|
||||
* Returns `true` if type is object, `false` if not (excludes arrays)
|
||||
*
|
||||
* @param T Type
|
||||
* @return Boolean
|
||||
*/
|
||||
export declare type IsObject<T> = T extends object ? ArrayKeys extends Extract<keyof T, ArrayKeys> ? false : true : false;
|
||||
/**
|
||||
* Returns `true` if type is array, `false` if not (excludes objects)
|
||||
*
|
||||
* @param T Type
|
||||
* @return Boolean
|
||||
*/
|
||||
export declare type IsArray<T> = T extends object ? ArrayKeys extends Extract<keyof T, ArrayKeys> ? true : false : false;
|
||||
export {};
|
||||
17
node_modules/json-schema-to-ts/lib/utils/filter.d.ts
generated
vendored
Normal file
17
node_modules/json-schema-to-ts/lib/utils/filter.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { Head } from "./head";
|
||||
import { Tail } from "./tail";
|
||||
import { Prepend } from "./prepend";
|
||||
import { Reverse } from "./reverse";
|
||||
/**
|
||||
* Filters out the values of a tuple `T` that don't extend type `F`
|
||||
*
|
||||
* Preserves the tuple original order
|
||||
*
|
||||
* @param T Tuple
|
||||
* @param F Type
|
||||
* @return Tuple
|
||||
*/
|
||||
export declare type FilterExtending<T, F, R extends any[] = []> = {
|
||||
continue: FilterExtending<Tail<T>, F, Head<T> extends F ? Prepend<Head<T>, R> : R>;
|
||||
stop: Reverse<R>;
|
||||
}[T extends [any, ...any[]] ? "continue" : "stop"];
|
||||
23
node_modules/json-schema-to-ts/lib/utils/get.d.ts
generated
vendored
Normal file
23
node_modules/json-schema-to-ts/lib/utils/get.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { Head } from "./head";
|
||||
import { Tail } from "./tail";
|
||||
/**
|
||||
* Returns the value at key `K` in object `O`, `F` if `K` misses from object
|
||||
*
|
||||
* @param O Object
|
||||
* @param K Property key
|
||||
* @param F _(optional:_ `never` _)_ Fallback type
|
||||
* @return Type
|
||||
*/
|
||||
export declare type Get<O, K, F = never> = K extends keyof O ? O[K] : F;
|
||||
/**
|
||||
* Returns the value at path `P` in object `O`, `F` if `P` misses from object
|
||||
*
|
||||
* @param O Object
|
||||
* @param P Path
|
||||
* @param F _(optional:_ `never` _)_ Fallback type
|
||||
* @return Type
|
||||
*/
|
||||
export declare type DeepGet<O, P, F = never> = {
|
||||
continue: Head<P> extends keyof O ? DeepGet<O[Head<P>], Tail<P>, F> : F;
|
||||
stop: O;
|
||||
}[P extends [any, ...any[]] ? "continue" : "stop"];
|
||||
8
node_modules/json-schema-to-ts/lib/utils/hasKeyIn.d.ts
generated
vendored
Normal file
8
node_modules/json-schema-to-ts/lib/utils/hasKeyIn.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* Returns `true` if object `O` has a property key in `K` (union), `false` if not
|
||||
*
|
||||
* @param O Object
|
||||
* @param K Union of property keys
|
||||
* @return Type
|
||||
*/
|
||||
export declare type HasKeyIn<O, K> = Extract<keyof O, K> extends never ? false : true;
|
||||
7
node_modules/json-schema-to-ts/lib/utils/head.d.ts
generated
vendored
Normal file
7
node_modules/json-schema-to-ts/lib/utils/head.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* Returns the first element of a tuple `T`
|
||||
*
|
||||
* @param T Tuple
|
||||
* @return Type
|
||||
*/
|
||||
export declare type Head<T> = T extends any[] ? T[0] : never;
|
||||
19
node_modules/json-schema-to-ts/lib/utils/index.d.ts
generated
vendored
Normal file
19
node_modules/json-schema-to-ts/lib/utils/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
export { And } from "./and";
|
||||
export { ConcatReversed, Concat } from "./concat";
|
||||
export { DoesExtend, IsObject, IsArray } from "./extends";
|
||||
export { FilterExtending } from "./filter";
|
||||
export { Get, DeepGet } from "./get";
|
||||
export { HasKeyIn } from "./hasKeyIn";
|
||||
export { Head } from "./head";
|
||||
export { DeepMergeSafe, DeepMergeUnsafe, Merge } from "./merge";
|
||||
export { Not } from "./not";
|
||||
export { OptionalProps } from "./optionalProps";
|
||||
export { Or } from "./or";
|
||||
export { Prepend } from "./prepend";
|
||||
export { Prettify } from "./prettify";
|
||||
export { DeepReadonly } from "./readonly";
|
||||
export { Replace } from "./replace";
|
||||
export { RequiredProps } from "./requiredProps";
|
||||
export { Reverse } from "./reverse";
|
||||
export { Tail } from "./tail";
|
||||
export { DeepWriteable } from "./writeable";
|
||||
45
node_modules/json-schema-to-ts/lib/utils/merge.d.ts
generated
vendored
Normal file
45
node_modules/json-schema-to-ts/lib/utils/merge.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import { Concat } from "./concat";
|
||||
import { IsObject, IsArray } from "./extends";
|
||||
/**
|
||||
* Recursively merge two types `A` and `B`:
|
||||
* - Returns `B` if `A` and `B` are not both objects or arrays
|
||||
* - Recursively merge `A` and `B` properties if both are objects
|
||||
* - Concat `A` and `B` if both are arrays
|
||||
*
|
||||
* `DeepMergeUnsafe` preserves non-required properties, but can return `never` if TS infers that `A & B = never` (which can happen if some properties are incompatible)
|
||||
*
|
||||
* @param A Type
|
||||
* @param B Type
|
||||
* @return Type
|
||||
*/
|
||||
export declare type DeepMergeUnsafe<A, B> = IsObject<A> extends true ? IsObject<B> extends true ? {
|
||||
[K in keyof (A & B)]: K extends keyof B ? K extends keyof A ? DeepMergeUnsafe<A[K], B[K]> : B[K] : K extends keyof A ? A[K] : never;
|
||||
} : B : IsArray<A> extends true ? IsArray<B> extends true ? B extends any[] ? Concat<A, B> : never : B : B;
|
||||
/**
|
||||
* Recursively merge two types `A` and `B`:
|
||||
* - Returns `B` if `A` and `B` are not both objects or arrays
|
||||
* - Recursively merge `A` and `B` properties if both are objects
|
||||
* - Concat `A` and `B` if both are arrays
|
||||
*
|
||||
* Contrary to `DeepMergeUnsafe`, `DeepMergeSafe` never returns `never`, but doesn't preserve non-required properties
|
||||
*
|
||||
* @param A Type
|
||||
* @param B Type
|
||||
* @return Type
|
||||
*/
|
||||
export declare type DeepMergeSafe<A, B> = IsObject<A> extends true ? IsObject<B> extends true ? {
|
||||
[K in keyof A | keyof B]: K extends keyof B ? K extends keyof A ? DeepMergeSafe<A[K], B[K]> : B[K] : K extends keyof A ? A[K] : never;
|
||||
} : B : IsArray<A> extends true ? IsArray<B> extends true ? B extends any[] ? Concat<A, B> : never : B : B;
|
||||
/**
|
||||
* Merge two types `A` and `B`:
|
||||
* - Returns `B` if `A` and `B` are not both objects
|
||||
* - Merge `A` and `B` properties if both are objects
|
||||
* - Merging is not recursive: Properties of `B` erase properties of `A`
|
||||
*
|
||||
* @param A Type
|
||||
* @param B Type
|
||||
* @return Type
|
||||
*/
|
||||
export declare type Merge<A, B> = IsObject<A> extends true ? IsObject<B> extends true ? {
|
||||
[K in keyof A | keyof B]: K extends keyof B ? B[K] : K extends keyof A ? A[K] : never;
|
||||
} : B : B;
|
||||
7
node_modules/json-schema-to-ts/lib/utils/not.d.ts
generated
vendored
Normal file
7
node_modules/json-schema-to-ts/lib/utils/not.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* Return `true` if `A` extends `false`, `false` if `A` extends `true`, `never` otherwise
|
||||
*
|
||||
* @param A Type
|
||||
* @return Boolean
|
||||
*/
|
||||
export declare type Not<A> = A extends false ? true : A extends true ? false : never;
|
||||
9
node_modules/json-schema-to-ts/lib/utils/optionalProps.d.ts
generated
vendored
Normal file
9
node_modules/json-schema-to-ts/lib/utils/optionalProps.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* Extract the names of an object's optional properties
|
||||
*
|
||||
* @param O Object
|
||||
* @return Property names
|
||||
*/
|
||||
export declare type OptionalProps<O extends Record<string | number | symbol, unknown>> = Exclude<{
|
||||
[K in keyof O]: undefined extends O[K] ? K : never;
|
||||
}[keyof O], undefined>;
|
||||
8
node_modules/json-schema-to-ts/lib/utils/or.d.ts
generated
vendored
Normal file
8
node_modules/json-schema-to-ts/lib/utils/or.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* Return `true` if `A` or `B` extend `true`, `false` otherwise
|
||||
*
|
||||
* @param A Type
|
||||
* @param B Type
|
||||
* @return Boolean
|
||||
*/
|
||||
export declare type Or<A, B> = A extends true ? true : B extends true ? true : false;
|
||||
8
node_modules/json-schema-to-ts/lib/utils/prepend.d.ts
generated
vendored
Normal file
8
node_modules/json-schema-to-ts/lib/utils/prepend.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* Inserts an element at the start of a tuple
|
||||
*
|
||||
* @param E Element (type)
|
||||
* @param T Tuple
|
||||
* @return Tuple
|
||||
*/
|
||||
export declare type Prepend<E, T extends any[]> = ((element: E, ...tail: T) => void) extends (...tuple: infer R) => void ? R : never;
|
||||
10
node_modules/json-schema-to-ts/lib/utils/prettify.d.ts
generated
vendored
Normal file
10
node_modules/json-schema-to-ts/lib/utils/prettify.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { IsObject } from "./extends";
|
||||
/**
|
||||
* Resolves generic definitions in hover windows to human-friendly results
|
||||
*
|
||||
* @param T Type
|
||||
* @return Type
|
||||
*/
|
||||
export declare type Prettify<T> = IsObject<T> extends true ? {
|
||||
[K in keyof T]: K extends keyof T ? T[K] : never;
|
||||
} : T;
|
||||
9
node_modules/json-schema-to-ts/lib/utils/readonly.d.ts
generated
vendored
Normal file
9
node_modules/json-schema-to-ts/lib/utils/readonly.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* Recursively add the `readonly` directive from an object properties or tuple items
|
||||
*
|
||||
* @param O Object / Tuple
|
||||
* @return Object / Tuple
|
||||
*/
|
||||
export declare type DeepReadonly<O> = O extends object ? {
|
||||
readonly [K in keyof O]: DeepReadonly<O[K]>;
|
||||
} : O;
|
||||
16
node_modules/json-schema-to-ts/lib/utils/replace.d.ts
generated
vendored
Normal file
16
node_modules/json-schema-to-ts/lib/utils/replace.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { DeepMergeUnsafe } from "./merge";
|
||||
import { OptionalProps } from "./optionalProps";
|
||||
import { RequiredProps } from "./requiredProps";
|
||||
/**
|
||||
* Set a specified value to an object property or properties
|
||||
*
|
||||
* @param O Object
|
||||
* @param P Properties
|
||||
* @param V Value (type)
|
||||
* @return Object
|
||||
*/
|
||||
export declare type Replace<O extends Record<string | number | symbol, any>, P extends keyof O, V, Req extends keyof O = RequiredProps<O>, Opt extends keyof O = OptionalProps<O>> = DeepMergeUnsafe<DeepMergeUnsafe<Omit<O, P>, {
|
||||
[key in P & Req]: V;
|
||||
}>, {
|
||||
[key in P & Opt]?: V;
|
||||
}>;
|
||||
9
node_modules/json-schema-to-ts/lib/utils/requiredProps.d.ts
generated
vendored
Normal file
9
node_modules/json-schema-to-ts/lib/utils/requiredProps.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* Extract the names of an object's required properties
|
||||
*
|
||||
* @param O Object
|
||||
* @return Property names
|
||||
*/
|
||||
export declare type RequiredProps<O extends Record<string | number | symbol, unknown>> = Exclude<{
|
||||
[K in keyof O]: undefined extends O[K] ? never : K;
|
||||
}[keyof O], undefined>;
|
||||
13
node_modules/json-schema-to-ts/lib/utils/reverse.d.ts
generated
vendored
Normal file
13
node_modules/json-schema-to-ts/lib/utils/reverse.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { Head } from "./head";
|
||||
import { Tail } from "./tail";
|
||||
import { Prepend } from "./prepend";
|
||||
/**
|
||||
* Reverses a tuple `T`
|
||||
*
|
||||
* @param T Tuple
|
||||
* @return Tuple
|
||||
*/
|
||||
export declare type Reverse<T, R extends any[] = []> = {
|
||||
stop: R;
|
||||
continue: T extends any[] ? Reverse<Tail<T>, Prepend<Head<T>, R>> : never;
|
||||
}[T extends [any, ...any[]] ? "continue" : "stop"];
|
||||
7
node_modules/json-schema-to-ts/lib/utils/tail.d.ts
generated
vendored
Normal file
7
node_modules/json-schema-to-ts/lib/utils/tail.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* Remove the first element of a tuple
|
||||
*
|
||||
* @param T Tuple
|
||||
* @return Tuple
|
||||
*/
|
||||
export declare type Tail<T> = T extends any[] ? ((...args: T) => void) extends (head: any, ...tail: infer R) => void ? R : T : never;
|
||||
9
node_modules/json-schema-to-ts/lib/utils/writeable.d.ts
generated
vendored
Normal file
9
node_modules/json-schema-to-ts/lib/utils/writeable.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* Recursively remove the `readonly` directive from an object properties or tuple items
|
||||
*
|
||||
* @param O Object / Tuple
|
||||
* @return Object / Tuple
|
||||
*/
|
||||
export declare type DeepWriteable<O> = O extends object ? {
|
||||
-readonly [K in keyof O]: DeepWriteable<O[K]>;
|
||||
} : O;
|
||||
Loading…
Add table
Add a link
Reference in a new issue