@enonic-types/lib-mail 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 (2) hide show
  1. package/README.md +19 -28
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -1,70 +1,61 @@
1
1
  # Enonic XP lib-mail TS types
2
2
 
3
3
  > TypeScript definitions for `lib-mail` library of Enonic XP
4
+
4
5
  ## Install
5
6
 
6
7
  ```bash
7
- npm i --save-dev @enonic/lib-mail
8
+ npm i --save-dev @enonic-types/lib-mail
8
9
  ```
9
10
 
10
11
  ## Use
11
12
 
12
- Add the corresponding types to your `tsconfig.json` file that is used for application's server-side TypeScript code.
13
-
14
- `tsconfig.json`
15
- ```json
16
- {
17
- "compilerOptions": {
18
- "types": [
19
- "@enonic-types/lib-mail"
20
- ]
21
- }
22
- }
23
- ```
24
-
25
13
  ### Require and custom imports
26
14
 
27
- To make `require` work out of box, you must install and add the `@enonic-types/global` types. Aside from providing definitions for XP global objects, e.g. `log`, `app`, `__`, etc, requiring library by the default path will return typed object.
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
16
+ global objects, e.g. `log`, `app`, `__`, etc, requiring a library by the default path will return typed object.
28
17
 
29
18
  `tsconfig.json`
30
- ```diff
19
+
20
+ ```json
31
21
  {
32
22
  "compilerOptions": {
33
23
  "types": [
34
- + "@enonic-types/global"
35
- "@enonic-types/lib-mail"
24
+ "@enonic-types/global"
36
25
  ]
37
26
  }
38
27
  }
39
28
  ```
40
29
 
41
30
  `example.ts`
31
+
42
32
  ```ts
43
33
  const {send} = require('/lib/xp/mail');
44
34
  ```
45
35
 
46
- More detailed explanation on how it works and how to type custom import function can be found [here](https://github.com/enonic/xp/tree/master/modules/lib/typescript/README.md).
36
+ More detailed explanation on how it works and how to type custom import function can be
37
+ found [here](https://developer.enonic.com/docs/xp/stable/api).
47
38
 
48
39
  ### ES6-style import
49
40
 
50
- If you are planning to use `import` in your code and transpile it with the default `tsc` TypeScript compiler, you'll need to add proper types mapping to your configuration.
41
+ If you are planning to use `import` in your code and transpile it with the default `tsc` TypeScript compiler, you'll need to add proper
42
+ types mapping to your configuration.
51
43
 
52
44
  `tsconfig.json`
53
- ```diff
45
+
46
+ ```json
54
47
  {
55
48
  "compilerOptions": {
56
- "types": [
57
- "@enonic-types/lib-mail"
58
- ]
59
- + "baseUrl": "./",
60
- + "paths": {
61
- + "/lib/xp/mail": ["node_modules/@enonic-types/lib-mail"],
62
- + }
49
+ "baseUrl": "./",
50
+ "paths": {
51
+ "/lib/xp/mail": ["node_modules/@enonic-types/lib-mail"]
52
+ }
63
53
  }
64
54
  }
65
55
  ```
66
56
 
67
57
  `example.ts`
58
+
68
59
  ```ts
69
60
  import {send} from '/lib/xp/mail';
70
61
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-mail",
3
- "version": "7.11.0-B1",
3
+ "version": "7.11.0-B4",
4
4
  "description": "Type definitions for lib-mail.",
5
5
  "types": "mail.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
  }