@enonic-types/global 7.11.0-B1 → 7.11.0-B3
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 +6 -5
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Add the corresponding types to your `tsconfig.json` file that is used for applic
|
|
|
17
17
|
"compilerOptions": {
|
|
18
18
|
"typeRoots": [
|
|
19
19
|
"node_modules/@types",
|
|
20
|
-
"node_modules/@enonic-types"
|
|
20
|
+
"node_modules/@enonic-types"
|
|
21
21
|
]
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -29,8 +29,8 @@ After that, all the global XP variables will be typed.
|
|
|
29
29
|
|
|
30
30
|
Adding not `"types": [...]` but `"typeRoots"` will allow to discover types for every other enonic library, that will be installed later.
|
|
31
31
|
|
|
32
|
-
Import functions, such as `require`, will return typed objects if the corresponding types for imported
|
|
33
|
-
|
|
32
|
+
Import functions, such as `require`, will return typed objects if the corresponding types for imported libraries are also added to
|
|
33
|
+
your `tsconfig.json`.
|
|
34
34
|
|
|
35
35
|
## Configuration
|
|
36
36
|
|
|
@@ -57,11 +57,12 @@ declare const __non_webpack_require__: XpRequire;
|
|
|
57
57
|
|
|
58
58
|
### Beans
|
|
59
59
|
|
|
60
|
-
To create a new bean, a `__.newBean()` function must be used. Making it return a proper type can be done in two ways. Say you have
|
|
60
|
+
To create a new bean, a `__.newBean()` function must be used. Making it return a proper type can be done in two ways. Say you have created
|
|
61
|
+
an interface for that been somewhere in your project:
|
|
61
62
|
|
|
62
63
|
```ts
|
|
63
64
|
interface SomeHelper {
|
|
64
|
-
|
|
65
|
+
help(text: string): void;
|
|
65
66
|
}
|
|
66
67
|
```
|
|
67
68
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enonic-types/global",
|
|
3
|
-
"version": "7.11.0-
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.11.0-B3",
|
|
4
|
+
"description": "Global variables and functions type definition.",
|
|
5
5
|
"types": "global.d.ts",
|
|
6
6
|
"files": [
|
|
7
7
|
"global.d.ts"
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"url": "https://github.com/enonic/xp/issues"
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/enonic/xp/tree/master#readme",
|
|
29
|
+
"dependencies": {},
|
|
29
30
|
"publishConfig": {
|
|
30
31
|
"access": "public"
|
|
31
32
|
}
|