tsickle

  • Version 0.46.3
  • Published
  • 688 kB
  • 1 dependency
  • MIT license

Install

npm i tsickle
yarn add tsickle
pnpm add tsickle

Overview

Transpile TypeScript code to JavaScript with Closure annotations.

Index

Functions

function emit

emit: (
program: ts.Program,
host: TsickleHost,
writeFile: ts.WriteFileCallback,
targetSourceFile?: ts.SourceFile,
cancellationToken?: ts.CancellationToken,
emitOnlyDtsFiles?: boolean,
customTransformers?: EmitTransformers
) => EmitResult;

    function emitWithTsickle

    emitWithTsickle: (
    program: ts.Program,
    host: TsickleHost,
    tsHost: ts.CompilerHost,
    tsOptions: ts.CompilerOptions,
    targetSourceFile?: ts.SourceFile,
    writeFile?: ts.WriteFileCallback,
    cancellationToken?: ts.CancellationToken,
    emitOnlyDtsFiles?: boolean,
    customTransformers?: EmitTransformers
    ) => EmitResult;
    • Deprecated

      Exposed for backward compat with Angular. Use emit() instead.

    function getGeneratedExterns

    getGeneratedExterns: (
    externs: { [fileName: string]: string },
    rootDir: string
    ) => string;
    • Concatenate all generated externs definitions together into a string, including a file comment header.

      Parameter rootDir

      Project root. Emitted comments will reference paths relative to this root.

    function mergeEmitResults

    mergeEmitResults: (emitResults: EmitResult[]) => EmitResult;

      function pathToModuleName

      pathToModuleName: (
      rootModulePath: string,
      context: string,
      fileName: string
      ) => string;
      • Takes a context (ts.SourceFile.fileName of the current file) and the import URL of an ES6 import and generates a googmodule module name for the imported module.

      Classes

      class ModulesManifest

      class ModulesManifest {}
      • A class that maintains the module dependency graph of output JS files.

      property fileNames

      readonly fileNames: string[];

        property modules

        readonly modules: string[];

          method addManifest

          addManifest: (other: ModulesManifest) => void;

            method addModule

            addModule: (fileName: string, module: string) => void;

              method addReferencedModule

              addReferencedModule: (fileName: string, resolvedModule: string) => void;

                method getFileNameFromModule

                getFileNameFromModule: (module: string) => string;

                  method getReferencedModules

                  getReferencedModules: (fileName: string) => string[];

                    Interfaces

                    interface EmitResult

                    interface EmitResult extends ts.EmitResult {}

                      property externs

                      externs: {
                      [moduleId: string]: string;
                      };
                      • externs.js files produced by tsickle, if any. module IDs are relative paths from fileNameToModuleId.

                      property modulesManifest

                      modulesManifest: ModulesManifest;

                        property tsMigrationExportsShimFiles

                        tsMigrationExportsShimFiles: tsmes.TsMigrationExportsShimFileMap;
                        • Content for the generated files, keyed by their intended filename. Filenames are google3 relative.

                        interface EmitTransformers

                        interface EmitTransformers {}

                          property afterDeclarations

                          afterDeclarations?: ts.CustomTransformers['afterDeclarations'];
                          • Custom transformers to evaluate after built-in .d.ts transformations.

                          property afterTs

                          afterTs?: ts.CustomTransformers['after'];
                          • Custom transformers to evaluate after built-in .js transformations.

                          property beforeTs

                          beforeTs?: ts.CustomTransformers['before'];
                          • Custom transformers to evaluate before built-in .js transformations.

                          interface FileMap

                          interface FileMap<T> {}
                          • Copyright Google Inc. All Rights Reserved.

                            Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at https://angular.io/license

                          index signature

                          [fileName: string]: T;

                            interface TsickleHost

                            interface TsickleHost
                            extends googmodule.GoogModuleProcessorHost,
                            tsmes.TsMigrationExportsShimProcessorHost,
                            AnnotatorHost {}

                              property addDtsClutzAliases

                              addDtsClutzAliases?: boolean;
                              • Whether to add aliases to the .d.ts files to add the exports to the ಠ_ಠ.clutz namespace.

                              property generateExtraSuppressions

                              generateExtraSuppressions: boolean;
                              • Whether to add suppressions by default.

                              property generateTsMigrationExportsShim

                              generateTsMigrationExportsShim?: boolean;
                              • Are tsMigrationExports calls allowed and should shim files be emitted?

                              property googmodule

                              googmodule: boolean;
                              • Whether to convert CommonJS require() imports to goog.module() and goog.require() calls.

                              property transformDecorators

                              transformDecorators?: boolean;
                              • Whether to downlevel decorators

                              property transformTypesToClosure

                              transformTypesToClosure?: boolean;
                              • Whether to convert types to closure

                              property useDeclarationMergingTransformation

                              useDeclarationMergingTransformation?: boolean;
                              • Whether to transform declaration merging namespaces.

                              method shouldIgnoreWarningsForPath

                              shouldIgnoreWarningsForPath: (filePath: string) => boolean;
                              • Tsickle treats warnings as errors, if true, ignore warnings. This might be useful for e.g. third party code.

                              method shouldSkipTsickleProcessing

                              shouldSkipTsickleProcessing: (fileName: string) => boolean;
                              • If true, tsickle and decorator downlevel processing will be skipped for that file.

                              Package Files (4)

                              Dependencies (1)

                              Dev Dependencies (15)

                              Peer Dependencies (1)

                              Badge

                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/tsickle.

                              • Markdown
                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/tsickle)
                              • HTML
                                <a href="https://www.jsdocs.io/package/tsickle"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>