-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
Out 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 TypeScriptToo ComplexAn issue which adding support for may be too complex for the value it addsAn issue which adding support for may be too complex for the value it adds
Description
Interface is a useful tool in TypeScript, but sometimes we'll need to write two pieces of almost identical code for intellisense and functionality respectively.
Is it acceptable to add a simple statement for generating part of interface information (properties)?
E.g.
class SomeClass { }
interface ISubFace {
abc: string;
def: number;
}
interface IFace {
str: string;
num: number;
obj: SomeClass;
sub: ISubFace;
}
var faceInfo = reflect IFace;Would emit:
var SomeClass = (function () {
function SomeClass() {
}
return SomeClass;
})();
var _ISubFaceReflection = {
abc: 'string',
def: 'number'
};
var _IFaceReflection = {
str: 'string',
num: 'number',
obj: SomeClass,
sub: _ISubFaceReflection
};
var faceInfo = _IFaceReflection;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Out 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 TypeScriptToo ComplexAn issue which adding support for may be too complex for the value it addsAn issue which adding support for may be too complex for the value it adds