-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Libraries Support #134
Comments
TODO:
|
Is it from |
I think it should work with both. Right? |
I think so. I can add some |
|
All interfaces are from TypeScript types.ts |
class A {
private a: number
protected b: string
} |
Example: export namespace N1 {
interface IF {
foo()
}
class Base {
a: number = 10
}
export class MyClass extends Base implements IF {
foo() {}
}
} In this case, |
Also we can create an instance by calling the exported function, but we can't use export namespace N1 {
class Foo {
a: number = 10
}
export function get(): Foo {
return new Foo();
}
}
let x = N1.get()
console.log(x.a)
// error!
// let y = new N1.Foo() |
const none: Option<never> = { _tag: 'None' }
const some = <A>(a: A): Option<A> => ({ _tag: 'Some', value: a }) |
Interesting. What's the return type of |
The type I got is: symbol: <ref *1> SymbolObject {
flags: 32,
escapedName: 'Foo',
declarations: [Array],
exports: [Map],
members: [Map],
valueDeclaration: [NodeObject],
parent: undefined,
isReferenced: 788968,
id: 14
}, In the members, we can also get private/protected members. |
I also find something like this in https://github.com/gcanti/fp-ts/blob/master/src/Option.ts. export const URI = 'Option' I think we'd better convert all stuffs rather than merely functions or interfaces. |
Huh, well yeah of course we should convert these too... |
(Note that the URI machinery is for higher kinded types and is used in conditional types, which we don't yet support.) |
|
Are you planning to support mapped types, conditional types, etc.? |
@kevinbarabash Yes, the plan is to eventually support arbitrary computations in types (in a way that cleanly generalizes TypeScript's various ad-hoc type computation syntaxes). However, there is a long road before we get there, as for the moment we are busy working out the basic components of the language and type system. |
Implementing ts2mls to allow using TypeScript libraries in MLscript.
Candidate TypeScript Libraries:
The text was updated successfully, but these errors were encountered: