TLInstancePageState

See source code
Table of contents

Extends BaseRecord<'instance_page_state', TLInstancePageStateId>.

State that is unique to a particular page within a particular browser tab. This record tracks all page-specific interaction state including selected shapes, editing state, hover state, and other transient UI state that is tied to both a specific page and a specific browser session.

Each combination of page and browser tab has its own TLInstancePageState record.

interface TLInstancePageState extends BaseRecord<
  "instance_page_state",
  TLInstancePageStateId
> {}

Example

const pageState: TLInstancePageState = {
  id: "instance_page_state:page1",
  typeName: "instance_page_state",
  pageId: "page:page1",
  selectedShapeIds: ["shape:rect1", "shape:circle2"],
  hoveredShapeId: "shape:text3",
  editingShapeId: null,
  focusedGroupId: null,
};

Properties

croppingShapeId

croppingShapeId: null | TLShapeId;

editingShapeId

editingShapeId: null | TLShapeId;

erasingShapeIds

erasingShapeIds: TLShapeId[];

focusedGroupId

focusedGroupId: null | TLShapeId;

hintingShapeIds

hintingShapeIds: TLShapeId[];

hoveredShapeId

hoveredShapeId: null | TLShapeId;

id

readonly
readonly id: Id;

meta

meta: JsonObject;

pageId

pageId: RecordId<TLPage>;

selectedShapeIds

selectedShapeIds: TLShapeId[];

typeName

readonly
readonly typeName: TypeName;

Prev
TLInstance
Next
TLInstancePresence