Skip to content

Instantly share code, notes, and snippets.

@leebyron
Created May 23, 2018 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leebyron/14bbb0cea0f21744c55883438163c8b7 to your computer and use it in GitHub Desktop.
Save leebyron/14bbb0cea0f21744c55883438163c8b7 to your computer and use it in GitHub Desktop.
declare function Record(): any
const RecordInstance = Record({
})
class _Foo extends RecordInstance {}
exports.Foo = _Foo
declare class Foo {
x: number;
y: number;
}
function Foo(values): Foo {
const val = new _Foo
val.x = values.x
val.y = values.y
return (val: any)
}
Foo.prototype = Object.create(_Foo)
const foo: Foo = MakeFoo({ x: 1, y: 2 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment