Comparing version 0.37.1 to 0.38.0
{ | ||
"name": "tsickle", | ||
"version": "0.37.1", | ||
"version": "0.38.0", | ||
"description": "Transpile TypeScript code to JavaScript with Closure annotations.", | ||
@@ -14,3 +14,3 @@ "main": "src/tsickle.js", | ||
"peerDependencies": { | ||
"typescript": "~3.6.4" | ||
"typescript": "~3.7.2" | ||
}, | ||
@@ -34,3 +34,3 @@ "devDependencies": { | ||
"tslint": "5.11.0", | ||
"typescript": "3.6.4" | ||
"typescript": "3.7.2" | ||
}, | ||
@@ -37,0 +37,0 @@ "scripts": { |
@@ -21,2 +21,10 @@ /** | ||
/** @typedef {!IteratorIterable} */ | ||
var IterableIterator; | ||
/** @typedef {!IIterableResult} */ | ||
var IteratorYieldResult; | ||
/** @typedef {!IIterableResult} */ | ||
var IteratorReturnResult; | ||
/** @typedef {!HTMLCollection} */ | ||
@@ -96,4 +104,4 @@ var HTMLCollectionOf; | ||
* @interface | ||
* @extends{WorkerGlobalScope} | ||
* @extends{Window} | ||
* @extends {WorkerGlobalScope} | ||
* @extends {Window} | ||
*/ | ||
@@ -104,1 +112,6 @@ var WindowOrWorkerGlobalScope; | ||
function CanvasDrawImage() {} | ||
/** @constructor */ | ||
function CryptoKey() {}; | ||
/** @constructor */ | ||
function CryptoKeyPair() {}; |
@@ -19,1 +19,31 @@ /** | ||
export declare function hasExportingDecorator(node: ts.Node, typeChecker: ts.TypeChecker): boolean | undefined; | ||
/** | ||
* A transform pass that adds goog.reflect.objectProperty calls to the property | ||
* name string literals that are emitted as part of TypeScript's default | ||
* decorator output. | ||
* | ||
* goog.reflect.objectProperty is a special function that is recognized by | ||
* Closure Compiler. It is called like goog.reflect.objectProperty('prop', obj) | ||
* and it is compiled to a string literal that's the property named 'prop' on | ||
* the obj value. | ||
* | ||
* This way, runtime decorators can use the property names (e.g. to register | ||
* the property as a getter/setter pair) while still being compatible with | ||
* Closure Compiler's property renaming. | ||
* | ||
* Transforms: | ||
* | ||
* tslib_1.__decorate([ | ||
* decorator, | ||
* tslib_1.__metadata("design:type", Object) | ||
* ], Foo.prototype, "prop", void 0); | ||
* | ||
* Into: | ||
* | ||
* tslib_1.__decorate([ | ||
* decorator, | ||
* tslib_1.__metadata("design:type", Object) | ||
* ], Foo.prototype, | ||
* __googReflect.objectProperty("prop", Foo.prototype), void 0); | ||
*/ | ||
export declare function transformDecoratorsOutputForClosurePropertyRenaming(diagnostics: ts.Diagnostic[]): (context: ts.TransformationContext) => ts.Transformer<ts.SourceFile>; |
@@ -71,3 +71,121 @@ /** | ||
} | ||
/** | ||
* A transform pass that adds goog.reflect.objectProperty calls to the property | ||
* name string literals that are emitted as part of TypeScript's default | ||
* decorator output. | ||
* | ||
* goog.reflect.objectProperty is a special function that is recognized by | ||
* Closure Compiler. It is called like goog.reflect.objectProperty('prop', obj) | ||
* and it is compiled to a string literal that's the property named 'prop' on | ||
* the obj value. | ||
* | ||
* This way, runtime decorators can use the property names (e.g. to register | ||
* the property as a getter/setter pair) while still being compatible with | ||
* Closure Compiler's property renaming. | ||
* | ||
* Transforms: | ||
* | ||
* tslib_1.__decorate([ | ||
* decorator, | ||
* tslib_1.__metadata("design:type", Object) | ||
* ], Foo.prototype, "prop", void 0); | ||
* | ||
* Into: | ||
* | ||
* tslib_1.__decorate([ | ||
* decorator, | ||
* tslib_1.__metadata("design:type", Object) | ||
* ], Foo.prototype, | ||
* __googReflect.objectProperty("prop", Foo.prototype), void 0); | ||
*/ | ||
function transformDecoratorsOutputForClosurePropertyRenaming(diagnostics) { | ||
return (context) => { | ||
const result = (sourceFile) => { | ||
let nodeNeedingGoogReflect = undefined; | ||
const visitor = (node) => { | ||
const replacementNode = rewriteDecorator(node, context); | ||
if (replacementNode) { | ||
nodeNeedingGoogReflect = node; | ||
return replacementNode; | ||
} | ||
return ts.visitEachChild(node, visitor, context); | ||
}; | ||
const updatedSourceFile = ts.visitNode(sourceFile, visitor); | ||
if (nodeNeedingGoogReflect !== undefined) { | ||
const statements = [...updatedSourceFile.statements]; | ||
const googModuleIndex = statements.findIndex(isGoogModuleStatement); | ||
if (googModuleIndex === -1) { | ||
transformer_util_1.reportDiagnostic(diagnostics, nodeNeedingGoogReflect, 'Internal tsickle error: could not find goog.module statement to import __tsickle_googReflect for decorator compilation.'); | ||
return sourceFile; | ||
} | ||
const googRequireReflectObjectProperty = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration('__tsickle_googReflect', undefined, ts.createCall(ts.createPropertyAccess(ts.createIdentifier('goog'), 'require'), undefined, [ts.createStringLiteral('goog.reflect')]))], ts.NodeFlags.Const)); | ||
// The boilerplate we produce has a goog.module line, then two related | ||
// lines dealing with the `module` variable. Insert our goog.require | ||
// after that to avoid visually breaking up the module info, and to be | ||
// with the rest of the goog.require statements. | ||
statements.splice(googModuleIndex + 3, 0, googRequireReflectObjectProperty); | ||
updatedSourceFile.statements = | ||
ts.setTextRange(ts.createNodeArray(statements), updatedSourceFile.statements); | ||
} | ||
return updatedSourceFile; | ||
}; | ||
return result; | ||
}; | ||
} | ||
exports.transformDecoratorsOutputForClosurePropertyRenaming = transformDecoratorsOutputForClosurePropertyRenaming; | ||
/** | ||
* If `node` is a call to the tslib __decorate function, this returns a modified | ||
* call with the string argument replaced with | ||
* `__tsickle_googReflect.objectProperty('prop', TheClass.prototype)`. | ||
* | ||
* Returns undefined if no modification is necessary. | ||
*/ | ||
function rewriteDecorator(node, context) { | ||
if (!ts.isCallExpression(node)) { | ||
return; | ||
} | ||
const identifier = node.expression; | ||
if (!ts.isIdentifier(identifier) || identifier.text !== '__decorate') { | ||
return; | ||
} | ||
const args = [...node.arguments]; | ||
if (args.length !== 4) { | ||
// Some decorators, like class decorators, have fewer arguments, and don't | ||
// need help to be renaming-safe. | ||
return; | ||
} | ||
const untypedFieldNameLiteral = args[2]; | ||
if (!ts.isStringLiteral(untypedFieldNameLiteral)) { | ||
// This is allowed, for example: | ||
// | ||
// const prop = Symbol(); | ||
// class Foo { | ||
// @decorate [prop] = 'val'; | ||
// } | ||
// | ||
// Nothing for us to do in that case. | ||
return; | ||
} | ||
const fieldNameLiteral = untypedFieldNameLiteral; | ||
args[2] = ts.createCall(ts.createPropertyAccess(ts.createIdentifier('__tsickle_googReflect'), 'objectProperty'), undefined, [ts.createStringLiteral(fieldNameLiteral.text), ts.getMutableClone(args[1])]); | ||
return ts.updateCall(node, node.expression, node.typeArguments, args); | ||
} | ||
function isGoogModuleStatement(statement) { | ||
if (!ts.isExpressionStatement(statement)) { | ||
return false; | ||
} | ||
const expr = statement.expression; | ||
if (!ts.isCallExpression(expr)) { | ||
return false; | ||
} | ||
if (!ts.isPropertyAccessExpression(expr.expression)) { | ||
return false; | ||
} | ||
const goog = expr.expression.expression; | ||
if (!ts.isIdentifier(goog)) { | ||
return false; | ||
} | ||
return goog.text === 'goog' && expr.expression.name.text === 'module'; | ||
} | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9kZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7O0lBRUgsaUNBQWlDO0lBRWpDLG1FQUF5RDtJQUV6RDs7T0FFRztJQUNILFNBQWdCLHdCQUF3QixDQUNwQyxTQUF1QixFQUFFLFdBQTJCO1FBQ3RELDZFQUE2RTtRQUM3RSxJQUFJLElBQUksR0FBWSxTQUFTLENBQUM7UUFDOUIsT0FBTyxJQUFJLENBQUMsSUFBSSxLQUFLLEVBQUUsQ0FBQyxVQUFVLENBQUMsVUFBVSxFQUFFO1lBQzdDLElBQUksSUFBSSxDQUFDLElBQUksS0FBSyxFQUFFLENBQUMsVUFBVSxDQUFDLFNBQVMsSUFBSSxJQUFJLENBQUMsSUFBSSxLQUFLLEVBQUUsQ0FBQyxVQUFVLENBQUMsY0FB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y5Ob2RlKSB7XG4gIGlmICghdHMuaXNFeHByZXNzaW9uU3RhdGVtZW50KHN0YXRlbWVudCkpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbiAgY29uc3QgZXhwciA9IHN0YXRlbWVudC5leHByZXNzaW9uO1xuICBpZiAoIXRzLmlzQ2FsbEV4cHJlc3Npb24oZXhwcikpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbiAgaWYgKCF0cy5pc1Byb3BlcnR5QWNjZXNzRXhwcmVzc2lvbihleHByLmV4cHJlc3Npb24pKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG4gIGNvbnN0IGdvb2cgPSBleHByLmV4cHJlc3Npb24uZXhwcmVzc2lvbjtcbiAgaWYgKCF0cy5pc0lkZW50aWZpZXIoZ29vZykpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbiAgcmV0dXJuIGdvb2cudGV4dCA9PT0gJ2dvb2cnICYmIGV4cHIuZXhwcmVzc2lvbi5uYW1lLnRleHQgPT09ICdtb2R1bGUnO1xufVxuIl19 |
@@ -111,2 +111,8 @@ /** | ||
/** | ||
* resolveRestParameterType resolves the array member type for a rest parameter ("..."). | ||
* In TypeScript you write "...x: number[]", but in Closure you don't write the array: | ||
* `@param {...number} x`. The code below unwraps the Array<> wrapper. | ||
*/ | ||
private resolveRestParameterType; | ||
/** | ||
* Creates the jsdoc for methods, including overloads. | ||
@@ -113,0 +119,0 @@ * If overloaded, merges the signatures in the list of SignatureDeclarations into a single jsdoc. |
@@ -21,6 +21,6 @@ /** | ||
addReferencedModule(fileName: string, resolvedModule: string): void; | ||
readonly modules: string[]; | ||
get modules(): string[]; | ||
getFileNameFromModule(module: string): string; | ||
readonly fileNames: string[]; | ||
get fileNames(): string[]; | ||
getReferencedModules(fileName: string): string[]; | ||
} |
@@ -14,2 +14,3 @@ /** | ||
function convertToRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string; | ||
function resolvePath(path: string, ...paths: Array<string | undefined>): string; | ||
} | ||
@@ -16,0 +17,0 @@ export declare function isAbsolute(path: string): boolean; |
@@ -46,6 +46,6 @@ /** | ||
function normalize(path) { | ||
return ts.sys.resolvePath(path); | ||
return ts.resolvePath(path); | ||
} | ||
exports.normalize = normalize; | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0aC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9wYXRoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7O0lBRUg7Ozs7Ozs7O09BUUc7SUFFSCxpQ0FBaUM7SUFXakMsU0FBZ0IsVUFBVSxDQUFDLElBQVk7UUFDckMsT0FBTyxFQUFFLENBQUMsZ0JBQWdCLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDbkMsQ0FBQztJQUZELGdDQUVDO0lBRUQsU0FBZ0IsSUFBSSxDQUFDLEVBQVUsRUFBRSxFQUFVO1FBQ3pDLE9BQU8sRUFBRSxDQUFDLFlBQVksQ0FBQyxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUM7SUFDakMsQ0FBQztJQUZELG9CQUVDO0lBRUQsU0FBZ0IsT0FBTyxDQUFDLElBQVk7UUFDbEMsT0FBTyxFQUFFLENBQUMsZ0JBQWdCLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDbkMsQ0FBQztJQUZELDBCQUVDO0lBRUQsU0FBZ0IsUUFBUSxDQUFDLElBQVksRUFBRSxHQUFXO1FBQ2hELE9BQU8sRUFBRSxDQUFDLHFCQUFxQixDQUFDLEdBQUcsRUFBRSxJQUFJLEVBQUUsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUNyRCxDQUFDO0lBRkQsNEJBRUM7SUFFRCxTQUFnQixTQUFTLENBQU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gICAgYWJzb2x1dGVPclJlbGF0aXZlUGF0aDogc3RyaW5nLCBiYXNlUGF0aDogc3RyaW5nLFxuICAgICAgZ2V0Q2Fub25pY2FsRmlsZU5hbWU6IChwYXRoOiBzdHJpbmcpID0+IHN0cmluZyk6IHN0cmluZztcbiAgZnVuY3Rpb24gcmVzb2x2ZVBhdGgocGF0aDogc3RyaW5nLCAuLi5wYXRoczogQXJyYXk8c3RyaW5nfHVuZGVmaW5lZD4pOiBzdHJpbmc7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBpc0Fic29sdXRlKHBhdGg6IHN0cmluZyk6IGJvb2xlYW4ge1xuICByZXR1cm4gdHMuaXNSb290ZWREaXNrUGF0aChwYXRoKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGpvaW4ocDE6IHN0cmluZywgcDI6IHN0cmluZyk6IHN0cmluZyB7XG4gIHJldHVybiB0cy5jb21iaW5lUGF0aHMocDEsIHAyKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGRpcm5hbWUocGF0aDogc3RyaW5nKTogc3RyaW5nIHtcbiAgcmV0dXJuIHRzLmdldERpcmVjdG9yeVBhdGgocGF0aCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiByZWxhdGl2ZShiYXNlOiBzdHJpbmcsIHJlbDogc3RyaW5nKTogc3RyaW5nIHtcbiAgcmV0dXJuIHRzLmNvbnZlcnRUb1JlbGF0aXZlUGF0aChyZWwsIGJhc2UsIHAgPT4gcCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBub3JtYWxpemUocGF0aDogc3RyaW5nKTogc3RyaW5nIHtcbiAgcmV0dXJuIHRzLnJlc29sdmVQYXRoKHBhdGgpO1xufVxuIl19 |
@@ -14,3 +14,3 @@ /** | ||
else if (typeof define === "function" && define.amd) { | ||
define("tsickle/src/tsickle", ["require", "exports", "typescript", "tsickle/src/cli_support", "tsickle/src/decorator_downlevel_transformer", "tsickle/src/enum_transformer", "tsickle/src/externs", "tsickle/src/fileoverview_comment_transformer", "tsickle/src/googmodule", "tsickle/src/jsdoc_transformer", "tsickle/src/modules_manifest", "tsickle/src/transformer_util", "tsickle/src/cli_support", "tsickle/src/externs", "tsickle/src/modules_manifest"], factory); | ||
define("tsickle/src/tsickle", ["require", "exports", "typescript", "tsickle/src/cli_support", "tsickle/src/decorator_downlevel_transformer", "tsickle/src/decorators", "tsickle/src/enum_transformer", "tsickle/src/externs", "tsickle/src/fileoverview_comment_transformer", "tsickle/src/googmodule", "tsickle/src/jsdoc_transformer", "tsickle/src/modules_manifest", "tsickle/src/transformer_util", "tsickle/src/cli_support", "tsickle/src/externs", "tsickle/src/modules_manifest"], factory); | ||
} | ||
@@ -23,2 +23,3 @@ })(function (require, exports) { | ||
const decorator_downlevel_transformer_1 = require("tsickle/src/decorator_downlevel_transformer"); | ||
const decorators_1 = require("tsickle/src/decorators"); | ||
const enum_transformer_1 = require("tsickle/src/enum_transformer"); | ||
@@ -97,2 +98,3 @@ const externs_1 = require("tsickle/src/externs"); | ||
tsTransformers.after.push(googmodule.commonJsToGoogmoduleTransformer(host, modulesManifest, typeChecker, tsickleDiagnostics)); | ||
tsTransformers.after.push(decorators_1.transformDecoratorsOutputForClosurePropertyRenaming(tsickleDiagnostics)); | ||
} | ||
@@ -267,6 +269,10 @@ // Wrap the writeFile callback to hook writing of the dts file. | ||
} | ||
globalSymbols += | ||
`\t\texport {${localName} as module$contents$${clutzModuleName}_${symbol.name}}\n`; | ||
nestedSymbols += | ||
`\t\texport {module$contents$${clutzModuleName}_${symbol.name} as ${symbol.name}}\n`; | ||
const mangledName = `module$contents$${clutzModuleName}_${symbol.name}`; | ||
globalSymbols += `\t\texport {${localName} as ${mangledName}}\n`; | ||
// TODO(mprobst): Once tsickle is on TS3.7, the two lines below can be replaced with | ||
// "export {localName};". However in TS3.5, localName resolves within the module, so | ||
// exporting {localName} causes a circular definition error. The workaround is to import the | ||
// mangled name. | ||
nestedSymbols += `\t\timport ${localName}$clutz = ಠ_ಠ.clutz.${mangledName};\n`; | ||
nestedSymbols += `\t\texport {${localName}$clutz as ${symbol.name}};\n`; | ||
} | ||
@@ -278,2 +284,4 @@ dtsFileContent += 'declare global {\n'; | ||
dtsFileContent += `\tnamespace ಠ_ಠ.clutz.module$exports$${clutzModuleName} {\n`; | ||
// TODO(martinprobst): See https://github.com/Microsoft/TypeScript/issues/35385, remove once fixed | ||
dtsFileContent += `\t\tconst clutz$workaround$tissue$35385: number;\n`; | ||
dtsFileContent += nestedSymbols; | ||
@@ -296,2 +304,2 @@ dtsFileContent += `\t}\n`; | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHNpY2tsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy90c2lja2xlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7O0lBRUgsaUNBQWlDO0lBR2pDLHlEQUE2QztJQUM3QyxpR0FBZ0Y7SUFDaEYsbUVBQW1EO0lBQ25ELGlEQUEwQztJQUMxQyxtR0FBdUY7SUFDdkYscURBQTJDO0lBQzNDLHFFQUEyRTtJQUMzRSxtRUFBbUQ7SUFDbkQsbUVBQWlEO0lBRWpELDREQUE0RDtJQUM1RCx1REFBK0M7SUFBdkMseUNBQUEsZ0JBQWdCLENBQUE7SUFDeEIsdUNBQXVDO0lBQ3ZDLCtDQUE4QztJQUF0Qyx3Q0FBQSxtQkFBbUIsQ0FBQTtJQUMzQixpRUFBNEQ7SUFBM0MsNkNBQUEsZUFBZSxDQUFBO0lBbUNoQyxTQUFnQixnQkFBZ0IsQ0FBQyxXQUF5QjtRQUN4RCxNQUFNLFdBQVcsR0FBb0IsRUFBRSxDQUFDO1FBQ3hDLElBQUksV0FBVyxHQUFHLElBQUksQ0FBQztRQUN2QixNQUFNLFlBQVksR0FBYSxFQUFFLENBQUM7UUF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lcjtcXG5gO1xuICBkdHNGaWxlQ29udGVudCArPSBuZXN0ZWRTeW1ib2xzO1xuICBkdHNGaWxlQ29udGVudCArPSBgXFx0fVxcbmA7XG4gIGR0c0ZpbGVDb250ZW50ICs9ICd9XFxuJztcblxuICByZXR1cm4gZHRzRmlsZUNvbnRlbnQ7XG59XG5cbmZ1bmN0aW9uIHNraXBUcmFuc2Zvcm1Gb3JTb3VyY2VGaWxlSWZOZWVkZWQoXG4gICAgaG9zdDogVHNpY2tsZUhvc3QsXG4gICAgZGVsZWdhdGVGYWN0b3J5OiB0cy5UcmFuc2Zvcm1lckZhY3Rvcnk8dHMuU291cmNlRmlsZT4pOiB0cy5UcmFuc2Zvcm1lckZhY3Rvcnk8dHMuU291cmNlRmlsZT4ge1xuICByZXR1cm4gKGNvbnRleHQ6IHRzLlRyYW5zZm9ybWF0aW9uQ29udGV4dCkgPT4ge1xuICAgIGNvbnN0IGRlbGVnYXRlID0gZGVsZWdhdGVGYWN0b3J5KGNvbnRleHQpO1xuICAgIHJldHVybiAoc291cmNlRmlsZTogdHMuU291cmNlRmlsZSkgPT4ge1xuICAgICAgaWYgKGhvc3Quc2hvdWxkU2tpcFRzaWNrbGVQcm9jZXNzaW5nKHNvdXJjZUZpbGUuZmlsZU5hbWUpKSB7XG4gICAgICAgIHJldHVybiBzb3VyY2VGaWxlO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGRlbGVnYXRlKHNvdXJjZUZpbGUpO1xuICAgIH07XG4gIH07XG59XG4iXX0= |
@@ -31,5 +31,14 @@ /** | ||
/** | ||
* Returns true if the symbol is defined in a Clutz-generated d.ts file. | ||
* typeValueConflictHandled returns true for symbols whose type/value conflict is handled outside of | ||
* tsickle. | ||
* | ||
* This covers two cases: | ||
* | ||
* - symbols provided by Clutz. Given that Closure has a merged type/value namespace, apparent | ||
* type/value conflicts on the TypeScript level are actually fine. | ||
* - builtin lib*.d.ts symbols, such as "Array", which are considered Closure-compatible. Note that | ||
* we don't actually enforce that the types are actually compatible, but mostly just hope that | ||
* they are due to being derived from the same HTML specs. | ||
*/ | ||
export declare function isClutzType(symbol: ts.Symbol): boolean; | ||
export declare function typeValueConflictHandled(symbol: ts.Symbol): boolean; | ||
export declare function typeToDebugString(type: ts.Type): string; | ||
@@ -36,0 +45,0 @@ export declare function symbolToDebugString(sym: ts.Symbol): string; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
982380
7171
0