INNER CODE UNIT · TypeScript
simpleType
dotnet-websharper/core · src/compiler/WebSharper.TypeScriptParser/app.ts:188
function simpleType(x: string): TSSimpleType {
return {
Kind: 'simple',
Type: x
}
}
function unhandled(x: ts.Node, ctx: string) {
throw Error(`Unhandled SyntaxKind for ${ctx}: ${x.kind} '${x.getText()}' in ${x.getSourceFile().fileName}`);
}
function transformType(x: ts.TypeNode): TSType {
if (!x) return simpleType('any');
if (ts.isParenthesizedTypeNode(x))
return transformType(x.type)
if (ts.isArrayTypeNode(x))
return {
Kind: 'array',