@ocdla/timer
v0.2.5
Published
Create text files; add content and headings to text files.
Downloads
3
Keywords
Readme
��## Links Controller Links Main
Timer
Represents a Timer with countdown functionality.
Versions
Version 0.2.0
removed several exports now just exporting one Timer no longer renders itself providing a new ontick method
Version 0.2.1
forgot to add changelog
Version 0.2.3
Changes to file path, now it is using path resolves in the project. General clean up of unwanted comments
Version 0.2.4
modified path spec to go from the @ocdla file located in node_modules
Version 0.2.5
Added new Component to display query
Kind: global class
- Timer
- instance
- static
- .convertTimer(sec) ��� Array.<number>
- .padTimer(number) ��� string
- .parse(seconds, pad) ��� Array.<string>
- .toSeconds(hours, minutes, seconds) ��� number
timer.g
The generator used to display units (usually seconds) for this timer.
Kind: instance property of Timer
timer.interval : number
Rederce to the interval used for timer updates
Kind: instance property of Timer
timer.callbacks
Array to store csllback functions
Kind: instance property of Timer
timer.start()
Start the timer and trigger tick function at specified intervals.
Kind: instance method of Timer
timer.stop()
Stop the timer.
Kind: instance method of Timer
timer.tick(seconds)
Execute callback functions with the current time values.
Kind: instance method of Timer
| Param | Type | Description | | --- | --- | --- | | seconds | number | The remaining seconds on the timer. |
timer.onTick(fn)
Register a callback function to be executed on each tick.
Kind: instance method of Timer
| Param | Type | Description | | --- | --- | --- | | fn | function | The callback function to be executed. |
Timer.convertTimer(sec) ��� Array.<number>
Convert total seconds into hours, minutes, and seconds.
Kind: static method of Timer
Returns: Array.<number> - - An array containing hours, minutes, and seconds.
| Param | Type | Description | | --- | --- | --- | | sec | number | The total seconds to convert. |
Timer.padTimer(number) ��� string
Pad a number with a leading zero if it is less than 10.
Kind: static method of Timer
Returns: string - - The padded number as a string.
| Param | Type | Description | | --- | --- | --- | | number | number | The number to pad. |
Timer.parse(seconds, pad) ��� Array.<string>
Parse total seconds into hours, minutes, and seconds.
Kind: static method of Timer
Returns: Array.<string> - - An array containing hour, minute, and second strings.
| Param | Type | Default | Description | | --- | --- | --- | --- | | seconds | number | | The total seconds to parse. | | pad | boolean | true | Whether to pad the values with zeros. |
Timer.toSeconds(hours, minutes, seconds) ��� number
Convert hours, minutes, and seconds into total seconds.
Kind: static method of Timer
Returns: number - - The total seconds equivalent.
| Param | Type | Description | | --- | --- | --- | | hours | number | The hours component. | | minutes | number | The minutes component. | | seconds | number | The seconds component. |