Skip to main content
This page documents the shared TypeScript types that appear in method signatures and return values across the SDK. All types are exported from @abloatai/decks and can be imported directly for use in your own type annotations.
import type {
  CommitReceipt,
  RequestOptions,
  DeckRecord,
  SlideRecord,
  LayerRecord,
  LayoutRecord,
  LayerPosition,
  LayerType,
} from '@abloatai/decks';

CommitReceipt

Every mutating method (create, update, delete) returns a CommitReceipt. It tells you whether the server has durably committed the operation.
id
string
The commit id. Stable across retries with the same idempotencyKey.
status
'queued' | 'confirmed'
The acknowledgement level reached before the call returned. 'confirmed' means the write is durable; 'queued' means the server accepted it but has not yet confirmed durability. Controlled by RequestOptions.wait.
lastSyncId
number
The sync cursor after this commit. Present when status is 'confirmed'. You can use this to wait for a specific sync position in real-time clients.

RequestOptions

Pass RequestOptions as the last argument to any mutating method to control commit behaviour.
wait
'queued' | 'confirmed'
default:"'confirmed'"
The acknowledgement level to wait for before the promise resolves. 'confirmed' (default) waits for a durable write — safe for scripts that must guarantee persistence before exiting. 'queued' returns as soon as the server accepts the operation, reducing latency at the cost of a weaker guarantee.
idempotencyKey
string | null
A unique key for safe retries. If you call the same method twice with the same key, the server returns the original CommitReceipt without creating a duplicate. Pass null to explicitly opt out of idempotency (rare). Omitting the field lets the server assign a key automatically.

DeckRecord

Returned by ablo.decks.retrieve(id).
id
string
The deck’s id.
title
string
The deck’s display title.
layoutId
string | null
The layout container this deck uses for template inheritance. null if no layout container is assigned.
themeId
string | null
The theme applied to this deck. null if using the workspace default.

SlideRecord

Returned by ablo.slides.retrieve(id) and ablo.slides.list({ deckId }).
id
string
The slide’s id.
deckId
string
The deck this slide belongs to.
title
string
The slide’s title.
order
number
Zero-based position in the deck.
templateId
string | null
The SlideLayout id this slide is based on. null for slides without a layout.
notes
string | null
Presenter notes attached to the slide.
settings
SlideCompositionSettings | null
The slide’s canvas settings (background, size, grid, layout exclusions). null if all defaults apply.

LayerRecord

Returned by ablo.layers.retrieve(id) and ablo.layers.list({ slideId }).
id
string
The layer’s id.
slideId
string
The slide this layer belongs to.
type
LayerType
The layer’s type — 'text', 'shape', 'icon', 'path', 'table', or 'chart'.
position
LayerPosition
Geometry in 1920×1080 slide space.
data
unknown
Type-specific payload. Charts store { chartDocument }, tables store TableData, shapes store { shapeType, ... }.
contentJson
unknown
Rich text content for text-bearing layers. null for non-text types.
style
Record<string, unknown> | null
Compiled style object (effects: opacity, corner radius, shadows).
zIndex
number
Stacking order within the slide. Higher values render on top.
visible
boolean
Whether the layer renders.
imageFill
LayerImageFill | null
Image fill applied to a shape layer. Contains url, optional objectFit, and optional intrinsic width/height.
metadata
LayerCompositionMetadata | null
AI brief and placeholder metadata. Present on layout placeholder layers and layers with prompt/examples set.
layoutLayerId
string | null
When this is a filled placeholder layer, the id of the layout layer it fills.

LayoutRecord

Returned by ablo.layouts.retrieve(id).
id
string
The layout’s id.
name
string
The layout’s display name.
layoutId
string
The layout container this template belongs to.
settings
SlideCompositionSettings | null
Canvas settings (background, size) inherited by slides using this layout.

LayerPosition

Describes the geometry of a layer in the slide canvas. All values are in the 1920×1080 coordinate space regardless of the slide’s export size or display resolution.
x
number
Left edge of the layer box in pixels.
y
number
Top edge of the layer box in pixels.
width
number
Width of the layer box in pixels.
height
number
Height of the layer box in pixels.
rotation
number
Clockwise rotation in degrees around the layer’s center. Omitted (or 0) for no rotation.

LayerType

The type discriminant on a persisted layer. Note that some input types map to different stored types — bar/donut inputs compile to 'chart' layers, and image inputs compile to 'shape' layers with an imageFill.
type LayerType = 'text' | 'shape' | 'icon' | 'path' | 'table' | 'chart';
ValueDescription
'text'Text, bullet lists, and numbered lists.
'shape'Rectangles, circles, ellipses, triangles, lines, and image fills.
'icon'SVG icon layers.
'path'Raw SVG path layers (advanced).
'table'Data tables.
'chart'All chart families (bar, donut, line, etc.).

SlideSettingsFields

Fields you can pass when creating or updating a slide to control canvas behaviour. All fields are optional — omitting them leaves the existing setting unchanged.
background
SlideBackgroundInput
Slide background. Accepts a color string, a background builder result, or a raw CSS string. Overrides the layout’s background for this slide.
size
SlideSizePreset
A size preset id that expands to width, height, and aspectRatio in one field. See SlideSizePreset below.
width
number
Canvas width in pixels (overrides the preset width when set directly).
height
number
Canvas height in pixels.
aspectRatio
'16:9' | '16:10' | '4:3' | 'custom'
Aspect ratio hint used by the renderer for responsive scaling.
showGrid
boolean
Show the alignment grid overlay in the editor.
gridSize
number
Grid cell size in pixels (default 40).
excludedLayoutLayerIds
string[]
A list of layout layer ids that this slide opts out of inheriting. Equivalent to hiding a master layer for just this slide (PowerPoint-style).
showMasterShapes
boolean
When false, this slide does not composite its layout’s master layers. Defaults to true.

SlideSizePreset

Pass one of these preset ids to size on a slide to set its canvas dimensions in one step.
Preset idWidthHeightAspect ratio
'16:9'1920108016:9
'16:10'1920120016:10
'a4-portrait'24803508custom
// Set a slide to A4 portrait at creation time.
await ablo.slides.create({
  deckId: deck.id,
  order: 0,
  size: 'a4-portrait',
});