SketchAPIHosted Drawing API
Menu
Get API Key
Skip to API reference

API reference

SketchAPI Reference

No matching public symbols.

SketchAPI Browser SDK

51 symbols

Classes

HostedSketchAPIError

# Class

Error returned by the hosted frame or client transport.

class HostedSketchAPIError extends Error
constructor
# Method

Create an error from hosted transport or frame failure details.

constructor(message: string, options?: { cause?: unknown; code?: string; name?: string })
code
# Property

Stable machine-readable transport or remote error code.

readonly code: string | undefined

Sketchpad

# Class

Hosted Sketchpad lifecycle backed by an origin-isolated frame.

class Sketchpad

Example

const sketchpad = new Sketchpad({ session: await response.json() })
const api = await sketchpad.mount(document.querySelector('#sketchpad'))
await api.tool?.use('paintbrush')
constructor
# Method

Create one unmounted client for a server-minted hosted session.

constructor(options: HostedSketchpadOptions)
destroy
# Method

Close the transport, remove the frame, and release this one-time session.

destroy() -> void
mount
# Method

Mount the one-time hosted session and return its async API. The container's existing children are replaced by the hosted frame.

mount(container: HTMLElement, options?: HostedSketchpadMountOptions) -> Promise<HostedSketchAPI>

Example

const controller = new AbortController()
const api = await sketchpad.mount(container, { signal: controller.signal })
// controller.abort() cancels a still-pending mount during teardown.
api
# Property

Instance API after a successful mount.

get api() -> HostedSketchAPI | undefined
files
# Property

Optional hosted document library after a successful mount.

get files() -> HostedSketchpadFiles | undefined
frame
# Property

Frame element owned by this instance.

get frame() -> HTMLIFrameElement | undefined

Interfaces

HostedSketchAPI

# Interface

Canonical async API exposed by a mounted hosted Sketchpad frame.

interface HostedSketchAPI
MemberSignatureDescription
brushreadonly brush: HostedSketchAPIBrushCreate, inspect, update, select, and remove brushes.
clipboardreadonly clipboard: HostedSketchAPIClipboardRead and modify the instance clipboard.
documentreadonly document: HostedSketchAPIDocumentCreate, activate, inspect, resize, and close documents.
eventsreadonly events: HostedSketchAPIEventsSubscribe to data-only instance events.
historyreadonly history: HostedSketchAPIHistoryRead and modify undoable history.
layerreadonly layer: HostedSketchAPILayerCreate, inspect, update, order, group, and remove layers.
mediareadonly media: HostedSketchAPIMediaAdd external media to the active document.
openreadonly open: HostedSketchAPIOpenOpen supported artwork and document formats.
runtimereadonly runtime: HostedSketchAPIRuntimeInspect hosted runtime metadata and readiness.
savereadonly save: HostedSketchAPISaveSave artwork in supported document and image formats.
selectionreadonly selection: HostedSketchAPISelectionInspect and change the active selection.
toolreadonly tool: HostedSketchAPITool | undefinedDiscover, configure, and activate tools when the product exposes them.

HostedSketchAPIBrush

# Interface

Hosted reusable brush-definition namespace.

interface HostedSketchAPIBrush
MemberSignatureDescription
createcreate(definition: BrushDefinition) -> Promise<RegisteredBrushDefinition>Register a new brush definition.
getget(id: string) -> Promise<RegisteredBrushDefinition | undefined>Return a detached brush definition by id.
hashas(id: string) -> Promise<boolean>Return whether a brush id is registered.
listlist(filter?: HostedSketchBrushListFilter) -> Promise<readonly RegisteredBrushDefinition[]>List registered brush definitions.
removeremove(id: string) -> Promise<boolean>Remove a registered brush definition.
updateupdate(id: string, patch: Partial<BrushDefinition>) -> Promise<RegisteredBrushDefinition>Update an existing brush definition.
useuse(id: string, options?: SketchBrushUseOptions) -> Promise<unknown>Activate a registered brush through the owning tool API.

HostedSketchAPIClipboard

# Interface

Clipboard reads are methods because hosted state crosses an async boundary.

interface HostedSketchAPIClipboard
MemberSignatureDescription
clearclear() -> Promise<void>Clear copied layers and their retained assets.
copycopy(references?: SketchClipboardLayerReference<SketchLayerHandle> | readonly SketchClipboardLayerReference<SketchLayerHandle>[], options?: SketchClipboardTargetOptions<SketchDocumentHandle>) -> Promise<void>Copy layers, defaulting to the target document's current selection.
cutcut(references?: SketchClipboardLayerReference<SketchLayerHandle> | readonly SketchClipboardLayerReference<SketchLayerHandle>[], options?: SketchClipboardTargetOptions<SketchDocumentHandle>) -> Promise<void>Cut layers, defaulting to the target document's current selection.
hasContenthasContent() -> Promise<boolean>Report whether the hosted clipboard currently contains pasteable content.
pastepaste(options?: SketchClipboardPasteOptions<SketchLayerHandle, SketchDocumentHandle>) -> Promise<readonly SketchLayerHandle[]>Paste copied layers into the active or explicitly targeted document.

HostedSketchAPIDocument

# Interface

Hosted document lifecycle namespace.

interface HostedSketchAPIDocument
MemberSignatureDescription
activateactivate(reference: SketchDocumentReference<SketchDocumentHandle>) -> Promise<SketchDocumentHandle>Make an open document the active default for subsequent operations.
clearclear(options?: SketchDocumentClearOptions<SketchDocumentHandle>) -> Promise<void>Remove every layer from the active or explicitly targeted document.
closeclose(reference?: SketchDocumentReference<SketchDocumentHandle>) -> Promise<void>Close a document, defaulting to the active document.
createcreate(options?: SketchDocumentCreateOptions) -> Promise<SketchDocumentHandle>Create and initialize a document.
currentcurrent() -> Promise<SketchDocumentHandle | undefined>Return the active document.
fitfit(options?: SketchDocumentFitOptions<SketchDocumentHandle>) -> Promise<void>Fit the active or explicitly targeted document into its viewport.
getget(reference: SketchDocumentReference<SketchDocumentHandle>) -> Promise<SketchDocumentHandle | undefined>Find an open document by index, id, or live handle.
getViewportgetViewport(options?: SketchDocumentTargetOptions<SketchDocumentHandle>) -> Promise<SketchDocumentViewportState>Return immutable camera and size state for the active or targeted document.
listlist() -> Promise<readonly SketchDocumentHandle[]>Return an immutable snapshot of the open document list.
resizeresize(options: SketchDocumentResizeOptions<SketchDocumentHandle>) -> Promise<void>Resize the active or explicitly targeted document.
resizeViewportresizeViewport(options?: SketchDocumentViewportOptions<SketchDocumentHandle>) -> Promise<void>Resize or remeasure the active or explicitly targeted viewport.
setViewportsetViewport(options: SketchDocumentSetViewportOptions<SketchDocumentHandle>) -> Promise<void>Apply camera or size state to the active or explicitly targeted document.

HostedSketchAPIEvent

# Interface

Data-only event delivered by a hosted SketchAPI subscription.

interface HostedSketchAPIEvent
MemberSignatureDescription
detailreadonly detail: unknownSerializable event payload.
sourcereadonly source: unknownSerializable source metadata supplied by the runtime.
targetreadonly target: Readonly<{ kind: "SketchAPI" }>Stable event target descriptor.
timereadonly time: numberEvent time in milliseconds since the Unix epoch.
typereadonly type: stringSketchAPI event name.

HostedSketchAPIEventOptions

# Interface

Hosted event options evaluated by the browser client and frame.

interface HostedSketchAPIEventOptions
MemberSignatureDescription
onceonce?: booleanRemove the subscription after its first event.
signalsignal?: AbortSignalRemove the subscription when this signal aborts.

HostedSketchAPIEvents

# Interface

Local subscription facade backed by frame event forwarding.

interface HostedSketchAPIEvents
MemberSignatureDescription
onon(type: string, handler: (event: HostedSketchAPIEvent) => void, options?: HostedSketchAPIEventOptions) -> () => voidSubscribe to one data-only hosted event and return its unsubscribe function.
namesreadonly names: readonly string[]Event names supported by the connected runtime.

Example: on

const off = api.events.on('document:change', event => console.log(event.type, event.detail))
off()
const controller = new AbortController()
api.events.on('tool:change', event => console.log(event.detail), { signal: controller.signal })
controller.abort()

HostedSketchAPIHistory

# Interface

Remote history operations with one atomic callback transaction.

interface HostedSketchAPIHistory
MemberSignatureDescription
canRedocanRedo(options?: SketchHistoryTargetOptions<SketchDocumentHandle>) -> Promise<boolean>Return whether the target document has a redo entry.
canUndocanUndo(options?: SketchHistoryTargetOptions<SketchDocumentHandle>) -> Promise<boolean>Return whether the target document has an undo entry.
redoredo(options?: SketchHistoryMoveOptions<SketchDocumentHandle>) -> Promise<void>Redo one or more entries in the target document.
transactiontransaction<T>(action: () => Promise<T> | T, options?: SketchHistoryTransactionOptions<SketchDocumentHandle>) -> Promise<T>Commit all callback operations as one undoable history transaction.
undoundo(options?: SketchHistoryMoveOptions<SketchDocumentHandle>) -> Promise<void>Undo one or more entries in the target document.

Example: transaction

await api.history.transaction(async () => {
const badge = await api.layer.create({ type: 'rectangle', width: 96, height: 96 })
await api.layer.update(badge, { name: 'Badge', opacity: 0.9 })
}, { name: 'Add badge' })
await api.history.undo()

HostedSketchAPILayer

