variable / @typed/template/RenderQueue

RenderPriority

Defines priority levels for rendering tasks.

Package version
1.0.0-beta.13
Category
Render priorities
Since
1.0.0

Import

import { RenderPriority } from "@typed/template/RenderQueue";

Signatures

export declare const RenderPriority: {
    readonly Sync: -1;
    readonly Raf: (priority: number) => number;
    readonly Idle: (priority: number) => number;
};

Why

A compact numeric protocol lets directives and renderer extensions select scheduling without importing concrete queue classes.

Ownership and lifetime

Priority values are immutable numbers and own no work.

Property: Idle

Scheduled via requestIdleCallback.

Property: Idle: Why

Places background work after the frame-priority range.

Property: Idle: Ownership and lifetime

Purely computes a number and schedules nothing.

Property: Raf

Scheduled via requestAnimationFrame.

Property: Raf: Why

Maps visual urgency into the queue’s bounded frame-priority range.

Property: Raf: Ownership and lifetime

Purely computes a number and schedules nothing.

Property: Sync

Immediate, synchronous execution.

Property: Sync: Why

Selects the current call stack for urgent or deterministic updates.

Property: Sync: Ownership and lifetime

The number owns no task.

Examples

import { RenderPriority } from "@typed/template/RenderQueue"

// Synchronous execution (highest priority)
const syncPriority = RenderPriority.Sync

// RequestAnimationFrame priority (0-10)
const rafPriority = RenderPriority.Raf(5)

// Idle callback priority (lowest priority)
const idlePriority = RenderPriority.Idle(1)

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source