happy-rusty 1.0.5 → 1.0.6
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 +6 -1
- package/package.json +2 -1
- package/src/mod.ts +9 -0
package/dist/types.d.ts
CHANGED
|
@@ -124,5 +124,10 @@ interface Err<T, E> {
|
|
|
124
124
|
*/
|
|
125
125
|
declare function Err<T, E>(error: E): Result<T, E>;
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
type AsyncOption<T> = Promise<Option<T>>;
|
|
128
|
+
type AsyncResult<T, E> = Promise<Result<T, E>>;
|
|
129
|
+
type IOResult<T> = Result<T, Error>;
|
|
130
|
+
type AsyncIOResult<T> = Promise<IOResult<T>>;
|
|
131
|
+
|
|
132
|
+
export { type AsyncIOResult, type AsyncOption, type AsyncResult, Err, type IOResult, None, Ok, type Option, type Result, Some };
|
|
128
133
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
"description": "Porting some excellent design implementations from Rust to JavaScript.",
|
|
4
4
|
"author": "jiang115jie@gmail.com",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.6",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"source": "./src/mod.ts",
|
|
8
9
|
"main": "./dist/main.cjs",
|
|
9
10
|
"module": "./dist/main.mjs",
|
package/src/mod.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import type { Option } from './enum/option.ts';
|
|
2
|
+
import type { Result } from './enum/result.ts';
|
|
3
|
+
|
|
1
4
|
export { None, Some, type Option } from './enum/option.ts';
|
|
2
5
|
export { Err, Ok, type Result } from './enum/result.ts';
|
|
6
|
+
|
|
7
|
+
// export some commonly used types
|
|
8
|
+
export type AsyncOption<T> = Promise<Option<T>>;
|
|
9
|
+
export type AsyncResult<T, E> = Promise<Result<T, E>>;
|
|
10
|
+
export type IOResult<T> = Result<T, Error>;
|
|
11
|
+
export type AsyncIOResult<T> = Promise<IOResult<T>>;
|