@Stability(value=Experimental) public static final class TypeScriptCompilerOptions.Builder extends Object implements software.amazon.jsii.Builder<TypeScriptCompilerOptions>
TypeScriptCompilerOptions| Constructor and Description |
|---|
Builder() |
@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder allowJs(Boolean allowJs)
TypeScriptCompilerOptions.getAllowJs()allowJs - Allow JavaScript files to be compiled.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder allowSyntheticDefaultImports(Boolean allowSyntheticDefaultImports)
TypeScriptCompilerOptions.getAllowSyntheticDefaultImports()allowSyntheticDefaultImports - Allow default imports from modules with no default export.
This does not affect code emit, just typechecking.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder alwaysStrict(Boolean alwaysStrict)
TypeScriptCompilerOptions.getAlwaysStrict()alwaysStrict - Ensures that your files are parsed in the ECMAScript strict mode, and emit “use strict” for each source file.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder baseUrl(String baseUrl)
TypeScriptCompilerOptions.getBaseUrl()baseUrl - Lets you set a base directory to resolve non-absolute module names.
You can define a root folder where you can do absolute file resolution.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder declaration(Boolean declaration)
TypeScriptCompilerOptions.getDeclaration()declaration - To be specified along with the above.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder declarationDir(String declarationDir)
TypeScriptCompilerOptions.getDeclarationDir()declarationDir - Offers a way to configure the root directory for where declaration files are emitted.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder emitDecoratorMetadata(Boolean emitDecoratorMetadata)
TypeScriptCompilerOptions.getEmitDecoratorMetadata()emitDecoratorMetadata - Enables experimental support for decorators, which is in stage 2 of the TC39 standardization process.
Decorators are a language feature which hasn’t yet been fully ratified into the JavaScript specification.
This means that the implementation version in TypeScript may differ from the implementation in JavaScript when it it decided by TC39.
You can find out more about decorator support in TypeScript in the handbook.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder esModuleInterop(Boolean esModuleInterop)
TypeScriptCompilerOptions.getEsModuleInterop()esModuleInterop - Emit __importStar and __importDefault helpers for runtime babel ecosystem compatibility and enable --allowSyntheticDefaultImports for typesystem compatibility.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder experimentalDecorators(Boolean experimentalDecorators)
TypeScriptCompilerOptions.getExperimentalDecorators()experimentalDecorators - Enables experimental support for decorators, which is in stage 2 of the TC39 standardization process.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder forceConsistentCasingInFileNames(Boolean forceConsistentCasingInFileNames)
TypeScriptCompilerOptions.getForceConsistentCasingInFileNames()forceConsistentCasingInFileNames - Disallow inconsistently-cased references to the same file.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder inlineSourceMap(Boolean inlineSourceMap)
TypeScriptCompilerOptions.getInlineSourceMap()inlineSourceMap - When set, instead of writing out a .js.map file to provide source maps, TypeScript will embed the source map content in the .js files.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder inlineSources(Boolean inlineSources)
TypeScriptCompilerOptions.getInlineSources()inlineSources - When set, TypeScript will include the original content of the .ts file as an embedded string in the source map. This is often useful in the same cases as inlineSourceMap.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder isolatedModules(Boolean isolatedModules)
TypeScriptCompilerOptions.getIsolatedModules()isolatedModules - Perform additional checks to ensure that separate compilation (such as with transpileModule or @babel/plugin-transform-typescript) would be safe.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder jsx(TypeScriptJsxMode jsx)
TypeScriptCompilerOptions.getJsx()jsx - Support JSX in .tsx files: "react", "preserve", "react-native" etc.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder lib(List<String> lib)
TypeScriptCompilerOptions.getLib()lib - Reference for type definitions / libraries to use (eg.
ES2016, ES5, ES2018).this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder module(String module)
TypeScriptCompilerOptions.getModule()module - Sets the module system for the program.
See https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder moduleResolution(TypeScriptModuleResolution moduleResolution)
TypeScriptCompilerOptions.getModuleResolution()moduleResolution - Determine how modules get resolved.
Either "Node" for Node.js/io.js style resolution, or "Classic".this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noEmit(Boolean noEmit)
TypeScriptCompilerOptions.getNoEmit()noEmit - Do not emit outputs.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noEmitOnError(Boolean noEmitOnError)
TypeScriptCompilerOptions.getNoEmitOnError()noEmitOnError - Do not emit compiler output files like JavaScript source code, source-maps or declarations if any errors were reported.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noFallthroughCasesInSwitch(Boolean noFallthroughCasesInSwitch)
TypeScriptCompilerOptions.getNoFallthroughCasesInSwitch()noFallthroughCasesInSwitch - Report errors for fallthrough cases in switch statements.
Ensures that any non-empty
case inside a switch statement includes either break or return. This means you won’t
accidentally ship a case fallthrough bug.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noImplicitAny(Boolean noImplicitAny)
TypeScriptCompilerOptions.getNoImplicitAny()noImplicitAny - In some cases where no type annotations are present, TypeScript will fall back to a type of any for a variable when it cannot infer the type.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noImplicitReturns(Boolean noImplicitReturns)
TypeScriptCompilerOptions.getNoImplicitReturns()noImplicitReturns - When enabled, TypeScript will check all code paths in a function to ensure they return a value.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noImplicitThis(Boolean noImplicitThis)
TypeScriptCompilerOptions.getNoImplicitThis()noImplicitThis - Raise error on ‘this’ expressions with an implied ‘any’ type.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noPropertyAccessFromIndexSignature(Boolean noPropertyAccessFromIndexSignature)
TypeScriptCompilerOptions.getNoPropertyAccessFromIndexSignature()noPropertyAccessFromIndexSignature - Raise error on use of the dot syntax to access fields which are not defined.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noUncheckedIndexedAccess(Boolean noUncheckedIndexedAccess)
TypeScriptCompilerOptions.getNoUncheckedIndexedAccess()noUncheckedIndexedAccess - Raise error when accessing indexes on objects with unknown keys defined in index signatures.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noUnusedLocals(Boolean noUnusedLocals)
TypeScriptCompilerOptions.getNoUnusedLocals()noUnusedLocals - Report errors on unused local variables.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder noUnusedParameters(Boolean noUnusedParameters)
TypeScriptCompilerOptions.getNoUnusedParameters()noUnusedParameters - Report errors on unused parameters in functions.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder outDir(String outDir)
TypeScriptCompilerOptions.getOutDir()outDir - Output directory for the compiled files.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder paths(Map<String,? extends List<String>> paths)
TypeScriptCompilerOptions.getPaths()paths - A series of entries which re-map imports to lookup locations relative to the baseUrl, there is a larger coverage of paths in the handbook.
paths lets you declare how TypeScript should resolve an import in your require/imports.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder resolveJsonModule(Boolean resolveJsonModule)
TypeScriptCompilerOptions.getResolveJsonModule()resolveJsonModule - Allows importing modules with a ‘.json’ extension, which is a common practice in node projects. This includes generating a type for the import based on the static JSON shape.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder rootDir(String rootDir)
TypeScriptCompilerOptions.getRootDir()rootDir - Specifies the root directory of input files.
Only use to control the output directory structure with outDir.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder skipLibCheck(Boolean skipLibCheck)
TypeScriptCompilerOptions.getSkipLibCheck()skipLibCheck - Skip type checking of all declaration files (*.d.ts).this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder strict(Boolean strict)
TypeScriptCompilerOptions.getStrict()strict - The strict flag enables a wide range of type checking behavior that results in stronger guarantees of program correctness.
Turning this on is equivalent to enabling all of the strict mode family
options, which are outlined below. You can then turn off individual strict mode family checks as
needed.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder strictNullChecks(Boolean strictNullChecks)
TypeScriptCompilerOptions.getStrictNullChecks()strictNullChecks - When strictNullChecks is false, null and undefined are effectively ignored by the language.
This can lead to unexpected errors at runtime.
When strictNullChecks is true, null and undefined have their own distinct types and you’ll
get a type error if you try to use them where a concrete value is expected.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder strictPropertyInitialization(Boolean strictPropertyInitialization)
TypeScriptCompilerOptions.getStrictPropertyInitialization()strictPropertyInitialization - When set to true, TypeScript will raise an error when a class property was declared but not set in the constructor.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder stripInternal(Boolean stripInternal)
TypeScriptCompilerOptions.getStripInternal()stripInternal - Do not emit declarations for code that has an @internal annotation in it’s JSDoc comment.this@Stability(value=Experimental) public TypeScriptCompilerOptions.Builder target(String target)
TypeScriptCompilerOptions.getTarget()target - Modern browsers support all ES6 features, so ES6 is a good choice.
You might choose to set
a lower target if your code is deployed to older environments, or a higher target if your
code is guaranteed to run in newer environments.this@Stability(value=Experimental) public TypeScriptCompilerOptions build()
build in interface software.amazon.jsii.Builder<TypeScriptCompilerOptions>TypeScriptCompilerOptionsNullPointerException - if any required attribute was not providedCopyright © 2021. All rights reserved.