TLInstance
See source codeTable of contents
- brush
- chatMessage
- currentPageId
- cursor
- devicePixelRatio
- duplicateProps
- exportBackground
- followingUserId
- highlightedUserIds
- id
- insets
- isChangingStyle
- isChatting
- isCoarsePointer
- isDebugMode
- isFocused
- isFocusMode
- isGridMode
- isHoveringCanvas
- isPenMode
- isReadonly
- isToolLocked
- meta
- opacityForNextShape
- openMenus
- screenBounds
- scribbles
- stylesForNextShape
- typeName
- zoomBrush
- Properties
Extends BaseRecord<'instance', TLInstanceId>.
State that is particular to a single browser tab. The TLInstance record stores all session-specific state including cursor position, selected tools, UI preferences, and temporary interaction state.
Each browser tab has exactly one TLInstance record that persists for the duration of the session and tracks the user's current interaction state.
interface TLInstance extends BaseRecord<'instance', TLInstanceId> {}Example
const instance: TLInstance = {
id: 'instance:instance',
typeName: 'instance',
currentPageId: 'page:page1',
cursor: { type: 'default', rotation: 0 },
screenBounds: { x: 0, y: 0, w: 1920, h: 1080 },
isFocusMode: false,
isGridMode: true,
}Properties
brush
brush: BoxModel | nullchatMessage
chatMessage: stringcurrentPageId
currentPageId: TLPageIdcursor
cursor: TLCursordevicePixelRatio
devicePixelRatio: numberduplicateProps
duplicateProps: {
offset: {
x: number
y: number
}
shapeIds: TLShapeId[]
} | nullexportBackground
exportBackground: booleanfollowingUserId
followingUserId: null | stringhighlightedUserIds
highlightedUserIds: string[]id
readonly
from BaseRecord
readonly id: Idinsets
insets: boolean[]isChangingStyle
isChangingStyle: booleanisChatting
isChatting: booleanisCoarsePointer
This is whether the primary input mechanism includes a pointing device of limited accuracy, such as a finger on a touchscreen.
isCoarsePointer: booleanisDebugMode
isDebugMode: booleanisFocused
isFocused: booleanisFocusMode
isFocusMode: booleanisGridMode
isGridMode: booleanisHoveringCanvas
Will be null if the pointer doesn't support hovering (e.g. touch), but true or false otherwise
isHoveringCanvas: boolean | nullisPenMode
isPenMode: booleanisReadonly
isReadonly: booleanisToolLocked
isToolLocked: booleanmeta
meta: JsonObjectopacityForNextShape
opacityForNextShape: TLOpacityTypeopenMenus
openMenus: string[]screenBounds
screenBounds: BoxModelscribbles
scribbles: TLScribble[]stylesForNextShape
stylesForNextShape: Record<string, unknown>typeName
readonly
from BaseRecord
readonly typeName: TypeNamezoomBrush
zoomBrush: BoxModel | nullPrev
TLImageShapePropsNext
TLInstancePageState