# Interface

Hosted layer namespace retaining both canonical creation overloads.

interface HostedSketchAPILayer
MemberSignatureDescription
createcreate<TDefinition extends SketchLayerDefinition>(definition: TDefinition, options?: SketchLayerCreateOptions<SketchDocumentHandle>) -> Promise<SketchLayerHandle> create<TDefinition extends SketchLayerDefinition>(definitions: readonly TDefinition[], options?: SketchLayerCreateOptions<SketchDocumentHandle>) -> Promise<SketchLayerHandle[]>Create one layer from a serializable layer definition.
getget(reference: SketchLayerReference, options?: SketchLayerTargetOptions<SketchDocumentHandle>) -> Promise<SketchLayerHandle | undefined>Find a layer by id or detached hosted handle.
groupgroup(references: readonly SketchLayerReference[], options?: SketchLayerTargetOptions<SketchDocumentHandle>) -> Promise<SketchLayerHandle>Group one or more layers and return the new group handle.
listlist(options?: SketchLayerTargetOptions<SketchDocumentHandle>) -> Promise<readonly SketchLayerHandle[]>Return an immutable layer-handle snapshot for the target document.
movemove(reference: SketchLayerReference, options: SketchLayerMoveOptions<SketchLayerHandle, SketchDocumentHandle>) -> Promise<void>Move or reparent one layer within the document tree.
removeremove(references: SketchLayerReference | readonly SketchLayerReference[], options?: SketchLayerRemoveOptions<SketchDocumentHandle>) -> Promise<void>Remove one or more layers from the target document.
schemaschema(type: string) -> Promise<ToolSchema | undefined>Read the registered configuration schema for one layer type.
snapshotsnapshot<TData extends object = Record<string, unknown>>(reference: SketchLayerReference, options?: SketchLayerTargetOptions<SketchDocumentHandle>) -> Promise<SketchLayerSnapshot<TData>>Return detached serializable state for one layer.
ungroupungroup(references: SketchLayerReference | readonly SketchLayerReference[], options?: SketchLayerTargetOptions<SketchDocumentHandle>) -> Promise<SketchLayerHandle[]>Ungroup one or more groups and return their moved child handles.
updateupdate<TChanges extends object>(references: SketchLayerReference | readonly SketchLayerReference[], changes: SketchLayerChanges<TChanges>, options?: SketchLayerUpdateOptions<SketchDocumentHandle>) -> Promise<void>Apply validated changes to one or more layer references.
typesreadonly types: readonly string[]Registered layer type ids.

Example: create

const card = await api.layer.create({
fill: '#2f6fed',
height: 240,
type: 'rectangle',
width: 320
})

HostedSketchAPIOpen

# Interface

Hosted document import namespace.

interface HostedSketchAPIOpen
MemberSignatureDescription
bundlebundle(blobs: Array<Blob | File>, options?: HostedSketchJsonOpenOptions) -> Promise<SketchDocumentHandle>Open a Sketchpad bundle archive.
jsonjson(content: SketchJsonInput, options?: HostedSketchJsonOpenOptions) -> Promise<SketchDocumentHandle>Open Sketchpad JSON data.
pdfpdf(file: ArrayBuffer | Blob | File | string, options?: HostedSketchPdfOpenOptions) -> Promise<SketchLayerHandle[]>Open a PDF document.
psdpsd(file: SketchPsdInput, options?: HostedSketchPsdOpenOptions) -> Promise<SketchLayerHandle[]>Open a PSD document.
sketchsketch(zipBlob: Blob, options?: HostedSketchJsonOpenOptions) -> Promise<SketchDocumentHandle>Open the native Sketchpad document format.
svgsvg(input: Blob | File | string, options?: HostedSketchSvgOpenOptions) -> Promise<SketchLayerHandle>Open SVG content as a layer.

HostedSketchAPIRuntime

# Interface

Hosted runtime metadata and readiness.

interface HostedSketchAPIRuntime
MemberSignatureDescription
readyready() -> Promise<void>Resolve after the hosted runtime is ready for API operations.
versionreadonly version: string | undefinedConnected hosted runtime version, when reported.

HostedSketchAPISave

# Interface

Hosted save namespace retaining output-format return inference.

interface HostedSketchAPISave
MemberSignatureDescription
assetsassets(options?: HostedSketchAssetsSaveOptions) -> Promise<Record<string, Blob | string>>Export assets referenced by the active or targeted document.
bundlebundle(options?: HostedSketchBundleSaveOptions) -> Promise<SketchBundleEntry[]>Save the active or targeted document as a native bundle.
jpegjpeg<TFormat extends HostedSketchRasterOutputFormat = "blob">(options?: HostedSketchImageSaveOptions<TFormat>) -> Promise<HostedSketchSaveOutput<TFormat>>Save a JPEG image in a portable representation.
jsonjson<TFormat extends HostedSketchJsonOutputFormat = "object">(options?: HostedSketchJsonSaveOptions<TFormat>) -> Promise<HostedSketchSaveOutput<TFormat>>Serialize a document or layer selection as Sketch JSON.
pdfpdf<TFormat extends HostedSketchPdfOutputFormat = "blob">(options?: HostedSketchPdfSaveOptions<TFormat>) -> Promise<HostedSketchSaveOutput<TFormat>>Save a PDF document in a portable representation.
pngpng<TFormat extends HostedSketchRasterOutputFormat = "blob">(options?: HostedSketchImageSaveOptions<TFormat>) -> Promise<HostedSketchSaveOutput<TFormat>>Save a PNG image in a portable representation.
psdpsd<TFormat extends HostedSketchPsdOutputFormat = "blob">(options?: HostedSketchPsdSaveOptions<TFormat>) -> Promise<HostedSketchSaveOutput<TFormat>>Save a PSD document in a portable representation.
rasterraster<TFormat extends HostedSketchRasterOutputFormat = "blob">(options?: HostedSketchRasterSaveOptions<TFormat>) -> Promise<HostedSketchSaveOutput<TFormat>>Render and save a raster image, returning a Blob by default.
svgsvg<TFormat extends HostedSketchSvgOutputFormat = "blob">(options?: HostedSketchSvgSaveOptions<TFormat>) -> Promise<HostedSketchSaveOutput<TFormat>>Save SVG in a portable representation.
webpwebp<TFormat extends HostedSketchRasterOutputFormat = "blob">(options?: HostedSketchImageSaveOptions<TFormat>) -> Promise<HostedSketchSaveOutput<TFormat>>Save a WebP image in a portable representation.
zipzip(options?: HostedSketchBundleSaveOptions) -> Promise<Blob>Save a ZIP-wrapped native bundle.
formatsreadonly formats: readonly string[]Export format identifiers available in the connected runtime.

Example: json

const document = await api.save.json() // portable object, same as { as: 'object' }
const text = await api.save.json({ as: 'string' })

HostedSketchAPISelection

# Interface

Hosted selection namespace.

interface HostedSketchAPISelection
MemberSignatureDescription
clearclear(options?: SketchSelectionTargetOptions<SketchDocumentHandle>) -> Promise<void>Clear the active or explicitly targeted document selection.
currentcurrent(options?: SketchSelectionTargetOptions<SketchDocumentHandle>) -> Promise<SketchLayerHandle | undefined>Return the primary selected layer in the active or targeted document.
deselectdeselect(input: SketchSelectionInput<SketchLayerHandle>, options?: SketchSelectionTargetOptions<SketchDocumentHandle>) -> Promise<SketchLayerHandle | SketchLayerHandle[] | undefined>Remove layers from the active or explicitly targeted selection.
hashas(input: string | SketchLayerHandle, options?: SketchSelectionTargetOptions<SketchDocumentHandle>) -> Promise<boolean>Check whether a layer or id is selected in the active or targeted document.
listlist(options?: SketchSelectionTargetOptions<SketchDocumentHandle>) -> Promise<readonly SketchLayerHandle[]>Return an immutable selection snapshot for the active or targeted document.
selectselect(input: SketchSelectionInput<SketchLayerHandle>, options?: SketchSelectionOptions<SketchDocumentHandle>) -> Promise<SketchLayerHandle | SketchLayerHandle[] | undefined>Select layers in the active or explicitly targeted document.

HostedSketchAPITool

# Interface

Hosted tool discovery, configuration, and activation namespace.

interface HostedSketchAPITool
MemberSignatureDescription
configconfig<TConfig extends object>(toolId: string, values: Readonly<TConfig>, options?: SketchToolConfigOptions) -> Promise<void> config<TConfigMap extends SketchToolConfigMap>(configs: TConfigMap, options?: SketchToolConfigOptions) -> Promise<void>Update one tool config or a map of tool configs without switching tools.
currentcurrent() -> Promise<SketchToolHandle | undefined>Get the active tool instance.
getConfiggetConfig<TConfig extends SketchToolConfigValues = SketchToolConfigValues>(toolId?: string) -> Promise<TConfig | undefined>Get a tool config by id, or the active tool config when omitted.
hashas(toolId: string) -> Promise<boolean>Return whether a tool id is registered.
hasCapabilityhasCapability(toolId: string, capability: string) -> Promise<boolean>Return whether a tool declares a capability.
listlist(filter?: SketchToolListFilter) -> Promise<readonly SketchToolListEntry[]>List registered public tools.
schemaschema(toolId: string) -> Promise<ToolSchema | undefined>Get the public schema for a tool id.
useuse<TConfig extends object = SketchToolConfigValues>(toolId: string, values?: Readonly<TConfig>, options?: SetCurrentToolOptions) -> Promise<SketchToolHandle>Switch to a tool and optionally apply config values.

HostedSketchAssetsSaveOptions

# Interface

Options for hosted referenced-asset export.

