Time span contract enabling interoperability with external duration/time libraries.
Provides a standard way to convert any duration representation to milliseconds.
Allows this library to work with external time libraries without direct dependencies:
Luxon Duration objects
Dayjs Duration objects
Custom time representation objects
Standard JavaScript Date differences
Implementers need only provide one method: convert their duration format to milliseconds.
Usage:
Implement ITimeSpan on your duration class by computing the TO_MILLISECONDS method
Pass instances to any daiso-core function accepting ITimeSpan
The library will call the method to get millisecond values for duration calculations
Time span contract enabling interoperability with external duration/time libraries. Provides a standard way to convert any duration representation to milliseconds.
Allows this library to work with external time libraries without direct dependencies:
Implementers need only provide one method: convert their duration format to milliseconds.
Usage:
IMPORT_PATH:
"@daiso-tech/core/time-span/contracts"