G-code Preview — API Reference
    Preparing search index...
    RendererEvent:
        | { chunksBuilt: number; chunksTotal: number; type: "buildProgress" }
        | {
            detail?: { built: number; total: number };
            progress?: number;
            stage: PreparationStage;
            type: "stage";
        }
        | {
            mode: ProgressPresentationMode;
            reason?: string;
            type: "progress-presentation-changed";
        }
        | {
            decimationApplied: number;
            quality: QualityMode;
            segments: number;
            travelHidden: boolean;
            type: "buildComplete";
        }
        | {
            from: QualityMode;
            reason: string;
            to: QualityMode;
            type: "qualityFallback";
        }
        | {
            cumulativeSegments: number;
            decimationApplied: number;
            type: "previewAppend";
        }
        | { stats: RenderStats; type: "renderStats" }
        | { type: "contextlost" }
        | { type: "restored" }
        | { state: CameraState; type: "camera-changed" }
        | { code: string; message: string; type: "error" }

    Type declaration

    • { chunksBuilt: number; chunksTotal: number; type: "buildProgress" }
    • {
          detail?: { built: number; total: number };
          progress?: number;
          stage: PreparationStage;
          type: "stage";
      }

      Staged preparation progress (DD-029). progress (0..1) + detail are present for building-geometry; preparing-gpu/ready are momentary (no fraction) in this renderer.

    • {
          mode: ProgressPresentationMode;
          reason?: string;
          type: "progress-presentation-changed";
      }
    • {
          decimationApplied: number;
          quality: QualityMode;
          segments: number;
          travelHidden: boolean;
          type: "buildComplete";
      }
    • { from: QualityMode; reason: string; to: QualityMode; type: "qualityFallback" }
    • { cumulativeSegments: number; decimationApplied: number; type: "previewAppend" }
    • { stats: RenderStats; type: "renderStats" }

      A fresh render-diagnostics snapshot settled (DD-027) — fires at build-complete. parseMs/ totalReadyMs are null here; core fills them when it re-emits.

    • { type: "contextlost" }
    • { type: "restored" }
    • { state: CameraState; type: "camera-changed" }

      The camera settled after a user interaction (orbit/pan/zoom/key) — carries the new serializable state so a consumer can persist "where the user was looking" (#275/M6). Programmatic setView / setCameraState do NOT emit this (they are consumer-driven already), so a bound prop can't loop.

    • { code: string; message: string; type: "error" }