(compiler-options program)
Returns: CompilerOptions
**Returns:** `CompilerOptions`
(config-file-parsing-diagnostics program)
Returns: readonly Diagnostic[]
**Returns:** `readonly Diagnostic[]`
(current-directory program)
Returns: string
**Returns:** `string`
(declaration-diagnostics program)
(declaration-diagnostics program source-file)
(declaration-diagnostics program source-file cancellation-token)
Parameters:
source-file
: SourceFile | undefined
cancellation-token
: CancellationToken | undefined
Returns: readonly DiagnosticWithLocation[]
**Parameters:** - `source-file`: `SourceFile | undefined` - `cancellation-token`: `CancellationToken | undefined` **Returns:** `readonly DiagnosticWithLocation[]`
(emit program)
(emit program target-source-file)
(emit program target-source-file write-file)
(emit program target-source-file write-file cancellation-token)
(emit program
target-source-file
write-file
cancellation-token
emit-only-dts-files?)
(emit program
target-source-file
write-file
cancellation-token
emit-only-dts-files?
custom-transformers)
Emits the JavaScript and declaration files. If targetSourceFile is not specified, then the JavaScript and declaration files will be produced for all the files in this program. If targetSourceFile is specified, then only the JavaScript and declaration for that specific file will be generated.
If writeFile is not specified then the writeFile callback from the compiler host will be used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter will be invoked when writing the JavaScript and declaration files.
Parameters:
target-source-file
: SourceFile | undefined
write-file
: WriteFileCallback | undefined
cancellation-token
: CancellationToken | undefined
emit-only-dts-files?
: boolean | undefined
custom-transformers
: CustomTransformers | undefined
Returns: EmitResult
Emits the JavaScript and declaration files. If targetSourceFile is not specified, then the JavaScript and declaration files will be produced for all the files in this program. If targetSourceFile is specified, then only the JavaScript and declaration for that specific file will be generated. If writeFile is not specified then the writeFile callback from the compiler host will be used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter will be invoked when writing the JavaScript and declaration files. **Parameters:** - `target-source-file`: `SourceFile | undefined` - `write-file`: `WriteFileCallback | undefined` - `cancellation-token`: `CancellationToken | undefined` - `emit-only-dts-files?`: `boolean | undefined` - `custom-transformers`: `CustomTransformers | undefined` **Returns:** `EmitResult`
(global-diagnostics program)
(global-diagnostics program cancellation-token)
Parameters:
cancellation-token
: CancellationToken | undefined
Returns: readonly Diagnostic[]
**Parameters:** - `cancellation-token`: `CancellationToken | undefined` **Returns:** `readonly Diagnostic[]`
(identifier-count program)
Returns: number
**Returns:** `number`
(instantiation-count program)
Returns: number
**Returns:** `number`
(mode-for-resolution-at-index program file index)
Calculates the final resolution mode for an import at some index within a file's imports
list. This is the resolution mode
explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In
--module node16
or nodenext
, this may depend on the file's impliedNodeFormat
. In --module preserve
, it depends only on the
input syntax of the reference. In other module
modes, when overriding import attributes are not provided, this function returns
undefined
, as the result would have no impact on module resolution, emit, or type checking.
Parameters:
file
: SourceFile
index
: number
Returns: ResolutionMode
Calculates the final resolution mode for an import at some index within a file's `imports` list. This is the resolution mode explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no impact on module resolution, emit, or type checking. **Parameters:** - `file`: `SourceFile` - `index`: `number` **Returns:** `ResolutionMode`
(mode-for-usage-location program file usage)
Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
attributes, if present, or the syntax the usage would have if emitted to JavaScript. In --module node16
or nodenext
, this may
depend on the file's impliedNodeFormat
. In --module preserve
, it depends only on the input syntax of the reference. In other
module
modes, when overriding import attributes are not provided, this function returns undefined
, as the result would have no
impact on module resolution, emit, or type checking.
Parameters:
file
: SourceFile
usage
: StringLiteralLike
Returns: ResolutionMode
Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no impact on module resolution, emit, or type checking. **Parameters:** - `file`: `SourceFile` - `usage`: `StringLiteralLike` **Returns:** `ResolutionMode`
(options-diagnostics program)
(options-diagnostics program cancellation-token)
Parameters:
cancellation-token
: CancellationToken | undefined
Returns: readonly Diagnostic[]
**Parameters:** - `cancellation-token`: `CancellationToken | undefined` **Returns:** `readonly Diagnostic[]`
(project-references program)
Returns: readonly ProjectReference[] | undefined
**Returns:** `readonly ProjectReference[] | undefined`
(relation-cache-sizes program)
Returns: { assignable: number; identity: number; subtype: number; strictSubtype: number; }
**Returns:** `{ assignable: number; identity: number; subtype: number; strictSubtype: number; }`
(resolved-project-references program)
Returns: readonly (ResolvedProjectReference | undefined)[] | undefined
**Returns:** `readonly (ResolvedProjectReference | undefined)[] | undefined`
(root-file-names program)
Get a list of root file names that were passed to a 'createProgram'
Returns: readonly string[]
Get a list of root file names that were passed to a 'createProgram' **Returns:** `readonly string[]`
(semantic-diagnostics program)
(semantic-diagnostics program source-file)
(semantic-diagnostics program source-file cancellation-token)
The first time this is called, it will return global diagnostics (no location).
Parameters:
source-file
: SourceFile | undefined
cancellation-token
: CancellationToken | undefined
Returns: readonly Diagnostic[]
The first time this is called, it will return global diagnostics (no location). **Parameters:** - `source-file`: `SourceFile | undefined` - `cancellation-token`: `CancellationToken | undefined` **Returns:** `readonly Diagnostic[]`
(source-file program file-name)
Parameters:
file-name
: string
Returns: SourceFile | undefined
**Parameters:** - `file-name`: `string` **Returns:** `SourceFile | undefined`
(source-file-by-path program path)
Parameters:
path
: Path
Returns: SourceFile | undefined
**Parameters:** - `path`: `Path` **Returns:** `SourceFile | undefined`
(source-file-default-library? program file)
Parameters:
file
: SourceFile
Returns: boolean
**Parameters:** - `file`: `SourceFile` **Returns:** `boolean`
(source-file-from-external-library? program file)
Parameters:
file
: SourceFile
Returns: boolean
**Parameters:** - `file`: `SourceFile` **Returns:** `boolean`
(source-files program)
Get a list of files in the program
Returns: readonly SourceFile[]
Get a list of files in the program **Returns:** `readonly SourceFile[]`
(syntactic-diagnostics program)
(syntactic-diagnostics program source-file)
(syntactic-diagnostics program source-file cancellation-token)
Parameters:
source-file
: SourceFile | undefined
cancellation-token
: CancellationToken | undefined
Returns: readonly DiagnosticWithLocation[]
**Parameters:** - `source-file`: `SourceFile | undefined` - `cancellation-token`: `CancellationToken | undefined` **Returns:** `readonly DiagnosticWithLocation[]`
(type-checker program)
Gets a type checker that can be used to semantically analyze source files in the program.
Returns: TypeChecker
Gets a type checker that can be used to semantically analyze source files in the program. **Returns:** `TypeChecker`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close