@everyonesoftware/common 10.0.0 → 12.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.
@@ -94,72 +94,6 @@ 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
-
117
- declare class SyncResult<T> implements AsyncResult<T> {
118
- private value;
119
- private error;
120
- private constructor();
121
- static create<T>(action: () => T): SyncResult<T>;
122
- static value<T>(value: T): SyncResult<T>;
123
- static error<T>(error: unknown): SyncResult<T>;
124
- await(): T;
125
- then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => TResult1) | null, onrejected?: ((reason: unknown) => TResult2) | null): SyncResult<TResult1 | TResult2>;
126
- then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => (TResult1 | PromiseLike<TResult1>)) | null, onrejected?: ((reason: unknown) => (TResult2 | PromiseLike<TResult2>)) | null): SyncResult<TResult1 | TResult2>;
127
- onValue(onValueFunction: (value: T) => void): SyncResult<T>;
128
- onValue(onValueFunction: (value: T) => Promise<void>): PromiseAsyncResult<T>;
129
- catch<TResult = never>(onrejected: (reason: unknown) => TResult): SyncResult<T | TResult>;
130
- catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): SyncResult<T | TResult> | PromiseAsyncResult<T | TResult>;
131
- catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => TResult): SyncResult<T | TResult>;
132
- catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => PromiseLike<TResult>): PromiseAsyncResult<T | TResult>;
133
- onError(onErrorFunction: (reason: unknown) => void): SyncResult<T>;
134
- onError(onErrorFunction: (reason: unknown) => PromiseLike<void>): PromiseAsyncResult<T>;
135
- onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => void): SyncResult<T>;
136
- onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => PromiseLike<void>): PromiseAsyncResult<T>;
137
- convertError(convertErrorFunction: (reason: unknown) => unknown): SyncResult<T>;
138
- convertError(onErrorFunction: (reason: unknown) => PromiseLike<unknown>): PromiseAsyncResult<T>;
139
- convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => unknown): SyncResult<T>;
140
- convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => PromiseLike<unknown>): PromiseAsyncResult<T>;
141
- finally(onfinally?: (() => void) | null): SyncResult<T>;
142
- finally(onfinally?: (() => Promise<void>) | null): PromiseAsyncResult<T>;
143
- readonly [Symbol.toStringTag]: string;
144
- }
145
-
146
- /**
147
- * A collection of {@link Function}s that can be used to determine if two values are equal.
148
- */
149
- declare class EqualFunctions {
150
- private readonly equalFunctions;
151
- private constructor();
152
- static create(): EqualFunctions;
153
- private defaultEqualFunction;
154
- /**
155
- * Get whether the provided values are equal based on the registered equal {@link Function}s.
156
- * @param left The left value in the comparison.
157
- * @param right The right value in the comparison.
158
- */
159
- areEqual(left: unknown, right: unknown): SyncResult<boolean>;
160
- add(equalFunction: (left: unknown, right: unknown) => (boolean | undefined)): this;
161
- }
162
-
163
97
  /**
164
98
  * The built-in {@link Array} type.
165
99
  *
@@ -632,7 +566,7 @@ declare function asFunctionWithParameterCount(value: unknown, parameterCount: nu
632
566
  * Get whether the provided value is an {@link Array}.
633
567
  * @param value The value to check.
634
568
  */
635
- declare function isArray(value: unknown): value is unknown[];
569
+ declare function isArray<T>(value: T[] | unknown): value is T[];
636
570
  /**
637
571
  * Return the provided value if it is an array, otherwise return undefined.
638
572
  * @param value The value to check.
@@ -686,6 +620,7 @@ declare function isJavascriptIterator<T>(value: unknown): value is JavascriptIte
686
620
  * @param value The value to check.
687
621
  */
688
622
  declare function isJavascriptIterable<T>(value: unknown): value is JavascriptIterable<T>;
623
+ declare function isIterator<T>(value: unknown): value is Iterator$1<T>;
689
624
  declare function isIterable<T>(value: unknown): value is Iterable$1<T>;
