G-code Preview — API Reference
    Preparing search index...

    @chestnutlabs/gcode-dialects — dialect adapter contracts & registry (DD-005).

    Phase 1 (#73): behavioral contracts, buffered annotation sink, and the composition runner. Built-in vendor adapters arrive in phases 3–5. Depends only on @chestnutlabs/toolpath-core; the parser consumes the runner through its own structural DialectRunnerFactory type (worker entries compose the two — DD-002 §5 boundaries).

    interface DialectAdapter {
        displayName: string;
        id: string;
        kind: "slicer" | "firmware" | "generic";
        detect(input: DetectInput): null | DialectDetection;
        finalize(ir: ToolpathIR, sink: AnnotationSink, config?: unknown): void;
        onCommand(
            event: CommandEvent,
            sink: AnnotationSink,
            config?: unknown,
        ): void;
        onComment(
            comment: string,
            srcByte: number,
            sink: AnnotationSink,
            config?: unknown,
        ): void;
    }
    Index

    Properties

    displayName: string
    id: string
    kind: "slicer" | "firmware" | "generic"

    'slicer' and 'firmware' adapters COMPOSE (amendment 1); one winner per kind.

    Methods

    • Per-adapter serializable configuration (validated by the adapter itself).

      Parameters

      • comment: string
      • srcByte: number
      • sink: AnnotationSink
      • Optionalconfig: unknown

      Returns void