G-code Preview — API Reference
    Preparing search index...
    interface GcodePreviewState {
        activeQuality: QualityMode | null;
        availableColorModes: (
            | "object"
            | "single"
            | "tool"
            | "feature"
            | "colorChange"
            | "filament"
            | "feedrate"
            | "layerHeight"
            | "power"
            | "moveKind"
        )[];
        disclosure: string;
        error: { code: string; message: string }
        | null;
        hasColorChanges: boolean;
        hasRetractions: boolean;
        layerCount: number;
        metadata: DialectMetadata | undefined;
        parseProgress: ParseProgress | null;
        parsing: boolean;
        presentation: ProgressPresentationMode;
        segmentCount: number;
        summary:
            | {
                capabilities: Record<string, Confidence>;
                complete: boolean;
                layers: number;
                segments: number;
                stopReason: string | undefined;
                warnings: number;
            }
            | null;
        timeEstimateSource: "slicer"
        | "kinematic"
        | null;
        totalTimeMs: number | null;
    }
    Index
    activeQuality: QualityMode | null
    availableColorModes: (
        | "object"
        | "single"
        | "tool"
        | "feature"
        | "colorChange"
        | "filament"
        | "feedrate"
        | "layerHeight"
        | "power"
        | "moveKind"
    )[]

    Which color modes the current file can actually support (DD-031 G6) — the capability-aware list a consumer UI should offer, so it can gray out (and explain) the rest rather than fabricating colors. Empty before a parse / before the renderer is ready. single/tool/moveKind are always present.

    disclosure: string

    User-presentable decimation/travel disclosure (empty when rendering everything).

    error: { code: string; message: string } | null
    hasColorChanges: boolean

    True when the current file carries M600 color-change boundaries (DD-031 G6).

    hasRetractions: boolean

    True when the current file carries retraction/deretraction events the markers can show (DD-031 G6).

    layerCount: number
    metadata: DialectMetadata | undefined
    parseProgress: ParseProgress | null
    parsing: boolean
    segmentCount: number
    summary:
        | {
            capabilities: Record<string, Confidence>;
            complete: boolean;
            layers: number;
            segments: number;
            stopReason: string | undefined;
            warnings: number;
        }
        | null

    Summary of the last successful parse — plain numbers/strings, never typed arrays.

    timeEstimateSource: "slicer" | "kinematic" | null
    totalTimeMs: number | null

    Estimated total print time in ms (#181), or null before a parse. timeEstimateSource says whether it's the slicer's own estimate ('slicer', trustworthy) or a kinematic approximation ('kinematic', constant-velocity, slightly low — disclose when shown).