@leancodepl/api-date 8.5.0 → 8.6.0
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 +55 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +2 -0
- package/index.cjs.mjs +2 -0
- package/index.d.ts +1 -0
- package/index.esm.js +1 -0
- package/package.json +1 -6
- package/src/index.d.ts +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @leancodepl/api-date
|
|
2
|
+
|
|
3
|
+
Type definitions for API date and time handling.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @leancodepl/api-date
|
|
9
|
+
# or
|
|
10
|
+
yarn add @leancodepl/api-date
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## API
|
|
14
|
+
|
|
15
|
+
### `ApiDateOnly`
|
|
16
|
+
|
|
17
|
+
Type representing date-only values for API communication.
|
|
18
|
+
|
|
19
|
+
### `ApiDateTime`
|
|
20
|
+
|
|
21
|
+
Type representing date and time values for API communication.
|
|
22
|
+
|
|
23
|
+
### `ApiTimeSpan`
|
|
24
|
+
|
|
25
|
+
Type representing time span values for API communication.
|
|
26
|
+
|
|
27
|
+
### `ApiTimeOnly`
|
|
28
|
+
|
|
29
|
+
Type representing time-only values for API communication.
|
|
30
|
+
|
|
31
|
+
### `ApiDateTimeOffset`
|
|
32
|
+
|
|
33
|
+
Type representing date and time with offset values for API communication.
|
|
34
|
+
|
|
35
|
+
## Usage Examples
|
|
36
|
+
|
|
37
|
+
### Type Definitions
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import {
|
|
41
|
+
ApiDateOnly,
|
|
42
|
+
ApiDateTime,
|
|
43
|
+
ApiTimeSpan,
|
|
44
|
+
ApiTimeOnly,
|
|
45
|
+
ApiDateTimeOffset
|
|
46
|
+
} from '@leancodepl/api-date';
|
|
47
|
+
|
|
48
|
+
interface UserProfile {
|
|
49
|
+
birthDate: ApiDateOnly;
|
|
50
|
+
createdAt: ApiDateTime;
|
|
51
|
+
sessionDuration: ApiTimeSpan;
|
|
52
|
+
preferredTime: ApiTimeOnly;
|
|
53
|
+
lastLogin: ApiDateTimeOffset;
|
|
54
|
+
}
|
|
55
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports._default = require('./index.cjs.js').default;
|
package/index.cjs.js
ADDED
package/index.cjs.mjs
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|
package/index.esm.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/api-date",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -33,11 +33,6 @@
|
|
|
33
33
|
"name": "LeanCode",
|
|
34
34
|
"url": "https://leancode.co"
|
|
35
35
|
},
|
|
36
|
-
"files": [
|
|
37
|
-
"dist",
|
|
38
|
-
"README.md",
|
|
39
|
-
"CHANGELOG.md"
|
|
40
|
-
],
|
|
41
36
|
"sideEffects": false,
|
|
42
37
|
"exports": {
|
|
43
38
|
"./package.json": "./package.json",
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare class AD {
|
|
2
|
+
private _;
|
|
3
|
+
}
|
|
4
|
+
declare class ADT {
|
|
5
|
+
private _;
|
|
6
|
+
}
|
|
7
|
+
declare class ATS {
|
|
8
|
+
private _;
|
|
9
|
+
}
|
|
10
|
+
declare class AT {
|
|
11
|
+
private _;
|
|
12
|
+
}
|
|
13
|
+
declare class ADO {
|
|
14
|
+
private _;
|
|
15
|
+
}
|
|
16
|
+
export type ApiDateOnly = AD;
|
|
17
|
+
export type ApiDateTime = ADT;
|
|
18
|
+
export type ApiTimeSpan = ATS;
|
|
19
|
+
export type ApiTimeOnly = AT;
|
|
20
|
+
export type ApiDateTimeOffset = ADO;
|
|
21
|
+
export {};
|