@zelgadis87/utils-core 5.2.12 → 5.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/.rollup/index.cjs +3267 -0
- package/.rollup/index.cjs.map +1 -0
- package/.rollup/index.d.ts +1303 -0
- package/.rollup/index.mjs +3088 -0
- package/.rollup/index.mjs.map +1 -0
- package/.rollup/tsconfig.tsbuildinfo +1 -0
- package/CHANGELOG.md +10 -0
- package/package.json +6 -8
- package/src/utils/arrays.ts +3 -1
- package/dist/Logger.d.ts +0 -22
- package/dist/Optional.d.ts +0 -108
- package/dist/async/CancelableDeferred.d.ts +0 -17
- package/dist/async/Deferred.d.ts +0 -32
- package/dist/async/RateThrottler.d.ts +0 -13
- package/dist/async/Semaphore.d.ts +0 -17
- package/dist/async/_index.d.ts +0 -3
- package/dist/index.d.ts +0 -8
- package/dist/lazy/Lazy.d.ts +0 -22
- package/dist/lazy/LazyAsync.d.ts +0 -24
- package/dist/lazy/LazyDictionary.d.ts +0 -9
- package/dist/lazy/_index.d.ts +0 -3
- package/dist/sorting/ComparisonChain.d.ts +0 -57
- package/dist/sorting/Sorter.d.ts +0 -121
- package/dist/sorting/_index.d.ts +0 -2
- package/dist/sorting/types.d.ts +0 -5
- package/dist/time/RandomTimeDuration.d.ts +0 -9
- package/dist/time/TimeBase.d.ts +0 -49
- package/dist/time/TimeDuration.d.ts +0 -71
- package/dist/time/TimeFrequency.d.ts +0 -10
- package/dist/time/TimeInstant.d.ts +0 -174
- package/dist/time/TimeInstantBuilder.d.ts +0 -72
- package/dist/time/TimeRange.d.ts +0 -11
- package/dist/time/TimeUnit.d.ts +0 -15
- package/dist/time/_index.d.ts +0 -8
- package/dist/time/constants.d.ts +0 -14
- package/dist/time/types.d.ts +0 -29
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/upgrade/DataUpgrader.d.ts +0 -22
- package/dist/upgrade/_index.d.ts +0 -2
- package/dist/upgrade/errors.d.ts +0 -12
- package/dist/upgrade/getTransitionsPath.d.ts +0 -3
- package/dist/upgrade/types.d.ts +0 -31
- package/dist/utils/_index.d.ts +0 -15
- package/dist/utils/arrays/groupBy.d.ts +0 -9
- package/dist/utils/arrays/indexBy.d.ts +0 -7
- package/dist/utils/arrays/statistics.d.ts +0 -8
- package/dist/utils/arrays/uniqBy.d.ts +0 -4
- package/dist/utils/arrays.d.ts +0 -71
- package/dist/utils/booleans.d.ts +0 -2
- package/dist/utils/css.d.ts +0 -14
- package/dist/utils/empties.d.ts +0 -18
- package/dist/utils/errors/withTryCatch.d.ts +0 -4
- package/dist/utils/errors.d.ts +0 -20
- package/dist/utils/functions/_index.d.ts +0 -3
- package/dist/utils/functions/constant.d.ts +0 -11
- package/dist/utils/functions/iff.d.ts +0 -8
- package/dist/utils/functions/predicateBuilder.d.ts +0 -7
- package/dist/utils/functions.d.ts +0 -41
- package/dist/utils/json.d.ts +0 -11
- package/dist/utils/nulls.d.ts +0 -9
- package/dist/utils/numbers/round.d.ts +0 -8
- package/dist/utils/numbers.d.ts +0 -35
- package/dist/utils/operations.d.ts +0 -28
- package/dist/utils/primitives.d.ts +0 -3
- package/dist/utils/promises.d.ts +0 -10
- package/dist/utils/random.d.ts +0 -3
- package/dist/utils/records/entries.d.ts +0 -7
- package/dist/utils/records.d.ts +0 -63
- package/dist/utils/strings/StringParts.d.ts +0 -38
- package/dist/utils/strings.d.ts +0 -20
- package/esbuild/index.cjs +0 -3380
- package/esbuild/index.cjs.map +0 -7
- package/esbuild/index.mjs +0 -3177
- package/esbuild/index.mjs.map +0 -7
package/dist/lazy/Lazy.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Class that stores a value that is computationally/memory intensive to initialize.
|
|
3
|
-
* The initialization of the value is done once and only if required (lazy initialization).
|
|
4
|
-
* @author gtomberli
|
|
5
|
-
*/
|
|
6
|
-
export declare class Lazy<T> {
|
|
7
|
-
private _value;
|
|
8
|
-
private _initialized;
|
|
9
|
-
private _generator;
|
|
10
|
-
private constructor();
|
|
11
|
-
get value(): T | undefined;
|
|
12
|
-
getOrCreate(): T;
|
|
13
|
-
getOrThrow(errorMessage?: "Value not initialized"): T;
|
|
14
|
-
or(t: T): T;
|
|
15
|
-
isPresent(): boolean;
|
|
16
|
-
isEmpty(): boolean;
|
|
17
|
-
ifPresent(fn: (t: T) => void): void;
|
|
18
|
-
ifEmpty(fn: () => void): void;
|
|
19
|
-
apply(fnPresent: (t: T) => void, fnEmpty: () => void): void;
|
|
20
|
-
static of<T>(generator: () => T): Lazy<T>;
|
|
21
|
-
}
|
|
22
|
-
export default Lazy;
|
package/dist/lazy/LazyAsync.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare class LazyAsync<T> {
|
|
2
|
-
private _promise;
|
|
3
|
-
private _pending;
|
|
4
|
-
private _resolvedValue;
|
|
5
|
-
private _error;
|
|
6
|
-
private _generator;
|
|
7
|
-
private constructor();
|
|
8
|
-
getOrCreate(): Promise<T>;
|
|
9
|
-
isPresent(): boolean;
|
|
10
|
-
isEmpty(): boolean;
|
|
11
|
-
isPending(): boolean;
|
|
12
|
-
isReady(): boolean;
|
|
13
|
-
isResolved(): boolean;
|
|
14
|
-
isError(): boolean;
|
|
15
|
-
ifPresent(fn: (t: Promise<T>) => void): void;
|
|
16
|
-
ifEmpty(fn: () => void): void;
|
|
17
|
-
ifPending(fn: (t: Promise<T>) => void): void;
|
|
18
|
-
ifReady(fn: (t: Promise<T>) => void): void;
|
|
19
|
-
ifResolved(fn: (t: T) => void): void;
|
|
20
|
-
ifError(fn: (err: Error) => void): void;
|
|
21
|
-
getOrThrow(errorMessage?: "Value not initialized"): Promise<T> | never;
|
|
22
|
-
static of<T>(generator: () => Promise<T>): LazyAsync<T>;
|
|
23
|
-
}
|
|
24
|
-
export default LazyAsync;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TFunction } from "../utils/_index.ts";
|
|
2
|
-
export declare class LazyDictionary<K extends string | number | symbol, T> {
|
|
3
|
-
private readonly _generator;
|
|
4
|
-
private readonly _dictionary;
|
|
5
|
-
private constructor();
|
|
6
|
-
static of<K extends string | number | symbol, T>(generator: TFunction<K, T>): LazyDictionary<K, T>;
|
|
7
|
-
getOrCreate(key: K): T;
|
|
8
|
-
getOrThrow(key: K, errorMessage?: "Value not initialized"): T;
|
|
9
|
-
}
|
package/dist/lazy/_index.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { TFunction, TKeysOfType, TReadableArray } from "../utils/_index.js";
|
|
2
|
-
import { TComparisonDirection, TComparisonFunction, TComparisonResult } from "./types.js";
|
|
3
|
-
type TCompareValueOptions = {
|
|
4
|
-
nullsFirst: boolean;
|
|
5
|
-
direction: TComparisonDirection;
|
|
6
|
-
};
|
|
7
|
-
type TLooseCompareValueOptions = Partial<TCompareValueOptions> | TComparisonDirection;
|
|
8
|
-
declare function compareStrings(options?: TLooseCompareValueOptions & {
|
|
9
|
-
ignoreCase?: boolean;
|
|
10
|
-
}): TComparisonFunction<string>;
|
|
11
|
-
declare function compareBooleans(options: Partial<TCompareValueOptions> & {
|
|
12
|
-
truesFirst: boolean;
|
|
13
|
-
}): TComparisonFunction<boolean>;
|
|
14
|
-
/**
|
|
15
|
-
* Creates a ComparisonChain V1.
|
|
16
|
-
* Usage: ComparisonChain.createWith<number>( c => c.compareUsingNumbers() ).sort( [ 100, 1, 10, 5 ] );
|
|
17
|
-
* @deprecated[2023-10-22]: Use createSorterFor instead.
|
|
18
|
-
**/
|
|
19
|
-
export declare class ComparisonChain<T> {
|
|
20
|
-
private readonly _fns;
|
|
21
|
-
private readonly _reversed;
|
|
22
|
-
private constructor();
|
|
23
|
-
compare: (a: T, b: T) => TComparisonResult;
|
|
24
|
-
sort: <A extends TReadableArray<T>>(arr: A) => A extends Array<T> ? Array<T> : ReadonlyArray<T>;
|
|
25
|
-
then(getFn: (compare: TChain<T>) => TComparisonFunction<T>): ComparisonChain<T>;
|
|
26
|
-
thenBy(cmp: ComparisonChain<T> | TComparisonFunction<T>): ComparisonChain<T>;
|
|
27
|
-
thenChain<R>(transform: TFunction<T, R>, getFn: (compare: TChain<R>) => TComparisonFunction<R>): ComparisonChain<T>;
|
|
28
|
-
thenChainBy<R>(transform: TFunction<T, R>, cmp: ComparisonChain<R> | TComparisonFunction<R>): ComparisonChain<T>;
|
|
29
|
-
reversed(): ComparisonChain<T>;
|
|
30
|
-
private doCompare;
|
|
31
|
-
static create<T>(): {
|
|
32
|
-
using: (getFn: (chainable: TChain<T>) => TComparisonFunction<T>) => ComparisonChain<T>;
|
|
33
|
-
usingTransformation: <R>(transform: TFunction<T, R>, getFn: (chainable: TChain<R>) => TComparisonFunction<R>) => ComparisonChain<T>;
|
|
34
|
-
};
|
|
35
|
-
static createWith<T>(getFn: (chainable: TChain<T>) => TComparisonFunction<T>): ComparisonChain<T>;
|
|
36
|
-
static createWithTransformation<T, R>(transform: TFunction<T, R>, getFn: (chainable: TChain<R>) => TComparisonFunction<R>): ComparisonChain<T>;
|
|
37
|
-
}
|
|
38
|
-
export default ComparisonChain;
|
|
39
|
-
declare function createCompare<T>(): {
|
|
40
|
-
compareUsingGetter: {
|
|
41
|
-
(getter: TFunction<T, string>, options?: TLooseCompareValueOptions): TComparisonFunction<T>;
|
|
42
|
-
(getter: TFunction<T, number>, options?: TLooseCompareValueOptions): TComparisonFunction<T>;
|
|
43
|
-
(getter: TFunction<T, Date>, options?: TLooseCompareValueOptions): TComparisonFunction<T>;
|
|
44
|
-
};
|
|
45
|
-
compareUsingField: (field: keyof T & TKeysOfType<T, string | number | Date>, options?: TLooseCompareValueOptions) => TComparisonFunction<T>;
|
|
46
|
-
compareUsingStrings: typeof compareStrings;
|
|
47
|
-
compareUsingStringsIgnoringCase: (options?: TLooseCompareValueOptions) => TComparisonFunction<string>;
|
|
48
|
-
compareUsingBooleans: typeof compareBooleans;
|
|
49
|
-
compareUsingNumbers: (options?: TLooseCompareValueOptions) => TComparisonFunction<number>;
|
|
50
|
-
compareUsingDates: (options?: TLooseCompareValueOptions) => TComparisonFunction<Date>;
|
|
51
|
-
compareUsingFunction: (fn: TComparisonFunction<T>) => TComparisonFunction<T>;
|
|
52
|
-
placeFirst: (arr: Array<T>) => TComparisonFunction<T>;
|
|
53
|
-
placeFirstInOrder: (arr: Array<T>) => TComparisonFunction<T>;
|
|
54
|
-
placeLast: (arr: Array<T>) => TComparisonFunction<T>;
|
|
55
|
-
placeLastInOrder: (arr: Array<T>) => TComparisonFunction<T>;
|
|
56
|
-
};
|
|
57
|
-
type TChain<T> = ReturnType<typeof createCompare<T>>;
|
package/dist/sorting/Sorter.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type TimeDuration from "../time/TimeDuration.js";
|
|
2
|
-
import type TimeInstant from "../time/TimeInstant.js";
|
|
3
|
-
import { TConditionalParameterOptions, TFunction, TKeysOfType, TPositiveNumber, TReadableArray } from "../utils/_index.js";
|
|
4
|
-
import { TComparisonFunction } from "./types.js";
|
|
5
|
-
type TComparable<T> = {
|
|
6
|
-
compare: TComparisonFunction<T>;
|
|
7
|
-
};
|
|
8
|
-
export type TSorter<T> = {
|
|
9
|
-
get then(): TSorterStep<T, TSorter<T>>;
|
|
10
|
-
reversed: () => TSorter<T>;
|
|
11
|
-
compare: TComparisonFunction<T>;
|
|
12
|
-
sort: (arr: TReadableArray<T>) => Array<T>;
|
|
13
|
-
top: (arr: TReadableArray<T>, n: TPositiveNumber) => Array<T>;
|
|
14
|
-
bottom: (arr: TReadableArray<T>, n: TPositiveNumber) => Array<T>;
|
|
15
|
-
first: (arr: TReadableArray<T>) => T | null;
|
|
16
|
-
last: (arr: TReadableArray<T>) => T | null;
|
|
17
|
-
};
|
|
18
|
-
type TSorterStepForRecords<T, Ret> = {
|
|
19
|
-
usingStrings: (field: TKeysOfType<T, string>) => TSorterStepUsing<string, Ret>;
|
|
20
|
-
usingNumbers: (field: TKeysOfType<T, number>) => TSorterStepUsing<number, Ret>;
|
|
21
|
-
usingBooleans: (field: TKeysOfType<T, boolean>) => TSorterStepUsing<boolean, Ret>;
|
|
22
|
-
usingDates: (field: TKeysOfType<T, Date>) => TSorterStepUsing<Date, Ret>;
|
|
23
|
-
usingTimeInstant: (field: TKeysOfType<T, TimeInstant>) => TSorterStepUsing<TimeInstant, Ret>;
|
|
24
|
-
usingTimeDuration: (field: TKeysOfType<T, TimeDuration>) => TSorterStepUsing<TimeDuration, Ret>;
|
|
25
|
-
};
|
|
26
|
-
type TSorterStepForNumbers<_T, Ret> = {
|
|
27
|
-
inAscendingOrder(opts?: {
|
|
28
|
-
nullsFirst?: boolean;
|
|
29
|
-
}): Ret;
|
|
30
|
-
inDescendingOrder(opts?: {
|
|
31
|
-
nullsFirst?: boolean;
|
|
32
|
-
}): Ret;
|
|
33
|
-
};
|
|
34
|
-
type TSorterStepForStrings<_T, Ret> = {
|
|
35
|
-
/** @deprecated: Use inLexographicalOrder instead */ inLexographicalOrder(opts?: {
|
|
36
|
-
nullsFirst?: boolean;
|
|
37
|
-
}): Ret;
|
|
38
|
-
/** @deprecated: Use inLexographicalOrderIgnoringCase instead */ inLexographicalOrderIgnoringCase(opts?: {
|
|
39
|
-
nullsFirst?: boolean;
|
|
40
|
-
}): Ret;
|
|
41
|
-
/** @deprecated: Use inReverseLexographicalOrder instead */ inReverseLexographicalOrder(opts?: {
|
|
42
|
-
nullsFirst?: boolean;
|
|
43
|
-
}): Ret;
|
|
44
|
-
/** @deprecated: Use inReverseLexographicalOrderIgnoringCase instead */ inReverseLexographicalOrderIgnoringCase(opts?: {
|
|
45
|
-
nullsFirst?: boolean;
|
|
46
|
-
}): Ret;
|
|
47
|
-
inLexicographicalOrder(opts?: {
|
|
48
|
-
nullsFirst?: boolean;
|
|
49
|
-
}): Ret;
|
|
50
|
-
inLexicographicalOrderIgnoringCase(opts?: {
|
|
51
|
-
nullsFirst?: boolean;
|
|
52
|
-
}): Ret;
|
|
53
|
-
inReverseLexicographicalOrder(opts?: {
|
|
54
|
-
nullsFirst?: boolean;
|
|
55
|
-
}): Ret;
|
|
56
|
-
inReverseLexicographicalOrderIgnoringCase(opts?: {
|
|
57
|
-
nullsFirst?: boolean;
|
|
58
|
-
}): Ret;
|
|
59
|
-
};
|
|
60
|
-
type TSorterStepForBooleans<_T, Ret> = {
|
|
61
|
-
truesFirst(opts?: {
|
|
62
|
-
nullsFirst?: boolean;
|
|
63
|
-
}): Ret;
|
|
64
|
-
falsesFirst(opts?: {
|
|
65
|
-
nullsFirst?: boolean;
|
|
66
|
-
}): Ret;
|
|
67
|
-
};
|
|
68
|
-
type TSorterStepForDates<_T, Ret> = {
|
|
69
|
-
oldestDateFirst(opts?: {
|
|
70
|
-
nullsFirst?: boolean;
|
|
71
|
-
}): Ret;
|
|
72
|
-
newestDateFirst(opts?: {
|
|
73
|
-
nullsFirst?: boolean;
|
|
74
|
-
}): Ret;
|
|
75
|
-
};
|
|
76
|
-
type TSorterStepForTimeInstant<_T, Ret> = {
|
|
77
|
-
oldestFirst(opts?: {
|
|
78
|
-
nullsFirst?: boolean;
|
|
79
|
-
}): Ret;
|
|
80
|
-
newestFirst(opts?: {
|
|
81
|
-
nullsFirst?: boolean;
|
|
82
|
-
}): Ret;
|
|
83
|
-
};
|
|
84
|
-
type TSorterStepForTimeDuration<_T, Ret> = {
|
|
85
|
-
longestFirst(opts?: {
|
|
86
|
-
nullsFirst?: boolean;
|
|
87
|
-
}): Ret;
|
|
88
|
-
shortestFirst(opts?: {
|
|
89
|
-
nullsFirst?: boolean;
|
|
90
|
-
}): Ret;
|
|
91
|
-
};
|
|
92
|
-
type TSorterStepForChainables<T, Ret> = {
|
|
93
|
-
chain: (chain: TComparable<T>) => Ret;
|
|
94
|
-
chainFunction: (fn: TComparisonFunction<T>) => Ret;
|
|
95
|
-
};
|
|
96
|
-
type TSorterStepForUsing<T, Ret> = {
|
|
97
|
-
using: <X>(transform: TFunction<T, X>) => TSorterStepUsing<X, Ret>;
|
|
98
|
-
};
|
|
99
|
-
type TSorterStepForPrioritizable<T extends string | number, Ret> = {
|
|
100
|
-
prioritizing(arr: T[], options?: TConditionalParameterOptions<TPrioritizeOptions, typeof defaultPrioritizeOptions>): Ret;
|
|
101
|
-
deprioritizing(arr: Array<T>, options?: TConditionalParameterOptions<TPrioritizeOptions, typeof defaultPrioritizeOptions>): Ret;
|
|
102
|
-
prioritizingWithEqualWeight(arr: T[], options?: TConditionalParameterOptions<TPrioritizeOptions, typeof defaultPrioritizeOptions>): Ret;
|
|
103
|
-
deprioritizingWithEqualWeight(arr: Array<T>, options?: TConditionalParameterOptions<TPrioritizeOptions, typeof defaultPrioritizeOptions>): Ret;
|
|
104
|
-
};
|
|
105
|
-
type TSorterStepUsing<T, Ret> = {} & (T extends Record<string | number | symbol, unknown> ? TSorterStepForRecords<T, Ret> : {}) & (T extends number ? TSorterStepForNumbers<T, Ret> : {}) & (T extends string ? TSorterStepForStrings<T, Ret> : {}) & (T extends boolean ? TSorterStepForBooleans<T, Ret> : {}) & (T extends Date ? TSorterStepForDates<T, Ret> : {}) & (T extends TimeInstant ? TSorterStepForTimeInstant<T, Ret> : {}) & (T extends TimeDuration ? TSorterStepForTimeDuration<T, Ret> : {}) & (T extends string ? TSorterStepForPrioritizable<string, Ret> : {}) & (T extends number ? TSorterStepForPrioritizable<number, Ret> : {});
|
|
106
|
-
type TSorterStep<T, Ret> = TSorterStepUsing<T, Ret> & TSorterStepForChainables<T, Ret> & TSorterStepForUsing<T, Ret>;
|
|
107
|
-
type TSorterStarter<T> = TSorterStepUsing<T, TSorter<T>> & TSorterStepForUsing<T, TSorter<T>> & {
|
|
108
|
-
usingFunction: (fn: TComparisonFunction<T>) => TSorter<T>;
|
|
109
|
-
};
|
|
110
|
-
export type TSorterBuilder<T> = (builder: TSorterStarter<T>) => TSorter<T>;
|
|
111
|
-
type TPrioritizeOptions = {};
|
|
112
|
-
declare const defaultPrioritizeOptions: {};
|
|
113
|
-
export declare const Sorter: {
|
|
114
|
-
createFor: <T>(_template?: T) => TSorterStarter<T>;
|
|
115
|
-
sort: <T>(arr: TReadableArray<T>, builder: TSorterBuilder<T>) => T[];
|
|
116
|
-
top: <T>(arr: TReadableArray<T>, n: TPositiveNumber, builder: TSorterBuilder<T>) => T[];
|
|
117
|
-
bottom: <T>(arr: TReadableArray<T>, n: TPositiveNumber, builder: TSorterBuilder<T>) => T[];
|
|
118
|
-
first: <T>(arr: TReadableArray<T>, builder: TSorterBuilder<T>) => T | null;
|
|
119
|
-
last: <T>(arr: TReadableArray<T>, builder: TSorterBuilder<T>) => T | null;
|
|
120
|
-
};
|
|
121
|
-
export default Sorter;
|
package/dist/sorting/_index.d.ts
DELETED
package/dist/sorting/types.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { TBiFunction } from "../utils/functions.js";
|
|
2
|
-
export type TComparisonResult = -1 | 0 | 1;
|
|
3
|
-
export type TStrictComparisonResult = -1 | 1;
|
|
4
|
-
export type TComparisonFunction<T> = TBiFunction<T, T, TComparisonResult>;
|
|
5
|
-
export type TComparisonDirection = 'ASC' | 'DESC';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import TimeDuration from "./TimeDuration.js";
|
|
2
|
-
export default class RandomTimeDuration {
|
|
3
|
-
private constructor();
|
|
4
|
-
static ms: (a: number, b: number) => TimeDuration;
|
|
5
|
-
static seconds: (a: number, b: number) => TimeDuration;
|
|
6
|
-
static minutes: (a: number, b: number) => TimeDuration;
|
|
7
|
-
static hours: (a: number, b: number) => TimeDuration;
|
|
8
|
-
static days: (a: number, b: number) => TimeDuration;
|
|
9
|
-
}
|
package/dist/time/TimeBase.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { TimeUnit } from "./TimeUnit";
|
|
2
|
-
export type TTimeInUnits = {
|
|
3
|
-
milliseconds: number;
|
|
4
|
-
seconds: number;
|
|
5
|
-
minutes: number;
|
|
6
|
-
hours: number;
|
|
7
|
-
days: number;
|
|
8
|
-
};
|
|
9
|
-
export default abstract class TimeBase<T> {
|
|
10
|
-
private readonly _ms;
|
|
11
|
-
protected constructor(value: number, unit: TimeUnit);
|
|
12
|
-
protected abstract create(value: number, unit: TimeUnit): T;
|
|
13
|
-
/**
|
|
14
|
-
* Total number of milliseconds, rounded down.
|
|
15
|
-
*/
|
|
16
|
-
get ms(): number;
|
|
17
|
-
/**
|
|
18
|
-
* Total number of seconds, rounded down.
|
|
19
|
-
*/
|
|
20
|
-
get seconds(): number;
|
|
21
|
-
/**
|
|
22
|
-
* Total number of minutes, rounded down.
|
|
23
|
-
*/
|
|
24
|
-
get minutes(): number;
|
|
25
|
-
/**
|
|
26
|
-
* Total number of hours, rounded down.
|
|
27
|
-
*/
|
|
28
|
-
get hours(): number;
|
|
29
|
-
/**
|
|
30
|
-
* Total number of days, rounded down.
|
|
31
|
-
*/
|
|
32
|
-
get days(): number;
|
|
33
|
-
addMs(milliseconds: number): T;
|
|
34
|
-
addSeconds(seconds: number): T;
|
|
35
|
-
addMinutes(minutes: number): T;
|
|
36
|
-
addHours(hours: number): T;
|
|
37
|
-
addDays(days: number): T;
|
|
38
|
-
removeDays(days: number): T;
|
|
39
|
-
addUnits(n: number, unit: TimeUnit): T;
|
|
40
|
-
removeMs(milliseconds: number): T;
|
|
41
|
-
removeSeconds(seconds: number): T;
|
|
42
|
-
removeMinutes(minutes: number): T;
|
|
43
|
-
removeHours(hours: number): T;
|
|
44
|
-
removeUnits(n: number, unit: TimeUnit): T;
|
|
45
|
-
getUnit(unit: TimeUnit): number;
|
|
46
|
-
protected toUnits(): TTimeInUnits;
|
|
47
|
-
protected static unitsToMs(units: Partial<TTimeInUnits>): number;
|
|
48
|
-
toJSON(): number;
|
|
49
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { ICancelable, ICancelablePromise } from "../async/Deferred.js";
|
|
2
|
-
import { TComparisonResult } from "../sorting/_index.js";
|
|
3
|
-
import { TIntervalHandle, TTimeoutHandle } from "../utils/_index.js";
|
|
4
|
-
import TimeBase, { type TTimeInUnits } from "./TimeBase";
|
|
5
|
-
import TimeInstant from "./TimeInstant";
|
|
6
|
-
import { TimeUnit } from "./TimeUnit";
|
|
7
|
-
export declare class TimeDuration extends TimeBase<TimeDuration> {
|
|
8
|
-
protected constructor(value: number, unit: TimeUnit);
|
|
9
|
-
protected create(value: number, unit: TimeUnit): TimeDuration;
|
|
10
|
-
addDuration(duration: TimeDuration): TimeDuration;
|
|
11
|
-
removeDuration(duration: TimeDuration): TimeDuration;
|
|
12
|
-
removeUnits(n: number, unit: TimeUnit): TimeDuration;
|
|
13
|
-
multiplyBy(times: number): TimeDuration;
|
|
14
|
-
divideBy(times: number): TimeDuration;
|
|
15
|
-
/**
|
|
16
|
-
* Returns the current duration in a human readable format, prioritizing the most significant unit of time and excluding the rest.
|
|
17
|
-
* @todo[2023-06] Should allow more customization options
|
|
18
|
-
* @todo[2023-06] By default should show the secondary unit only when actually needed (eg, 1h 20m & 3h, instead of 1h 20m & 3h 28m)
|
|
19
|
-
* @todo[2023-06] Should not allow negative durations, as this is a duration and not an instant.
|
|
20
|
-
* @returns the duration, with only the most significant units displayed as a human readable string, eg: 1d 20h, 10m 30s.
|
|
21
|
-
*/
|
|
22
|
-
get formatted(): string;
|
|
23
|
-
interval(cb: () => unknown): TIntervalHandle;
|
|
24
|
-
timeout(cb: () => unknown): TTimeoutHandle;
|
|
25
|
-
cancelablePromise(): ICancelablePromise<void>;
|
|
26
|
-
promise(): Promise<void>;
|
|
27
|
-
delay(cb: () => unknown): void;
|
|
28
|
-
cancelableDelay(cb: () => unknown): ICancelable;
|
|
29
|
-
debounce<T>(fn: (t: T) => void): (t: T) => void;
|
|
30
|
-
toDigitalClock(): string;
|
|
31
|
-
get asSeconds(): string;
|
|
32
|
-
fromNow(): TimeInstant;
|
|
33
|
-
differenceFrom(other: TimeDuration): TimeDuration;
|
|
34
|
-
isGreaterThan(other: TimeDuration): boolean;
|
|
35
|
-
isLessThan(other: TimeDuration): boolean;
|
|
36
|
-
compareTo(other: TimeDuration): TComparisonResult;
|
|
37
|
-
atLeast(other: TimeDuration): TimeDuration;
|
|
38
|
-
atMost(other: TimeDuration): TimeDuration;
|
|
39
|
-
isEmpty(): boolean;
|
|
40
|
-
isNotEmpty(): boolean;
|
|
41
|
-
toUnits(): TTimeInUnits;
|
|
42
|
-
/**
|
|
43
|
-
* This method is used to provide a better DX when inspecting a TimeInstant object in DevTools.
|
|
44
|
-
*/
|
|
45
|
-
protected get _duration(): string;
|
|
46
|
-
toString(): string;
|
|
47
|
-
static parseHumanTime(humanTime: string): TimeDuration;
|
|
48
|
-
static compare(a: TimeDuration, b: TimeDuration): TComparisonResult;
|
|
49
|
-
static ms: (value: number) => TimeDuration;
|
|
50
|
-
static seconds: (value: number) => TimeDuration;
|
|
51
|
-
static minutes: (value: number) => TimeDuration;
|
|
52
|
-
static hours: (value: number) => TimeDuration;
|
|
53
|
-
static days: (value: number) => TimeDuration;
|
|
54
|
-
static shamefulUnref: (ms: TAllowedTimeDuration) => number;
|
|
55
|
-
static shamefulRef: (ms: TAllowedTimeDuration) => TimeDuration;
|
|
56
|
-
static unref: (ms: TValidTimeDuration) => TPredefinedTimeDuration;
|
|
57
|
-
static ref: (ms: TValidTimeDuration) => TimeDuration;
|
|
58
|
-
static fromMs(ms: number): TimeDuration;
|
|
59
|
-
static distanceFromNow(instant: TimeInstant): TimeDuration;
|
|
60
|
-
static distance(instant1: TimeInstant, instant2: TimeInstant): TimeDuration;
|
|
61
|
-
static greatest(duration1: TimeDuration, duration2: TimeDuration): TimeDuration;
|
|
62
|
-
static lowest(duration1: TimeDuration, duration2: TimeDuration): TimeDuration;
|
|
63
|
-
static ZERO: TimeDuration;
|
|
64
|
-
static fromJSON(ms: number): TimeDuration;
|
|
65
|
-
static fromUnits(parameters: Partial<TTimeInUnits>): TimeDuration;
|
|
66
|
-
}
|
|
67
|
-
export type TPredefinedTimeDuration = 0 | 50 | 100 | 150 | 200 | 250 | 300 | 500 | 1000 | 1500 | 2000 | 2500 | 5000;
|
|
68
|
-
export type TValidTimeDuration = TimeDuration | TPredefinedTimeDuration;
|
|
69
|
-
type TAllowedTimeDuration = TValidTimeDuration | number;
|
|
70
|
-
export declare function isAllowedTimeDuration(t: unknown): t is TAllowedTimeDuration;
|
|
71
|
-
export default TimeDuration;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TPositiveNumber } from "../utils/_index";
|
|
2
|
-
import TimeDuration from "./TimeDuration";
|
|
3
|
-
export default class TimeFrequency {
|
|
4
|
-
readonly times: TPositiveNumber;
|
|
5
|
-
readonly period: TimeDuration;
|
|
6
|
-
constructor(times: TPositiveNumber, period: TimeDuration);
|
|
7
|
-
get frequency(): TimeDuration;
|
|
8
|
-
static onceEvery(period: TimeDuration): TimeFrequency;
|
|
9
|
-
static twiceEvery(period: TimeDuration): TimeFrequency;
|
|
10
|
-
}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { ICancelable, ICancelablePromise } from "../async/Deferred.js";
|
|
2
|
-
import { TComparisonResult } from "../sorting/_index.js";
|
|
3
|
-
import TimeBase from "./TimeBase";
|
|
4
|
-
import TimeDuration from "./TimeDuration";
|
|
5
|
-
import { TTimeInstantBuilder, TTimeInstantCreationParameters, type TTimeInstantParameters } from "./TimeInstantBuilder.js";
|
|
6
|
-
import { TimeUnit } from "./TimeUnit";
|
|
7
|
-
import { TIso8601DateUtcString, TWeekNumber } from "./types";
|
|
8
|
-
export declare class TimeInstant extends TimeBase<TimeInstant> {
|
|
9
|
-
protected constructor(number: number, unit: TimeUnit);
|
|
10
|
-
protected create(value: number, unit: TimeUnit): TimeInstant;
|
|
11
|
-
addDuration(duration: TimeDuration): TimeInstant;
|
|
12
|
-
removeDuration(duration: TimeDuration): TimeInstant;
|
|
13
|
-
distanceFrom(instant: TimeInstant): TimeDuration;
|
|
14
|
-
distanceFromNow(): TimeDuration;
|
|
15
|
-
distanceFromUnixTimestamp(timestamp: number): TimeDuration;
|
|
16
|
-
timeLeftFrom(instant: TimeInstant): TimeDuration;
|
|
17
|
-
timeLeftFromNow(): TimeDuration;
|
|
18
|
-
distanceFromStartOfDay(): TimeDuration;
|
|
19
|
-
atStartOfDay(): TimeInstant;
|
|
20
|
-
distanceFromEndOfDay(): TimeDuration;
|
|
21
|
-
atEndOfDay(): TimeInstant;
|
|
22
|
-
promise(): Promise<void>;
|
|
23
|
-
cancelablePromise(): ICancelablePromise<void>;
|
|
24
|
-
delay(cb: () => unknown): void;
|
|
25
|
-
cancelableDelay(cb: () => unknown): ICancelable;
|
|
26
|
-
ensureInTheFuture(): void;
|
|
27
|
-
ensureInThePast(): void;
|
|
28
|
-
isToday(): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Formats this instant using the given pattern. The pattern can contain the following tokens:
|
|
31
|
-
*
|
|
32
|
-
* Note: Implementation inspired by the small-date library (https://github.com/robinweser/small-date).
|
|
33
|
-
*
|
|
34
|
-
* | Token | Description | Example |
|
|
35
|
-
* |:------|:--------------------------------|:------------------------------|
|
|
36
|
-
* | D | Weekday, 1 letter | W |
|
|
37
|
-
* | DD | Weekday, 3 letters | Wed |
|
|
38
|
-
* | DDD | Weekday, long | Wednesday |
|
|
39
|
-
* | d | Day of the month, no padding | 3 |
|
|
40
|
-
* | dd | Day of the month, padded to 2 | 03 |
|
|
41
|
-
* | M | Month, numeric | 3 |
|
|
42
|
-
* | MM | Month, 2 digits | 03 |
|
|
43
|
-
* | MMM | Month, 3 letters | Mar |
|
|
44
|
-
* | MMMM | Month, long | March |
|
|
45
|
-
* | y | Year, numeric | 2021 |
|
|
46
|
-
* | yy | Year, 2 digits | 21 |
|
|
47
|
-
* | yyyy | Year, numeric | 2021 |
|
|
48
|
-
* | h | Hours, no padding | 6 |
|
|
49
|
-
* | hh | Hours, padded to 2 | 06 |
|
|
50
|
-
* | H | Hours in 24-format, no padding | 18 |
|
|
51
|
-
* | HH | Hours in 24-format, padded to 2 | 18 |
|
|
52
|
-
* | m | Minutes, no padding | 7 |
|
|
53
|
-
* | m | Minutes, padded to 2 | 07 |
|
|
54
|
-
* | s | Seconds, no padding | 8 |
|
|
55
|
-
* | ss | Seconds, padded to 2 | 08 |
|
|
56
|
-
* | S | Milliseconds, no padding | 9 |
|
|
57
|
-
* | SS | Milliseconds, padded to 2 | 09 |
|
|
58
|
-
* | SSS | Milliseconds, padded to 3 | 009 |
|
|
59
|
-
* | G | Era, narrow | A |
|
|
60
|
-
* | GG | Era, short | AD |
|
|
61
|
-
* | GGG | Era, long | Anno Domino |
|
|
62
|
-
* | Z | Time zone, short | GMT+1 |
|
|
63
|
-
* | ZZ | Time short, long C | entral European Standard Time |
|
|
64
|
-
* | P | Period of the day, narrow | in the morning |
|
|
65
|
-
* | PP | Period of the day, short | in the morning |
|
|
66
|
-
* | PPP | Period of the day, long | in the morning |
|
|
67
|
-
* | a | Meridiem | pm |
|
|
68
|
-
* @param pattern The pattern to use. Refer to the token table above for details.
|
|
69
|
-
* @param config An optional locale and timeZone definition to use during the format.
|
|
70
|
-
* @returns a string, formatted using the given pattern, at the given timeZone with the given locale.
|
|
71
|
-
*/
|
|
72
|
-
format(pattern: string, config?: {
|
|
73
|
-
locale?: string;
|
|
74
|
-
timeZone?: string;
|
|
75
|
-
}): string;
|
|
76
|
-
/**
|
|
77
|
-
* Parses a date string using the given pattern and creates a TimeInstant.
|
|
78
|
-
* This method is the inverse of format() - parsing a formatted string should recreate the original instant.
|
|
79
|
-
*
|
|
80
|
-
* For partial patterns (e.g., time-only or date-only), the missing components are taken from the base instant.
|
|
81
|
-
* For example, parsing "14:30" with base set to yesterday at midnight will result in yesterday at 14:30.
|
|
82
|
-
*
|
|
83
|
-
* Note: Currently performs basic validation (e.g., month 1-12, day 1-31) but does not validate
|
|
84
|
-
* calendar-specific constraints (e.g., February 30th, April 31st). Invalid dates may be
|
|
85
|
-
* normalized by the underlying Date constructor.
|
|
86
|
-
*
|
|
87
|
-
* @param dateString The date string to parse
|
|
88
|
-
* @param pattern The pattern used to parse the string (same tokens as format())
|
|
89
|
-
* @param base The base TimeInstant to use for partial patterns (defaults to now)
|
|
90
|
-
* @param config An optional locale and timeZone definition to use during parsing
|
|
91
|
-
* @returns A TimeInstant parsed from the string
|
|
92
|
-
* @throws Error if the string doesn't match the pattern or contains invalid basic values
|
|
93
|
-
* @todo Add calendar-aware validation to reject dates like February 30th, April 31st
|
|
94
|
-
*/
|
|
95
|
-
static fromString(dateString: string, pattern: string, base?: TimeInstant, config?: {
|
|
96
|
-
locale?: string;
|
|
97
|
-
timeZone?: string;
|
|
98
|
-
}): TimeInstant;
|
|
99
|
-
static parse(dateString: string, pattern: string, config?: {
|
|
100
|
-
locale?: string;
|
|
101
|
-
timeZone?: string;
|
|
102
|
-
}): Partial<TTimeInstantParameters>;
|
|
103
|
-
/**
|
|
104
|
-
* @returns this instant, in ISO 8601 format (eg, 2024-11-01T15:49:22.024Z). The format is meant to always be realiable.
|
|
105
|
-
*/
|
|
106
|
-
asIso8601(): TIso8601DateUtcString;
|
|
107
|
-
/**
|
|
108
|
-
* @returns this instant, in a human readable format, containing both the date and the time. The format COULD change in the future, do NOT use this method for consistent outputs.
|
|
109
|
-
*/
|
|
110
|
-
asHumanTimestamp(): string;
|
|
111
|
-
toUnixTimestamp(): number;
|
|
112
|
-
toDate(): Date;
|
|
113
|
-
toParameters(): TTimeInstantParameters;
|
|
114
|
-
/**
|
|
115
|
-
* @returns true if the instant is in the past, false otherwise
|
|
116
|
-
*/
|
|
117
|
-
isInThePast(): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* @returns true if the instant is in the future, false otherwise
|
|
120
|
-
*/
|
|
121
|
-
isInTheFuture(): boolean;
|
|
122
|
-
isAfter(other: TimeInstant): boolean;
|
|
123
|
-
isBefore(other: TimeInstant): boolean;
|
|
124
|
-
compareTo(other: TimeInstant): TComparisonResult;
|
|
125
|
-
atTime(parameters: Partial<TTimeInstantCreationParameters & {
|
|
126
|
-
year: never;
|
|
127
|
-
month: never;
|
|
128
|
-
date: never;
|
|
129
|
-
}>): TimeInstant;
|
|
130
|
-
atDate(parameters: Partial<TTimeInstantCreationParameters & {
|
|
131
|
-
hours: never;
|
|
132
|
-
minutes: never;
|
|
133
|
-
seconds: never;
|
|
134
|
-
milliseconds: never;
|
|
135
|
-
}>): TimeInstant;
|
|
136
|
-
at(parameters: Partial<TTimeInstantCreationParameters>): TimeInstant;
|
|
137
|
-
isBetween(start: TimeInstant, end: TimeInstant): boolean;
|
|
138
|
-
static fromDate(date: Date): TimeInstant;
|
|
139
|
-
static fromUnixTimestamp(unixTimestamp: number): TimeInstant;
|
|
140
|
-
static fromUnixSeconds(unixSeconds: number): TimeInstant;
|
|
141
|
-
static fromParameters(parameters: Partial<TTimeInstantCreationParameters>, referenceDate?: Date | TimeInstant): TimeInstant;
|
|
142
|
-
static highest(instant1: TimeInstant, instant2: TimeInstant): TimeInstant;
|
|
143
|
-
static lowest(instant1: TimeInstant, instant2: TimeInstant): TimeInstant;
|
|
144
|
-
static builder(): TTimeInstantBuilder;
|
|
145
|
-
static fromIso8601(str: string): TimeInstant;
|
|
146
|
-
/**
|
|
147
|
-
* @deprecated [2025.10.19]: Use fromIso8601 instead.
|
|
148
|
-
*/
|
|
149
|
-
static tryFromIso8601: typeof TimeInstant.fromIso8601;
|
|
150
|
-
static now(): TimeInstant;
|
|
151
|
-
static compare(a: TimeInstant, b: TimeInstant): TComparisonResult;
|
|
152
|
-
roundedToStartOf(unit: TimeUnit): TimeInstant;
|
|
153
|
-
roundedToEndOf(unit: TimeUnit): TimeInstant;
|
|
154
|
-
roundedToNext(unit: TimeUnit, factor?: number): TimeInstant;
|
|
155
|
-
roundedToPrevious(unit: TimeUnit, factor?: number): TimeInstant;
|
|
156
|
-
roundedTo(unit: TimeUnit, factor?: number): TimeInstant;
|
|
157
|
-
/**
|
|
158
|
-
* Returns the week number represented by this instant, according to the ISO 8601 standard.
|
|
159
|
-
* Please note that the instant and the week number could be of two different years, eg the friday 1st january is actually part of week 52 of the previous year.
|
|
160
|
-
*/
|
|
161
|
-
get weekNumber(): {
|
|
162
|
-
weekNumber: TWeekNumber;
|
|
163
|
-
year: number;
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* This method is used to provide a better DX when inspecting a TimeInstant object in DevTools.
|
|
167
|
-
*/
|
|
168
|
-
protected get _time(): string;
|
|
169
|
-
toString(): string;
|
|
170
|
-
static ZERO: TimeInstant;
|
|
171
|
-
static fromJSON(ms: number): TimeInstant;
|
|
172
|
-
}
|
|
173
|
-
export declare function isTimeInstant(x: unknown): x is TimeInstant;
|
|
174
|
-
export default TimeInstant;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { TimeInstant } from "./TimeInstant.js";
|
|
2
|
-
import { TDayOfMonth, THourOfDay, TMillisecondOfSecond, TMinuteOfHour, TMonth, TSecondOfMinute, TUpToTwoDigits, type TMonthName, type TYear } from "./types.js";
|
|
3
|
-
type TRelativeSignum = '+' | '-';
|
|
4
|
-
type TRelativeNumber = `${TRelativeSignum}${TUpToTwoDigits}`;
|
|
5
|
-
export type TTimeInstantParameters = {
|
|
6
|
-
year: TYear;
|
|
7
|
-
month: TMonth;
|
|
8
|
-
date: TDayOfMonth;
|
|
9
|
-
hours: THourOfDay;
|
|
10
|
-
minutes: TMinuteOfHour;
|
|
11
|
-
seconds: TSecondOfMinute;
|
|
12
|
-
milliseconds: TMillisecondOfSecond;
|
|
13
|
-
};
|
|
14
|
-
export type TTimeInstantCreationParameters = {
|
|
15
|
-
year: TTimeInstantParameters["year"] | {
|
|
16
|
-
absolute: TTimeInstantParameters["year"];
|
|
17
|
-
} | TRelativeNumber | {
|
|
18
|
-
relative: number;
|
|
19
|
-
relativeTo: 'now' | TimeInstant;
|
|
20
|
-
} | 'next' | 'last' | 'current' | undefined;
|
|
21
|
-
month: TTimeInstantParameters["month"] | {
|
|
22
|
-
absolute: TTimeInstantParameters["month"];
|
|
23
|
-
} | TMonthName | TRelativeNumber | {
|
|
24
|
-
relative: number;
|
|
25
|
-
relativeTo: 'now' | TimeInstant;
|
|
26
|
-
} | 'next' | 'last' | 'current' | undefined;
|
|
27
|
-
date: TTimeInstantParameters["date"] | {
|
|
28
|
-
absolute: TTimeInstantParameters["date"];
|
|
29
|
-
} | TRelativeNumber | {
|
|
30
|
-
relative: number;
|
|
31
|
-
relativeTo: 'now' | TimeInstant;
|
|
32
|
-
} | 'next' | 'last' | 'current' | undefined;
|
|
33
|
-
hours: TTimeInstantParameters["hours"] | {
|
|
34
|
-
absolute: TTimeInstantParameters["hours"];
|
|
35
|
-
} | TRelativeNumber | {
|
|
36
|
-
relative: number;
|
|
37
|
-
relativeTo: 'now' | TimeInstant;
|
|
38
|
-
} | 'next' | 'last' | 'current' | undefined;
|
|
39
|
-
minutes: TTimeInstantParameters["minutes"] | {
|
|
40
|
-
absolute: TTimeInstantParameters["minutes"];
|
|
41
|
-
} | TRelativeNumber | {
|
|
42
|
-
relative: number;
|
|
43
|
-
relativeTo: 'now' | TimeInstant;
|
|
44
|
-
} | 'next' | 'last' | 'current' | undefined;
|
|
45
|
-
seconds: TTimeInstantParameters["seconds"] | {
|
|
46
|
-
absolute: TTimeInstantParameters["seconds"];
|
|
47
|
-
} | TRelativeNumber | {
|
|
48
|
-
relative: number;
|
|
49
|
-
relativeTo: 'now' | TimeInstant;
|
|
50
|
-
} | 'next' | 'last' | 'current' | undefined;
|
|
51
|
-
milliseconds: TTimeInstantParameters["milliseconds"] | {
|
|
52
|
-
absolute: TTimeInstantParameters["milliseconds"];
|
|
53
|
-
} | TRelativeNumber | {
|
|
54
|
-
relative: number;
|
|
55
|
-
relativeTo: 'now' | TimeInstant;
|
|
56
|
-
} | 'next' | 'last' | 'current' | undefined;
|
|
57
|
-
};
|
|
58
|
-
export declare function createTimeInstantFromParameters(aParameters: Partial<TTimeInstantCreationParameters>, aReferenceDate?: TimeInstant | Date): TimeInstant;
|
|
59
|
-
export declare function timeInstantBuilder(): {
|
|
60
|
-
year: (x: TTimeInstantCreationParameters["year"]) => /*elided*/ any;
|
|
61
|
-
month: (x: TTimeInstantCreationParameters["month"]) => /*elided*/ any;
|
|
62
|
-
date: (x: TTimeInstantCreationParameters["date"]) => /*elided*/ any;
|
|
63
|
-
hours: (x: TTimeInstantCreationParameters["hours"]) => /*elided*/ any;
|
|
64
|
-
minutes: (x: TTimeInstantCreationParameters["minutes"]) => /*elided*/ any;
|
|
65
|
-
seconds: (x: TTimeInstantCreationParameters["seconds"]) => /*elided*/ any;
|
|
66
|
-
milliseconds: (x: TTimeInstantCreationParameters["milliseconds"]) => /*elided*/ any;
|
|
67
|
-
values: (x: Partial<TTimeInstantCreationParameters>) => /*elided*/ any;
|
|
68
|
-
relativeTo: (x: TimeInstant | Date) => /*elided*/ any;
|
|
69
|
-
build: () => TimeInstant;
|
|
70
|
-
};
|
|
71
|
-
export type TTimeInstantBuilder = ReturnType<typeof timeInstantBuilder>;
|
|
72
|
-
export {};
|
package/dist/time/TimeRange.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { TimeDuration } from "./_index.js";
|
|
2
|
-
import TimeInstant from "./TimeInstant.js";
|
|
3
|
-
export declare class TimeRange {
|
|
4
|
-
readonly start: TimeInstant;
|
|
5
|
-
readonly duration: TimeDuration;
|
|
6
|
-
readonly end: TimeInstant;
|
|
7
|
-
protected constructor(start: TimeInstant, duration: TimeDuration);
|
|
8
|
-
static fromInstants(a: TimeInstant, b: TimeInstant): TimeRange;
|
|
9
|
-
static fromInstantWithDuration(a: TimeInstant, d: TimeDuration): TimeRange;
|
|
10
|
-
static fromNowWithDuration(d: TimeDuration): TimeRange;
|
|
11
|
-
}
|