interface HostedSketchAssetsSaveOptions extends HostedSketchSaveOptions<"blob" | "dataURL">
MemberSignatureDescription
preferOriginalBlobspreferOriginalBlobs?: booleanReuse unchanged source blobs instead of re-encoding them.

HostedSketchBrushListFilter

# Interface

Structured brush filter accepted across the hosted boundary.

interface HostedSketchBrushListFilter
MemberSignatureDescription
typetype?: BrushDefinition["type"]Keep brushes with this public definition type.

HostedSketchBundleSaveOptions

# Interface

Options for hosted native bundle and ZIP export.

interface HostedSketchBundleSaveOptions extends HostedSketchSaveTargetOptions
MemberSignatureDescription
withHistorywithHistory?: booleanInclude undo history in the bundle.
withResourceswithResources?: booleanInclude reusable document resources in the bundle.

HostedSketchJsonOpenOptions

# Interface

Options for hosted native JSON and bundle imports.

interface HostedSketchJsonOpenOptions extends HostedSketchOpenOptions
MemberSignatureDescription
renderScenerenderScene?: booleanRender the document after loading it.

HostedSketchJsonSaveOptions

# Interface

Options for hosted native JSON export.

interface HostedSketchJsonSaveOptions<TFormat extends HostedSketchJsonOutputFormat = HostedSketchJsonOutputFormat> extends HostedSketchSaveOptions<TFormat>
MemberSignatureDescription
qualityquality?: numberEncoder quality used when embedding raster assets.
withAssetswithAssets?: booleanEmbed referenced assets into the JSON output.
withHistorywithHistory?: booleanInclude undo history in the JSON output.
withResourceswithResources?: booleanInclude reusable resources in the JSON output.

HostedSketchMediaBufferSource

# Interface

Buffer-backed media source accepted by the hosted importer.

interface HostedSketchMediaBufferSource
MemberSignatureDescription
bufferbuffer: ArrayBufferMedia bytes to import.
typetype?: stringOptional MIME type or importer-specific media hint.

HostedSketchMediaOptions

# Interface

Data-only options accepted by hosted media import.

interface HostedSketchMediaOptions
MemberSignatureDescription
anchoranchor?: SketchMediaPointPlacement anchor interpreted by the selected media importer.
assetasset?: SketchImportedMediaAssetExisting asset metadata to reuse while importing.
docdoc?: SketchDocumentHandleTarget document, defaulting to the active document.
namename?: stringOptional display name for the imported media.
openAsNewopenAsNew?: booleanOpen the input in a new document instead of the active document.
originalUrloriginalUrl?: stringOriginal source URL retained as media metadata.
parentIdparentId?: stringParent layer id for the imported content.
placeAtplaceAt?: SketchMediaPointExplicit document-space placement point.
renderScenerenderScene?: booleanRender the scene after the import completes.
rotationrotation?: numberInitial rotation in radians.
signalsignal?: AbortSignalCancel the import without sending a callback across the frame boundary.
targetIdxtargetIdx?: numberTarget child index under the selected parent.

HostedSketchMediaUrlSource

# Interface

URL-backed media source accepted by the hosted importer.

interface HostedSketchMediaUrlSource
MemberSignatureDescription
srcsrc: stringSource URL to import inside the hosted frame.
typetype?: stringOptional MIME type or importer-specific media hint.

HostedSketchOpenOptions

# Interface

Shared data-only controls for hosted document-open operations.

interface HostedSketchOpenOptions
MemberSignatureDescription
docdoc?: SketchDocumentHandleTarget document, defaulting to the active document.
openAsNewopenAsNew?: booleanReplace the target document instead of placing imported content into it.
signalsignal?: AbortSignalCancel the import.

HostedSketchPdfOpenOptions

# Interface

Options for hosted PDF imports.

interface HostedSketchPdfOpenOptions extends HostedSketchOpenOptions
MemberSignatureDescription
openAsLayersopenAsLayers?: booleanPreserve recoverable PDF vector layers when possible.
pageNumberspageNumbers?: number[]Import only these one-based page numbers.
placeAtplaceAt?: SketchMediaPointCenter imported pages at this document-space point.
throwOnLayerFallbackthrowOnLayerFallback?: booleanReject instead of rasterizing a page whose vector import fails.

HostedSketchPdfSaveOptions

# Interface

Options for hosted PDF export.

interface HostedSketchPdfSaveOptions<TFormat extends HostedSketchPdfOutputFormat = HostedSketchPdfOutputFormat> extends HostedSketchSaveOptions<TFormat>
MemberSignatureDescription
clipToPixelBoundsclipToPixelBounds?: booleanCrop the PDF to nontransparent pixel bounds.
clipToSelectionclipToSelection?: booleanExport only the current selection.
convertTextToPathsconvertTextToPaths?: booleanConvert text to vector paths before export.
dpidpi?: numberTarget PDF rasterization resolution in dots per inch.
qualityquality?: numberEncoder quality from zero to one for raster fallbacks.
regionregion?: SketchSaveRegionDocument region to export.
surfacesurface?: stringSurface color used behind exported content.
vectorvector?: booleanPrefer native vector output when supported.

HostedSketchPsdOpenOptions

# Interface

Options for hosted PSD imports.

interface HostedSketchPsdOpenOptions extends HostedSketchOpenOptions
MemberSignatureDescription
openAsLayersopenAsLayers?: booleanPreserve PSD layers instead of importing only the composite image.
placeAtplaceAt?: SketchMediaPointCenter imported content at this document-space point.

HostedSketchRenderedSaveOptions

# Interface

Shared hosted options for rendered image and PSD exports.

interface HostedSketchRenderedSaveOptions<TFormat extends HostedSketchSaveOutputFormat> extends HostedSketchSaveOptions<TFormat>
MemberSignatureDescription
clipToPixelBoundsclipToPixelBounds?: booleanCrop the rendered output to its nontransparent pixel bounds.
clipToSelectionclipToSelection?: booleanCrop the rendered output to the current selection.
dpidpi?: numberTarget dots per inch used to derive export scaling.
includeSurfaceincludeSurface?: booleanInclude the document surface behind exported layers.
longestEdgelongestEdge?: numberScale the longest output edge to this pixel length.
preferCanvasFallbackWhenSafepreferCanvasFallbackWhenSafe?: booleanPrefer Canvas2D when the layer set requires no Pixi-only effects.
qualityquality?: numberEncoder quality from zero to one for lossy formats.
regionregion?: SketchSaveRegionRegion of the document to export.
scalescale?: numberExplicit output scale multiplier.
surfacesurface?: HostedSketchSurfaceInputData-only surface override used behind exported layers.

HostedSketchSaveTargetOptions

# Interface

Shared document, layer, and cancellation controls for hosted saves.

interface HostedSketchSaveTargetOptions
MemberSignatureDescription
docdoc?: SketchDocumentHandleTarget document, defaulting to the active document.
layerslayers?: readonly SketchLayerHandle[]Optional layer subset to export.
signalsignal?: AbortSignalCancel the export.

HostedSketchSvgOpenOptions

# Interface

Options for hosted SVG imports.

interface HostedSketchSvgOpenOptions extends HostedSketchOpenOptions
MemberSignatureDescription
combineContiguousPathscombineContiguousPaths?: booleanMerge compatible neighboring paths into compound paths.
placeAtplaceAt?: SketchMediaPointCenter imported content at this document-space point.

HostedSketchSvgSaveOptions

# Interface

Options for hosted SVG export.

interface HostedSketchSvgSaveOptions<TFormat extends HostedSketchSvgOutputFormat = HostedSketchSvgOutputFormat> extends HostedSketchSaveOptions<TFormat>
MemberSignatureDescription
backgroundbackground?: stringBackground color written behind exported content.
clipToPixelBoundsclipToPixelBounds?: booleanCrop the SVG to nontransparent pixel bounds.
clipToSelectionclipToSelection?: booleanExport only the current selection.
exportBezierPathsexportBezierPaths?: booleanConvert compatible geometry to editable Bezier paths.
exportRawImagesexportRawImages?: booleanPreserve source raster images instead of re-encoding them.
inlineClipartinlineClipart?: "base64" | "merge" | "package" | falseStrategy for embedding or packaging clipart dependencies.
inlineFontinlineFont?: "base64" | "outline" | "package" | falseStrategy for embedding, outlining, or packaging fonts.
regionregion?: SketchSaveRegionDocument region to export.

HostedSketchpadMountOptions

# Interface

Options accepted while mounting the hosted frame.

interface HostedSketchpadMountOptions
MemberSignatureDescription
signalsignal?: AbortSignalCancel frame loading and connection.

HostedSketchpadOptions

# Interface

Hosted client construction options.

interface HostedSketchpadOptions
MemberSignatureDescription
definitiondefinition?: SketchpadAppDefinitionInputOptional JSON-safe recipe for the hosted drawing experience.
onStateChangeonStateChange?: (state: HostedSketchpadState) => voidObserve lifecycle transitions, including destruction caused by a lost frame connection. States arrive as 'mounting', 'mounted', or 'destroyed'.
requestTimeoutMsrequestTimeoutMs?: numberPer-request transport timeout in milliseconds.
sessionsession: HostedSketchpadSessionShort-lived session returned by the SketchAPI control plane.
titletitle?: stringAccessible title applied to the hosted frame.

Example: onStateChange

const sketchpad = new Sketchpad({
session,
onStateChange: state => {
if (state === 'destroyed') showReconnectPrompt()
}
})

HostedSketchpadSession

# Interface

One short-lived hosted session minted by the SketchAPI control plane.

