## 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 { Box2dModel } from '@tldraw/tlschema';
import { ComponentType } from 'react';
import { Computed } from '@tldraw/state';
import { computed } from '@tldraw/state';
import { ComputedCache } from '@tldraw/store';
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 { 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 { Vec2dModel } from '@tldraw/tlschema';
import { whyAmIRunning } from '@tldraw/state';
// @public
export function angleDelta(a0: number, a1: 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: Vec2d;
radius: number;
start: Vec2d;
end: Vec2d;
sweepFlag: number;
largeArcFlag: number;
});
// (undocumented)
angleEnd: number;
// (undocumented)
angleStart: number;
// (undocumented)
_center: Vec2d;
// (undocumented)
end: Vec2d;
// (undocumented)
getVertices(): Vec2d[];
// (undocumented)
hitTestLineSegment(A: Vec2d, B: Vec2d, _zoom: number): boolean;
// (undocumented)
length: number;
// (undocumented)
measure: number;
// (undocumented)
nearestPoint(point: Vec2d): Vec2d;
// (undocumented)
radius: number;
// (undocumented)
start: Vec2d;
}
// @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)
abstract shapeType: string;
}
// @public (undocumented)
export abstract class BaseBoxShapeUtil extends ShapeUtil {
// (undocumented)
getGeometry(shape: Shape): Geometry2d;
// (undocumented)
onResize: TLOnResizeHandler;
}
// @public (undocumented)
export class Box2d {
constructor(x?: number, y?: number, w?: number, h?: number);
// (undocumented)
get aspectRatio(): number;
// (undocumented)
get center(): Vec2d;
set center(v: Vec2d);
// (undocumented)
clone(): Box2d;
// (undocumented)
static Collides: (A: Box2d, B: Box2d) => boolean;
// (undocumented)
collides(B: Box2d): boolean;
// (undocumented)
static Common: (boxes: Box2d[]) => Box2d;
// (undocumented)
static Contains: (A: Box2d, B: Box2d) => boolean;
// (undocumented)
contains(B: Box2d): boolean;
// (undocumented)
static ContainsPoint: (A: Box2d, B: VecLike, margin?: number) => boolean;
// (undocumented)
containsPoint(V: VecLike, margin?: number): boolean;
// (undocumented)
get corners(): Vec2d[];
// (undocumented)
static Equals(a: Box2d | Box2dModel, b: Box2d | Box2dModel): boolean;
// (undocumented)
equals(other: Box2d | Box2dModel): boolean;
// (undocumented)
static Expand(A: Box2d, B: Box2d): Box2d;
// (undocumented)
expand(A: Box2d): this;
// (undocumented)
static ExpandBy(A: Box2d, n: number): Box2d;
// (undocumented)
expandBy(n: number): this;
// (undocumented)
static From(box: Box2dModel): Box2d;
// (undocumented)
static FromPoints(points: VecLike[]): Box2d;
// (undocumented)
getHandlePoint(handle: SelectionCorner | SelectionEdge): Vec2d;
// (undocumented)
h: number;
// (undocumented)
get height(): number;
set height(n: number);
// (undocumented)
static Includes: (A: Box2d, B: Box2d) => boolean;
// (undocumented)
includes(B: Box2d): 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(): Vec2d;
set point(val: Vec2d);
// (undocumented)
static Resize(box: Box2d, handle: SelectionCorner | SelectionEdge | string, dx: number, dy: number, isAspectRatioLocked?: boolean): {
box: Box2d;
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: Box2d): this;
// (undocumented)
static Sides: (A: Box2d, inset?: number) => Vec2d[][];
// (undocumented)
get sides(): Array<[Vec2d, Vec2d]>;
// (undocumented)
get size(): Vec2d;
// (undocumented)
get snapPoints(): Vec2d[];
// (undocumented)
snapToGrid(size: number): void;
// (undocumented)
toFixed(): this;
// (undocumented)
toJson(): Box2dModel;
// (undocumented)
translate(delta: VecLike): this;
// (undocumented)
union(box: Box2dModel): this;
// (undocumented)
w: number;
// (undocumented)
get width(): number;
set width(n: number);
// (undocumented)
x: number;
// (undocumented)
y: number;
// (undocumented)
static ZeroFix(other: Box2d | Box2dModel): Box2d;
// (undocumented)
zeroFix(): this;
}
// @public (undocumented)
export type BoxLike = Box2d | Box2dModel;
// @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.Element;
// @public (undocumented)
export class Circle2d extends Geometry2d {
constructor(config: Omit & {
x?: number;
y?: number;
radius: number;
isFilled: boolean;
});
// (undocumented)
_center: Vec2d;
// (undocumented)
config: Omit & {
x?: number;
y?: number;
radius: number;
isFilled: boolean;
};
// (undocumented)
getBounds(): Box2d;
// (undocumented)
getVertices(): Vec2d[];
// (undocumented)
hitTestLineSegment(A: Vec2d, B: Vec2d, _zoom: number): boolean;
// (undocumented)
nearestPoint(point: Vec2d): Vec2d;
// (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 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: Vec2d;
cp1: Vec2d;
cp2: Vec2d;
end: Vec2d;
});
// (undocumented)
a: Vec2d;
// (undocumented)
b: Vec2d;
// (undocumented)
c: Vec2d;
// (undocumented)
d: Vec2d;
// (undocumented)
getVertices(): Vec2d[];
// (undocumented)
midPoint(): Vec2d;
// (undocumented)
nearestPoint(A: Vec2d): Vec2d;
}
// @public (undocumented)
export class CubicSpline2d extends Geometry2d {
constructor(config: Omit & {
points: Vec2d[];
});
// (undocumented)
getVertices(): Vec2d[];
// (undocumented)
hitTestLineSegment(A: Vec2d, B: Vec2d, zoom: number): boolean;
// (undocumented)
get length(): number;
// (undocumented)
_length?: number;
// (undocumented)
nearestPoint(A: Vec2d): Vec2d;
// (undocumented)
points: Vec2d[];
// (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