diff options
author | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2019-10-22 16:51:40 -0400 |
---|---|---|
committer | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2019-10-24 10:30:14 -0400 |
commit | 2771cf2a71b3c599125b0ce7bc8d5450ea8998e8 (patch) | |
tree | f0e813bdf3e7c5b956d6557f69fd3b7b1befabae /src | |
parent | 5552de93d539d56ab38d41f1916fc37a4745cd30 (diff) | |
download | liza-2771cf2a71b3c599125b0ce7bc8d5450ea8998e8.tar.gz liza-2771cf2a71b3c599125b0ce7bc8d5450ea8998e8.tar.bz2 liza-2771cf2a71b3c599125b0ce7bc8d5450ea8998e8.zip |
src/types/misc: Add UnixTimestampMillis, Seconds, and Milliseconds
These should be moved into their own module at some point and provide
functions to convert between and to yield these types.
Diffstat (limited to 'src')
-rw-r--r-- | src/types/misc.d.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/types/misc.d.ts b/src/types/misc.d.ts index 83b11b5..5572739 100644 --- a/src/types/misc.d.ts +++ b/src/types/misc.d.ts @@ -38,12 +38,24 @@ type NominalType<K, T> = K & { __nominal_type__: T }; +/** Unit of time in seconds */ +type Seconds = NominalType<number, 'Seconds'>; + + /** * Unix timestamp * * Number of seconds since the Unix epoch (1970-01-01 UTC). */ -type UnixTimestamp = NominalType<number, 'UnixTimestamp'>; +type UnixTimestamp = NominalType<Seconds, 'UnixTimestamp'>; + + +/** Unit of time in milliseconds */ +type Milliseconds = NominalType<number, 'Milliseconds'>; + + +/** Unix timestamp represented in milliseconds */ +type UnixTimestampMillis = NominalType<Milliseconds, 'UnixTimestampMillis'>; /** |