1
- typescript-service
2
- ===
1
+ # typescript-service
3
2
Language service which helps to get diagnostic messages from typescript source files.
4
3
5
4
## INSTALL
@@ -16,22 +15,25 @@ const diagnostics = service.getDiagnostics(fileName);
16
15
```
17
16
18
17
## API
19
- ```
20
- createService({ configFile, compilerOptions })
21
- ```
22
- ` configFile ` (required, string) Path to tsconfig.json file
23
- ` compilerOptions ` (optional, Object) Compiler options to overwrite defined in tsconfig.json
18
+
19
+ #### createService({ configFile: string, compilerOptions?: ts.CompilerOptions })
20
+ * ` configFile ` (required, string) Path to tsconfig.json file
21
+ * ` compilerOptions ` (optional, Object) Compiler options to overwrite defined in tsconfig.json
24
22
25
23
Returns object with properties which are functions:
26
24
27
- * ` update({ fileName: string, fileContent?: string }) ` Update (add) information about file in typescript service
28
- ` fileName ` (required, string) Path to typescript file
29
- ` fileContent (optional, string) ` File content of this file
25
+ ##### getSourceFile({ fileName: string, sourceText?: string })
26
+ Update (add) information about file in typescript service.
27
+ * ` fileName ` (required, string) Path to typescript file
28
+ * ` sourceText ` (optional, string) File content of this file
30
29
31
- * ` getDiagnostics(fileName: string): Array<ts.DiagnosticWithLocation> ` Get diagnostic messages for ` fileName `
32
- ` fileName ` (required, string) Path to typescript file
30
+ ##### getDiagnostics: (fileName: string, sourceText?: string): Array<ts.DiagnosticWithLocation>
31
+ Get diagnostic messages for ` fileName `
32
+ * ` fileName ` (required, string) Path to typescript file
33
+ * ` sourceText ` (optional, string) If path outside of scope defined in tsconfig you need provide ` sourceText `
33
34
34
- * ` getProgram(): ts.Program ` Get ` ts.Program `
35
+ ##### getProgram(): ts.Program
36
+ Get ` ts.Program `
35
37
36
38
## CHANGELOG
37
39
See [ CHANGELOG.md] ( CHANGELOG.md )
0 commit comments