in lib/json/conversions.ts [115:149]
export function convertKeywordTypeNode(node: ts.KeywordTypeNode): KeywordType {
switch (node.kind) {
case ts.SyntaxKind.AnyKeyword:
return new KeywordType(node, 'any');
case ts.SyntaxKind.UnknownKeyword:
return new KeywordType(node, 'unknown');
case ts.SyntaxKind.NumberKeyword:
return new KeywordType(node, 'number');
case ts.SyntaxKind.BigIntKeyword:
return new KeywordType(node, 'bigint');
case ts.SyntaxKind.ObjectKeyword:
return new KeywordType(node, 'object');
case ts.SyntaxKind.BooleanKeyword:
return new KeywordType(node, 'boolean');
case ts.SyntaxKind.StringKeyword:
return new KeywordType(node, 'string');
case ts.SyntaxKind.SymbolKeyword:
return new KeywordType(node, 'symbol');
case ts.SyntaxKind.ThisKeyword:
return new KeywordType(node, 'this');
case ts.SyntaxKind.VoidKeyword:
return new KeywordType(node, 'void');
case ts.SyntaxKind.UndefinedKeyword:
return new KeywordType(node, 'undefined');
case ts.SyntaxKind.NullKeyword:
return new KeywordType(node, 'null');
case ts.SyntaxKind.NeverKeyword:
return new KeywordType(node, 'never');
default:
const error =
new Error(`Unexpected KeywordTypeNode kind: ${ts.SyntaxKind[(node as ts.Node).kind]}`);
error.name = 'DartFacadeError';
throw error;
}
}