@naturalcycles/js-lib 14.113.0 → 14.114.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/dist/types.d.ts +4 -2
- package/package.json +1 -1
- package/src/types.ts +9 -5
package/dist/types.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ export interface SavedDBEntity<ID extends string | number = string> {
|
|
|
48
48
|
* When it's known to be saved - `SavedDBEntity` interface can be used instead.
|
|
49
49
|
*/
|
|
50
50
|
export declare type BaseDBEntity<ID extends string | number = string> = Partial<SavedDBEntity<ID>>;
|
|
51
|
-
export declare type Saved<T extends Partial<ObjectWithId>> = Omit<T, 'id' | 'created' | 'updated'> & SavedDBEntity<NonNullable<T['id']
|
|
52
|
-
export declare type Unsaved<T extends Partial<ObjectWithId>> = Omit<T, 'id' | 'created' | 'updated'> & BaseDBEntity<NonNullable<T['id']
|
|
51
|
+
export declare type Saved<T extends Partial<ObjectWithId>> = T extends AnyObject ? Omit<T, 'id' | 'created' | 'updated'> & SavedDBEntity<NonNullable<T['id']>> : T;
|
|
52
|
+
export declare type Unsaved<T extends Partial<ObjectWithId>> = T extends AnyObject ? Omit<T, 'id' | 'created' | 'updated'> & BaseDBEntity<NonNullable<T['id']>> : T;
|
|
53
53
|
export declare type UnsavedId<T extends Partial<ObjectWithId>> = Omit<T, 'id'> & {
|
|
54
54
|
id?: T['id'];
|
|
55
55
|
};
|
|
@@ -163,6 +163,8 @@ export declare type UnixTimestamp = number;
|
|
|
163
163
|
* Same as `number`, but with semantic meaning that it's an Integer.
|
|
164
164
|
*/
|
|
165
165
|
export declare type Integer = number;
|
|
166
|
+
export declare type Base64String = string;
|
|
167
|
+
export declare type Base64UrlString = string;
|
|
166
168
|
/**
|
|
167
169
|
* Named type for JSON.parse / JSON.stringify second argument
|
|
168
170
|
*/
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -62,12 +62,13 @@ export interface SavedDBEntity<ID extends string | number = string> {
|
|
|
62
62
|
*/
|
|
63
63
|
export type BaseDBEntity<ID extends string | number = string> = Partial<SavedDBEntity<ID>>
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
export type Saved<T extends Partial<ObjectWithId>> = T extends AnyObject
|
|
66
|
+
? Omit<T, 'id' | 'created' | 'updated'> & SavedDBEntity<NonNullable<T['id']>>
|
|
67
|
+
: T
|
|
68
68
|
|
|
69
|
-
export type Unsaved<T extends Partial<ObjectWithId>> =
|
|
70
|
-
BaseDBEntity<NonNullable<T['id']>>
|
|
69
|
+
export type Unsaved<T extends Partial<ObjectWithId>> = T extends AnyObject
|
|
70
|
+
? Omit<T, 'id' | 'created' | 'updated'> & BaseDBEntity<NonNullable<T['id']>>
|
|
71
|
+
: T
|
|
71
72
|
|
|
72
73
|
export type UnsavedId<T extends Partial<ObjectWithId>> = Omit<T, 'id'> & {
|
|
73
74
|
id?: T['id']
|
|
@@ -222,6 +223,9 @@ export type UnixTimestamp = number
|
|
|
222
223
|
*/
|
|
223
224
|
export type Integer = number
|
|
224
225
|
|
|
226
|
+
export type Base64String = string
|
|
227
|
+
export type Base64UrlString = string
|
|
228
|
+
|
|
225
229
|
/**
|
|
226
230
|
* Named type for JSON.parse / JSON.stringify second argument
|
|
227
231
|
*/
|