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

    Properties

    activeQuality: null | QualityMode
    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: null | { code: string; message: string }
    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: undefined | DialectMetadata
    parseProgress: null | ParseProgress
    parsing: boolean
    segmentCount: number
    summary:
        | null
        | {
            capabilities: Record<string, Confidence>;
            complete: boolean;
            layers: number;
            segments: number;
            stopReason: undefined | string;
            warnings: number;
        }

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

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

    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).