UNPKG

569 BTypeScriptView Raw
1import type { Intrinsics } from "../GetIntrinsic";
2
3// eslint-disable-next-line @typescript-eslint/ban-types
4type TypedProto<P> = { readonly prototype?: P | undefined } & Omit<Function, "prototype">;
5
6declare function GetPrototypeFromConstructor<P, K extends keyof Intrinsics>(
7 constructor: TypedProto<P>,
8 intrinsicDefaultProto: K,
9): P extends object ? P : Intrinsics[K];
10declare function GetPrototypeFromConstructor<P>(
11 constructor: TypedProto<P>,
12 intrinsicDefaultProto: string,
13): P extends object ? P : object;
14export = GetPrototypeFromConstructor;