interface HostedSketchpadSession
MemberSignatureDescription
expiresAtexpiresAt: stringISO timestamp after which the session cannot be mounted.
frameUrlframeUrl: stringExact hosted frame URL for this session.
sessionIdsessionId?: stringServer-side session id for support and usage correlation.
tokentoken: stringOne-time secret passed through the authenticated frame channel.

Type aliases

HostedSketchJsonOutputFormat

# Type alias

Portable output representations supported by hosted Sketch JSON export.

type HostedSketchJsonOutputFormat = "blob" | "dataURL" | "object" | "string"

HostedSketchPdfOutputFormat

# Type alias

Portable output representations supported by hosted PDF export.

type HostedSketchPdfOutputFormat = "arrayBuffer" | "blob" | "dataURL"

HostedSketchPsdOutputFormat

# Type alias

Portable output representations supported by hosted PSD export.

type HostedSketchPsdOutputFormat = "arrayBuffer" | "blob"

HostedSketchRasterOutputFormat

# Type alias

Portable output representations supported by hosted raster exporters.

type HostedSketchRasterOutputFormat = "arrayBuffer" | "base64" | "blob" | "dataURL"

HostedSketchSurfaceInput

# Type alias

Data-only paint or layer reference accepted as a hosted export surface.

type HostedSketchSurfaceInput = string | SketchLayerHandle | Readonly<Record<string, unknown>>

HostedSketchSvgOutputFormat

# Type alias

Portable output representations supported by hosted SVG export.

type HostedSketchSvgOutputFormat = "arrayBuffer" | "base64" | "blob" | "dataURL" | "string"

HostedSketchpadFiles

# Type alias

Optional remote document-library operations owned by the hosted frame.

type HostedSketchpadFiles = SketchpadFilesService

HostedSketchpadState

# Type alias

Hosted instance lifecycle state.

type HostedSketchpadState = "destroyed" | "idle" | "mounted" | "mounting"

Supporting types

144 symbols

Interfaces

BaseGradientDef

# Interface

Common properties shared by all gradient types

interface BaseGradientDef
MemberSignatureDescription
colorSpacecolorSpace?: ColorSpaceColor interpolation space (default: 'linear-rgb', recommend 'oklab' for quality)
coordSystemcoordSystem?: CoordSystemCoordinate system for Y-axis (default: 'canvas')
extendModeextendMode?: ExtendModeEdge behavior when gradient is extended (default: 'clamp')
noisenoise?: GradientNoiseConfigOptional noise configuration for color stops
stopsstops: GradientStop[]Array of color stops (minimum 2 for most gradients)
transformtransform?: GradientTransformOptional transform matrix applied in normalized gradient space

BasePatternDef

# Interface

Common properties for all pattern types

interface BasePatternDef
MemberSignatureDescription
offsetoffset?: [number, number]Offset position [x, y]
opacityopacity?: numberPattern opacity (0-1)
rotationrotation?: numberRotation angle in degrees
scalescale?: PatternScaleScale factor for the pattern
transformtransform?: PatternTransformAdditional affine transform applied to the pattern tile.

BrushDefinitionStyle

# Interface

Compositing applied exactly once to one Hybrid layer.

interface BrushDefinitionStyle
MemberSignatureDescription
blendModeblendMode?: stringBlend mode applied while compositing the layer.
opacityopacity?: numberOpacity multiplier from zero to one.

ColorPaint

# Interface

Paint source backed by one CSS color.

interface ColorPaint
MemberSignatureDescription
colorcolor: stringCSS color string (hex, rgb, rgba, hsl, hsla, named, oklch, etc.)
typetype: "color"Paint kind discriminator.

ConicGradientDef

# Interface

Conic gradient - rotates around a center point (also called angular/sweep)

interface ConicGradientDef extends BaseGradientDef
MemberSignatureDescription
centercenter: [number, number]Center point [x, y] in normalized coordinates (0-1)
rotationrotation?: numberStarting rotation angle in degrees (0-360)
scaleXscaleX?: numberHorizontal scale
scaleYscaleY?: numberVertical scale
sectorssectors?: numberNumber of sectors/segments (for stepped gradients)
typetype: "conic"Gradient kind discriminator.

CoonsGradientDef

# Interface

Coons patch gradient - bilinear interpolation across 4 boundary curves Used for complex mesh gradients

interface CoonsGradientDef extends OptionalStopsGradientDef
MemberSignatureDescription
bottombottom?: [number, number][]Bottom edge control points
colorscolors?: [string, string, string, string]Corner colors [topLeft, topRight, bottomLeft, bottomRight]
leftleft?: [number, number][]Left edge control points
patchespatches?: CoonsPatchDef[]Multiple independent patches
rightright?: [number, number][]Right edge control points
toptop?: [number, number][]Top edge control points
typetype: "coons"Gradient kind discriminator.

CoonsPatchDef

# Interface

Coons patch definition (for multi-patch gradients)

interface CoonsPatchDef
MemberSignatureDescription
bottombottom: [number, number][]Bottom edge control points (4 points)
colorscolors: [string, string, string, string]Corner colors [topLeft, topRight, bottomLeft, bottomRight]
leftleft: [number, number][]Left edge control points (4 points)
rightright: [number, number][]Right edge control points (4 points)
toptop: [number, number][]Top edge control points (4 points)

CurveGradientDef

# Interface

Curve gradient - gradient that follows a curve path

interface CurveGradientDef extends BaseGradientDef
MemberSignatureDescription
controlPointscontrolPoints?: [number, number][]Curve control points (cubic bezier). Provide 4 points per segment (p0, c1, c2, p3).
curvescurves?: CurvePathDef[]Multiple independent curves (shared stops by default).
emissionSideemissionSide?: CurveEmissionSideEmission side relative to curve direction
falloffModefalloffMode?: CurveFalloffModeFalloff mode for distance from curve
typetype: "curve"Gradient kind discriminator.
widthwidth?: numberGradient width perpendicular to curve
widthEasingwidthEasing?: CurveWidthEasingWidth interpolation easing between stops

CurvePathDef

# Interface

Curve path definition (for multi-curve gradients)

interface CurvePathDef
MemberSignatureDescription
controlPointscontrolPoints: [number, number][]Curve control points (cubic bezier). Provide 4 points per segment (p0, c1, c2, p3).
widthwidth?: numberOptional width override for this curve

DiamondGradientDef

# Interface

Diamond gradient - diamond-shaped gradient from center

interface DiamondGradientDef extends BaseGradientDef
MemberSignatureDescription
angleangle?: numberRotation angle in degrees
centercenter: [number, number]Center point [x, y] in normalized coordinates (0-1)
focalfocal?: [number, number]Optional focal point [x, y] for asymmetric diamond gradients
radiusradius?: numberGradient radius in normalized coordinates (relative to min dimension)
scaleXscaleX?: numberHorizontal scale
scaleYscaleY?: numberVertical scale
typetype: "diamond"Gradient kind discriminator.

FreeformGradientDef

# Interface

Freeform gradient - N arbitrary color points with Gaussian-weighted blending Most flexible gradient type, similar to Illustrator's freeform gradient

interface FreeformGradientDef extends OptionalStopsGradientDef
MemberSignatureDescription
aspectaspect?: numberAspect ratio adjustment
fallofffalloff?: numberFalloff rate for color blending (higher = sharper transitions)
pointspoints: GradientPoint[]Array of gradient points with position and color
powerpower?: numberPower for distance weighting
typetype: "freeform"Gradient kind discriminator.

GradientControlPoint

# Interface

A control point for N-point gradients

interface GradientControlPoint
MemberSignatureDescription
colorcolor: stringCSS color string
positionposition: [number, number]Position [x, y] in normalized coordinates (0-1)
radiusradius?: numberInfluence radius

GradientNoiseConfig

# Interface

Configuration for gradient color noise effect.

interface GradientNoiseConfig
MemberSignatureDescription
densitydensity?: numberNumber of interpolated stops to generate
hueRangehueRange?: numberHue variation range in degrees
lumRangelumRange?: numberLightness variation range
satRangesatRange?: numberSaturation variation range
seedseed?: numberRandom seed for reproducible noise

GradientPaint

# Interface

Paint source backed by a canonical gradient definition.

interface GradientPaint
MemberSignatureDescription
gradientgradient: GradientDefGradient definition (linear, radial, conic, etc.)
typetype: "gradient"Paint kind discriminator.

GradientPoint

# Interface

A point in a freeform gradient

interface GradientPoint
MemberSignatureDescription
colorcolor: stringCSS color string
positionposition: [number, number]Position [x, y] in normalized coordinates (0-1)

GradientStop

# Interface

A single color stop in a gradient

interface GradientStop
MemberSignatureDescription
colorcolor: stringCSS color string (hex, rgb, rgba, hsl, hsla, named)
offsetoffset: numberPosition along gradient (0-1)

HybridBrushDefinition

# Interface

Public, serializable Hybrid brush definition.

interface HybridBrushDefinition
MemberSignatureDescription
idid: stringStable registry id.
layerslayers: HybridBrushLayerDefinition[]Back-to-front ordered layers.
namename: stringHuman-readable brush name.
typetype: "hybrid"Brush definition discriminator.

HybridBrushLayerDefinition

# Interface

One stable, independently configured layer in a Hybrid brush.

interface HybridBrushLayerDefinition
MemberSignatureDescription
brushIdbrushId: stringBrush or preset id owned by the selected engine.
enabledenabled: booleanWhether this layer participates in rendering.
engineIdengineId: stringBrush engine plugin id. Hybrid cannot recursively contain Hybrid.
idid: stringStable layer identity. Reordering layers never changes this value.
settingssettings?: BrushDefinitionSettingsEngine-specific serializable settings frozen into each stroke recipe.
stylestyle?: BrushDefinitionStyleLayer-level compositing applied to committed and live output.
transformtransform?: BrushTransformSerializable point transform applied before dispatching to this layer.

