Skip to content

Commit 32e1449

Browse files
author
roman.vasilev
committed
docs: Updated README
1 parent 68044bb commit 32e1449

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
typescript-service
2-
===
1+
# typescript-service
32
Language 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

2523
Returns 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
3739
See [CHANGELOG.md](CHANGELOG.md)

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"clean": "rimraf dist",
2727
"commit": "git-cz"
2828
},
29-
"dependencies": {},
29+
"dependencies": {
30+
"tslib": "^1.9.3"
31+
},
3032
"devDependencies": {
3133
"@semantic-release/changelog": "^3.0.0",
3234
"@semantic-release/git": "^7.0.2",

tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
"target": "es5",
44
"module": "commonjs",
55
"moduleResolution": "node",
6+
"importHelpers": true,
67
"declaration": false,
78
"outDir": "dist",
89
"removeComments": false,
10+
"strict": true,
911
"sourceMap": true,
1012
"lib": [
1113
"esnext"

0 commit comments

Comments
 (0)