Commit 0966866f authored by nanahira's avatar nanahira

fix

parent 875e2517
Pipeline #14514 passed with stages
in 2 minutes and 10 seconds
......@@ -29,15 +29,12 @@ export class BlankReturnMessageDto implements BlankReturnMessage {
}
}
export type AnyClass = new (...args: any[]) => any;
export type ClassType<T> = new (...args: any[]) => T;
export type ClassOrArray = AnyClass | [AnyClass];
export type TypeFromClass<T extends AnyClass> = T extends new (
...args: any[]
) => infer U
? U
: never;
export type ParseType<T> = T extends [ClassType<infer U>] ? U : ClassType<T>;
type AnyClass = new (...args: any[]) => any;
type ClassOrArray = AnyClass | [AnyClass];
type TypeFromClass<T> = T extends new (...args: any[]) => infer U ? U : never;
export type ParseType<T extends ClassOrArray> = T extends [infer U]
? TypeFromClass<U>[]
: TypeFromClass<T>;
export function ReturnMessageDto<T extends ClassOrArray>(type: T) {
const cl = class SpecificReturnMessage extends BlankReturnMessageDto {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment