The renderer contract names what a renderer does, by role

ROLES sorts every member of PORTS into one of six roles: the Earth (streaming
and building the globe from map sources), scene contents, camera and input,
world queries, the look, and the host and frame loop. The ports follow the
API's shape; the roles say what the engine behind them does, and that the app
keeps the data while the renderer owns everything from a source spec or a
draw set down to the pixels. roleOf resolves a member to its role, the most
specific entry winning. No member changes; a test keeps every member in
exactly one role and every entry naming a real member.
This commit is contained in:
Sameh Khamis committed 2026-11-11 13:36:06 -08:00
1 parent 1f307e0735
commit 21fdc6a332
3 files changed
+132

No files matched your search

+18
View File
@@ -28,6 +28,24 @@ export type PortDescriptor = Readonly<
/** Every port's members, by port name. */
export declare const PORTS: Readonly<Record<string, PortDescriptor>>;
/** One of the roles a renderer plays, and the members that make it up. */
export interface ContractRole {
readonly id: 'surface' | 'scene' | 'view' | 'queries' | 'look' | 'host';
readonly title: string;
readonly summary: string;
/** `port` or `port.member`; the most specific entry wins. */
readonly members: readonly string[];
}
/** What a renderer does, by role: every member of {@link PORTS} in one. */
export declare const ROLES: readonly ContractRole[];
/** The role of `port`'s `member` (dotted), or undefined. */
export declare function roleOf(
port: string,
member: string,
): ContractRole['id'] | undefined;
/** Every quality setting a renderer may support. */
export declare const QUALITY_KEYS: readonly import('./quality').QualityKey[];