ImagePatternDef

# Interface

Image-based pattern

interface ImagePatternDef extends BasePatternDef
MemberSignatureDescription
fitfit?: PatternFitFit mode
repeatrepeat?: PatternRepeatRepetition mode
srcsrc: stringURL or data URL of the image
typetype: "image"Pattern kind discriminator.

LinearGradientDef

# Interface

Linear gradient - interpolates along a line from start to end point

interface LinearGradientDef extends BaseGradientDef
MemberSignatureDescription
endend: [number, number]End point [x, y] in normalized coordinates (0-1)
startstart: [number, number]Start point [x, y] in normalized coordinates (0-1)
typetype: "linear"Gradient kind discriminator.

NPointGradientDef

# Interface

N-Point gradient - gradient defined by N control points

interface NPointGradientDef extends BaseGradientDef
MemberSignatureDescription
pointspoints: GradientControlPoint[]Array of control points
typetype: "npoint"Gradient kind discriminator.

NoisePatternDef

# Interface

Procedural noise pattern

interface NoisePatternDef extends BasePatternDef
MemberSignatureDescription
colorModecolorMode?: "grayscale" | "color"Color mode
colorscolors?: [string, string]Base colors for noise output
frequencyfrequency?: numberNoise frequency/detail level
noiseTypenoiseType: NoiseTypeNoise algorithm
octavesoctaves?: numberNumber of octaves for fbm/turbulence
persistencepersistence?: numberPersistence between octaves
seedseed?: numberRandom seed for reproducible results
typetype: "noise"Pattern kind discriminator.

OptionalStopsGradientDef

# Interface

Shared gradient properties for gradient types that can derive their stops.

interface OptionalStopsGradientDef extends Omit<BaseGradientDef, "stops">
MemberSignatureDescription
stopsstops?: GradientStop[]Optional color stops used when the gradient does not derive them.

PaintEffectInput

# Interface

Structural input shared by normalized paint effects.

interface PaintEffectInput
MemberSignatureDescription
blendModeblendMode?: unknownRaw blend mode value.
enabledenabled?: unknownRaw enabled state.
opacityopacity?: unknownRaw opacity value.
paintpaint?: Paint | string | nullPaint value applied by the effect.

PatternPaint

# Interface

Paint source backed by an image, noise, or SVG pattern.

interface PatternPaint
MemberSignatureDescription
patternpattern: PatternDefPattern definition (image, noise, svg)
typetype: "pattern"Paint kind discriminator.

RadialGradientDef

# Interface

Radial gradient - radiates from a center point with optional focal offset Supports elliptical gradients via scaleY and rotation via angle

interface RadialGradientDef extends BaseGradientDef
MemberSignatureDescription
angleangle?: numberRotation angle in degrees (0-360)
aspectaspect?: numberAspect ratio adjustment
centercenter: [number, number]Center point [x, y] in normalized coordinates (0-1)
centerRadiuscenterRadius: numberOuter radius at center (0-1, where 1 = full width/height)
focalfocal?: [number, number]Optional focal point [x, y] for off-center gradients
focalRadiusfocalRadius?: numberOptional inner radius at focal point
scaleYscaleY?: numberVertical scale for elliptical gradients (1.0 = circle, <1 = wide, >1 = tall)
typetype: "radial"Gradient kind discriminator.

SVGPatternDef

# Interface

SVG pattern reference

interface SVGPatternDef extends BasePatternDef
MemberSignatureDescription
contentcontent: stringSVG content or URL
inlineinline?: booleanWhether content is inline SVG or URL
repeatrepeat?: PatternRepeatRepetition mode
typetype: "svg"Pattern kind discriminator.

ShapeGradientDef

# Interface

Shape gradient - gradient that follows a shape contour

interface ShapeGradientDef extends BaseGradientDef
MemberSignatureDescription
angleangle?: numberRotation angle in degrees
bandWidthbandWidth?: numberStroke band width (0 = fill), normalized 0-1
centercenter: [number, number]Center point [x, y] in normalized coordinates (0-1)
closePathclosePath?: booleanClose the polygon path (default: true)
emissionModeemissionMode?: ShapeEmissionModeWhich side(s) to emit from the polygon
focalfocal?: [number, number]Optional focal point for square/diamond shapes
pointspoints?: [number, number][]Polygon points in normalized coordinates (0-1)
radiusradius?: numberSquare/diamond radius in normalized coordinates (relative to min dimension)
scaleYscaleY?: numberVertical scale for square/diamond shapes
shapeshape: "square" | "diamond" | "star" | "polygon"Shape type
sidessides?: numberNumber of sides (for polygon)
sizesize?: numberGradient spread as a fraction of the shorter dimension
typetype: "shape"Gradient kind discriminator.

SketchBrushUseOptions

# Interface

Public brush activation options.

interface SketchBrushUseOptions
MemberSignatureDescription
saveSettingssaveSettings?: booleanPersist supplied activation values as remembered tool settings.
toolIdtoolId?: stringTool id used to activate the brush.

SketchBundleEntry

# Interface

File entry returned by a native Sketchpad bundle export.

interface SketchBundleEntry
MemberSignatureDescription
namename: stringFile name within the exported bundle.
valuevalue: BlobSerialized file content.

SketchClipboardPasteOffset

# Interface

Point offset applied to pasted layers in document coordinates.

interface SketchClipboardPasteOffset
MemberSignatureDescription
xx?: numberHorizontal offset in document coordinates.
yy?: numberVertical offset in document coordinates.

SketchClipboardPasteOptions

# Interface

Options accepted by SketchAPI.clipboard.paste(...).

interface SketchClipboardPasteOptions<TLayer extends SketchLayerHandle = SketchLayerHandle, TDocument = object> extends SketchClipboardTargetOptions<TDocument>
MemberSignatureDescription
offsetByoffsetBy?: SketchClipboardPasteOffsetOffset applied after insertion.
parentparent?: SketchClipboardLayerReference<TLayer> | nullDestination group, null for the scene root, or omitted for the current selection context.

SketchClipboardTargetOptions

# Interface

Options targeting one open document.

interface SketchClipboardTargetOptions<TDocument = object>
MemberSignatureDescription
docdoc?: TDocumentTarget document, defaulting to the active document.

SketchDocumentClearOptions

# Interface

Options accepted when clearing an open document.

interface SketchDocumentClearOptions<TDocument extends SketchDocumentHandle = SketchDocumentHandle> extends SketchDocumentTargetOptions<TDocument>
MemberSignatureDescription
recordHistoryrecordHistory?: booleanRecord the clear operation in document history.

SketchDocumentCreateOptions

# Interface

Options accepted when creating an empty live document in the mounted host.

interface SketchDocumentCreateOptions
MemberSignatureDescription
heightheight?: numberInitial document height in the requested units.
unitsunits?: SketchDocumentSize["units"]Document unit id understood by the runtime.
widthwidth?: numberInitial document width in the requested units.

SketchDocumentHandle

# Interface

Live document capability returned by an instance-scoped SketchAPI.

This is deliberately narrower than the internal document runtime and is not the portable SketchDocument save format.

interface SketchDocumentHandle<TLayer extends SketchLayerHandle = SketchLayerHandle>
MemberSignatureDescription
heightreadonly height?: numberCurrent document height in document units.
layersreadonly layers?: readonly TLayer[]Snapshot-readable layer collection owned by this document.
uuidreadonly uuid: stringStable identity of this open document.
widthreadonly width?: numberCurrent document width in document units.

SketchDocumentRect

# Interface

Rectangular document region used by public camera fitting operations.

interface SketchDocumentRect
MemberSignatureDescription
heightheight: numberRegion height in document units.
widthwidth: numberRegion width in document units.
xx: numberHorizontal origin in document units.
yy: numberVertical origin in document units.

SketchDocumentSize

# Interface

Required dimensions used by public document resize operations.

interface SketchDocumentSize
MemberSignatureDescription
heightheight: numberDocument height in the requested units.
unitsunits?: SketchMeasurementUnitsOptional document unit id understood by the runtime.
widthwidth: numberDocument width in the requested units.

SketchDocumentTargetOptions

# Interface

Options shared by operations targeting an open document.

interface SketchDocumentTargetOptions<TDocument extends SketchDocumentHandle = SketchDocumentHandle>
MemberSignatureDescription
docdoc?: TDocumentTarget document, defaulting to the active document.

SketchDocumentViewportChanges

# Interface

Camera and document-size changes accepted by setViewport(...).

interface SketchDocumentViewportChanges
MemberSignatureDescription
heightheight?: numberReplacement document height.
scrollscroll?: { x: number; y: number }Replacement viewport scroll position.
unitsunits?: SketchDocumentSize["units"]Replacement document units.
widthwidth?: numberReplacement document width.
zoomzoom?: numberReplacement viewport zoom multiplier.

SketchDocumentViewportOptions

# Interface

Options accepted when resizing an open document's viewport.

interface SketchDocumentViewportOptions<TDocument extends SketchDocumentHandle = SketchDocumentHandle> extends SketchDocumentTargetOptions<TDocument>
MemberSignatureDescription
heightheight?: numberExplicit viewport height, or omit to measure the host element.
widthwidth?: numberExplicit viewport width, or omit to measure the host element.

SketchDocumentViewportState

# Interface

Immutable camera and document-size state for one open document.

interface SketchDocumentViewportState
MemberSignatureDescription
heightreadonly height: numberDocument height in its current units.
scrollreadonly scroll: Readonly<{ x: number; y: number }>Current viewport scroll position.
unitsreadonly units?: SketchDocumentSize["units"]Current document units.
widthreadonly width: numberDocument width in its current units.
zoomreadonly zoom: numberCurrent zoom multiplier.

