## API Report File for "@tldraw/editor"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
///
import { Atom } from '@tldraw/state';
import { atom } from '@tldraw/state';
import { BoxModel } from '@tldraw/tlschema';
import { ComponentType } from 'react';
import { Computed } from '@tldraw/state';
import { computed } from '@tldraw/state';
import { EmbedDefinition } from '@tldraw/tlschema';
import { EMPTY_ARRAY } from '@tldraw/state';
import { EventEmitter } from 'eventemitter3';
import { HistoryEntry } from '@tldraw/store';
import { HTMLProps } from 'react';
import { JsonObject } from '@tldraw/utils';
import { JSX as JSX_2 } from 'react/jsx-runtime';
import { MemoExoticComponent } from 'react';
import { Migrations } from '@tldraw/store';
import { NamedExoticComponent } from 'react';
import { PointerEventHandler } from 'react';
import { react } from '@tldraw/state';
import { default as React_2 } from 'react';
import * as React_3 from 'react';
import { SerializedSchema } from '@tldraw/store';
import { SerializedStore } from '@tldraw/store';
import { ShapeProps } from '@tldraw/tlschema';
import { Signal } from '@tldraw/state';
import { StoreSchema } from '@tldraw/store';
import { StoreSnapshot } from '@tldraw/store';
import { StyleProp } from '@tldraw/tlschema';
import { TLArrowShape } from '@tldraw/tlschema';
import { TLArrowShapeArrowheadStyle } from '@tldraw/tlschema';
import { TLAsset } from '@tldraw/tlschema';
import { TLAssetId } from '@tldraw/tlschema';
import { TLAssetPartial } from '@tldraw/tlschema';
import { TLBaseShape } from '@tldraw/tlschema';
import { TLBookmarkAsset } from '@tldraw/tlschema';
import { TLCamera } from '@tldraw/tlschema';
import { TLCursor } from '@tldraw/tlschema';
import { TLCursorType } from '@tldraw/tlschema';
import { TLDefaultHorizontalAlignStyle } from '@tldraw/tlschema';
import { TLDocument } from '@tldraw/tlschema';
import { TLGroupShape } from '@tldraw/tlschema';
import { TLHandle } from '@tldraw/tlschema';
import { TLImageAsset } from '@tldraw/tlschema';
import { TLInstance } from '@tldraw/tlschema';
import { TLInstancePageState } from '@tldraw/tlschema';
import { TLInstancePresence } from '@tldraw/tlschema';
import { TLPage } from '@tldraw/tlschema';
import { TLPageId } from '@tldraw/tlschema';
import { TLParentId } from '@tldraw/tlschema';
import { TLRecord } from '@tldraw/tlschema';
import { TLScribble } from '@tldraw/tlschema';
import { TLShape } from '@tldraw/tlschema';
import { TLShapeId } from '@tldraw/tlschema';
import { TLShapePartial } from '@tldraw/tlschema';
import { TLStore } from '@tldraw/tlschema';
import { TLStoreProps } from '@tldraw/tlschema';
import { TLUnknownShape } from '@tldraw/tlschema';
import { TLVideoAsset } from '@tldraw/tlschema';
import { track } from '@tldraw/state';
import { transact } from '@tldraw/state';
import { transaction } from '@tldraw/state';
import { UnknownRecord } from '@tldraw/store';
import { useComputed } from '@tldraw/state';
import { useQuickReactor } from '@tldraw/state';
import { useReactor } from '@tldraw/state';
import { useValue } from '@tldraw/state';
import { VecModel } from '@tldraw/tlschema';
import { whyAmIRunning } from '@tldraw/state';
// @public
export function angleDistance(fromAngle: number, toAngle: number, direction: number): number;
// @internal (undocumented)
export const ANIMATION_MEDIUM_MS = 320;
// @internal (undocumented)
export const ANIMATION_SHORT_MS = 80;
// @internal (undocumented)
export function applyRotationToSnapshotShapes({ delta, editor, snapshot, stage, }: {
delta: number;
snapshot: TLRotationSnapshot;
editor: Editor;
stage: 'end' | 'one-off' | 'start' | 'update';
}): void;
// @public
export function approximately(a: number, b: number, precision?: number): boolean;
// @public (undocumented)
export class Arc2d extends Geometry2d {
constructor(config: Omit & {
center: Vec;
radius: number;
start: Vec;
end: Vec;
sweepFlag: number;
largeArcFlag: number;
});
// (undocumented)
angleEnd: number;
// (undocumented)
angleStart: number;
// (undocumented)
_center: Vec;
// (undocumented)
end: Vec;
// (undocumented)
getVertices(): Vec[];
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, _zoom: number): boolean;
// (undocumented)
length: number;
// (undocumented)
measure: number;
// (undocumented)
nearestPoint(point: Vec): Vec;
// (undocumented)
radius: number;
// (undocumented)
start: Vec;
}
// @public
export function areAnglesCompatible(a: number, b: number): boolean;
export { Atom }
export { atom }
// @public (undocumented)
export function average(A: VecLike, B: VecLike): string;
// @public (undocumented)
export abstract class BaseBoxShapeTool extends StateNode {
// (undocumented)
static children: () => (typeof Idle | typeof Pointing)[];
// (undocumented)
static id: string;
// (undocumented)
static initial: string;
// (undocumented)
onCreate?: (_shape: null | TLShape) => null | void;
// (undocumented)
abstract shapeType: string;
}
// @public (undocumented)
export abstract class BaseBoxShapeUtil extends ShapeUtil {
// (undocumented)
getGeometry(shape: Shape): Geometry2d;
// (undocumented)
onResize: TLOnResizeHandler;
}
// @public (undocumented)
export interface BoundsSnapPoint {
// (undocumented)
handle?: SelectionCorner;
// (undocumented)
id: string;
// (undocumented)
x: number;
// (undocumented)
y: number;
}
// @public (undocumented)
export class Box {
constructor(x?: number, y?: number, w?: number, h?: number);
// (undocumented)
get aspectRatio(): number;
// (undocumented)
get center(): Vec;
set center(v: Vec);
// (undocumented)
clone(): Box;
// (undocumented)
static Collides: (A: Box, B: Box) => boolean;
// (undocumented)
collides(B: Box): boolean;
// (undocumented)
static Common: (boxes: Box[]) => Box;
// (undocumented)
static Contains: (A: Box, B: Box) => boolean;
// (undocumented)
contains(B: Box): boolean;
// (undocumented)
static ContainsPoint: (A: Box, B: VecLike, margin?: number) => boolean;
// (undocumented)
containsPoint(V: VecLike, margin?: number): boolean;
// (undocumented)
get corners(): Vec[];
// (undocumented)
static Equals(a: Box | BoxModel, b: Box | BoxModel): boolean;
// (undocumented)
equals(other: Box | BoxModel): boolean;
// (undocumented)
static Expand(A: Box, B: Box): Box;
// (undocumented)
expand(A: Box): this;
// (undocumented)
static ExpandBy(A: Box, n: number): Box;
// (undocumented)
expandBy(n: number): this;
// (undocumented)
static From(box: BoxModel): Box;
// (undocumented)
static FromCenter(center: VecLike, size: VecLike): Box;
// (undocumented)
static FromPoints(points: VecLike[]): Box;
// (undocumented)
getHandlePoint(handle: SelectionCorner | SelectionEdge): Vec;
// (undocumented)
h: number;
// (undocumented)
get height(): number;
set height(n: number);
// (undocumented)
static Includes: (A: Box, B: Box) => boolean;
// (undocumented)
includes(B: Box): boolean;
// (undocumented)
get maxX(): number;
// (undocumented)
get maxY(): number;
// (undocumented)
get midX(): number;
// (undocumented)
get midY(): number;
// (undocumented)
get minX(): number;
set minX(n: number);
// (undocumented)
get minY(): number;
set minY(n: number);
// (undocumented)
get point(): Vec;
set point(val: Vec);
// (undocumented)
static Resize(box: Box, handle: SelectionCorner | SelectionEdge | string, dx: number, dy: number, isAspectRatioLocked?: boolean): {
box: Box;
scaleX: number;
scaleY: number;
};
// (undocumented)
resize(handle: SelectionCorner | SelectionEdge | string, dx: number, dy: number): void;
// (undocumented)
scale(n: number): this;
// (undocumented)
set(x?: number, y?: number, w?: number, h?: number): this;
// (undocumented)
setTo(B: Box): this;
// (undocumented)
static Sides: (A: Box, inset?: number) => Vec[][];
// (undocumented)
get sides(): Array<[Vec, Vec]>;
// (undocumented)
get size(): Vec;
// (undocumented)
get snapPoints(): Vec[];
// (undocumented)
snapToGrid(size: number): void;
// (undocumented)
toFixed(): this;
// (undocumented)
toJson(): BoxModel;
// (undocumented)
translate(delta: VecLike): this;
// (undocumented)
union(box: BoxModel): this;
// (undocumented)
w: number;
// (undocumented)
get width(): number;
set width(n: number);
// (undocumented)
x: number;
// (undocumented)
y: number;
// (undocumented)
static ZeroFix(other: Box | BoxModel): Box;
// (undocumented)
zeroFix(): this;
}
// @public (undocumented)
export type BoxLike = Box | BoxModel;
// @internal (undocumented)
export const CAMERA_SLIDE_FRICTION = 0.09;
// @public (undocumented)
export function canonicalizeRotation(a: number): number;
// @public (undocumented)
export function Canvas({ className }: {
className?: string;
}): JSX_2.Element;
// @public (undocumented)
export class Circle2d extends Geometry2d {
constructor(config: Omit & {
x?: number;
y?: number;
radius: number;
isFilled: boolean;
});
// (undocumented)
_center: Vec;
// (undocumented)
config: Omit & {
x?: number;
y?: number;
radius: number;
isFilled: boolean;
};
// (undocumented)
getBounds(): Box;
// (undocumented)
getVertices(): Vec[];
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, _zoom: number): boolean;
// (undocumented)
nearestPoint(point: Vec): Vec;
// (undocumented)
radius: number;
// (undocumented)
x: number;
// (undocumented)
y: number;
}
// @public
export function clamp(n: number, min: number): number;
// @public
export function clamp(n: number, min: number, max: number): number;
// @public
export function clampRadians(r: number): number;
// @public
export function clockwiseAngleDist(a0: number, a1: number): number;
export { computed }
// @public (undocumented)
export const coreShapes: readonly [typeof GroupShapeUtil];
// @public
export function counterClockwiseAngleDist(a0: number, a1: number): number;
// @public
export function createSessionStateSnapshotSignal(store: TLStore): Signal;
// @public
export function createTLStore({ initialData, defaultName, ...rest }: TLStoreOptions): TLStore;
// @public (undocumented)
export function createTLUser(opts?: {
derivePresenceState?: ((store: TLStore) => Signal) | undefined;
userPreferences?: Signal | undefined;
setUserPreferences?: ((userPreferences: TLUserPreferences) => void) | undefined;
}): TLUser;
// @public (undocumented)
export class CubicBezier2d extends Polyline2d {
constructor(config: Omit & {
start: Vec;
cp1: Vec;
cp2: Vec;
end: Vec;
});
// (undocumented)
a: Vec;
// (undocumented)
b: Vec;
// (undocumented)
c: Vec;
// (undocumented)
d: Vec;
// (undocumented)
getVertices(): Vec[];
// (undocumented)
midPoint(): Vec;
// (undocumented)
nearestPoint(A: Vec): Vec;
}
// @public (undocumented)
export class CubicSpline2d extends Geometry2d {
constructor(config: Omit & {
points: Vec[];
});
// (undocumented)
getVertices(): Vec[];
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, zoom: number): boolean;
// (undocumented)
get length(): number;
// (undocumented)
_length?: number;
// (undocumented)
nearestPoint(A: Vec): Vec;
// (undocumented)
points: Vec[];
// (undocumented)
get segments(): CubicBezier2d[];
// (undocumented)
_segments?: CubicBezier2d[];
}
// @public (undocumented)
export function dataUrlToFile(url: string, filename: string, mimeType: string): Promise;
// @internal (undocumented)
export type DebugFlag = DebugFlagDef & Atom;
// @internal (undocumented)
export const debugFlags: {
preventDefaultLogging: DebugFlag;
pointerCaptureLogging: DebugFlag;
pointerCaptureTracking: DebugFlag;
pointerCaptureTrackingObject: DebugFlag