@enonic-types/lib-common 7.11.0-B3 → 7.11.0-B4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,20 +10,6 @@ npm i --save-dev @enonic-types/lib-common
|
|
|
10
10
|
|
|
11
11
|
## Use
|
|
12
12
|
|
|
13
|
-
Add the corresponding types to your `tsconfig.json` file that is used for application's server-side TypeScript code.
|
|
14
|
-
|
|
15
|
-
`tsconfig.json`
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"compilerOptions": {
|
|
20
|
-
"types": [
|
|
21
|
-
"@enonic-types/lib-common"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
13
|
### Require and custom imports
|
|
28
14
|
|
|
29
15
|
To make `require` work out of the box, you must install and add the `@enonic-types/global` types. Aside from providing definitions for XP
|
|
@@ -31,12 +17,11 @@ global objects, e.g. `log`, `app`, `__`, etc, requiring a library by the default
|
|
|
31
17
|
|
|
32
18
|
`tsconfig.json`
|
|
33
19
|
|
|
34
|
-
```
|
|
20
|
+
```json
|
|
35
21
|
{
|
|
36
22
|
"compilerOptions": {
|
|
37
23
|
"types": [
|
|
38
|
-
|
|
39
|
-
"@enonic-types/lib-common"
|
|
24
|
+
"@enonic-types/global"
|
|
40
25
|
]
|
|
41
26
|
}
|
|
42
27
|
}
|
|
@@ -58,16 +43,13 @@ types mapping to your configuration.
|
|
|
58
43
|
|
|
59
44
|
`tsconfig.json`
|
|
60
45
|
|
|
61
|
-
```
|
|
46
|
+
```json
|
|
62
47
|
{
|
|
63
48
|
"compilerOptions": {
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
+ "paths": {
|
|
69
|
-
+ "/lib/xp/common": ["node_modules/@enonic-types/lib-common"],
|
|
70
|
-
+ }
|
|
49
|
+
"baseUrl": "./",
|
|
50
|
+
"paths": {
|
|
51
|
+
"/lib/xp/common": ["node_modules/@enonic-types/lib-common"]
|
|
52
|
+
}
|
|
71
53
|
}
|
|
72
54
|
}
|
|
73
55
|
```
|