TLNoteUtil

Public Class

Table of Contents
Signature
class TLNoteUtil extends TLShapeUtil<TLNoteShape> {}
References

TLShapeUtil, TLNoteShape


Properties

canEdit

Public Property

Signature
canEdit: () => boolean

hideResizeHandles

Public Property

Signature
hideResizeHandles: () => boolean

hideSelectionBoundsBg

Public Property

Signature
hideSelectionBoundsBg: () => boolean

hideSelectionBoundsFg

Public Property

Signature
hideSelectionBoundsFg: () => boolean

onBeforeCreate

Public Property

Signature
onBeforeCreate: (next: TLNoteShape) =>
  | {
      props: {
        growY: number
        color:
          | 'black'
          | 'blue'
          | 'green'
          | 'grey'
          | 'light-blue'
          | 'light-green'
          | 'light-red'
          | 'light-violet'
          | 'orange'
          | 'red'
          | 'violet'
          | 'yellow'
        size: 'l' | 'm' | 's' | 'xl'
        font: 'draw' | 'mono' | 'sans' | 'serif'
        align: 'end' | 'middle' | 'start'
        opacity: '0.1' | '0.25' | '0.5' | '0.75' | '1'
        url: string
        text: string
      }
      type: 'note'
      x: number
      y: number
      rotation: number
      index: string
      parentId: import('@tldraw/tlschema').TLParentId
      isLocked: boolean
      id: import('@tldraw/tlstore').ID<TLNoteShape>
      typeName: 'shape'
    }
  | undefined
References

TLNoteShape, TLParentId, ID


onBeforeUpdate

Public Property

Signature
onBeforeUpdate: (
  prev: TLNoteShape,
  next: TLNoteShape
) =>
  | {
      props: {
        growY: number
        color:
          | 'black'
          | 'blue'
          | 'green'
          | 'grey'
          | 'light-blue'
          | 'light-green'
          | 'light-red'
          | 'light-violet'
          | 'orange'
          | 'red'
          | 'violet'
          | 'yellow'
        size: 'l' | 'm' | 's' | 'xl'
        font: 'draw' | 'mono' | 'sans' | 'serif'
        align: 'end' | 'middle' | 'start'
        opacity: '0.1' | '0.25' | '0.5' | '0.75' | '1'
        url: string
        text: string
      }
      type: 'note'
      x: number
      y: number
      rotation: number
      index: string
      parentId: import('@tldraw/tlschema').TLParentId
      isLocked: boolean
      id: import('@tldraw/tlstore').ID<TLNoteShape>
      typeName: 'shape'
    }
  | undefined
References

TLNoteShape, TLParentId, ID


onEditEnd

Public Property

Signature
onEditEnd: OnEditEndHandler<TLNoteShape>
References

OnEditEndHandler, TLNoteShape


type

Public Static Property

Signature
static type: string

Methods

defaultProps()

Public Method

Parameters

None

Returns
TLNoteShape['props']
References

TLNoteShape


getBounds()

Public Method

Parameters
NameDescription

shape

TLNoteShape
Returns
Box2d
References

TLNoteShape, Box2d


getCenter()

Public Method

Parameters
NameDescription

_shape

TLNoteShape
Returns
Vec2d
References

TLNoteShape, Vec2d


getHeight()

Public Method

Parameters
NameDescription

shape

TLNoteShape
Returns
number
References

TLNoteShape


getOutline()

Public Method

Parameters
NameDescription

shape

TLNoteShape
Returns
Vec2d[]
References

TLNoteShape, Vec2d


indicator()

Public Method

Parameters
NameDescription

shape

TLNoteShape
Returns
JSX.Element
References

TLNoteShape, JSX.Element


render()

Public Method

Parameters
NameDescription

shape

TLNoteShape
Returns
JSX.Element
References

TLNoteShape, JSX.Element


toSvg()

Public Method

Parameters
NameDescription

shape

TLNoteShape

font

string

colors

TLExportColors
Returns
SVGGElement
References

TLNoteShape, TLExportColors, SVGGElement


Edit this page
Last edited on 11 May 2023
TLNoteShapeDefTLPinchEvent