Reference

Types and Enums

Key Telva type model documents, shapes, assets, export types, and settings enums.

Types and Enums

This page summarizes the most important type contracts in telva.

Document model

interface TVDocument {
  id: string
  name: string
  version: number
  pages: Record<string, TVPage>
  pageStates: Record<string, TLPageState>
  assets: TVAssets
}

Shape union

TVShape includes:

  • RectangleShape
  • EllipseShape
  • TriangleShape
  • DrawShape
  • ArrowShape
  • TextShape
  • GroupShape
  • StickyShape
  • ImageShape
  • VideoShape
  • ReactComponentShape
  • PenShape

Shape type discriminator is TVShapeType:

enum TVShapeType {
  Sticky = 'sticky',
  Ellipse = 'ellipse',
  Rectangle = 'rectangle',
  Triangle = 'triangle',
  Draw = 'draw',
  Arrow = 'arrow',
  Line = 'line',
  Text = 'text',
  Group = 'group',
  Image = 'image',
  Video = 'video',
  ReactComponent = 'reactComponent',
  Pen = 'pen',
}

Style model

ShapeStyles includes base style primitives and rich options:

  • color, size, dash
  • typography (font, textAlign, fontFamily)
  • fill/stroke overrides (fillHex, strokeHex, opacity)
  • geometry hints (borderRadius, strokeWidthOverride, scale)
  • gradients (gradient, textGradient)

Assets

type TVAsset = TVImageAsset | TVVideoAsset
type TVAssets = Record<string, TVAsset>

Asset type enum:

enum TVAssetType {
  Image = 'image',
  Video = 'video',
}

Export contracts

enum TVExportType {
  PNG = 'png',
  JPG = 'jpeg',
  WEBP = 'webp',
  SVG = 'svg',
  JSON = 'json',
}

interface TVExport {
  name: string
  type: string
  blob: Blob
}

Background strategy enum:

enum TVExportBackground {
  Transparent = 'transparent',
  Auto = 'auto',
  Light = 'light',
  Dark = 'dark',
}

Presence and status

Presence user status:

enum TVUserStatus {
  Idle = 'idle',
  Connecting = 'connecting',
  Connected = 'connected',
  Disconnected = 'disconnected',
}

Editor status machine values are represented by TVStatus (for example idle, translating, transforming, pinching, brushing, editing-text).

On this page