SketchHistoryMoveOptions

# Interface

Options accepted by public undo and redo operations.

interface SketchHistoryMoveOptions<TDocument = object> extends SketchHistoryTargetOptions<TDocument>
MemberSignatureDescription
stepssteps?: numberPositive number of journal entries to apply.

SketchHistoryTargetOptions

# Interface

Options targeting one open document's history.

interface SketchHistoryTargetOptions<TDocument = object>
MemberSignatureDescription
docdoc?: TDocumentTarget document, defaulting to the active document.

SketchHistoryTransactionOptions

# Interface

Options accepted by one atomic public history transaction.

interface SketchHistoryTransactionOptions<TDocument = object> extends SketchHistoryTargetOptions<TDocument>
MemberSignatureDescription
namename?: stringUser-facing history entry name.

SketchImportedMediaAsset

# Interface

Asset metadata returned when media is installed without creating a layer.

interface SketchImportedMediaAsset
MemberSignatureDescription
assetIdreadonly assetId: stringStable asset id used by document layers and resource references.
heightreadonly height?: numberImported asset height when the source has intrinsic dimensions.
widthreadonly width?: numberImported asset width when the source has intrinsic dimensions.

SketchJsonInputDocument

# Interface

Structured JSON document accepted by open.json.

interface SketchJsonInputDocument
MemberSignatureDescription
assetsassets?: Record<string, unknown>Serialized asset table.
configconfig?: Record<string, unknown>Serialized document configuration.
historyhistory?: unknownSerialized undo history.
layerslayers?: unknown[]Serialized root layer tree.
resourcesresources?: unknown[]Serialized reusable document resources.

SketchLayerBoundsInput

# Interface

Bounding-box and transform fields accepted by public layer creation.

interface SketchLayerBoundsInput
MemberSignatureDescription
anchoranchor?: number | Partial<SketchLayerPointLike>Anchor ratio or horizontal and vertical anchor ratios.
heightheight?: numberLayer height in document units.
rotationrotation?: numberClockwise rotation in radians.
scalescale?: number | Partial<SketchLayerPointLike>Uniform scale or horizontal and vertical scale factors.
sxsx?: numberHorizontal scale override.
sysy?: numberVertical scale override.
translatetranslate?: Partial<SketchLayerPointLike>Relative translation in document units.
widthwidth?: numberLayer width in document units.
xx?: numberHorizontal position in document units.
yy?: numberVertical position in document units.

SketchLayerCreateOptions

# Interface

Options accepted when creating layers.

interface SketchLayerCreateOptions<TDocument = object>
MemberSignatureDescription
docdoc?: TDocumentTarget document, defaulting to the active document.
recordHistoryrecordHistory?: booleanRecord the creation in document history.
selectselect?: booleanSelect the created layers.

SketchLayerDefinition

# Interface

Common layer input accepted by SketchAPI.layer.create(...).

interface SketchLayerDefinition extends SketchLayerProperties
MemberSignatureDescription
typereadonly type: stringCanonical layer/tool type id.

SketchLayerHandle

# Interface

Live layer capability returned by an instance-scoped SketchAPI.

interface SketchLayerHandle
MemberSignatureDescription
idreadonly id: stringStable identity within the owning document.
idxreadonly idx?: numberCurrent zero-based position within the parent layer collection.
namereadonly name?: stringUser-facing layer name when one is assigned.
typereadonly type: stringCanonical layer/tool type id.

SketchLayerMoveOptions

# Interface

Options accepted when moving a layer within the document tree.

interface SketchLayerMoveOptions<TLayer extends SketchLayerHandle = SketchLayerHandle, TDocument = object> extends SketchLayerTargetOptions<TDocument>
MemberSignatureDescription
indexindex: numberZero-based destination index in the target parent.
parentparent?: SketchLayerReference<TLayer> | nullDestination group, null for the scene root, or omitted for the current parent.
recordHistoryrecordHistory?: booleanRecord the ordering change in document history.

SketchLayerProperties

# Interface

Common serializable properties shared by public layer creation and updates.

interface SketchLayerProperties extends SketchLayerBoundsInput
MemberSignatureDescription
bboxbbox?: SketchLayerBoundsInputExplicit bounding-box transform, when preferred over top-level geometry fields.
fillfill?: FillInput | nullPrimary fill paint.
fillsfills?: readonly FillInput[]Ordered fill paint stack.
namename?: stringUser-facing layer name.
opacityopacity?: numberLayer opacity from zero to one.
strokestroke?: StrokeInput | nullPrimary stroke paint.
strokesstrokes?: readonly StrokeInput[]Ordered stroke paint stack.
visiblevisible?: booleanWhether the layer participates in rendering.

SketchLayerRemoveOptions

# Interface

Options accepted when removing layers.

interface SketchLayerRemoveOptions<TDocument = object> extends SketchLayerTargetOptions<TDocument>
MemberSignatureDescription
fadeOutfadeOut?: numberOptional removal fade duration in milliseconds.
recordHistoryrecordHistory?: booleanRecord the removal in document history.

SketchLayerTargetOptions

# Interface

Options shared by operations targeting layers in an open document.

interface SketchLayerTargetOptions<TDocument = object>
MemberSignatureDescription
docdoc?: TDocumentTarget document, defaulting to the active document.

SketchLayerUpdateOptions

# Interface

Options accepted when updating one or more layers.

interface SketchLayerUpdateOptions<TDocument = object> extends SketchLayerTargetOptions<TDocument>
MemberSignatureDescription
recordHistoryrecordHistory?: booleanRecord the update in document history.
storeAsstoreAs?: stringOptional history entry name.

SketchMediaAssetResult

# Interface

Result of installing a reusable media asset.

interface SketchMediaAssetResult
MemberSignatureDescription
assetreadonly asset: SketchImportedMediaAssetReusable asset installed by the importer.
kindreadonly kind: "asset"Result discriminator.

SketchMediaBatchResult

# Interface

Result of importing a heterogeneous collection.

interface SketchMediaBatchResult<TDocument = object, TLayer extends SketchLayerHandle = SketchLayerHandle>
MemberSignatureDescription
kindreadonly kind: "batch"Result discriminator.
resultsreadonly results: readonly SketchMediaAddResult<TDocument, TLayer>[]Ordered normalized results for each imported input.

SketchMediaDocumentResult

# Interface

Result of opening media as a document.

interface SketchMediaDocumentResult<TDocument = object>
MemberSignatureDescription
documentreadonly document: TDocumentDocument opened by the importer.
kindreadonly kind: "document"Result discriminator.

SketchMediaLayerResult

# Interface

Result of creating one media layer.

interface SketchMediaLayerResult<TLayer extends SketchLayerHandle = SketchLayerHandle>
MemberSignatureDescription
kindreadonly kind: "layer"Result discriminator.
layerreadonly layer: TLayerLayer created by the importer.

SketchMediaLayersResult

# Interface

Result of creating multiple media layers.

interface SketchMediaLayersResult<TLayer extends SketchLayerHandle = SketchLayerHandle>
MemberSignatureDescription
kindreadonly kind: "layers"Result discriminator.
layersreadonly layers: readonly TLayer[]Layers created by the importer.

SketchMediaMessageResult

# Interface

Informational result produced by resource-only imports such as brush packs.

interface SketchMediaMessageResult
MemberSignatureDescription
kindreadonly kind: "message"Result discriminator.
messagereadonly message: stringInformational message produced by the importer.

SketchMediaNoneResult

# Interface

Result produced when an importer completes without creating a public value.

interface SketchMediaNoneResult
MemberSignatureDescription
kindreadonly kind: "none"Result discriminator.

SketchMediaPoint

# Interface

Shared two-dimensional document-space point.

interface SketchMediaPoint
MemberSignatureDescription
xx: numberHorizontal document-space coordinate.
yy: numberVertical document-space coordinate.

SketchSaveRegion

# Interface

Document-space rectangle used to constrain an export.

interface SketchSaveRegion
MemberSignatureDescription
heightheight?: numberRegion height in document units.
widthwidth?: numberRegion width in document units.
xx?: numberHorizontal region origin in document units.
yy?: numberVertical region origin in document units.

SketchSelectionOptions

# Interface

Options accepted when selecting layers.

interface SketchSelectionOptions<TDocument = object> extends SketchSelectionTargetOptions<TDocument>
MemberSignatureDescription
replacereplace?: booleanReplace the existing selection before selecting the input.

SketchSelectionTargetOptions

# Interface

Options shared by selection operations targeting an open document.

interface SketchSelectionTargetOptions<TDocument = object>
MemberSignatureDescription
docdoc?: TDocumentTarget document, defaulting to the active document.

SketchToolConfigOptions

# Interface

Options accepted while applying tool configuration.

interface SketchToolConfigOptions
MemberSignatureDescription
registerNullPropertiesregisterNullProperties?: booleanRegister values that are not already present on the target config.
silentsilent?: booleanSuppress configuration change notifications.

SketchpadAppDefinition

# Interface

Portable recipe for one Sketchpad product experience.

Runtime services, credentials, documents, and mounted objects are excluded.

