API

Interface FgPendingTask

One outstanding async task (a delay, an animation). The unique token enables precise cancellation and lets a block own several tasks at once.

interface FgPendingTask {
    blockId: string;
    canceled: boolean;
    done: boolean;
    state: Record<string, unknown>;
    token: number;
}
Index
blockId: string
canceled: boolean
done: boolean

Set by a def's onTick when the task has finished; compacted out after the frame's pending loop.

state: Record<string, unknown>

Task-local state (e.g. remainingMs, delayIndex, animation handle).

token: number

Unique per task; a block may own several concurrently.