Ƭ TimeParams: { after?: undefined | number ; before?: undefined | number }
Defined in src/types.ts:1
Name | Type |
---|---|
after? |
undefined | number |
before? |
undefined | number |
Ƭ TimespanParams: TimeParams & { bounds: number[] }
Defined in src/types.ts:6
▸ farFuture({ after: undefined | number ; before: undefined | number }): number
Defined in src/index.ts:81
Returns a number that is higher than before
but lower than after
representing a time in the near future (seconds to minutes).
throws
BadBoundsError if passed invalid bounds
Name | Type | Default value |
---|---|---|
(destructured) |
{ after: undefined | number ; before: undefined | number } | {} |
Returns: number
▸ farPast({ after: undefined | number ; before: undefined | number }): number
Defined in src/index.ts:44
Returns a number that is higher than before
but lower than after
representing a time in the distant past (months to decades).
throws
BadBoundsError if passed invalid bounds
Name | Type | Default value |
---|---|---|
(destructured) |
{ after: undefined | number ; before: undefined | number } | {} |
Returns: number
▸ fromTimespan({ after: undefined | number ; before: undefined | number ; bounds: number[] }): number
Defined in src/index.ts:22
Returns a number between bounds[0] and bounds[1] (inclusive) that is higher
than before
but lower than after
.
throws
BadBoundsError if passed invalid bounds
Name | Type |
---|---|
(destructured) |
{ after: undefined | number ; before: undefined | number ; bounds: number[] } |
Returns: number
▸ nearFuture({ after: undefined | number ; before: undefined | number }): number
Defined in src/index.ts:71
Returns a number that is higher than before
but lower than after
representing a time in the distant future (months to decades).
throws
BadBoundsError if passed invalid bounds
Name | Type | Default value |
---|---|---|
(destructured) |
{ after: undefined | number ; before: undefined | number } | {} |
Returns: number
▸ nearPast({ after: undefined | number ; before: undefined | number }): number
Defined in src/index.ts:54
Returns a number that is higher than before
but lower than after
representing a time in the near past (seconds to minutes).
throws
BadBoundsError if passed invalid bounds
Name | Type | Default value |
---|---|---|
(destructured) |
{ after: undefined | number ; before: undefined | number } | {} |
Returns: number
▸ present(): number
Defined in src/index.ts:61
Returns Date.now()
Returns: number