interface SketchpadAppDefinition
MemberSignatureDescription
assetsassets?: SketchpadAssetSourcesPortable asset source selections.
capabilitiescapabilities?: SketchpadCapabilitiesProduct capabilities requested by the definition.
defaultsdefaults?: SketchpadDefaultsDefaults contributed to newly created app state.
definitionVersiondefinitionVersion: stringAuthor-managed revision of this recipe.
descriptiondescription?: stringHuman-readable description.
extensionsextensions?: Record<string, SketchpadJsonValue>Namespaced extension data preserved without interpretation.
integrationsintegrations?: SketchpadIntegrationRequirementsRuntime integrations requested from the host.
namename: stringHuman-readable app name.
settingssettings?: SketchpadSettingsDefaultsCatalog-owned app setting defaults.
sketchApisketchApi: stringCompatible Sketchpad app-definition schema version.
toolstools?: SketchpadToolSurfaceCanonical tool selection and presentation.
uiui?: SketchpadUiCompositionRegistered UI composition.

SketchpadCapabilities

# Interface

Required and optional product capabilities selected by a definition.

interface SketchpadCapabilities
MemberSignatureDescription
optionaloptional?: string[]Capabilities the runtime may use when available.
requiredrequired?: string[]Capabilities that must be available before mounting.

SketchpadFilesDocument

# Interface

Lightweight document reference accepted by the browser files service.

interface SketchpadFilesDocument
MemberSignatureDescription
uuidreadonly uuid: stringStable identity of the open Sketchpad document.

SketchpadFilesDuplicateOptions

# Interface

Options accepted when duplicating a stored Sketchpad file.

interface SketchpadFilesDuplicateOptions
MemberSignatureDescription
namename?: stringUser-facing name for the copy. Defaults to the source name.

SketchpadFilesOpenOptions

# Interface

Options accepted when opening a stored Sketchpad file.

interface SketchpadFilesOpenOptions
MemberSignatureDescription
openAsNewopenAsNew?: booleanOpen beside the active document instead of replacing it. Defaults to false.
signalsignal?: AbortSignalCancel reading or opening the file.

SketchpadFilesSaveOptions

# Interface

Options accepted when saving an open Sketchpad document.

interface SketchpadFilesSaveOptions
MemberSignatureDescription
docdoc?: SketchpadFilesDocumentDocument to save. Defaults to the active document.
namename?: stringUser-facing name for the stored file.
signalsignal?: AbortSignalCancel serialization or persistence.

SketchpadFilesService

# Interface

Instance-bound local document library supplied through host.services.files.

interface SketchpadFilesService
MemberSignatureDescription
deletedelete(id: string) -> Promise<void>Delete a stored file without closing an open document.
duplicateduplicate(id: string, options?: SketchpadFilesDuplicateOptions) -> Promise<SketchpadStoredFile>Copy a stored file under a new identity.
flushflush() -> Promise<void>Wait for all currently queued autosaves.
listlist() -> Promise<readonly SketchpadStoredFile[]>List stored files from most recently updated to oldest.
openopen(id: string, options?: SketchpadFilesOpenOptions) -> Promise<SketchpadFilesDocument>Open a stored native Sketchpad file in the mounted instance.
renamerename(id: string, name: string) -> Promise<SketchpadStoredFile>Change a stored file's user-facing name.
savesave(options?: SketchpadFilesSaveOptions) -> Promise<SketchpadStoredFile>Save an open document as a native Sketchpad file.
typereadonly type: "sketchapi.files"Stable host-service discriminator.

SketchpadIntegrationRequirements

# Interface

Runtime integrations requested from the embedding host.

interface SketchpadIntegrationRequirements
MemberSignatureDescription
optionaloptional?: string[]Integrations used only when the host supplies them.
requiredrequired?: string[]Integrations that must be supplied before mounting.

SketchpadStoredFile

# Interface

Metadata for one native Sketchpad file stored by a files service.

interface SketchpadStoredFile
MemberSignatureDescription
createdAtreadonly createdAt: numberTime the stored file was first created, in milliseconds since the Unix epoch.
idreadonly id: stringStable storage identity.
namereadonly name: stringUser-facing file name.
sizereadonly size: numberNative Sketchpad archive size in bytes.
updatedAtreadonly updatedAt: numberTime the stored file was last written, in milliseconds since the Unix epoch.

SketchpadToolGroup

# Interface

One ordered group in the Sketchpad tool surface.

interface SketchpadToolGroup
MemberSignatureDescription
idid: stringStable group id.
toolstools: string[]Canonical tool ids in display order.

SketchpadToolPresentation

# Interface

Portable presentation overrides for a canonical tool.

interface SketchpadToolPresentation
MemberSignatureDescription
descriptiondescription?: stringHuman-readable tool description.
iconicon?: stringRegistered icon or portable asset id.
labellabel?: stringHuman-readable tool label.
tooltiptooltip?: stringHuman-readable hover or focus help.

SketchpadToolSurface

# Interface

Canonical tools selected and arranged by an app definition.

interface SketchpadToolSurface
MemberSignatureDescription
defaultTooldefaultTool?: stringTool selected for a newly mounted app.
groupsgroups?: SketchpadToolGroup[]Ordered tool groups.
overridesoverrides?: Record<string, SketchpadJsonObject>Catalog-supported options keyed by canonical tool id.
presentationpresentation?: Record<string, SketchpadToolPresentation>Presentation overrides keyed by canonical tool id.

SketchpadUiComposition

# Interface

Registered UI contributions grouped into stable regions.

interface SketchpadUiComposition
MemberSignatureDescription
regionsregions?: Record<string, SketchpadUiContribution[]>Contributions keyed by canonical region id.

SketchpadUiContribution

# Interface

One registered contribution in a Sketchpad UI region.

interface SketchpadUiContribution
MemberSignatureDescription
optionsoptions?: SketchpadJsonObjectCatalog-owned contribution options.
typetype: stringRegistered contribution type.

SpiralGradientDef

# Interface

Spiral gradient - spirals outward from center.

interface SpiralGradientDef extends BaseGradientDef
MemberSignatureDescription
centercenter: [number, number]Center point [x, y] in normalized coordinates (0-1)
coilscoils?: numberNumber of spiral rotations/coils
ellipseAngleellipseAngle?: numberEllipse rotation angle in degrees
focalfocal?: [number, number]Optional focal point [x, y] for off-center spirals
growthgrowth?: numberSpiral growth rate
rotationrotation?: numberStarting rotation angle in degrees
rotationsrotations?: numberNumber of rotations
scaleXscaleX?: numberHorizontal scale
scaleYscaleY?: numberVertical scale
startAnglestartAngle?: numberStarting angle in degrees
typetype: SpiralGradientKindGradient kind discriminator.

StrokeEffectInput

# Interface

Structural input accepted by stroke effect normalization.

interface StrokeEffectInput extends PaintEffectInput
MemberSignatureDescription
alignmentalignment?: unknownAlias for stroke position.
capcap?: unknownAlias for line cap.
dashArraydashArray?: unknownAlias for line dash.
dashOffsetdashOffset?: unknownAlias for line dash offset.
joinjoin?: unknownAlias for line join.
lineCaplineCap?: unknownRaw line cap value.
lineDashlineDash?: unknownRaw line dash sequence.
lineDashOffsetlineDashOffset?: unknownRaw line dash offset.
lineJoinlineJoin?: unknownRaw line join value.
lineWidthlineWidth?: unknownAlias for stroke width.
miterLimitmiterLimit?: unknownRaw miter limit.
positionposition?: unknownRaw stroke position.
widthwidth?: unknownRaw stroke width.

ToolSurfaceConfig

# Interface

Data-only UI surface metadata exported from tool config files.

interface ToolSurfaceConfig
MemberSignatureDescription
quickOnlyquickOnly?: booleanWhether the tool is meant to be activated only as a held or temporary tool.
surfacesurface: ToolSurfaceWhere the tool should be exposed.

Type aliases

BrushDefinition

# Type alias

Public serializable brush definition.

type BrushDefinition = HybridBrushDefinition

BrushDefinitionSettings

# Type alias

Engine-specific JSON settings stored with a brush layer.

type BrushDefinitionSettings = Readonly<Record<string, unknown>>

BrushTransform

# Type alias

Serializable brush point transform.

type BrushTransform = { type: "offset"; x?: number; y?: number } | { type: "rotate"; angle: number; origin?: BrushTransformOrigin } | { type: "mirror"; angle?: number; axis: "angle" | "x" | "y"; origin?: BrushTransformOrigin } | { type: "radial"; count: number; index?: number; origin?: BrushTransformOrigin }

BrushTransformOrigin

# Type alias

Origin used by declarative brush transforms.

type BrushTransformOrigin = "canvas-center" | "stroke-start" | "viewport-center" | { x: number; y: number }

ColorSpace

# Type alias

Color space for gradient interpolation Maps to imagefx ColorSpace enum

type ColorSpace = "linear-rgb" | "srgb" | "oklab"

CoordSystem

# Type alias

Coordinate system for Y-axis orientation Maps to imagefx CoordSystem enum

type CoordSystem = "canvas" | "gl"

CurveEmissionSide

# Type alias

Curve emission side Maps to imagefx CurveEmissionSide enum

type CurveEmissionSide = "both" | "left" | "right"

CurveFalloffMode

# Type alias

Curve falloff mode Maps to imagefx FalloffMode enum

type CurveFalloffMode = "radial" | "perpendicular"

CurveWidthEasing

# Type alias

Curve width easing between stops Maps to imagefx width_easing flag

type CurveWidthEasing = "linear" | "ease-in-out"

ExtendMode

# Type alias

How the gradient behaves beyond its defined range Maps to imagefx ExtendMode enum

type ExtendMode = "clamp" | "repeat" | "reflect" | "repeat-reverse" | "reflect-reverse"

FillInput

# Type alias

Input accepted when normalizing a fill effect.

type FillInput = Paint | string | PaintEffectInput

GradientTransform

# Type alias

2D transform matrix [a, b, c, d, e, f] Equivalent to DOMMatrix/Canvas 2D transform order.

