-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
roman.vasilev
committed
Jul 1, 2018
1 parent
0c7e6aa
commit de14fc3
Showing
1 changed file
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,37 @@ | ||
typescript-service | ||
=== | ||
Language service which helps to get diagnostic messages from typescript source files. | ||
|
||
## INSTALL | ||
``` | ||
npm install --save-dev typescript-service | ||
``` | ||
|
||
CHANGELOG | ||
--- | ||
## USAGE | ||
```ts | ||
import { createService } from 'typescript-service'; | ||
|
||
const service = createService({ configFile, compilerOptions }); | ||
const diagnostics = service.getDiagnostics(fileName); | ||
``` | ||
|
||
## API | ||
``` | ||
createService({ configFile, compilerOptions }) | ||
``` | ||
`configFile` (required, string) Path to tsconfig.json file | ||
`compilerOptions` (optional, Object) Compiler options to overwrite defined in tsconfig.json | ||
|
||
Returns object with properties which are functions: | ||
|
||
* `update({ fileName: string, fileContent?: string })` Update (add) information about file in typescript service | ||
`fileName` (required, string) Path to typescript file | ||
`fileContent (optional, string)` File content of this file | ||
|
||
* `getDiagnostics(fileName: string): Array<ts.DiagnosticWithLocation>` Get diagnostic messages for `fileName` | ||
`fileName` (required, string) Path to typescript file | ||
|
||
* `getProgram(): ts.Program` Get `ts.Program` | ||
|
||
## CHANGELOG | ||
See [CHANGELOG.md](CHANGELOG.md) |