@file-services/typescript
TypeScript icon, indicating that this package has built-in type declarations

9.4.1 • Public • Published

@file-services/typescript

npm version package size

Helpers for creation of TypeScript hosts.

Installation

Install library in project:

npm i @file-services/typescript

API

/**
 * Create an IBaseHost, which is actually three interfaces combined:
 * - `ts.ParseConfigHost` - for parsing of `tsconfig.json` files
 * - `ts.FormatDiagnosticsHost` - for formatting of `ts.Diagnostic` instances
 * - `ts.ModuleResolutionHost` - for resolution of imports using TypeScript's built-in mechanism
 *
 * @param fs the file system to use as host backend
 */
export function createBaseHost(fs: IFileSystemSync): IBaseHost;

/**
 * Create a TypeScript `LanguageServiceHost` using provided file system.
 *
 * @param fs the file system used as host backend
 * @param baseHost created using `createBaseHost()`
 * @param fileNames list of absolute paths to `.ts/tsx` files included in this transpilation
 * @param compilerOptions compilerOptions to use when transpiling or type checking
 * @param defaultLibsDirectory absolute path to the directory that contains TypeScript's built-in `.d.ts` files
 *                             `path.dirname(ts.getDefaultLibFilePath({}))` in node,
 *                             or custom directory with `@file-services/memory`
 * @param customTransformers optional custom transformers to apply during transpilation
 */
export function createLanguageServiceHost(
  fs: IFileSystemSync,
  baseHost: IBaseHost,
  fileNames: string[],
  compilerOptions: ts.CompilerOptions,
  defaultLibsDirectory: string,
  customTransformers?: ts.CustomTransformers,
): ts.LanguageServiceHost;

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
9.4.1665latest

Version History

VersionDownloads (Last 7 Days)Published
9.4.1665
9.4.00
9.3.10
9.3.00
9.2.10
9.2.00
9.1.00
9.0.00
8.3.34
8.3.20
8.3.10
8.3.01
8.2.00
8.1.30
8.1.20
8.1.10
8.1.00
8.0.10
8.0.00
7.4.04
7.3.00
7.2.50
7.2.41
7.2.30
7.2.20
7.2.00
7.0.10
7.0.00
6.0.02
5.7.12
5.7.00
5.4.33
5.4.00
5.3.10
5.3.00
5.2.10
5.2.00
5.0.00
4.1.00
4.0.00
3.1.10
3.1.00
3.0.00
2.2.00
2.1.20
2.1.10
2.1.00
2.0.10
2.0.00
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00
0.5.00
0.4.100
0.4.90
0.4.80
0.4.70
0.4.60
0.4.40
0.4.20
0.4.10
0.4.00
0.3.00
0.2.40
0.2.30

Package Sidebar

Install

npm i @file-services/typescript

Weekly Downloads

682

Version

9.4.1

License

MIT

Unpacked Size

37.7 kB

Total Files

14

Last publish

Collaborators

  • avi.vahl
  • pistolpete_
  • tomermes
  • cijoe