master
AdityaAngajala
v0.13.0
12542ed
import type { EnvironmentStatus } from '../3DViewer/SceneBuilder';
/** An actionable finding in the ready report. */
export interface ViewerHint {
code: string;
level: 'info' | 'warning' | 'error';
message: string;
action?: string;
data?: Record<string, unknown>;
}
/**
* What the viewer knows once its first scene is up (adom/adom-3d-viewer#5).
* A consumer in a sandboxed frame cannot tell "painted" from "stuck behind
* the overlay" by counting meshes; this says it outright, with hints that
* name the fix.
*/
export interface ViewerReadyReport {
/** True when the scene rendered, the overlay is gone, the environment is
* ready (or deliberately absent), no CSP violation was recorded and any
* requested model loaded with geometry. */
ok: boolean;
/** True once the viewer is destroyed. A viewer destroyed before its
* scene was ready settles whenReady() with this set. */
destroyed: boolean;
engine: { webglVersion: number; contextLost: boolean };
environment: EnvironmentStatus;
camera: { ready: boolean; mode: 'perspective' | 'orthographic' };
storage: 'persistent' | 'ephemeral';
loadingOverlay: 'hidden' | 'visible';
model: { requested: boolean; loaded: boolean; meshes: number; vertices: number; error: string | null };
cspViolations: { directive: string; blocked: string }[];
hints: ViewerHint[];
}