-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionOut of ScopeThis idea sits outside of the TypeScript language design constraintsThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
I know this is a stretch, but what if you could set a flag to transpile TS code into code that would be readable by babel-plugin-tcomb
, which came out recently? This would enable runtime type checking, which I previously brought up in #1573, but it would require interfaces be transpiled into structs:
interface Point {
x: number;
y: number;
}
function foo(point: Point) {
return point.x * point.y;
}
becomes...
import t from 'tcomb';
const Point = t.struct({
x: t.Number,
y: t.Number
});
function foo(point: Point) {
return point.x * point.y;
}
If not provided directly by the compiler, the same could be achieved by a 3rd party module, if only a concrete syntax tree #625 were provided.
Related issues:
tkrotoff, aegyed91, justgook and sunny-g
Metadata
Metadata
Assignees
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionOut of ScopeThis idea sits outside of the TypeScript language design constraintsThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScriptAn idea for TypeScript