@everyonesoftware/common 6.0.0 → 7.0.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/outputs/{characterWriteStream-DUlG_bx_.d.cts → characterWriteStream-ogvZec-U.d.cts} +25 -22
- package/outputs/{characterWriteStream-DUlG_bx_.d.ts → characterWriteStream-ogvZec-U.d.ts} +25 -22
- package/outputs/{chunk-5Z677JON.js → chunk-MMAX3IZF.js} +7694 -3814
- package/outputs/chunk-MMAX3IZF.js.map +1 -0
- package/outputs/{chunk-CHBOMCYM.js → chunk-VF6FBNAU.js} +444 -227
- package/outputs/chunk-VF6FBNAU.js.map +1 -0
- package/outputs/sourceIndex.cjs +925 -559
- package/outputs/sourceIndex.cjs.map +1 -1
- package/outputs/sourceIndex.d.cts +122 -33
- package/outputs/sourceIndex.d.ts +122 -33
- package/outputs/sourceIndex.js +53 -1094
- package/outputs/sourceIndex.js.map +1 -1
- package/outputs/testIndex.cjs +1816 -1126
- package/outputs/testIndex.cjs.map +1 -1
- package/outputs/testIndex.d.cts +112 -64
- package/outputs/testIndex.d.ts +112 -64
- package/outputs/testIndex.js +2 -2
- package/outputs/tests.cjs +13935 -12780
- package/outputs/tests.cjs.map +1 -1
- package/outputs/tests.js +2795 -2250
- package/outputs/tests.js.map +1 -1
- package/package.json +1 -1
- package/outputs/chunk-5Z677JON.js.map +0 -1
- package/outputs/chunk-6V7JRJ7P.js +0 -2469
- package/outputs/chunk-6V7JRJ7P.js.map +0 -1
- package/outputs/chunk-CHBOMCYM.js.map +0 -1
|
@@ -94,6 +94,26 @@ declare abstract class Comparable<T> {
|
|
|
94
94
|
static greaterThan<T>(left: Comparable<T>, right: T): boolean;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
declare class PromiseAsyncResult<T> implements AsyncResult<T> {
|
|
98
|
+
private readonly promise;
|
|
99
|
+
private constructor();
|
|
100
|
+
static create<T>(actionOrPromise: (() => (T | Promise<T>)) | Promise<T>): PromiseAsyncResult<T>;
|
|
101
|
+
static empty(): PromiseAsyncResult<void>;
|
|
102
|
+
static value<T>(value: T): PromiseAsyncResult<T>;
|
|
103
|
+
static error<T>(error: unknown): PromiseAsyncResult<T>;
|
|
104
|
+
static yield(): PromiseAsyncResult<void>;
|
|
105
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseAsyncResult<TResult1 | TResult2>;
|
|
106
|
+
onValue(onValueFunction: (value: T) => (void | Promise<void>)): PromiseAsyncResult<T>;
|
|
107
|
+
catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): PromiseAsyncResult<T | TResult>;
|
|
108
|
+
catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => (TResult | PromiseLike<TResult>)): PromiseAsyncResult<T | TResult>;
|
|
109
|
+
onError(onErrorFunction: (reason: unknown) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
|
|
110
|
+
onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
|
|
111
|
+
convertError(convertErrorFunction: (reason: unknown) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
|
|
112
|
+
convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
|
|
113
|
+
finally(onfinally?: (() => (void | Promise<void>)) | null): PromiseAsyncResult<T>;
|
|
114
|
+
readonly [Symbol.toStringTag]: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
97
117
|
declare class SyncResult<T> implements AsyncResult<T> {
|
|
98
118
|
private value;
|
|
99
119
|
private error;
|
|
@@ -690,8 +710,11 @@ declare function isPromise<T>(value: unknown): value is Promise<T>;
|
|
|
690
710
|
* A result object that adds extra behavior beyond the standard {@link Promise}.
|
|
691
711
|
*/
|
|
692
712
|
declare abstract class AsyncResult<T> implements Promise<T> {
|
|
693
|
-
static create<T>(
|
|
694
|
-
|
|
713
|
+
static create<T>(actionOrPromise: (() => (T | Promise<T>)) | Promise<T>): AsyncResult<T>;
|
|
714
|
+
/**
|
|
715
|
+
* Get an {@link AsyncResult} that is already completed and doesn't do anything.
|
|
716
|
+
*/
|
|
717
|
+
static empty(): AsyncResult<void>;
|
|
695
718
|
/**
|
|
696
719
|
* Create a new {@link AsyncResult} that contains the provided value.
|
|
697
720
|
* @param value The value to wrap in a {@link AsyncResult}.
|
|
@@ -755,26 +778,6 @@ declare abstract class AsyncResult<T> implements Promise<T> {
|
|
|
755
778
|
readonly abstract [Symbol.toStringTag]: string;
|
|
756
779
|
}
|
|
757
780
|
|
|
758
|
-
declare class PromiseAsyncResult<T> implements AsyncResult<T> {
|
|
759
|
-
private readonly promise;
|
|
760
|
-
private constructor();
|
|
761
|
-
static create<T>(action: () => (T | Promise<T>)): PromiseAsyncResult<T>;
|
|
762
|
-
static create<T>(promise: Promise<T>): PromiseAsyncResult<T>;
|
|
763
|
-
static value<T>(value: T): PromiseAsyncResult<T>;
|
|
764
|
-
static error<T>(error: unknown): PromiseAsyncResult<T>;
|
|
765
|
-
static yield(): PromiseAsyncResult<void>;
|
|
766
|
-
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseAsyncResult<TResult1 | TResult2>;
|
|
767
|
-
onValue(onValueFunction: (value: T) => (void | Promise<void>)): PromiseAsyncResult<T>;
|
|
768
|
-
catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): PromiseAsyncResult<T | TResult>;
|
|
769
|
-
catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => (TResult | PromiseLike<TResult>)): PromiseAsyncResult<T | TResult>;
|
|
770
|
-
onError(onErrorFunction: (reason: unknown) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
|
|
771
|
-
onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
|
|
772
|
-
convertError(convertErrorFunction: (reason: unknown) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
|
|
773
|
-
convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
|
|
774
|
-
finally(onfinally?: (() => (void | Promise<void>)) | null): PromiseAsyncResult<T>;
|
|
775
|
-
readonly [Symbol.toStringTag]: string;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
781
|
declare abstract class CharacterWriteStream {
|
|
779
782
|
/**
|
|
780
783
|
* Write the provided text to this {@link CharacterWriteStream}.
|
|
@@ -94,6 +94,26 @@ declare abstract class Comparable<T> {
|
|
|
94
94
|
static greaterThan<T>(left: Comparable<T>, right: T): boolean;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
declare class PromiseAsyncResult<T> implements AsyncResult<T> {
|
|
98
|
+
private readonly promise;
|
|
99
|
+
private constructor();
|
|
100
|
+
static create<T>(actionOrPromise: (() => (T | Promise<T>)) | Promise<T>): PromiseAsyncResult<T>;
|
|
101
|
+
static empty(): PromiseAsyncResult<void>;
|
|
102
|
+
static value<T>(value: T): PromiseAsyncResult<T>;
|
|
103
|
+
static error<T>(error: unknown): PromiseAsyncResult<T>;
|
|
104
|
+
static yield(): PromiseAsyncResult<void>;
|
|
105
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseAsyncResult<TResult1 | TResult2>;
|
|
106
|
+
onValue(onValueFunction: (value: T) => (void | Promise<void>)): PromiseAsyncResult<T>;
|
|
107
|
+
catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): PromiseAsyncResult<T | TResult>;
|
|
108
|
+
catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => (TResult | PromiseLike<TResult>)): PromiseAsyncResult<T | TResult>;
|
|
109
|
+
onError(onErrorFunction: (reason: unknown) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
|
|
110
|
+
onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
|
|
111
|
+
convertError(convertErrorFunction: (reason: unknown) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
|
|
112
|
+
convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
|
|
113
|
+
finally(onfinally?: (() => (void | Promise<void>)) | null): PromiseAsyncResult<T>;
|
|
114
|
+
readonly [Symbol.toStringTag]: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
97
117
|
declare class SyncResult<T> implements AsyncResult<T> {
|
|
98
118
|
private value;
|
|
99
119
|
private error;
|
|
@@ -690,8 +710,11 @@ declare function isPromise<T>(value: unknown): value is Promise<T>;
|
|
|
690
710
|
* A result object that adds extra behavior beyond the standard {@link Promise}.
|
|
691
711
|
*/
|
|
692
712
|
declare abstract class AsyncResult<T> implements Promise<T> {
|
|
693
|
-
static create<T>(
|
|
694
|
-
|
|
713
|
+
static create<T>(actionOrPromise: (() => (T | Promise<T>)) | Promise<T>): AsyncResult<T>;
|
|
714
|
+
/**
|
|
715
|
+
* Get an {@link AsyncResult} that is already completed and doesn't do anything.
|
|
716
|
+
*/
|
|
717
|
+
static empty(): AsyncResult<void>;
|
|
695
718
|
/**
|
|
696
719
|
* Create a new {@link AsyncResult} that contains the provided value.
|
|
697
720
|
* @param value The value to wrap in a {@link AsyncResult}.
|
|
@@ -755,26 +778,6 @@ declare abstract class AsyncResult<T> implements Promise<T> {
|
|
|
755
778
|
readonly abstract [Symbol.toStringTag]: string;
|
|
756
779
|
}
|
|
757
780
|
|
|
758
|
-
declare class PromiseAsyncResult<T> implements AsyncResult<T> {
|
|
759
|
-
private readonly promise;
|
|
760
|
-
private constructor();
|
|
761
|
-
static create<T>(action: () => (T | Promise<T>)): PromiseAsyncResult<T>;
|
|
762
|
-
static create<T>(promise: Promise<T>): PromiseAsyncResult<T>;
|
|
763
|
-
static value<T>(value: T): PromiseAsyncResult<T>;
|
|
764
|
-
static error<T>(error: unknown): PromiseAsyncResult<T>;
|
|
765
|
-
static yield(): PromiseAsyncResult<void>;
|
|
766
|
-
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseAsyncResult<TResult1 | TResult2>;
|
|
767
|
-
onValue(onValueFunction: (value: T) => (void | Promise<void>)): PromiseAsyncResult<T>;
|
|
768
|
-
catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): PromiseAsyncResult<T | TResult>;
|
|
769
|
-
catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => (TResult | PromiseLike<TResult>)): PromiseAsyncResult<T | TResult>;
|
|
770
|
-
onError(onErrorFunction: (reason: unknown) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
|
|
771
|
-
onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
|
|
772
|
-
convertError(convertErrorFunction: (reason: unknown) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
|
|
773
|
-
convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
|
|
774
|
-
finally(onfinally?: (() => (void | Promise<void>)) | null): PromiseAsyncResult<T>;
|
|
775
|
-
readonly [Symbol.toStringTag]: string;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
781
|
declare abstract class CharacterWriteStream {
|
|
779
782
|
/**
|
|
780
783
|
* Write the provided text to this {@link CharacterWriteStream}.
|