isShape
See source codeType guard to check if a record is a shape.
function isShape(record?: UnknownRecord): record is TLShapeExample
const record = store.get('shape:abc123')
if (isShape(record)) {
console.log(`Shape type: ${record.type}`)
console.log(`Position: (${record.x}, ${record.y})`)
}Parameters
| Name | Description |
|---|---|
| The record to check |
Returns
record is TLShapeTrue if the record is a shape, false otherwise
Prev
isPageIdNext
isShapeId