Skip to content

LayoutDiagnostic and layoutDiagnostic

Read as Markdown

import { LayoutDiagnostic, layoutDiagnostic } from "@pibbl/core";

LayoutDiagnostic is the runtime error class for contextual layout failures. layoutDiagnostic(input) constructs the same error. Both expose component, property, supplied value, algorithm, and optional constraints, preserving a useful diagnostic when public geometry or style validation fails.

throw layoutDiagnostic({
property: "width",
value: -1,
reason: "must be nonnegative",
});

Its LayoutDiagnosticInput and LayoutDiagnosticContext types belong to the Layout type reference.

A layout validation error carrying the affected property and component context.

class LayoutDiagnostic extends Error

Related API: LayoutDiagnostic.

layoutDiagnostic

View source — packages/core/src/lib/style/diagnostics.ts:51

component
readonly component: string

Component identity or diagnostic name associated with this value. See LayoutDiagnostic .

View source — packages/core/src/lib/style/diagnostics.ts:56

property
readonly property: string

Name of the affected input property. See LayoutDiagnostic.

View source — packages/core/src/lib/style/diagnostics.ts:58

suppliedValue
readonly suppliedValue: unknown

The original value that failed validation. See LayoutDiagnostic.

View source — packages/core/src/lib/style/diagnostics.ts:60

algorithm
readonly algorithm: string

Name of the layout algorithm producing this diagnostic or resolution. See LayoutDiagnostic.

View source — packages/core/src/lib/style/diagnostics.ts:65

constraints
readonly constraints: Readonly<Constraints> | undefined

Related API: Constraints.

Sizing limits and available dimensions for this operation. See Constraints.

View source — packages/core/src/lib/style/diagnostics.ts:67

Creates a structured layout error from a validation failure and its component context.

layoutDiagnostic: (input: LayoutDiagnosticInput) => LayoutDiagnostic

Related API: layoutDiagnostic, LayoutDiagnosticInput, LayoutDiagnostic.

A structured layout diagnostic. See LayoutDiagnostic.

LayoutDiagnosticInput

LayoutDiagnostic

View source — packages/core/src/lib/style/diagnostics.ts:102

Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.