The canonical TypeScript types for the .gui format — colors, fills, tokens, dimensions, effects, shapes — exported from the @dotgui/kit root with zero runtime code.

@dotgui/kit

typesthe format vocabulary

The root export is only the format’s canonical TypeScript types — the shared vocabulary every other module and every consumer builds on. Behaviour lives in the subpaths, so importing the types pulls in no runtime code.

These are the value kinds the format speaks in: colors and fills, token references, dimensions, blend modes, layout directions, effects, shapes, borders, and image formats.

Signature

import type {
  ColorValue, FillValue, GradientValue, TokenRef,
  DimensionValue, BlendMode, LayoutDirection,
  EffectType, ShapeType, BorderStyle, ImageFormat,
} from '@dotgui/kit'

Use cases

  • Type your own tooling against the format vocabulary.
  • Shared, versioned types across parser, render, score, and package.

Type your tooling against the format

import type { ColorValue, FillValue, TokenRef } from '@dotgui/kit'

function resolveFill(fill: FillValue, tokens: Record<string, ColorValue>) {
  // fill can be a hex ColorValue, a gradient, or a $token TokenRef
  return typeof fill === 'string' && fill.startsWith('$')
    ? tokens[(fill as TokenRef).slice(1)]
    : fill
}