g3-toolkit API Reference
    Preparing search index...

    Interface ShaclShapeBrowserProps

    interface ShaclShapeBrowserProps {
        className?: string;
        onSelectShape?(shapeId: string | null): void;
        selectedShape?: string | null;
        shapes: ShaclShape[];
        summary?: Record<string, ShaclShapeSummary>;
        validationResults: ShaclValidationResult[];
    }
    Index

    Properties

    className?: string
    selectedShape?: string | null

    Controlled selection: the shape to show as selected and expanded (a deep link, for instance). null means none. When this prop is present the browser never keeps its own expanded state; pass onSelectShape and feed the id back. Absent, the browser is uncontrolled, as before.

    shapes: ShaclShape[]
    summary?: Record<string, ShaclShapeSummary>

    Per-shape totals keyed by shape id. When a shape has an entry it takes precedence over counting validationResults, so a host with an aggregated report need not invent one placeholder result per passing focus node to get the totals right.

    validationResults: ShaclValidationResult[]

    Methods

    • Called when the user picks (or, controlled, collapses) a shape. Uncontrolled: fires with the id on expand only, the original contract. Controlled: also fires with null when the selected shape is collapsed, so the host can clear its state.

      Declared as a method signature on purpose: method parameters are bivariant under strictFunctionTypes, so a host that typed its handler as (id: string) => void before null existed keeps compiling. Uncontrolled hosts never receive null.

      Parameters

      • shapeId: string | null

      Returns void