fix lint
This commit is contained in:
parent
abbeb9a071
commit
02dbdc54c3
|
@ -50,7 +50,7 @@ export const refs = {
|
||||||
export interface Schema extends SimpleSchema {
|
export interface Schema extends SimpleSchema {
|
||||||
properties?: Obj;
|
properties?: Obj;
|
||||||
ref?: keyof typeof refs;
|
ref?: keyof typeof refs;
|
||||||
};
|
}
|
||||||
|
|
||||||
type NonUndefinedPropertyNames<T extends Obj> = {
|
type NonUndefinedPropertyNames<T extends Obj> = {
|
||||||
[K in keyof T]: T[K]['optional'] extends true ? never : K
|
[K in keyof T]: T[K]['optional'] extends true ? never : K
|
||||||
|
@ -63,7 +63,7 @@ type UndefinedPropertyNames<T extends Obj> = {
|
||||||
type OnlyRequired<T extends Obj> = Pick<T, NonUndefinedPropertyNames<T>>;
|
type OnlyRequired<T extends Obj> = Pick<T, NonUndefinedPropertyNames<T>>;
|
||||||
type OnlyOptional<T extends Obj> = Pick<T, UndefinedPropertyNames<T>>;
|
type OnlyOptional<T extends Obj> = Pick<T, UndefinedPropertyNames<T>>;
|
||||||
|
|
||||||
export interface Obj extends SimpleObj { [key: string]: Schema };
|
export interface Obj extends SimpleObj { [key: string]: Schema; }
|
||||||
|
|
||||||
export type ObjType<s extends Obj> =
|
export type ObjType<s extends Obj> =
|
||||||
{ [P in keyof OnlyOptional<s>]?: SchemaType<s[P]> } &
|
{ [P in keyof OnlyOptional<s>]?: SchemaType<s[P]> } &
|
||||||
|
|
|
@ -10,6 +10,6 @@ export interface SimpleSchema {
|
||||||
ref?: string;
|
ref?: string;
|
||||||
enum?: string[];
|
enum?: string[];
|
||||||
default?: boolean | null;
|
default?: boolean | null;
|
||||||
};
|
}
|
||||||
|
|
||||||
export type SimpleObj = { [key: string]: SimpleSchema };
|
export interface SimpleObj { [key: string]: SimpleSchema; }
|
||||||
|
|
Loading…
Reference in New Issue