UNPKG

@starrah/mongo-ts-struct

Version:

Mongoose wrapper for Typescript supports

11 lines (10 loc) 535 B
export declare type SubType<Base, Condition> = Pick<Base, { [Key in keyof Base]: Base[Key] extends Condition ? Key : never; }[keyof Base]>; declare type ExcludeSubType<Base, NegateCondition> = Pick<Base, { [Key in keyof Base]: Base[Key] extends NegateCondition ? never : Key; }[keyof Base]>; export declare type ExtractFunction<T> = SubType<T, ((_: any) => any)>; export declare type ExtractProperty<T> = ExcludeSubType<T, ((_: any) => any)>; export declare type Ctor<T = any> = new (...args: any[]) => T; export {};