Skip to content

Instantly share code, notes, and snippets.

@betawaffle betawaffle/globals.d.ts Secret
Last active Oct 21, 2019

What would you like to do?
declare global {
interface ObjectConstructor {
create<Proto extends object | null, Props extends PropertyDescriptorMap>(
proto: Proto,
props: Props,
): {
[K in keyof Proto | keyof Props]: K extends keyof Props
? Props[K] extends TypedPropertyDescriptor<infer T>
? T
: never
: K extends keyof Proto
? Proto[K]
: never
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.