1- typescript-service
2- ===
1+ # typescript-service
32Language service which helps to get diagnostic messages from typescript source files.
43
54## INSTALL
@@ -16,22 +15,25 @@ const diagnostics = service.getDiagnostics(fileName);
1615```
1716
1817## 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
2422
2523Returns object with properties which are functions:
2624
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
3029
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 `
3334
34- * ` getProgram(): ts.Program ` Get ` ts.Program `
35+ ##### getProgram(): ts.Program
36+ Get ` ts.Program `
3537
3638## CHANGELOG
3739See [ CHANGELOG.md] ( CHANGELOG.md )
0 commit comments