type GradientTransform = [number, number, number, number, number, number]

HostedSketchSaveOutputMap

# Type alias

Portable hosted save representations keyed by their requested format.

type HostedSketchSaveOutputMap = { arrayBuffer: ArrayBuffer; base64: string; blob: Blob; dataURL: string; object: SketchJsonDocument; string: string }
MemberSignatureDescription
arrayBufferarrayBuffer: ArrayBufferRaw exported bytes.
base64base64: stringBase64-encoded export payload without a data URL prefix.
blobblob: BlobExport payload with its media type.
dataURLdataURL: stringData URL containing the exported payload.
objectobject: SketchJsonDocumentParsed Sketch JSON document.
stringstring: stringText representation of the exported payload.

NoiseType

# Type alias

Procedural noise algorithm types

type NoiseType = "perlin" | "simplex" | "worley" | "fbm" | "turbulence" | "white"

Paint

# Type alias

A Paint is a single visual source Discriminated union - check type to determine which property is active

type Paint = ColorPaint | GradientPaint | PatternPaint

PatternFit

# Type alias

How a pattern fits within its container Similar to CSS background-size

type PatternFit = "tile" | "fill" | "contain" | "cover"

PatternRepeat

# Type alias

How a pattern repeats across its container Maps to CSS/Canvas pattern repetition

type PatternRepeat = "repeat" | "repeat-x" | "repeat-y" | "no-repeat"

PatternScale

# Type alias

Pattern scale. A number scales both axes; a tuple scales [x, y].

type PatternScale = number | [number, number]

PatternTransform

# Type alias

Affine transform for pattern coordinate space.

type PatternTransform = [number, number, number, number, number, number]

RegisteredBrushDefinition

# Type alias

Registered definitions already require stable ids.

type RegisteredBrushDefinition = BrushDefinition

SetCurrentToolOptions

# Type alias

Options forwarded to the Sketch tool switcher.

type SetCurrentToolOptions = { saveSettings?: boolean }
MemberSignatureDescription
saveSettingssaveSettings?: booleanPersist supplied values as the tool's remembered settings.

ShapeEmissionMode

# Type alias

Shape gradient emission side

type ShapeEmissionMode = "inside" | "outside" | "bidirectional"

SketchClipboardLayerReference

# Type alias

Public reference accepted by clipboard layer operations.

type SketchClipboardLayerReference<TLayer extends SketchLayerHandle = SketchLayerHandle> = string | TLayer

SketchDocumentReference

# Type alias

Public reference accepted by document lookup and close operations.

type SketchDocumentReference<TDocument extends SketchDocumentHandle = SketchDocumentHandle> = number | string | TDocument

SketchJsonDocument

# Type alias

Portable object returned by sketch.save.json({ as: 'object' }).

type SketchJsonDocument = Record<string, unknown> & { config: Record<string, unknown>; layers: SketchJsonLayer[]; version: string }

SketchJsonInput

# Type alias

Input accepted by the native JSON document opener.

type SketchJsonInput = Blob | SketchJsonInputDocument | string

SketchJsonLayer

# Type alias

Portable serialized layer returned by Sketch JSON export.

type SketchJsonLayer = Record<string, unknown> & { children?: SketchJsonLayer[]; id?: string; type?: string }

SketchLayerChanges

# Type alias

Common properties plus caller-owned extensions inferred by update operations.

type SketchLayerChanges<TChanges extends object = object> = Readonly<SketchLayerProperties & TChanges>

SketchLayerPointLike

# Type alias

Shared two-dimensional layer point or scale value.

type SketchLayerPointLike = { x: number; y: number }
MemberSignatureDescription
xx: numberHorizontal coordinate or scale.
yy: numberVertical coordinate or scale.

SketchLayerReference

# Type alias

Public reference accepted by layer lookup and mutation operations.

type SketchLayerReference<TLayer extends SketchLayerHandle = SketchLayerHandle> = string | TLayer

SketchLayerSnapshot

# Type alias

Detached serializable state for one live layer.

type SketchLayerSnapshot<TData extends object = Record<string, unknown>> = Readonly<TData> & { readonly id: string; readonly type: string }

SketchMeasurementUnits

# Type alias

Supported measurement unit labels.

type SketchMeasurementUnits = "px" | "pt" | "pc" | "in" | "ft" | "yd" | "mm" | "cm" | "m"

SketchPsdInput

# Type alias

Input accepted by the public PSD opener.

type SketchPsdInput = ArrayBuffer | Blob | File | string

SketchSelectionInput

# Type alias

Layer or layer id accepted by public selection operations.

type SketchSelectionInput<TLayer extends SketchLayerHandle = SketchLayerHandle> = string | TLayer | readonly (string | TLayer)[]

SketchToolConfigMap

# Type alias

Tool config values keyed by registered tool id.

type SketchToolConfigMap<TConfig extends object = SketchToolConfigValues> = Readonly<Record<string, Readonly<TConfig>>>

SketchToolConfigValues

# Type alias

Dynamic, schema-validated values for one registered tool.

type SketchToolConfigValues = Readonly<Record<string, unknown>>

SketchToolHandle

# Type alias

Data-only identity for an activated tool.

type SketchToolHandle = { readonly id: string; readonly toolkitId?: string }
MemberSignatureDescription
idreadonly id: stringCanonical tool id.
toolkitIdreadonly toolkitId?: stringToolkit family that owns the tool implementation.

SketchToolListEntry

# Type alias

Public metadata for a registered Sketch tool.

type SketchToolListEntry = { capabilities?: Record<string, boolean>; id: string; surface?: ToolSurfaceConfig; toolkitId?: string }
MemberSignatureDescription
capabilitiescapabilities?: Record<string, boolean>Capability flags registered for this tool.
idid: stringTool id used with sketch.tool.use(...).
surfacesurface?: ToolSurfaceConfigConfig-pane surface metadata for this tool.
toolkitIdtoolkitId?: stringToolkit family that owns the tool implementation.

SketchToolListFilter

# Type alias

Filters accepted by sketch.tool.list(...).

type SketchToolListFilter = { capability?: string; surface?: string; toolkitId?: string }
MemberSignatureDescription
capabilitycapability?: stringKeep tools that declare this capability.
surfacesurface?: stringKeep tools assigned to this config surface id.
toolkitIdtoolkitId?: stringKeep tools from this toolkit family.

SketchpadAppDefinitionInput

# Type alias

Author input accepted by defineSketchpadApp; the SDK owns its schema version.

type SketchpadAppDefinitionInput = Omit<SketchpadAppDefinition, "sketchApi">

SketchpadAssetSources

# Type alias

Portable asset source ids keyed by catalog-owned role.

type SketchpadAssetSources = Record<string, string[]>

SketchpadInitialDocument

# Type alias

Initial document behavior for the maintained browser runtime.

type SketchpadInitialDocument = false | SketchDocumentCreateOptions

SketchpadJsonObject

# Type alias

A JSON-safe object with string keys.

type SketchpadJsonObject = { [key: string]: SketchpadJsonValue }

SketchpadJsonPrimitive

# Type alias

A primitive value preserved by JSON serialization.

type SketchpadJsonPrimitive = boolean | null | number | string

SketchpadSettingsDefaults

# Type alias

Catalog-owned setting defaults keyed by canonical setting id.

type SketchpadSettingsDefaults = Record<string, SketchpadJsonValue>

SpiralGradientKind

# Type alias

Spiral gradient variant.

type SpiralGradientKind = "spiral" | "archimedean-spiral" | "logarithmic-spiral"

StrokeInput

# Type alias

Input accepted when normalizing a stroke effect.

type StrokeInput = Paint | string | StrokeEffectInput

ToolSchema

# Type alias

Normalized public schema for a registered tool.

type ToolSchema = { capabilities?: Record<string, boolean>; id: string; surface?: ToolSurfaceConfig; toolkitId?: string; values: Record<string, ToolSchemaValue> }
MemberSignatureDescription
capabilitiescapabilities?: Record<string, boolean>Capability flags declared by the tool.
idid: stringCanonical registered tool id.
surfacesurface?: ToolSurfaceConfigConfig-pane surface metadata.
toolkitIdtoolkitId?: stringToolkit family that owns the tool.
valuesvalues: Record<string, ToolSchemaValue>Public configurable values keyed by config id.

ToolSchemaValue

# Type alias

One public configurable value in a registered tool schema.

type ToolSchemaValue = { default?: unknown; label?: string; max?: number; min?: number; options?: readonly unknown[] | Record<string, unknown>; path: string; step?: number; type: ToolSchemaValueType; unit?: string }
MemberSignatureDescription
defaultdefault?: unknownDefault value applied when the tool has no stored value.
labellabel?: stringHuman-readable control label.
maxmax?: numberMaximum numeric value accepted by the control.
minmin?: numberMinimum numeric value accepted by the control.
optionsoptions?: readonly unknown[] | Record<string, unknown>Choice metadata for controls such as select inputs.
pathpath: stringConfig path updated by the control.
stepstep?: numberNumeric increment used by stepped controls.
typetype: ToolSchemaValueTypeCanonical control value kind.
unitunit?: stringDisplay unit for numeric values.

ToolSchemaValueType

# Type alias

Public value kinds used by registered tool schemas.

type ToolSchemaValueType = "angle" | "blend" | "boolean" | "color" | "filter" | "number" | "paint" | "point" | "resource" | "select" | "style" | "text" | "unknown"

ToolSurface

# Type alias

Where a tool should appear in the Sketchpad UI.

type ToolSurface = "primary" | "secondary" | "utility" | "command" | "transient" | "hidden"

Generated from public source documentation by CodeAtlas 0.10.0.