ts-gems 3.2.0 → 3.3.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/lib/dto.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IfNoDeepValue } from './helpers.js';
2
- import { DeeperNullish } from './nullish.js';
3
- import { DeeperPartial } from './partial.js';
2
+ import { DeepNullish } from './nullish.js';
3
+ import { DeepPartial } from './partial.js';
4
4
  import { IfNever } from './type-check.js';
5
5
 
6
6
  /**
@@ -17,5 +17,5 @@ export type DTO<T> = {
17
17
  : DTO<Exclude<T[K], undefined | null>>
18
18
  };
19
19
 
20
- export type PartialDTO<T> = DeeperPartial<DTO<T>>;
21
- export type PatchDTO<T> = DeeperNullish<DTO<T>>;
20
+ export type PartialDTO<T> = DeepPartial<DTO<T>>;
21
+ export type PatchDTO<T> = DeepNullish<DTO<T>>;
package/lib/types.d.ts CHANGED
@@ -1,15 +1,32 @@
1
1
  /**
2
2
  * Declare ReadableStream and WritableStream in case dom.d.ts is not added to the tsconfig
3
- * lib causing ReadableStream or WritableStream interface is not defined.
4
- * For developers with dom.d.ts added, the ReadableStream and WritableStream
3
+ * lib causing ReadableStream or WritableStream interface is not defined.
4
+ * For developers with dom.d.ts added, the ReadableStream and WritableStream
5
5
  * interface will be merged correctly.
6
6
  *
7
7
  * This is also required for any clients with streaming interface where ReadableStream
8
- * or WritableStream type is also referred.
8
+ * or WritableStream type is also referred.
9
9
  */
10
10
  declare global {
11
- export interface ReadableStream {}
12
- export interface WritableStream {}
11
+ export interface ReadableStream<R = any> {
12
+ readonly locked: boolean;
13
+
14
+ cancel(reason?: any): Promise<void>;
15
+
16
+ getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
17
+
18
+ getReader(): ReadableStreamDefaultReader<R>;
19
+
20
+ getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<R>;
21
+ }
22
+
23
+ export interface WritableStream<W = any> {
24
+ readonly locked: boolean;
25
+
26
+ abort(reason?: any): Promise<void>;
27
+
28
+ getWriter(): WritableStreamDefaultWriter<W>;
29
+ }
13
30
  }
14
31
 
15
32
  /**
@@ -58,7 +75,6 @@ export type Class<Args extends any[] = any[], Instance = {}, Static = {}> =
58
75
  (new(...args: Args) => Instance) & Static;
59
76
 
60
77
 
61
-
62
78
  /**
63
79
  * Maybe
64
80
  * @desc Type representing T | undefined
@@ -80,6 +96,8 @@ export type ThunkAsync<T> = Thunk<T> | (() => Promise<T>)
80
96
  export type TypeThunk<T = any> = Thunk<Type<T>>;
81
97
  export type TypeThunkAsync<T = any> = ThunkAsync<Type<T>>;
82
98
 
99
+ export type MaybePromise<T> = T | Promise<T>;
100
+
83
101
 
84
102
  /**
85
103
  * PropertyType
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "lodash",
13
13
  "underscore"
14
14
  ],
15
- "version": "3.2.0",
15
+ "version": "3.3.0",
16
16
  "types": "lib/index.d.ts",
17
17
  "main": "lib/index.js",
18
18
  "module": "lib/index.js",
@@ -33,9 +33,9 @@
33
33
  ],
34
34
  "devDependencies": {
35
35
  "@types/jest": "^29.5.12",
36
- "eslint": "^8.57.0",
36
+ "eslint": "^9.0.0",
37
37
  "jest": "^29.7.0",
38
38
  "ts-jest": "^29.1.2",
39
- "typescript": "^5.4.2"
39
+ "typescript": "^5.4.5"
40
40
  }
41
41
  }