@tldraw/tlschema
Version:
A tiny little drawing app (schema).
8 lines (7 loc) • 1.54 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/misc/TLCursor.ts"],
"sourcesContent": ["import { T } from '@tldraw/validate'\nimport { SetValue } from '../util-types'\n\n/**\n * The cursor types used by tldraw's default shapes.\n *\n * @public */\nexport const TL_CURSOR_TYPES = new Set([\n\t'none',\n\t'default',\n\t'pointer',\n\t'cross',\n\t'grab',\n\t'rotate',\n\t'grabbing',\n\t'resize-edge',\n\t'resize-corner',\n\t'text',\n\t'move',\n\t'ew-resize',\n\t'ns-resize',\n\t'nesw-resize',\n\t'nwse-resize',\n\t'nesw-rotate',\n\t'nwse-rotate',\n\t'swne-rotate',\n\t'senw-rotate',\n\t'zoom-in',\n\t'zoom-out',\n])\n\n/**\n * A type for the cursor types used by tldraw's default shapes.\n *\n * @public */\nexport type TLCursorType = SetValue<typeof TL_CURSOR_TYPES>\n\n/** @public */\nexport const cursorTypeValidator = T.setEnum(TL_CURSOR_TYPES)\n\n/**\n * A cursor used by tldraw.\n *\n * @public */\nexport interface TLCursor {\n\ttype: TLCursorType\n\trotation: number\n}\n\n/** @public */\nexport const cursorValidator: T.ObjectValidator<TLCursor> = T.object<TLCursor>({\n\ttype: cursorTypeValidator,\n\trotation: T.number,\n})\n"],
"mappings": "AAAA,SAAS,SAAS;AAOX,MAAM,kBAAkB,oBAAI,IAAI;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AASM,MAAM,sBAAsB,EAAE,QAAQ,eAAe;AAYrD,MAAM,kBAA+C,EAAE,OAAiB;AAAA,EAC9E,MAAM;AAAA,EACN,UAAU,EAAE;AACb,CAAC;",
"names": []
}