Skip to content
D
Documentation

interfaces s–v

reference
4 min readUpdated

Import these from @grafloria/renderer.

Interfaces

SelectPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Select (dropdown) property definition with options

ts
interface SelectPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'select'Editor type to use for this property
optionsSelectOption[]
validation?{ required?: boolean; }Validation rules for this property

Example

typescript
const prop: SelectPropertyDefinition = {
  key: 'nodeType',
  label: 'Node Type',
  editor: 'select',
  options: [
    { value: 'table', label: 'Table' },
    { value: 'view', label: 'View' },
    { value: 'procedure', label: 'Stored Procedure', disabled: true }
  ],
  validation: { required: true }
};

SemanticPalette

The host's semantic colour vocabulary (see {@link Theme.categories}). Open-ended: the built-in themes ship the names below, and callers add theirs.

ts
interface SemanticPalette

Properties

NameTypeDefaultDescription
critical?stringBlocking / fatal — the strongest attention colour.
warning?stringNon-blocking problem.
success?stringHealthy / passing.
info?stringNeutral information.
neutral?stringDe-emphasised / inactive.
accent?stringThe host's brand accent.

SliderPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Slider (range) property definition

ts
interface SliderPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'slider'Editor type to use for this property
minnumber
maxnumber
step?number
defaultValue?numberDefault value if property is not set

Example

typescript
const prop: SliderPropertyDefinition = {
  key: 'opacity',
  label: 'Opacity',
  editor: 'slider',
  min: 0,
  max: 100,
  step: 1,
  defaultValue: 100
};

Spacing

Spacing theme (in pixels)

ts
interface Spacing

Properties

NameTypeDefaultDescription
xsnumber
smnumber
mdnumber
lgnumber
xlnumber

StringPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

String property definition with string-specific validation

ts
interface StringPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'string'Editor type to use for this property
validation?{ required?: boolean; minLength?: number; maxLength?: number; pattern?: string; }Validation rules for this property

Example

typescript
const prop: StringPropertyDefinition = {
  key: 'tableName',
  label: 'Table Name',
  editor: 'string',
  validation: {
    required: true,
    minLength: 3,
    maxLength: 50,
    pattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
  }
};

TextAreaPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Textarea (multi-line text) property definition

ts
interface TextAreaPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'textarea'Editor type to use for this property
validation?{ required?: boolean; minLength?: number; maxLength?: number; }Validation rules for this property

Example

typescript
const prop: TextAreaPropertyDefinition = {
  key: 'description',
  label: 'Description',
  editor: 'textarea',
  validation: {
    maxLength: 500
  }
};

TextMetrics

Text measurement result.

ts
interface TextMetrics

Properties

NameTypeDefaultDescription
widthnumber
heightnumber
baselinenumber

TextStyle

Text styling for measurement.

ts
interface TextStyle

Properties

NameTypeDefaultDescription
fontFamily?string
fontSize?number
fontWeight?string | number
fontStyle?string
letterSpacing?number
lineHeight?number

Theme

Complete theme definition Supports both CSS Variables (SVG+HTML) and Programmatic (Canvas)

ts
interface Theme

Properties

NameTypeDefaultDescription
namestringTheme name (e.g., "Light", "Dark", "High Contrast")
versionstringTheme version
colorsColorPaletteColor palette
typographyTypographyTypography settings
spacingSpacingSpacing scale
effectsEffectsVisual effects (shadows, border radius, opacity)
nodes{ default: NodeStyleTheme; [nodeType: string]: Partial<NodeStyleTheme>; }Node type defaults - default: Base styles for all nodes - [nodeType]: Type-specific overrides
links{ default: LinkStyleTheme; [linkType: string]: Partial<LinkStyleTheme>; }Link type defaults - default: Base styles for all links - [linkType]: Type-specific overrides
portsPortThemeConfigPort configuration
categories?SemanticPaletteSEMANTIC / CATEGORY PALETTE — the caller's OWN vocabulary of colours.
numbers?NumberScaleNAMED NUMERIC SCALE — the numeric analogue of {@link categories}.

Typography

Typography theme

ts
interface Typography

Properties

NameTypeDefaultDescription
fontFamily{ default: string; mono: string; }Font families
fontSize{ xs: number; sm: number; md: number; lg: number; xl: number; }Font sizes (in pixels)
fontWeight{ normal: number; medium: number; bold: number; }Font weights
lineHeight{ tight: number; normal: number; relaxed: number; }Line heights

ValidationError

Validation error returned from validation functions

ts
interface ValidationError

Properties

NameTypeDefaultDescription
messagestringHuman-readable error message
code?stringOptional error code for programmatic handling

Example

typescript
const error: ValidationError = {
  message: 'Value must be positive',
  code: 'POSITIVE_VALUE_REQUIRED'
};

ValidationResult

Result of running validation on a property value

ts
interface ValidationResult

Properties

NameTypeDefaultDescription
validbooleanWhether the value is valid
errorsValidationError[]Array of validation errors (empty if valid)

Example

typescript
const result: ValidationResult = {
  valid: false,
  errors: [{ message: 'Required field is missing' }]
};

VNode

Virtual Node - Abstract representation of visual element Framework-agnostic, serializable, diffable

Supports both SVG and Canvas rendering modes, as well as HTML content via foreignObject for embedding rich components.

ts
interface VNode

Properties

NameTypeDefaultDescription
typeVNodeTypeElement type: 'svg', 'g', 'rect', 'circle', 'path', 'text', 'foreignObject', etc.
propsVNodePropsElement properties (attributes, styles, event handlers)
children?VNode[]Optional children VNodes (for hierarchical structures)
key?stringOptional unique key for diffing optimization Used by renderers to efficiently update only changed nodes

Was this page helpful?

interfaces s–v — Grafloria