Reference · 1,106 exports · mocanvas 4.11.2
The editor itself — the store, the records, geometry, and everything the UI is built on.
Read out of the type declarations inside the published package, so a name here is a name in the version above — and its description is the one written next to the code.
1106 of 1106
class
A circular arc, given the way SVG gives one: a centre, two endpoints, and the two flags that pick which of the four possible arcs between them is meant.
class
An array whose every item matches `item`.
class
Describes how one kind of asset behaves.
class
The per-editor registry behind `editor.assetUtils` and the `getAssetUtil*` family.
class
Shapes with `w` and `h` props.
Container behaviour, complete, for a `w`/`h` shape.
class
Describes how a binding type behaves.
class
Bounds snapping: aligning a dragged or resized selection's edges and centres with those of the shapes around it.
class
class
class
A circle of the given radius, inscribed in its own bounding box.
class
Turns a stream of pointer presses into double-click events.
class
One element per shape, for as long as the shape exists.
class
A single cubic bézier segment: `start` → `end`, shaped by the two control points `cp1` and `cp2`.
class
A chain of cubic bézier segments, serialized natively rather than flattened.
class
A validator for an object used as a lookup table: any key the key validator accepts, every value matching the value validator.
class
One straight segment.
class
class
class
A piece of reactive state that belongs to an editor rather than to a module.
class
The base class for anything that owns subscriptions on behalf of an editor.
class
An ellipse inscribed in a `width × height` box at the shape's origin.
class
class
Catches a render-time throw in its subtree and renders `fallback` instead.
class
Minimal typed event emitter.
class
Loads the typefaces the canvas actually needs, and only those.
class
Base class for shape geometry.
class
Several geometries drawn as one shape (e.g.
class
Handle snapping: finding somewhere for a dragged endpoint to land.
class
Interns string ids to dense u32 engine handles.
class
Undo/redo over store diffs.
class
The editor's input state.
class
class
The set of menus that are open, kept in the `instance` session record so it survives tool changes, is visible to anything reading the store, and is reactive: reading `getOpenMenus()` inside a signal re-runs it on every change.
class
A validator for a plain object with a known set of properties.
class
The registry of canvas overlays.
class
Base class for a canvas overlay.
Mirrors the editor's timing events into the browser's own Performance timeline, and collects long-animation-frame reports.
class
A small, self-contained sink for the editor's own timing events.
class
A single point, with a `margin` that gives it something to be hit at.
class
A closed run of straight segments.
class
An open run of straight segments.
What the current selection has in common, style by style — the read-only half.
class
An axis-aligned rectangle, optionally offset from the shape's origin.
class
The root of the tool tree.
class
The trails a laser pointer, an eraser or a select brush leaves behind.
Paints shape indicators onto the canvas overlay.
class
class
The writable form, used while the shared styles are being computed.
class
Edge and center snapping against nearby shapes.
class
A rectangle with fully rounded ends — a pill.
class
A node in the tool state machine.
class
A shape prop that is a *style*: shared across shape types, remembered for the next created shape, and editable for a whole selection at once.
class
Text measurement, as the editor's own manager.
class
Owns the host's GPU textures: allocates ids, refcounts them by key, loads their pixels asynchronously and uploads them through the current `RenderBackend`.
class
Holds the themes and the colour mode, reactively.
class
Per-editor timers.
class
The registry behind {@link tleditors}.
Another geometry seen through an affine transform.
class
A discriminated union, dispatched on one property.
Reads preferences with the editor's defaults applied, and writes them back through whoever owns them.
class
Thrown when a value does not match its validator.
class
A checked value: `validate` narrows or throws, everything else is built on top of it.
class
class
function
The turn from `fromAngle` to `toAngle` in the given direction: `1` for anti-clockwise, `-1` for clockwise.
function
Move a shape to a new position/rotation/opacity over time.
function
{@link animateShape} for many shapes on one clock, so a group of shapes arrives together rather than drifting apart over the animation.
function
Apply a patch to a theme, merging `colors` one ramp at a time.
function
Whether two numbers are equal to within `precision`.
function
Whether two angles describe the same axis, i.e.
function
An array whose every item matches `item`.
function
The `sequenceId` under which asset type `type`'s props migrations are registered.
function
Publishes an {@link TLAssetUrls} map to everything below it.
function
The midpoint of two points written for an SVG path `d`.
function
The `sequenceId` under which binding type `type`'s props migrations are registered.
function
A rectangle, as the indicator of last resort.
function
`dpr × min(MAX_TEXTURE_ZOOM, zoom)` snapped up to a power of two, so panning and zooming only re-rasterize a texture when it crosses a bucket boundary.
function
Whether a binding of `bindingType` may be created between two shapes.
function
Whether `Path2D` exists in this realm (it does not in Node, or during SSR).
function
Whether one more shape can be added to the current page.
function
Whether a whole batch can be added.
function
Whether a shape can enter cropping.
function
Whether a shape can be put into its editing state right now.
function
An angle brought into `[0, 2π)`, whatever it started as.
function
The canvas: a WebGL2 surface driven by the engine, a DOM overlay for shapes that render through `ShapeUtil.component`, a 2D canvas overlay for shape indicators, and an SVG layer for the selection handles, snap lines, the brush — and for …
function
The centre of the circle through three points, or null when they are collinear and no such circle exists.
function
Clamp a value into a range.
function
An angle brought into `[0, 2π)`.
function
The turn from `a0` to `a1` going clockwise (increasing angle), in `[0, 2π)`.
function
Convert segments whose points are still stored as objects into packed ones.
function
Publishes `container` to {@link useContainer} and {@link EditorPortal}.
function
The turn from `a0` to `a1` going anti-clockwise, in `[0, 2π)`.
function
function
Migration ids for an asset type, from friendly version names:
Check an asset props migration sequence and hand it back.
function
The validator for an asset type, from its prop map.
function
The validator for an asset type, from its props.
function
Create the synchronous WebGL2 backend.
function
The fields every asset has whatever its type — everything but `props`.
function
The counterpart of {@link createBaseShapeValidator} for bindings.
function
The fields every shape has, whatever its type — everything but `props`.
function
function
Migration ids for a binding type; see {@link createShapePropsMigrationIds}.
Check a binding props migration sequence; see {@link createShapePropsMigrationSequence}.
function
The validator for a binding type, from its `static props`.
Migration ids for an asset type **this library ships**, under {@link BUILTIN_ASSET_MIGRATION_SEQUENCE_PREFIX}.
As {@link createBuiltInShapePropsMigrationIds}, for a built-in binding type.
Migration ids for a shape type **this library ships**, under {@link BUILTIN_SHAPE_MIGRATION_SEQUENCE_PREFIX}.
function
Wrap a {@link UserStore}'s `resolve` so the same id is not looked up twice.
function
Build a comment record.
function
function
Build a reaction record.
function
function
Build a thread record.
function
function
A {@link CurrentUser} backed by one atom.
function
Create a record of a declared custom type, with its defaults filled in.
function
Mint an id for a custom record of `type`.
function
Migration ids for a custom record type, from friendly version names:
Check a custom record props migration sequence and hand it back.
The migration sequences for a set of custom record declarations.
function
Build the `RecordType` for one custom record type.
function
One `RecordType` covering every declared custom type.
function
The validator for a custom record type, from its props.
function
Encode a deep link as a short string.
function
The store used when an app supplies none: files become `data:` URLs held in memory for the life of the page.
function
A `UserStore` over a fixed list of people.
function
Build the signal that says what to broadcast about this client.
function
The store migration sequences for a set of shape and binding utils.
function
Build a root state class with the given tools and initial tool id.
function
Build the editor's schema.
function
A signal of the store's current session state.
function
function
Migration ids for a shape type, from friendly version names:
Check a props migration sequence and hand it back.
function
The validator for a shape type, from its `static props`.
function
Create a store with the editor's record types.
function
A theme built on top of the built-in one — the way an app feeds its own design tokens to the canvas:
function
A {@link CurrentUser} over the persisted preferences above — the editor's `user` prop when an app has no opinion about where preferences live.
function
Build a store schema from the utils an editor will be given.
function
Mint a `user:` id.
function · deprecated
Create a `UserPreferences` backed by one session atom.
function
A `user` record type carrying the app's own fields.
function
The `sequenceId` under which custom record type `type`'s migrations are registered.
function
Turn a data URL back into a `File`.
function
Decode a packed freehand segment path into its points, or `null` when the blob is not in the layout we understand.
function
The plate behind the page: a flat fill in the theme's canvas colour.
function
The canvas surface.
function
A pointer arrow drawn in the editor, with an optional name tag.
function
What an unhandled error looks like when nothing better is configured: the message, and a button that re-mounts the subtree.
function
The grid: one lattice of dots on the document's own grid step, drawn with an SVG pattern in page space.
function
Drawn in place of one shape whose body threw.
function
The element a shape's DOM body is rendered into.
function
The indeterminate progress mark, sized to the text around it.
function
The document-level `<defs>`: the one place a shape can put a gradient, filter or marker that every instance of it shares.
function
function
Remove shapes from the selection, leaving the rest of it alone.
function
An object used as a lookup table: any key, every value matching `value`.
function
Move `shapes` into `target` (or back onto the page when `target` is `undefined`), through the containers' own hooks.
function
Copy a page — its shapes, the bindings among them, and its name — and return the new page's id.
function
The default animation curve: slow at both ends, quick through the middle.
function
Renders `children` into the editor's container rather than in place.
function
Publishes an editor to the React tree.
function
A full-bleed error surface, for a failure that happened before there was an editor to put a fallback inside of — a store that would not load, a schema that would not migrate.
function
Read a file as a base64 `data:` URL.
function
Read a file into a `data:` URL.
function
The innermost shape that every one of `shapes` sits inside, or `undefined` when they only share the page.
function
The nearest ancestor of `shape` that `predicate` accepts, or `undefined`.
function
Identity of a face for deduplication: two faces are the same request when every descriptor matches.
function
Render a path as `props.segments.0.x`, the form used in error messages.
function
The signed sweep of the arc that runs from angle `A` to angle `B` with the given SVG arc flags.
function
The `src` an asset carries in its own props, or `null` when it has none yet.
function
The zoom level that counts as `1` for these constraints in a viewport of this size.
function
The camera, as custom properties.
function
The colour names a set of themes defines, as the union of every ramp's palette keys, in the order they were first seen.
function
One value out of a ramp: the paint a given colour name gets for a given variant.
function
The shapes the renderer is allowed to skip this frame: off screen *and* willing to be skipped.
The current page's shapes in paint order, without the render metadata — the plain list for anything that only needs "which shapes, in what order".
The current page's shapes in READING order: top to bottom, then left to right, the way a person scans a board.
function
The CSS `cursor` value for a cursor record.
function
The type part of a custom record id, or `undefined` when it is not one.
function
Build an {@link AssetContext}, filling anything unspecified from {@link DEFAULT_ASSET_CONTEXT}.
function
The base URL that default asset URLs (icons, fonts, translations) are built from.
function
The whole of the content: the crop a shape starts out with.
function
The default resolution of the shared style props.
function
Read this client's presence state out of the store: the default {@link CreatePresenceStateDerivationOpts.getUserPresence}.
function
The default properties the built-in `user` record type starts from.
function
The display values of one shape, as its util resolves them.
function
The new parent for each shape after a drag, keyed by shape id.
function
function
The registered export implementation, or `null` when nothing has registered one.
function
The focused group's record, or `undefined` when the page is focused.
function
The container gestures are currently scoped to: a group that has been drilled into, or the current page when none has.
function
Every font name any registered theme defines, in first-seen order.
function
Every font face a rich-text document needs, in first-seen order.
function
The frame-like shape a drag would drop into, or `undefined` for the page.
function
Mint a brand new set of preferences: a fresh id and a presence colour, and nothing else.
function
The effective hit radius for the current selection.
function
A name that is not already taken: `"Page"` becomes `"Page 1"`, then `"Page 2"`, and `"Page 2"` itself becomes `"Page 3"`.
function
@see IndicatorSource
function
The `meta` every newly created shape starts with.
function
The locales to try, most specific first: the locale itself, its base language, then English.
function
The shape a person means when they press an arrow key from `shape`.
function
Shapes on the current page that are not on screen — off the edge of the viewport, or clipped away entirely by an ancestor.
function
The id of the only selected shape, or `null` when zero or many are.
function
The paint one overlay util draws with, resolved against the live theme.
function
The document `el` belongs to, falling back to the ambient one.
function
The window `el` is painted in, falling back to the ambient one.
function
The session state of every page: what is selected, hovered, being edited or cropped on each one.
function
Every palette entry of a ramp, in registration order.
function
A dash pattern that divides evenly into the length it has to cover.
function
Read a browser pointer event into the fields the editor's dispatch loop wants, in the coordinate space of `container`.
function
Where the angle `P` falls along the arc from `A` to `B`, as a `t` in `[0, 1]` for a point on the arc and outside it for a point that is not.
function
The point at angle `a` on the circle of radius `r` about `center`.
function
`numPoints` points along the arc from `startPoint` to `endPoint`, inclusive.
function
The vertices of a regular `sides`-gon scaled to exactly fill a `width × height` box, starting at the apex (the `-π/2` angle) and running clockwise.
function
Every shape on the current page in paint order, with its render metadata.
function
The topmost SELECTED shape under a page point, or `undefined`.
function
Screen-space positions of the selection handles for the current selection, or null if nothing is selected / handles are hidden.
function
The selection's bounds in the selection's OWN rotated frame.
function
{@link getSelectionRotatedPageBounds} in screen space: the rotated box scaled and offset by the camera, still expressed in its own rotated frame.
function
The selection's bounds in SCREEN space (window-relative pixels) — where a `position: fixed` toolbar has to be put to sit against the selection.
function
Just the session half of the current editor state.
function
Read the session state straight out of a store.
function
Every id in `ids`, plus every descendant of each of them.
function
The CSS `clip-path` that cuts a shape down to what its ancestors allow, or `undefined` when nothing clips it.
function
A shape's drag handles in its own coordinate space, or `undefined` when its util defines none.
function
The ids of every shape completely inside a page-space box.
function · deprecated
The outline to draw over one shape: whatever its util's `indicator()` returns, or a rectangle around the shape's geometry bounds when the util has no indicator (or returns nothing).
function
The paths to stroke for one shape, or `undefined` for "this layer draws nothing here".
function
The part of a shape's page bounds that its clipping ancestors leave visible.
function
The common page bounds of several shapes, clipping included, or `null` when none of them is visible.
function
A shape's value for one style prop, or `undefined` when that shape does not carry that style at all.
function
The opacity of the current selection, as the style panel needs it.
function
Everything needed to reopen this editor exactly as it is: the document, and where the person using it was.
function
Style props declared on a ShapeUtil's `static props` map, by prop key.
function
Rasterise an SVG.
function
SVG path data through a list of points.
function
The registered text measure provider, or `null` when nothing has registered one.
function
The custom properties for one resolved ramp.
function
The size the content would occupy uncropped, given the shape's current box.
function
The local person's preferences.
function
Throw away this origin's local editor state and reload.
function
Tear one editor down and hard-reset the origin.
function
Whether `ancestorId` is somewhere above `shape` in the tree.
function
Parse `#rrggbb` or `#rrggbbaa` to the engine's `0xRRGGBBAA`.
function
Is the screen point inside the selection bounds (for dragging the selection as a whole)?
function
The selection handle under a screen point, if any.
function
The DOM body of a shape.
function
A record id of a given type: `"shape:abc"`, `"page:home"`, ...
function
A validator for ids of the record type named by `typeName`.
function
Where two circles cross.
function
Where a circle crosses a closed polygon's outline.
function
Where a circle crosses an open polyline.
function
Where the segment `a1`→`a2` crosses the circle of radius `r` about `c`, or null when it misses it entirely.
function
Where the segments `a1`→`a2` and `b1`→`b2` cross, or null if they do not.
function
Where the segment `a1`→`a2` crosses a closed polygon's outline.
function
Where the segment `a1`→`a2` crosses an open polyline.
function
Where a closed polygon's outline crosses the edges of an axis-aligned box.
function
The convex region common to two convex polygons, or null when they do not overlap.
function
Whether any ancestor of `shape` is selected.
function
function
function
function
function
function
function
function
Whether the pointer is currently over the canvas.
function
Whether `record` is a custom record — optionally, one of a particular type.
function
Whether `id` is a custom record id — optionally, one of a particular type.
function
Whether `record` is the document record.
function
Whether `crop` hides nothing — the case a util can skip drawing a crop for.
function
function
True when a validator accepts `undefined`, i.e.
function
Whether `record` is a page record.
function
function
Whether a page-space point falls on a shape, honouring what clips it.
function
Whether `value` is a props migration sequence (as opposed to a store one, or nothing).
function
Whether `n` is a number a geometry routine may safely divide by, compare or persist: finite, not `NaN`, and inside the range where a `double` still has enough mantissa left to be meaningful at canvas scale.
function
function
Whether the host has hidden this shape.
function
function
Whether `shape` lives on `pageId` (the current page by default).
function
True when `id` is a `user:` id.
function
Whether `value` matches a props map.
function
Reparent to the page any shape that is no longer inside the container it claims to be in.
function
Linear blend, the interpolation almost every numeric prop wants.
function
Whether the segments `A`→`B` and `C`→`D` cross.
function
Exactly one value, compared with `===`.
function
One of a fixed set of values: `T.literalEnum("start", "end")`.
function
What is on screen while the editor's store and engine are still coming up.
Apply a session snapshot to a store.
function
Restore a snapshot, or just its document half.
function
Walk up from `node` to the first `HTMLElement`, or `null`.
function
Snap a page-space point to the grid, when grid mode is on.
function
`amount` of the way from `from` to `to`, per channel.
function
Provides the merged chrome map and tool/action lists.
function
Name a validator so its failures read `At <name>(...): ...` instead of bare.
function
Move `element` to be the last child of `parent`, preserving its state.
function
Move shapes — and everything under them — to another page.
function
Normalize what a util returned into the composed form.
function
Rewrite loaded records so the shape utils see the props they declare.
function
Note the kind of pointer that just produced an event.
function
`T | null`.
function
An object with a known set of properties.
function
Open a URL through the current {@link runtime}.
function
`T | undefined`.
function
Either of two shapes, tried in order.
function
Pack shapes into a tight block, in place.
function
Decode a string produced by {@link createDeepLinkString}.
function
The perimeter of an ellipse, to Ramanujan's second approximation — accurate to better than a part in ten thousand for any eccentricity a shape can have.
function
Whether `A` lies inside the closed polygon `points`.
function
Whether an open polyline touches a closed polygon — either by crossing its outline or by running entirely inside it.
function
Whether two closed polygons overlap at all — including the case where one is entirely inside the other, which no edge crossing would reveal.
function
Back out one level of drill-in: focus the focused group's own parent group, or the page when there is none.
function
A point written for an SVG path `d`, rounded to DOM precision.
function
Re-throw `error` with `segment` pushed onto the front of its path.
function
`preventDefault` as a standalone handler, for hanging on an event directly.
function
function
function
The overlap of the ranges `[a0, a1]` and `[b0, b1]`, or null when they do not meet.
function
Reload the page through the current {@link runtime}.
function
Re-read the reactive environment from the DOM.
function
Point the colour style props at the names the live themes actually define.
function
Add a shape util to {@link coreShapes}.
function
Register a built-in asset type's schema.
function
Register a built-in binding type's schema.
function
Register a built-in shape type's schema.
function
Install the fallback behind `new Editor({ ...
function
Install the implementation behind `Editor.getSvgString` and `Editor.toImage`.
function
Make every font named by a registered theme selectable.
Install the measurer behind `Editor.textMeasure`.
function
Undo a {@link setPointerCapture}.
function
The default resize for a box-shaped shape.
function
Resize by scaling the whole shape, including whatever `scale` prop it keeps.
function
Scale and move shapes so their common bounds become `bounds` exactly.
function
Resolve an asset through `store`, falling back to the asset's own `props.src` when the store has no `resolve` (or when there is no store at all).
function
A line height in page units, from whatever the theme or a shape gave.
function
Resolve either spelling of a shape reference to a record.
function
The themes an editor will run with: the built-in `default` plus whatever the app registered, with an app's `default` *replacing* the built-in one.
function
The display text for `id`, or `id` itself when no dictionary has it.
function
Flatten a rich-text document to the plain string mocanvas stores in `props.text`.
function
The handle you are really dragging once the selection is rotated.
function
Make an arbitrary string usable as a fragment identifier, and prefix it so it cannot start with a digit.
function
Move the selection one shape in `direction`, keeping it a single selection.
function
Select the first child of the only selected shape — the inverse of {@link selectParentShape}, and what "enter" does on a selected group.
function
Select the parents of the selected shapes.
function
Point {@link getDefaultCdnBaseUrl} somewhere.
function
Drill into a group, or back out to the page with `null`.
function
A `Set` whose every member matches `item`.
function
Set the opacity newly created shapes will start with.
function
Set the opacity of the selected shapes.
function
Keep sending this pointer's events to `element` until it is released, even once the pointer leaves the element's box.
function
Replace some or all of the runtime's side effects.
function
Replace the local person's preferences, and persist them.
function
The `sequenceId` under which shape type `type`'s props migrations are registered.
function
The shortest signed turn from `a0` to `a1`, in `(-π, π]`.
function
Round `r` to the nearest of `segments` evenly spaced angles — what shift-drag does to a rotation.
function
Stop an event travelling any further up the tree.
function
Stroke the indicator outline of each shape onto `ctx`.
function
Add a suffix to a safe id and keep it safe.
function
The SVG body of a shape: an `<svg>` filling the shape's bounds, whose user space is the shape's own local coordinate space, so a `<path>` drawn at `(0, 0)` sits at the shape's origin at any pan, zoom or rotation.
function
Puts an export context in scope.
function
Turn a custom record type's props migrations into the record-scoped `MigrationSequence` the store applies.
function
Round to a sensible number of decimal places for the DOM.
function
Round `n` to `precision` decimal places, without the float dust that a naive `Math.round(n * 100) / 100` leaves behind.
function
Turn a props migration sequence into the record-scoped `MigrationSequence` the store applies.
function
Round to a fixed number of decimal places, returning a number.
function
Mirror an editor's page-space pointer into a signal, so {@link createPresenceStateDerivation} can broadcast a cursor that moves.
function
A discriminated union: pick the member validator by the value of `key`.
function
The distinct values of `array`, in first-seen order.
function
Change a page's own fields — its name, its `meta`, its index among the other pages.
function
The UI action list after overrides.
function
The asset urls the host configured.
function
{@link getCameraCssVars} for an editor, tracked reactively.
function
The colour mode the canvas is painting in, resolved: `"system"` has already been turned into `"light"` or `"dark"` by the time it gets here.
function
The editor's container element.
function
The editor's container element, or `null` when there is none.
function
The theme the canvas is painting with.
function
Adapt host-owned preferences into the {@link CurrentUser} the editor takes.
function
Delay the export snapshot until this component says it is ready.
function
The editor of the nearest `<EditorProvider>` / `<Canvas>`.
function
The chrome map after defaults and overrides.
function
Where floating layers are portalled to.
function
Register a menu as globally open, so the editor can stand down while it is.
function
Whether a shape is being cropped — its crop handles are live, so the ordinary resize handles must not be.
function
Whether a shape is being edited — its text caret is live, so its DOM body takes pointer events.
function
Whether a tool item is the active one, tracked reactively.
function
function
The merged UI context.
function
Let a wheel event over this element reach the canvas underneath it.
function
A stable id derived from a name, safe for `url(#…)`.
function
The export in progress, or `null` when rendering normally.
function
The ramp the canvas is painting with: the current theme's colours for the current mode.
function
The theme's custom properties for an editor, tracked reactively — swapping a theme or flipping to dark restamps the container without anything being invalidated by hand.
function
A schema built from the given utils, memoised.
function
A store built from the given options, memoised.
function
The UI tool list after overrides.
function
Write a page-to-screen transform onto an element.
function
An id unique to this component instance, safe for `url(#…)`.
function
The visual viewport's height in CSS pixels.
function
Check a set of custom record declarations before anything is built from them.
function
Validate `value` against a props map.
function
Call `visitor` for every descendant of `parent`, depth first, in draw order.
function
Say something, once, about a mistake the library can see but cannot fix.
function
The utils an editor should construct: the core ones, then the app's.
interface
How an asset is about to be used, so a store can serve a resolution- or bandwidth-appropriate variant instead of always handing back the original.
interface
The seam between the editor and wherever asset bytes actually live.
interface
What {@link AssetStore.upload} resolves to: where the bytes ended up, plus anything to remember.
interface
interface
A point with pen pressure, as freehand strokes record them.
interface
A document-scoped record describing external media referenced by shapes (images, videos, bookmarks).
interface
A directed relationship between two shapes (e.g.
interface
interface
interface
One entry in a {@link TextManager.measureHtmlBatch} call.
interface
What a shape is asked before a binding is made between it and another shape.
interface
interface
interface
What the binding's own delete callbacks are told.
interface
interface
interface
interface
interface
interface
The points a shape contributes to bounds snapping.
interface
One point a dragged shape's own points may align to.
interface
What {@link BoundsSnaps.snapResizeShapes} is asked.
interface
What {@link BoundsSnaps.snapTranslateShapes} is asked.
interface
Anything with an `x`, `y`, `w` and `h`.
interface
interface
interface
interface
interface
interface
interface
What the manager needs from the editor: a way to find a shape's util.
interface
The half of a shape util this manager needs.
interface
Options for {@link createCachedUserResolve}.
interface
Options for {@link createPresenceStateDerivation}, under the documented name.
interface
interface
The control points of one cubic segment, as a spline stores them.
interface
A preferences object plus the way to replace it — the editor's `user` prop.
interface
What an app tells `createTLSchema` about one custom record type.
interface
A point of a freehand stroke: position plus pen pressure.
interface
The translation, rotation and per-axis scale a transform is made of.
interface
interface
interface
The editor's option bag.
interface
interface
interface
interface
interface
Live pointer and modifier state.
interface
interface
interface
Props of {@link EditorProvider}.
interface
interface
interface
interface
interface
interface
Options for measuring a block of HTML.
interface
interface
interface
interface
interface
"These gaps are equal." The indicator drawn when a shape is being spaced evenly between others.
interface
Which parts of a shape's geometry a caller wants to see.
interface
interface
Options for {@link getSvgAsImage}.
interface
Where a dragged *handle* may land on this shape.
interface
What {@link HandleSnaps.snapHandle} is asked.
interface
interface
interface
Pixel dimensions and source of an image file.
interface
The two members of a shape util this module cares about.
interface
The subset of a shape util the compositor reads.
interface
interface
interface
What one other person is doing right now: where their cursor is, what they have selected, which page they are on.
interface
interface
interface
A draw segment as it was stored before the points were packed.
interface
interface
The structural form of a {@link Mat}: any object carrying the six components.
interface
Everything the UI hooks read.
interface
interface
interface
interface
An overlay paired with the util that produced it.
interface
What an overlay util needs from the host.
interface
The minimum an overlay record has to carry for the base class to talk about it without importing {@link TLOverlay} from the editor directory — which would be a cycle, since the overlay manager imports this file.
interface
The half of an overlay util's `options` that concerns paint.
interface
interface
Options for {@link getPerfectDashProps}.
interface
What SVG needs to draw the pattern.
interface
Options for {@link PerformanceApiAdapter}.
interface
What the editor reports about its own work.
interface
interface
Anything that emits editor events and exposes the current pointer — i.e.
interface
A page-space point.
interface
"These points are in a line." The indicator drawn when edges or centres align.
interface
interface
The identity half of a presence record: everything the derivation cannot read off the store because it is about *who* rather than *what they are doing*.
interface
One step of a props migration sequence.
interface
A shape's or binding's props migrations, in version order.
interface
A util as this module needs to see it: a type name and maybe some migrations.
interface
What a props migration sequence is attached to.
interface
What this module needs to know about one util: its type and its props.
interface
Options the record validator factories share.
interface
A GPU backend that can draw one engine frame.
interface
Bounds a {@link resizeBox} result is clamped to.
interface
interface
interface
The font a piece of text is currently in, as the walk carries it down the tree.
interface
The props-and-migrations pair a schema needs for one shape, binding or asset type.
interface
interface
One live scribble, plus the bookkeeping that fades it out.
interface
How a scribble looks and how it fades.
interface
interface
interface
Export-wide settings handed to `ShapeUtil.toSvg` / `toBackgroundSvg`.
interface
What {@link ShapeUtil.configure} may be called on.
interface
interface
The per-util settings bag, read as `util.options` and set with {@link ShapeUtil.configure}.
interface
How far a snap moved the thing being dragged.
interface
interface
interface
interface
How the indicators should look.
interface
interface
Props for {@link SvgExportContextProvider}.
interface
A `<defs>` entry a shape needs present in the exported SVG — a gradient, a marker, a filter, a pattern.
interface
interface
interface
interface
interface
What the manager needs from the editor: a way to find its window.
interface
interface
interface
One node of a rich-text document.
interface
How an animated shape change is paced.
interface
Where an app self-hosts the files the UI loads at runtime.
interface
What {@link AssetUtil.configure} may be called on.
interface
An asset util as an app registers it: the class, not an instance.
interface
Constructor form, as an app registers it.
interface
What the editor requires of an asset util.
interface
The settings an asset util reads.
interface
What every kind of external content carries.
interface
A region the camera is kept over, plus how zoom relates to it.
interface
The matching end of a {@link TLCameraStartPerfEvent}.
interface
Options accepted by every camera move (`setCamera`, `zoomToBounds`, …).
interface
Camera configuration, held on the editor and reachable through `Editor.getCameraOptions()` / `Editor.setCameraOptions()`.
interface
A camera move began, animated or not.
interface
What the `Canvas` component slot is handed.
interface
What is being written to the clipboard, before it is written.
interface
Just enough of a `Window` to follow the system colour scheme.
interface
One message in a thread.
interface
One person's reaction to one comment.
interface
A conversation pinned somewhere in the document.
interface
The chrome override map, passed as `components`.
interface
A copied selection, whole enough to be pasted into a different document.
interface
A crop in progress, handed to {@link ShapeUtil.onCrop}.
interface
The cursor to show, and how far to rotate it.
interface
interface
What a {@link TLComponents.CollaboratorCursor} slot is rendered with.
interface
What {@link isCursorInViewport} needs of an editor.
interface
One custom record.
interface
How an editor turns its current state into a link, and back.
interface
One palette entry — every way a single colour name can be painted.
interface
The concrete values a default shape paints with, once its style props have been resolved against a theme and a colour mode.
interface
What {@link getDisplayValues} needs from a shape util: the editor it belongs to, its options (which may carry `getDefaultDisplayValues`) and its optional `getCustomDisplayValues` override.
interface
The facts every drag callback receives.
interface
Shapes have just been dragged over this shape for the first time.
interface
Shapes have been dragged away from this shape.
interface
The props both forms of the editor component accept.
interface
The branch where the component builds the store from what the document needs.
interface
The branch where the host owns the store.
interface
The full option bag.
interface
One continuous run of a freehand stroke.
interface
The editor's half of the map: the fonts the canvas loads.
interface
The editor-level component map: the twelve slots `<Canvas>` itself renders.
interface
Options for `Editor.run`.
interface
A document and a person's place in it, saved together.
interface
How an edit was asked for, handed to {@link ShapeUtil.canEdit} so a util can accept some routes into editing and refuse others.
interface
A URL the caller has already decided to embed.
interface
Fixed facts about the browser and platform, detected once at load.
interface
interface
A reading that failed.
interface
Failure containment for the editor's React tree.
interface
What an error-fallback slot is rendered with.
interface
The editor-level notifications, by name, as argument tuples.
interface
A drawing exported from Excalidraw.
interface
An Excalidraw clipboard payload, recognised but not interpreted.
interface
A file something should be made from.
interface
A file dropped onto an existing shape, to replace what that shape shows.
interface
One or more files, from a drop, a paste or a file picker.
interface
One loadable typeface, in the vocabulary of the CSS `@font-face` rule.
interface
Where the bytes of one font face come from.
interface
One rendered frame.
interface
Options passed to `ShapeUtil.getGeometry` alongside the shape.
interface
Options for `Editor.getShapeAtPoint`.
interface
Props of every registered asset type, keyed by asset type.
interface
Props of every registered binding type, keyed by binding type.
interface
Props of every custom record type an app has registered, keyed by type.
interface
Props of every registered custom shape type, keyed by shape type.
interface
What the `Grid` slot is rendered with.
interface
One band of the alignment grid.
interface
What a handle-drag callback is told.
interface
Options for a batch of history-affecting work.
interface
One recorded change on the undo stack.
interface
A boundary between undo steps.
interface
Options for a raster export (`toImage`, `toImageDataUrl`).
interface
What the compositor needs from the editor.
interface
One indicator, fully resolved: the paths to stroke, the page transform to stroke them under, and the paint to use.
interface
A composed indicator: an outline, an optional hole punched in it, and extra strokes drawn outside that hole.
interface
A 2×3 affine matrix, in the `a b c d e f` order `CanvasRenderingContext2D` takes.
interface
The matching end of a {@link TLInteractionStartPerfEvent}.
interface
A user interaction began: a drag, a resize, a tool gesture.
interface
Options for {@link loadSessionStateSnapshotIntoStore}.
interface
Which halves of a snapshot to take or restore.
interface
What a measurement comes back as.
interface
How a run of text should be laid out before it is measured.
interface
Options for splitting text into positioned spans.
interface
The open-menu registry.
interface
One thing an overlay wants drawn this frame.
interface
What {@link getOverlayDisplayValues} needs from an overlay util: the editor it belongs to, its options, and its optional override.
interface
A constructor the {@link OverlayManager} can register.
interface
Every timing event by name.
interface
Summary statistics over a window of frame times, in milliseconds.
interface
A frame the browser considered long enough to be worth reporting.
interface
One script attributed to a long animation frame, as the browser reports it.
interface
Where the pointer is, in page space, plus the moment it was last there.
interface
What {@link getPointerInfo} reads off a pointer event.
interface
Options for {@link isPointInShape}.
interface
Environment facts that can change while the page is open.
interface
Built-in palette colours an app has removed, declared by augmenting this interface.
interface
One shape, with everything the renderer needs to place it.
interface
What {@link hardResetEditor} needs of an editor, so this module needs no import cycle.
interface
What {@link getFontsFromRichText} needs of an editor.
interface
The side effects a host may take over.
interface
Per-page session state worth restoring.
interface
Where one person was looking, independently of the document.
interface
The visible window over a croppable shape's content, in normalized coordinates: `{ topLeft: { x: 0, y: 0 }, bottomRight: { x: 1, y: 1 } }` is the whole thing.
interface
Stroke weights, in CSS pixels — the two numbers `configure` exists to change.
interface
A batch of shape records was created, changed or deleted.
interface
Why a shape is being asked whether it can be laid out.
interface
A `<defs>` entry a shape needs present in the canvas SVG — a gradient, a filter, a marker, a pattern.
interface
interface
What a {@link TLComponents.ShapeWrapper} slot is rendered with.
interface
What every way of building a store has in common: the data to start from and where its asset bytes live.
interface
The schema half: what record types this store may contain.
interface
A shape as far as display values are concerned: a props bag, nothing else.
interface
The style props {@link getDefaultDisplayValues} reads, all optional.
interface
What a shape can find out about the export it is being rendered into.
interface
SVG markup, as text.
interface
A preview shown while an upload is still in flight.
interface
Plain or rich text, pasted or dropped.
interface
Plain or rich text found on the clipboard.
interface
Rich-text configuration, as an app supplies it.
interface
One laid-out run of text, positioned relative to the text block's origin.
interface
A complete theme: both ramps and the metrics that go with them.
interface
A full ramp: the palette plus the handful of colours that belong to the surface rather than to any one shape.
interface
One selectable typeface: the stack shapes render with, the faces to load, and what the picker shows.
interface
What {@link getDisplayValues} reads a theme off.
interface
A change to a theme.
interface
The process-wide timer registry.
interface
The timer API, bound to one context.
interface
A selection copied out of another canvas, in this library's own format.
interface
This library's own format, found on the clipboard and already parsed.
interface
One entry in the UI action list — undo, delete, group, and friends.
interface
The UI layer's half: the icons and translation bundles a self-hosting app serves itself.
interface
Editor-side helpers handed to an override callback, so it can build items that do the things the default chrome does without reaching for the DOM.
interface
Rewrite the UI's tool and action lists, passed as `overrides`.
interface
One entry in the UI tool list: everything the chrome needs to draw a tool and to bind its shortcut.
interface
A history step was applied.
interface
How to move the editor's idea of where the pointer is without a real pointer event having arrived.
interface
A URL something should be made *from*, rather than content to place.
interface
A URL, before anything has decided whether it becomes a bookmark or an embed.
interface
Extra flags a {@link TransformedGeometry2d} may override on its source.
interface
interface
interface
Who somebody *is*, as opposed to what they have configured.
interface · deprecated
The local person's identity, held in a signal so that renaming or recolouring re-renders anything that shows it.
interface
interface
The local person's settings, as one plain serializable object.
interface
What a schema is told about the `user` record type.
interface
Where the editor asks about people.
interface
Anything that can check a value and narrow its type: a `Validator`, a `StyleProp`, ...
interface
Anything with an `x` and a `y`: the shape almost every API here accepts.
interface
Plain `{ x, y }`; kept structural so records stay JSON-serializable.
interface
interface
The serialized form of a {@link Vec}, as it is stored in shape props.
interface
type
type
type
An asset to create: `id` and `meta` are optional, `props` must be complete.
type
type
Forget every asset id in `ids`.
type
The props of asset type `Type`, or the open `object` when that type has not been registered through {@link TLGlobalAssetPropsMap}.
type
type
An asset type name: the registered ones, plus any other string.
type
A binding record.
type
type
type
The props of binding type `Type`, or the open `object` when that type has not been registered through {@link TLGlobalBindingPropsMap}.
type
A binding type name; see {@link ShapeTypeName}.
type
type
A handle name `Box.Resize` and `Box.getHandlePoint` accept.
type
The serialized form of a {@link Box}, as it is stored in records.
A {@link UserStore.resolve} wrapped in a cache.
type
type
type
The only multi-click the editor reports.
type
How the canvas picks its palette: an explicit choice, or `"system"` to follow the operating system.
The DOM `Document` / `Window` types under names that cannot be shadowed.
type
The props of custom record type `Type`, or the open `object` when that type has not been registered.
type
Supplies an engine to editors constructed without an explicit one.
type
type
type
A built-in shape's outline, described by the numbers that generate it.
The pre-`TL` spelling of {@link TLErrorBoundaryProps}.
type
type
Something an asset can be produced from.
type
Content dropped or pasted onto the canvas.
The registered shape types whose props include `Props`.
type
The presentation flags every geometry config carries.
type
A box shape, as far as this base class is concerned.
type
type
type
Which layer owns a util's indicator.
type
type
type
type
type
type
A `Mat` compatible alias, matching the name transforms are usually given.
type
Props as a migration sees them: whatever was persisted, not yet validated.
The object type a `T.object({...})` config describes.
type
The keys of `T` that may be omitted.
Keys of an object validator config whose validator also accepts `undefined`.
The options shape of an overlay util that resolves paint from the theme — the common case, and the reason {@link OverlayOptionsWithDisplayValues} is re-exported through this module's barrel next to the class it configures.
type
type
How a dashed stroke behaves at one end of an open path.
type
type
type
type
A props map as the factories accept it: one validator (or {@link StyleProp}) per prop.
type
The `static props` map of a shape or binding util: one validator per prop of the record it describes.
type
The props object a `static props` map describes.
One entry of a `static props` map: a validator, or a {@link StyleProp} — which validates too, and additionally makes the prop shared across shapes.
The asset types registered in {@link TLGlobalAssetPropsMap}.
The binding types registered in {@link TLGlobalBindingPropsMap}.
The custom record types registered in {@link TLGlobalRecordPropsMap}.
The shape types registered in {@link TLGlobalShapePropsMap}.
type
The keys of `T` that a caller has to supply.
type
Called for each node while collecting fonts.
type
The invisible handle just outside a corner that rotates instead of resizing.
type
A string that is safe to use as a fragment identifier — i.e.
The type-keyed maps the registries below hold.
type
A util as the schema reads it: a type name, its `static props` (what the records of that type are validated against) and its `static migrations`.
type
A handle on one of a box's four corners.
type
A handle on the middle of one of a box's four sides.
type
type
The union of the values of a `const` object or array.
type
One shape record, with its props resolved from {@link TLGlobalShapePropsMap}.
type
A shape partial without a required id (id and index are assigned on create).
type
type
The props of shape type `Type`, or the open `object` when that type has not been registered through {@link TLGlobalShapePropsMap}.
type
How a caller may name a shape: by record or by id.
type
What an SVG export callback may return: a raw markup string (inserted verbatim, so it must be well-formed and escaped by the util) or a React node the exporter serializes.
type
A shape type name: the registered ones (so editors autocomplete them) and any other string, because a shape type need not be registered to exist.
The patch {@link ShapeUtil.configure} accepts for a given util class: a partial of whatever that class declared as its `static options`, or an open bag for a util that declared none.
type
A shape that can be cropped: one whose props carry a `crop`.
type
type
Something the canvas draws to explain a snap.
type
Convenience for subclass typing.
type
type
The value a {@link StyleProp} carries.
type
Produces the pixels for a texture.
type
Anything the GPU can sample as a texture.
type
type
A live rich-text editing session, as the host's text stack exposes it.
Where the quick actions (undo, redo, delete, duplicate) render.
A direction for keyboard shape-to-shape movement.
Any asset util constructor, whatever asset type it handles.
Any overlay util constructor, whatever it produces.
type
type
A shape that points at an asset.
type
A shape with `w` and `h` props: the shape {@link resizeBox} knows how to resize.
type
A patch to an existing binding: the id and type identify it, everything else is optional.
How a zoom level is derived from the constraint bounds and the viewport.
type
`"idle"` when the camera has settled, `"moving"` while it is in flight.
type
Called when the current gesture is abandoned — Escape, or a competing gesture.
type
One of {@link TL_CANVAS_UI_COLOR_TYPES}.
type
A handler for a synthesised click event.
type
The click event the manager produces, ready to dispatch.
type
The names {@link ClickManager} can emit.
type
Where a click gesture currently is.
The raw clipboard, before the editor has tried to make sense of it.
type
A resolved colour mode: what the canvas actually paints in.
type
The colour-mode *setting*.
type
Where a thread is pinned.
type
type
Called when the current gesture is committed — Enter, or a double click that ends it.
The chrome map after mocanvas's defaults have been merged in: every slot present, `null` where it was removed.
A shape to create: like `TLShapePartial`, but the id is optional because the store mints one.
type
One of {@link TL_CURSOR_TYPES}.
type
The id of a custom record: `custom:<type>:<unique>`.
type
A place on a board, in the form a URL can carry.
type
The asset types this library ships: `image`, `video` and `bookmark`.
type
The binding types this library ships; see {@link TLDefaultShape}.
Which part of a palette entry to read.
type
The record types this library ships, as a union.
type
The shape types this library ships.
Shapes are still being dragged over this shape.
What the editor component accepts: exactly one of the two branches above.
Shapes have been dropped while over this shape.
type
The name of one of the {@link EASINGS}.
Read for its side effect on the type checker only; keeps `Editor` imported.
Called as a state node becomes active.
A replacement for the editor-wide error screen, or `null` to render nothing at all.
A handler for one entry of {@link TLEventMap}.
type
Every name a dispatched canvas event can carry.
Called as a state node becomes inactive.
type
The formats an export can be asked for.
type
What an asset can be produced from.
One reading of a paste.
type
The faces of one family, indexed `[style][weight]` — the shape a picker reads a single preview face out of: `DefaultFontFaces["tldraw_serif"]?.normal?.normal`.
type
How far a request got.
The override point: return only the fields you want to change, or nothing at all to accept the defaults.
The override point: return only the fields to change, or nothing to accept the defaults wholesale.
A shape util's *default* display values: everything the util renders, derived from the shape and the live theme.
How an overlay util resolves its default paint.
The host's hook for hiding shapes without deleting them — layers, filters, a review mode that shows only one author's work.
type
One of {@link TL_HANDLE_TYPES}.
type
An entry on the undo or redo stack: either a change or a boundary.
How a batch of changes should be recorded.
type
Asset utils keyed by asset type.
Binding utils keyed by binding type.
type
Records of one kind, grouped by their `type` discriminant.
type
Shape utils (or anything else) keyed by shape type.
Why a shape is showing an indicator.
What `ShapeUtil.getIndicatorPath` may return: a bare `Path2D` (the common case), a composed {@link TLIndicatorPath}, or `undefined` to draw nothing.
The `TL`-spelled name for {@link InstancePresenceId}.
How a shape's props are blended between two versions of it, for {@link ShapeUtil.getInterpolatedProps}.
type
Called when something outside the tool takes over: a window blur, a programmatic tool change, a store reset.
type
A keyboard-event handler.
type
Called once the editor exists.
type
A shape's opacity: `0` to `1` inclusive.
type
The documented spelling of {@link OverlayEntry}.
type
A pinch-event handler.
type
The three phases of a pinch gesture.
type
A pointer-event handler, as a tool or shape util declares one.
What a pointer event happened *on*.
type
What one client broadcasts about itself, minus the record's own identity.
An asset record of type `Type`, with its props resolved from the global map.
type
The handles a resize can be driven from.
type
What a resize means for the shape's contents.
type
The schema an editor store is built on.
type
One of {@link TL_SCRIBBLE_STATES}.
A replacement for the fallback drawn in place of a single broken shape, or `null` to draw nothing.
The documented name for what {@link ShapeUtil.canBind} is asked.
What the host may say about one shape's visibility.
type
Opacity shared by the selection: a value, or `"mixed"`, or `undefined`.
type
What a store listener is handed: the records that changed, and who changed them.
type
Everything needed to build a store: the data and the schema.
type
The props an editor store carries.
A store, or the reason there isn't one yet.
The palette: one {@link TLDefaultColor} per style colour name, minus any an app has removed by augmenting {@link TLRemovedDefaultThemeColors}.
type
CSS font stacks, one per font style prop value.
type
A theme id.
type
Every registered theme, by id.
type
What an app hands in: a partial map, merged over the built-in `default`.
The colours in a ramp that belong to the *surface* rather than to any shape.
type
Called once per animation frame while the editor is running.
The UI action list, keyed by {@link TLUiActionItem.id}.
A component slot.
type
Where a UI item was activated from.
type
Builds the list a `TLUiOverrides` callback starts from.
The UI tool list, keyed by {@link TLUiToolItem.id}.
type
UI strings by locale, then by string id.
type
An asset whose type this build does not know.
type
A wheel-event handler.
type
The type a validator produces.
type
What a host's analytics hook receives.
type
The variant table a {@link UnionValidator} is built from: one validator per value of the discriminant.
type
A custom record whose type is only known at runtime.
How strict the props half of a record validator is about props the map does not declare.
A `static props` map read without knowing the record type — what the base class can say about it.
type
type
type
The id type a `user` record is keyed by, for an app declaring its own.
The type of the {@link T} namespace, for anyone who wants to pass it around.
One step of the path to the value that failed: an object key or an array index.
type
type
constant
Font size per size style for an arrow's label, which steps up more gently still: an arrow's text sits on a line rather than in a box, and has no width of its own to grow into.
constant
How an arrow's body is routed.
constant
The arrow binding's props versions.
constant
Shapes an arrow terminal can be drawn as.
constant
The arrowhead drawn at an arrow's end; see {@link ArrowShapeArrowheadStartStyle}.
constant
The arrowhead drawn at an arrow's start.
constant
How an arrow's body is routed: a bowed arc, or axis-aligned elbow legs.
constant
The `sequenceId` prefix of asset type `type`'s props migrations.
constant
An `asset:...` record id.
constant
As {@link rootShapeMigrations}, for the asset record itself.
constant
Per-type validation lives in `../assets/assetValidators` — `imageAssetValidator`, `videoAssetValidator` and `bookmarkAssetValidator`, plus the `assetValidator` union over the three.
constant
Any asset, dispatched on `type`.
constant
The per-type validators, keyed by asset type — handy for a lookup by `asset.type`.
constant
Encode and decode packed point lists.
The `sequenceId` of binding type `type`'s props migrations.
constant
A binding id: `binding:…`.
constant
constant
The `bookmark` asset's props migrations; see {@link imageAssetMigrations}.
constant
The props of a `bookmark` asset: the unfurled metadata behind a link card.
constant
The unfurled metadata a bookmark asset caches for its card.
constant
A link asset: the unfurled title, description and images behind a bookmark shape.
constant
A box: `{ x, y, w, h }`.
As {@link ASSET_MIGRATION_SEQUENCE_PREFIX}, for asset types **this library ships**.
As {@link BUILTIN_SHAPE_MIGRATION_SEQUENCE_PREFIX}, for built-in bindings.
The prefix for migrations on shapes **this library ships**.
constant
constant
Which theme colour each custom property carries.
constant
constant
How long a collaborator may go without refreshing their presence record before they stop being drawn.
constant
constant
constant
constant
constant
constant
constant
constant
The commenting record types, in the shape `createTLSchema({ records })` expects.
constant
constant
constant
constant
The core shape utils, in registration order.
constant
Bumped when the shape of {@link TLSessionStateSnapshot} changes.
constant
Every cursor name, re-exported so a picker can enumerate them without a second import.
constant
constant
The `sequenceId` prefix of a custom record type's props migrations.
constant
The `typeName` every custom record shares.
constant
The context used when nobody supplied one: original quality, no network hints.
constant
The camera options an editor starts with.
constant
Style value unions shared by the default shapes.
constant
The built-in dark ramp.
constant
constant
constant
Which palette token each fill *style* paints with.
constant
constant
CSS stacks per font style — the value a shape's `font` prop resolves to.
constant
constant
constant
Distance between hatch lines, in page units.
constant
Which palette token each fill style draws its *hatch* in, for the styles that have one.
constant
The built-in light ramp.
constant
Line height as a multiple of the font size, shared by every size.
constant
The context used by callers that do not name one.
constant
The id of an empty document's first page.
constant
The v5 defaults: 1.5 CSS px normally, 2.5 for a drop target.
constant
constant
Horizontal alignment of *text inside a text-bearing shape*, as opposed to the alignment of the shape's own label box, which is {@link DEFAULT_H_ALIGNS}.
constant
The built-in theme, registered under the id `default`.
constant
The context id used when a caller does not name one.
constant
constant
The migration sequences for the asset types this library ships.
constant
The props and migrations of the built-in *asset* types.
constant
The props and migrations of the built-in *binding* types.
constant
constant
constant
constant
Every built-in face, keyed by family then `[style][weight]` — the shape a font picker reads one preview face out of:
constant
The CSS stacks per built-in font style, under the documented name.
constant
constant
constant
constant
The props and migrations of the built-in *shape* types.
constant
constant
Alignment of the text *inside* a shape, shared across every text-bearing shape.
constant
Every default, as one object.
constant
What every unset preference resolves to.
constant
A {@link UserStore} over the local preferences: one person, this browser.
constant
constant
Floats per point in a 2D stroke: `x`, `y`.
constant
Floats per point in a 3D stroke: `x`, `y`, `z` — where `z` is pen pressure.
constant
constant
constant
constant
The easing curves available to camera moves, animated nudges and anything else that tweens.
constant
constant
Where an elbow arrow is allowed to attach when its terminal is bound to a shape: `"none"` keeps the stored point, `"edge"` snaps to the nearest edge, `"center"` to the shape's centre, `"edge-point"` to the nearest point on an edge, `"non…
constant
Where an elbow arrow attaches to the shape its terminal is bound to.
constant
constant
The index a blank document's first page gets.
constant
constant
constant
constant
A quarter turn in radians.
constant
Half the size of a selection handle's pointer target, in screen pixels.
constant
constant
The `image` asset's props migrations.
constant
The props of an `image` asset: the file, its dimensions, and how to describe it.
constant
`w`, `h`, `src` and the file metadata an image or video asset carries.
constant
A bitmap asset: an image the canvas paints inside an `image` shape.
constant
The validator an image-like shape declares its `crop` prop with.
constant
An {@link AssetStore} that keeps every uploaded file inside the document, as a base64 data URL.
constant
constant
constant
constant
constant
Font size per size style for a *label* — the text inside a geo shape or on a note, as opposed to a text shape, which is its own text and uses {@link FONT_SIZES}.
constant
A palette in the spirit of the classic light theme.
constant
How a line shape interpolates between its points.
constant
How a line shape interpolates between its points.
constant
The prefix every key this library writes to web storage carries, so a hard reset can find its own keys and leave the host application's alone.
constant
Largest device-pixel scale a rasterized texture is rendered at.
constant
Largest zoom factor that still increases texture resolution.
constant
A transparent sheet that swallows the click which closes an open menu.
constant
constant
A page id: `page:…`.
constant
constant
A shape's parent: either the page it sits on or the shape (a frame, a group) that contains it.
constant
π.
constant
A full turn in radians.
constant
constant
constant
Eight colours that stay readable on the canvas background in any order.
constant
As {@link rootShapeMigrations}, for the binding record itself.
constant
Migrations that apply to *every* shape, whatever its type — the record's own fields rather than any type's props.
Which corner each rotate handle sits outside.
constant
constant
The live runtime.
constant
constant
The `sequenceId` of shape type `type`'s props migrations.
constant
A shape id: `shape:…`.
constant
constant
The four sides, in clockwise order starting from the top.
constant
`Math.sin`, under the name the geometry code refers to it by.
constant
Stroke widths in page units per size, matching the classic look.
constant
The validation library, as one namespace object.
constant
A stable per-tab identifier.
constant
Colours the canvas chrome is allowed to use.
constant
Every cursor the canvas can show.
constant
What a handle on a shape does.
constant
A scribble's lifecycle.
constant
The registry every mounted `Mocanvas` adds itself to.
constant
Browser and platform facts, decided at load.
constant
Environment facts that change during a session.
constant
The process-wide open-menu registry.
constant
The id of the one pointer record.
constant
The registry itself.
constant
The edit-start info a caller with no more specific answer passes.
constant
What every unset preference resolves to.
constant
Validates a `user:` id.
constant
Validates a stored preferences object.
constant
constant
Validates a whole `user` record.
constant
Validates a whole `user` record.
constant
A point: `{ x, y }`, optionally with the pressure/z a freehand point carries.
constant
The `video` asset's props migrations; see {@link imageAssetMigrations}.
constant
The props of a `video` asset.
constant
A video asset.
mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.