690
625
  /**
691
626
  * Get whether the provided value is a {@link JavascriptAsyncIterator}.
@@ -778,6 +713,118 @@ declare abstract class AsyncResult<T> implements Promise<T> {
778
713
  readonly abstract [Symbol.toStringTag]: string;
779
714
  }
780
715
 
716
+ declare class PromiseAsyncResult<T> implements AsyncResult<T> {
717
+ private readonly promise;
718
+ private constructor();
719
+ static create<T>(actionOrPromise: (() => (T | Promise<T>)) | Promise<T>): PromiseAsyncResult<T>;
720
+ static empty(): PromiseAsyncResult<void>;
721
+ static value<T>(value: T): PromiseAsyncResult<T>;
722
+ static error<T>(error: unknown): PromiseAsyncResult<T>;
723
+ static yield(): PromiseAsyncResult<void>;
724
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseAsyncResult<TResult1 | TResult2>;
725
+ onValue(onValueFunction: (value: T) => (void | Promise<void>)): PromiseAsyncResult<T>;
726
+ catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): PromiseAsyncResult<T | TResult>;
727
+ catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => (TResult | PromiseLike<TResult>)): PromiseAsyncResult<T | TResult>;
728
+ onError(onErrorFunction: (reason: unknown) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
729
+ onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
730
+ convertError(convertErrorFunction: (reason: unknown) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
731
+ convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
732
+ finally(onfinally?: (() => (void | Promise<void>)) | null): PromiseAsyncResult<T>;
733
+ readonly [Symbol.toStringTag]: string;
734
+ }
735
+
736
+ declare class SyncResult<T> implements AsyncResult<T> {
737
+ private value;
738
+ private error;
739
+ private constructor();
740
+ static create<T>(action: () => T): SyncResult<T>;
741
+ static value<T>(value: T): SyncResult<T>;
742
+ static error<T>(error: unknown): SyncResult<T>;
743
+ await(): T;
744
+ then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => TResult1) | null, onrejected?: ((reason: unknown) => TResult2) | null): SyncResult<TResult1 | TResult2>;
745
+ then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => (TResult1 | PromiseLike<TResult1>)) | null, onrejected?: ((reason: unknown) => (TResult2 | PromiseLike<TResult2>)) | null): SyncResult<TResult1 | TResult2>;
746
+ onValue(onValueFunction: (value: T) => void): SyncResult<T>;
747
+ onValue(onValueFunction: (value: T) => Promise<void>): PromiseAsyncResult<T>;
748
+ catch<TResult = never>(onrejected: (reason: unknown) => TResult): SyncResult<T | TResult>;
749
+ catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): SyncResult<T | TResult> | PromiseAsyncResult<T | TResult>;
750
+ catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => TResult): SyncResult<T | TResult>;
751
+ catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => PromiseLike<TResult>): PromiseAsyncResult<T | TResult>;
752
+ onError(onErrorFunction: (reason: unknown) => void): SyncResult<T>;
753
+ onError(onErrorFunction: (reason: unknown) => PromiseLike<void>): PromiseAsyncResult<T>;
754
+ onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => void): SyncResult<T>;
755
+ onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => PromiseLike<void>): PromiseAsyncResult<T>;
756
+ convertError(convertErrorFunction: (reason: unknown) => unknown): SyncResult<T>;
757
+ convertError(onErrorFunction: (reason: unknown) => PromiseLike<unknown>): PromiseAsyncResult<T>;
758
+ convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => unknown): SyncResult<T>;
759
+ convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => PromiseLike<unknown>): PromiseAsyncResult<T>;
760
+ finally(onfinally?: (() => void) | null): SyncResult<T>;
761
+ finally(onfinally?: (() => Promise<void>) | null): PromiseAsyncResult<T>;
762
+ readonly [Symbol.toStringTag]: string;
763
+ }
764
+
765
+ /**
766
+ * A collection of {@link Function}s that can be used to determine if two values are equal.
767
+ */
768
+ declare class EqualFunctions {
769
+ private readonly equalFunctions;
770
+ private constructor();
771
+ static create(): EqualFunctions;
772
+ private defaultEqualFunction;
773
+ /**
774
+ * Get whether the provided values are equal based on the registered equal {@link Function}s.
775
+ * @param left The left value in the comparison.
776
+ * @param right The right value in the comparison.
777
+ */
778
+ areEqual(left: unknown, right: unknown): SyncResult<boolean>;
779
+ add(equalFunction: (left: unknown, right: unknown) => (boolean | undefined)): this;
780
+ }
781
+
782
+ declare abstract class DateTime {
783
+ static parse(text: string): DateTime;
784
+ static now(): DateTime;
785
+ abstract getYear(): number;
786
+ abstract getMonth(): number;
787
+ abstract getDay(): number;
788
+ abstract getHour(): number;
789
+ abstract getMinute(): number;
790
+ abstract getSecond(): number;
791
+ abstract addDays(days: number): DateTime;
792
+ /**
793
+ * Compare this {@link DateTime} to the provided {@link DateTime}. If this {@link DateTime} is
794
+ * less than the provided {@link DateTime}, then a negative number will be returned, 0 if
795
+ * they're equal, or a positive number if this {@link DateTime} is greater than the provided
796
+ * {@link DateTime}.
797
+ * @param dateTime The {@link DateTime} to compare to this {@link DateTime}.
798
+ */
799
+ compareTo(dateTime: DateTime, compareTimes: boolean): number;
800
+ static compareTo(left: DateTime, right: DateTime, compareTimes: boolean): number;
801
+ lessThan(dateTime: DateTime, compareTimes: boolean): boolean;
802
+ static lessThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
803
+ lessThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean;
804
+ static lessThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
805
+ equals(dateTime: DateTime, compareTimes: boolean): boolean;
806
+ static equals(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
807
+ greaterThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean;
808
+ static greaterThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
809
+ greaterThan(dateTime: DateTime, compareTimes: boolean): boolean;
810
+ static greaterThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
811
+ get debug(): string;
812
+ static debug(dateTime: DateTime): string;
813
+ abstract toString(): string;
814
+ abstract toDateString(): string;
815
+ }
816
+
817
+ /**
818
+ * A type that can be used to get the current {@link DateTime}.
819
+ */
820
+ declare abstract class Clock {
821
+ static create(): Clock;
822
+ /**
823
+ * Get the current {@link DateTime}.
824
+ */
825
+ abstract now(): DateTime;
826
+ }
827
+
781
828
  declare abstract class CharacterWriteStream {
782
829
  /**
783
830
  * Write the provided text to this {@link CharacterWriteStream}.
@@ -795,4 +842,4 @@ declare abstract class CharacterWriteStream {
795
842
  static writeLine(writeStream: CharacterWriteStream, text?: string): AsyncResult<number>;
796
843
  }
797
844
 
798
- export { isUndefined as $, AsyncResult as A, instanceOf as B, CharacterWriteStream as C, instanceOfType as D, EqualFunctions as E, isArray as F, isAsyncIterable as G, isBoolean as H, Iterable$1 as I, type JavascriptArray as J, isFunction as K, isFunctionWithParameterCount as L, isIterable as M, isJavascriptAsyncIterable as N, isJavascriptAsyncIterator as O, PromiseAsyncResult as P, isJavascriptIterable as Q, isJavascriptIterator as R, SyncResult as S, ToStringFunctions as T, isNull as U, isNumber as V, isObject as W, isObjectOrArrayOrNull as X, isPromise as Y, isPromiseLike as Z, isString as _, Comparable as a, isUndefinedOrNull as a0, Comparison as b, Iterator$1 as c, type JavascriptAsyncIterable as d, type JavascriptAsyncIterator as e, type JavascriptIterable as f, type JavascriptIterator as g, type JavascriptIteratorResult as h, JavascriptMap as i, JavascriptSet as j, type Type as k, as as l, asArray as m, asBoolean as n, asFunction as o, asFunctionWithParameterCount as p, asNull as q, asNumber as r, asObject as s, asObjectOrArrayOrNull as t, asString as u, getName as v, getParameterCount as w, getPropertyNames as x, hasFunction as y, hasProperty as z };
845
+ export { isPromise as $, AsyncResult as A, hasProperty as B, CharacterWriteStream as C, DateTime as D, EqualFunctions as E, instanceOf as F, instanceOfType as G, isArray as H, Iterable$1 as I, type JavascriptArray as J, isAsyncIterable as K, isBoolean as L, isFunction as M, isFunctionWithParameterCount as N, isIterable as O, PromiseAsyncResult as P, isIterator as Q, isJavascriptAsyncIterable as R, SyncResult as S, ToStringFunctions as T, isJavascriptAsyncIterator as U, isJavascriptIterable as V, isJavascriptIterator as W, isNull as X, isNumber as Y, isObject as Z, isObjectOrArrayOrNull as _, Clock as a, isPromiseLike as a0, isString as a1, isUndefined as a2, isUndefinedOrNull as a3, Comparable as b, Comparison as c, Iterator$1 as d, type JavascriptAsyncIterable as e, type JavascriptAsyncIterator as f, type JavascriptIterable as g, type JavascriptIterator as h, type JavascriptIteratorResult as i, JavascriptMap as j, JavascriptSet as k, type Type as l, as as m, asArray as n, asBoolean as o, asFunction as p, asFunctionWithParameterCount as q, asNull as r, asNumber as s, asObject as t, asObjectOrArrayOrNull as u, asString as v, getName as w, getParameterCount as x, getPropertyNames as y, hasFunction as z };
@@ -94,72 +94,6 @@ 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
-
117
- declare class SyncResult<T> implements AsyncResult<T> {
118
- private value;
119
- private error;
120
- private constructor();
121
- static create<T>(action: () => T): SyncResult<T>;
122
- static value<T>(value: T): SyncResult<T>;
123
- static error<T>(error: unknown): SyncResult<T>;
124
- await(): T;
125
- then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => TResult1) | null, onrejected?: ((reason: unknown) => TResult2) | null): SyncResult<TResult1 | TResult2>;
126
- then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => (TResult1 | PromiseLike<TResult1>)) | null, onrejected?: ((reason: unknown) => (TResult2 | PromiseLike<TResult2>)) | null): SyncResult<TResult1 | TResult2>;
127
- onValue(onValueFunction: (value: T) => void): SyncResult<T>;
128
- onValue(onValueFunction: (value: T) => Promise<void>): PromiseAsyncResult<T>;
129
- catch<TResult = never>(onrejected: (reason: unknown) => TResult): SyncResult<T | TResult>;
130
- catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): SyncResult<T | TResult> | PromiseAsyncResult<T | TResult>;
131
- catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => TResult): SyncResult<T | TResult>;
132
- catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => PromiseLike<TResult>): PromiseAsyncResult<T | TResult>;
133
- onError(onErrorFunction: (reason: unknown) => void): SyncResult<T>;
134
- onError(onErrorFunction: (reason: unknown) => PromiseLike<void>): PromiseAsyncResult<T>;
135
- onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => void): SyncResult<T>;
136
- onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => PromiseLike<void>): PromiseAsyncResult<T>;
137
- convertError(convertErrorFunction: (reason: unknown) => unknown): SyncResult<T>;
138
- convertError(onErrorFunction: (reason: unknown) => PromiseLike<unknown>): PromiseAsyncResult<T>;
139
- convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => unknown): SyncResult<T>;
140
- convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => PromiseLike<unknown>): PromiseAsyncResult<T>;
141
- finally(onfinally?: (() => void) | null): SyncResult<T>;
142
- finally(onfinally?: (() => Promise<void>) | null): PromiseAsyncResult<T>;
143
- readonly [Symbol.toStringTag]: string;
144
- }
145
-
146
- /**
147
- * A collection of {@link Function}s that can be used to determine if two values are equal.
148
- */
149
- declare class EqualFunctions {
150
- private readonly equalFunctions;
151
- private constructor();
152
- static create(): EqualFunctions;
153
- private defaultEqualFunction;
154
- /**
155
- * Get whether the provided values are equal based on the registered equal {@link Function}s.
156
- * @param left The left value in the comparison.
157
- * @param right The right value in the comparison.
158
- */
159
- areEqual(left: unknown, right: unknown): SyncResult<boolean>;
160
- add(equalFunction: (left: unknown, right: unknown) => (boolean | undefined)): this;
161
- }
162
-
163
97
  /**
164
98
  * The built-in {@link Array} type.
165
99
  *
@@ -632,7 +566,7 @@ declare function asFunctionWithParameterCount(value: unknown, parameterCount: nu
632
566
  * Get whether the provided value is an {@link Array}.
633
567
  * @param value The value to check.
634
568
  */
635
- declare function isArray(value: unknown): value is unknown[];
569
+ declare function isArray<T>(value: T[] | unknown): value is T[];
636
570
  /**
637
571
  * Return the provided value if it is an array, otherwise return undefined.
638
572
  * @param value The value to check.
@@ -686,6 +620,7 @@ declare function isJavascriptIterator<T>(value: unknown): value is JavascriptIte
686
620
  * @param value The value to check.
687
621
  */
688
622
  declare function isJavascriptIterable<T>(value: unknown): value is JavascriptIterable<T>;
623
+ declare function isIterator<T>(value: unknown): value is Iterator$1<T>;
689
624
  declare function isIterable<T>(value: unknown): value is Iterable$1<T>;
690
625
  /**
691
626
  * Get whether the provided value is a {@link JavascriptAsyncIterator}.
@@ -778,6 +713,118 @@ declare abstract class AsyncResult<T> implements Promise<T> {
778
713
  readonly abstract [Symbol.toStringTag]: string;
779
714
  }
780
715
 
716
+ declare class PromiseAsyncResult<T> implements AsyncResult<T> {
717
+ private readonly promise;
718
+ private constructor();
719
+ static create<T>(actionOrPromise: (() => (T | Promise<T>)) | Promise<T>): PromiseAsyncResult<T>;
720
+ static empty(): PromiseAsyncResult<void>;
721
+ static value<T>(value: T): PromiseAsyncResult<T>;
722
+ static error<T>(error: unknown): PromiseAsyncResult<T>;
723
+ static yield(): PromiseAsyncResult<void>;
724
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseAsyncResult<TResult1 | TResult2>;
725
+ onValue(onValueFunction: (value: T) => (void | Promise<void>)): PromiseAsyncResult<T>;
726
+ catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): PromiseAsyncResult<T | TResult>;
727
+ catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => (TResult | PromiseLike<TResult>)): PromiseAsyncResult<T | TResult>;
728
+ onError(onErrorFunction: (reason: unknown) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
729
+ onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => (void | PromiseLike<void>)): PromiseAsyncResult<T>;
730
+ convertError(convertErrorFunction: (reason: unknown) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
731
+ convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => (unknown | PromiseLike<unknown>)): PromiseAsyncResult<T>;
732
+ finally(onfinally?: (() => (void | Promise<void>)) | null): PromiseAsyncResult<T>;
733
+ readonly [Symbol.toStringTag]: string;
734
+ }
735
+
736
+ declare class SyncResult<T> implements AsyncResult<T> {
737
+ private value;
738
+ private error;
739
+ private constructor();
740
+ static create<T>(action: () => T): SyncResult<T>;
741
+ static value<T>(value: T): SyncResult<T>;
742
+ static error<T>(error: unknown): SyncResult<T>;
743
+ await(): T;
744
+ then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => TResult1) | null, onrejected?: ((reason: unknown) => TResult2) | null): SyncResult<TResult1 | TResult2>;
745
+ then<TResult1 = T, TResult2 = never>(onfullfilled?: ((value: T) => (TResult1 | PromiseLike<TResult1>)) | null, onrejected?: ((reason: unknown) => (TResult2 | PromiseLike<TResult2>)) | null): SyncResult<TResult1 | TResult2>;
746
+ onValue(onValueFunction: (value: T) => void): SyncResult<T>;
747
+ onValue(onValueFunction: (value: T) => Promise<void>): PromiseAsyncResult<T>;
748
+ catch<TResult = never>(onrejected: (reason: unknown) => TResult): SyncResult<T | TResult>;
749
+ catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): SyncResult<T | TResult> | PromiseAsyncResult<T | TResult>;
750
+ catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => TResult): SyncResult<T | TResult>;
751
+ catch<TError, TResult = never>(errorType: Type<TError>, onrejected: (reason: TError) => PromiseLike<TResult>): PromiseAsyncResult<T | TResult>;
752
+ onError(onErrorFunction: (reason: unknown) => void): SyncResult<T>;
753
+ onError(onErrorFunction: (reason: unknown) => PromiseLike<void>): PromiseAsyncResult<T>;
754
+ onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => void): SyncResult<T>;
755
+ onError<TError>(errorType: Type<TError>, onErrorFunction: (reason: TError) => PromiseLike<void>): PromiseAsyncResult<T>;
756
+ convertError(convertErrorFunction: (reason: unknown) => unknown): SyncResult<T>;
757
+ convertError(onErrorFunction: (reason: unknown) => PromiseLike<unknown>): PromiseAsyncResult<T>;
758
+ convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => unknown): SyncResult<T>;
759
+ convertError<TError>(errorType: Type<TError>, convertErrorFunction: (reason: TError) => PromiseLike<unknown>): PromiseAsyncResult<T>;
760
+ finally(onfinally?: (() => void) | null): SyncResult<T>;
761
+ finally(onfinally?: (() => Promise<void>) | null): PromiseAsyncResult<T>;
762
+ readonly [Symbol.toStringTag]: string;
763
+ }
764
+
765
+ /**
766
+ * A collection of {@link Function}s that can be used to determine if two values are equal.
767
+ */
768
+ declare class EqualFunctions {
769
+ private readonly equalFunctions;
770
+ private constructor();
771
+ static create(): EqualFunctions;
772
+ private defaultEqualFunction;
773
+ /**
774
+ * Get whether the provided values are equal based on the registered equal {@link Function}s.
775
+ * @param left The left value in the comparison.
776
+ * @param right The right value in the comparison.
777
+ */
778
+ areEqual(left: unknown, right: unknown): SyncResult<boolean>;
779
+ add(equalFunction: (left: unknown, right: unknown) => (boolean | undefined)): this;
780
+ }
781
+
782
+ declare abstract class DateTime {
783
+ static parse(text: string): DateTime;
784
+ static now(): DateTime;
785
+ abstract getYear(): number;
786
+ abstract getMonth(): number;
787
+ abstract getDay(): number;
788
+ abstract getHour(): number;
789
+ abstract getMinute(): number;
790
+ abstract getSecond(): number;
791
+ abstract addDays(days: number): DateTime;
792
+ /**
793
+ * Compare this {@link DateTime} to the provided {@link DateTime}. If this {@link DateTime} is
794
+ * less than the provided {@link DateTime}, then a negative number will be returned, 0 if
795
+ * they're equal, or a positive number if this {@link DateTime} is greater than the provided
796
+ * {@link DateTime}.
797
+ * @param dateTime The {@link DateTime} to compare to this {@link DateTime}.
798
+ */
799
+ compareTo(dateTime: DateTime, compareTimes: boolean): number;
800
+ static compareTo(left: DateTime, right: DateTime, compareTimes: boolean): number;
801
+ lessThan(dateTime: DateTime, compareTimes: boolean): boolean;
802
+ static lessThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
803
+ lessThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean;
804
+ static lessThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
805
+ equals(dateTime: DateTime, compareTimes: boolean): boolean;
806
+ static equals(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
807
+ greaterThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean;
808
+ static greaterThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
809
+ greaterThan(dateTime: DateTime, compareTimes: boolean): boolean;
810
+ static greaterThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean;
811
+ get debug(): string;
812
+ static debug(dateTime: DateTime): string;
813
+ abstract toString(): string;
814
+ abstract toDateString(): string;
815
+ }
816
+
817
+ /**
818
+ * A type that can be used to get the current {@link DateTime}.
819
+ */
820
+ declare abstract class Clock {
821
+ static create(): Clock;
822
+ /**
823
+ * Get the current {@link DateTime}.
824
+ */
825
+ abstract now(): DateTime;
826
+ }
827
+
781
828
  declare abstract class CharacterWriteStream {
782
829
  /**
783
830
  * Write the provided text to this {@link CharacterWriteStream}.
@@ -795,4 +842,4 @@ declare abstract class CharacterWriteStream {
795
842
  static writeLine(writeStream: CharacterWriteStream, text?: string): AsyncResult<number>;
796
843
  }
797
844
 
798
- export { isUndefined as $, AsyncResult as A, instanceOf as B, CharacterWriteStream as C, instanceOfType as D, EqualFunctions as E, isArray as F, isAsyncIterable as G, isBoolean as H, Iterable$1 as I, type JavascriptArray as J, isFunction as K, isFunctionWithParameterCount as L, isIterable as M, isJavascriptAsyncIterable as N, isJavascriptAsyncIterator as O, PromiseAsyncResult as P, isJavascriptIterable as Q, isJavascriptIterator as R, SyncResult as S, ToStringFunctions as T, isNull as U, isNumber as V, isObject as W, isObjectOrArrayOrNull as X, isPromise as Y, isPromiseLike as Z, isString as _, Comparable as a, isUndefinedOrNull as a0, Comparison as b, Iterator$1 as c, type JavascriptAsyncIterable as d, type JavascriptAsyncIterator as e, type JavascriptIterable as f, type JavascriptIterator as g, type JavascriptIteratorResult as h, JavascriptMap as i, JavascriptSet as j, type Type as k, as as l, asArray as m, asBoolean as n, asFunction as o, asFunctionWithParameterCount as p, asNull as q, asNumber as r, asObject as s, asObjectOrArrayOrNull as t, asString as u, getName as v, getParameterCount as w, getPropertyNames as x, hasFunction as y, hasProperty as z };
845
+ export { isPromise as $, AsyncResult as A, hasProperty as B, CharacterWriteStream as C, DateTime as D, EqualFunctions as E, instanceOf as F, instanceOfType as G, isArray as H, Iterable$1 as I, type JavascriptArray as J, isAsyncIterable as K, isBoolean as L, isFunction as M, isFunctionWithParameterCount as N, isIterable as O, PromiseAsyncResult as P, isIterator as Q, isJavascriptAsyncIterable as R, SyncResult as S, ToStringFunctions as T, isJavascriptAsyncIterator as U, isJavascriptIterable as V, isJavascriptIterator as W, isNull as X, isNumber as Y, isObject as Z, isObjectOrArrayOrNull as _, Clock as a, isPromiseLike as a0, isString as a1, isUndefined as a2, isUndefinedOrNull as a3, Comparable as b, Comparison as c, Iterator$1 as d, type JavascriptAsyncIterable as e, type JavascriptAsyncIterator as f, type JavascriptIterable as g, type JavascriptIterator as h, type JavascriptIteratorResult as i, JavascriptMap as j, JavascriptSet as k, type Type as l, as as m, asArray as n, asBoolean as o, asFunction as p, asFunctionWithParameterCount as q, asNull as r, asNumber as s, asObject as t, asObjectOrArrayOrNull as u, asString as v, getName as w, getParameterCount as x, getPropertyNames as y, hasFunction as z };
@@ -22,7 +22,7 @@ import {
22
22
  isString,
23
23
  isUndefinedOrNull,
24
24
  join
25
- } from "./chunk-OYMWB5SX.js";
25
+ } from "./chunk-MHMLVX2O.js";
26
26
 
27
27
  // tests/test.ts
28
28
  var Test = class _Test {
@@ -1196,4 +1196,4 @@ export {
1196
1196
  BasicTestError,
1197
1197
  ConsoleTestRunner
1198
1198
  };
1199
- //# sourceMappingURL=chunk-TPV4JEMM.js.map
1199
+ //# sourceMappingURL=chunk-FZ3WRQ7B.js.map