Created
May 23, 2018 00:07
-
-
Save leebyron/14bbb0cea0f21744c55883438163c8b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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