/** * Enum representing the different states of a Stream. */ export declare enum StreamState { Playing = "Playing", Paused = "Paused", Ended = "Ended" } /** * Interface defining the basic functionality of a Stream. * Streams are typically associated with media playback, such as audio or animation. */ export interface Stream { /** * Starts or resumes playback of the Stream. * * @param opts Optional playback options to customize behavior. */ play(opts?: PlayOptions): void; /** * Pauses playback of the Stream. */ pause(): void; /** * Seeks to a specific time within the Stream. * * @param t The time (in milliseconds) to seek to. */ seek(t: number): void; /** * Stops playback of the Stream and resets its position. */ stop(): void; /** * Optionally defines a method to get the length of the Stream. * * @returns The length of the Stream in milliseconds. */ length?: () => number | undefined; /** * Optionally defines a method to check if the Stream is currently stalled. * * @returns True if the Stream is stalled, false otherwise. */ isStalled?: () => boolean; } /** * Interface defining options for playing a Stream. */ export interface PlayOptions { /** * Speed multiplier for playback. A value of 1 plays at normal speed. */ speed?: number; /** * Whether the Stream should loop when it reaches the end. */ loop?: boolean; }