@enonic-types/lib-app 7.11.0-B1 → 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.
Files changed (3) hide show
  1. package/README.md +11 -15
  2. package/app.d.ts +4 -4
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm i --save-dev @enonic/lib-app
8
+ npm i --save-dev @enonic-types/lib-app
9
9
  ```
10
10
 
11
11
  ## Use
@@ -26,17 +26,16 @@ Add the corresponding types to your `tsconfig.json` file that is used for applic
26
26
 
27
27
  ### Require and custom imports
28
28
 
29
- To make `require` work out of box, you must install and add the `@enonic-types/global` types. Aside from providing definitions for XP global
30
- objects, e.g. `log`, `app`, `__`, etc, requiring library by the default path will return typed object.
29
+ To make `require` work out of the box, you must install and add the `@enonic-types/global` types. Aside from providing definitions for XP
30
+ global objects, e.g. `log`, `app`, `__`, etc, requiring a library by the default path will return typed object.
31
31
 
32
32
  `tsconfig.json`
33
33
 
34
- ```diff
34
+ ```json
35
35
  {
36
36
  "compilerOptions": {
37
37
  "types": [
38
- + "@enonic-types/global"
39
- "@enonic-types/lib-app"
38
+ "@enonic-types/global"
40
39
  ]
41
40
  }
42
41
  }
@@ -57,7 +56,7 @@ const {
57
56
  ```
58
57
 
59
58
  More detailed explanation on how it works and how to type custom import function can be
60
- found [here](https://github.com/enonic/xp/tree/master/modules/lib/typescript/README.md).
59
+ found [here](https://developer.enonic.com/docs/xp/stable/api).
61
60
 
62
61
  ### ES6-style import
63
62
 
@@ -66,16 +65,13 @@ types mapping to your configuration.
66
65
 
67
66
  `tsconfig.json`
68
67
 
69
- ```diff
68
+ ```json
70
69
  {
71
70
  "compilerOptions": {
72
- "types": [
73
- "@enonic-types/lib-app"
74
- ]
75
- + "baseUrl": "./",
76
- + "paths": {
77
- + "/lib/xp/app": ["node_modules/@enonic-types/lib-app"],
78
- + }
71
+ "baseUrl": "./",
72
+ "paths": {
73
+ "/lib/xp/app": ["node_modules/@enonic-types/lib-app"]
74
+ }
79
75
  }
80
76
  }
81
77
  ```
package/app.d.ts CHANGED
@@ -101,15 +101,15 @@ export interface HasVirtualApplicationParams {
101
101
  * @returns {boolean} result.
102
102
  */
103
103
  export declare function hasVirtual(params: HasVirtualApplicationParams): boolean;
104
- export interface HasRealApplicationParams {
104
+ export interface GetApplicationModeParams {
105
105
  key: string;
106
106
  }
107
107
  /**
108
- * Checks if there is a real app with the app key.
108
+ * Fetches a mode of the app with the app key.
109
109
  *
110
110
  * @param {object} params JSON with the parameters.
111
111
  * @param {string} params.key Application key.
112
112
  *
113
- * @returns {boolean} result.
113
+ * @returns {string} application mode.
114
114
  */
115
- export declare function hasReal(params: HasRealApplicationParams): boolean;
115
+ export declare function getApplicationMode(params: GetApplicationModeParams): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-app",
3
- "version": "7.11.0-B1",
3
+ "version": "7.11.0-B4",
4
4
  "description": "Type definitions for lib-app.",
5
5
  "types": "app.d.ts",
6
6
  "files": [
@@ -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
  }