Skip to content

Commit 9370d1b

Browse files
docs(core): update docstrings (time provider)
1 parent 68862c6 commit 9370d1b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

packages/core/src/api.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ export type Maybe<T> = T | undefined;
3939
* function returns false, the animation loop will be stopped (via
4040
* {@link GenArtAPI.stop}), otherwise the loop continues until stopped
4141
* explicitly.
42+
*
43+
* @remarks
44+
* Arguments are information sourced from {@link TimeProvider.now}.
45+
*
46+
* @param time
47+
* @param frame
4248
*/
4349
export type UpdateFn = (time: number, frame: number) => boolean;
4450

packages/core/src/api/time.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ export interface TimeProvider {
1717
*/
1818
next(fn: (time: number, frame: number) => void): void;
1919
/**
20-
* Returns tuple of current `[time, frame]` (where `time` is in
21-
* milliseconds and `frame` the current frame number)
20+
* Returns tuple of current `[time, frame]` (where `time` is the current
21+
* frame's number of milliseconds since start and `frame` the current frame
22+
* number).
23+
*
24+
* @remarks
25+
* Function is idempotent when called during a single frame update. Can also
26+
* be called via `$genart.timeProvider.now()`.
2227
*/
2328
now(): [number, number];
2429
}

0 commit comments

Comments
 (0)