packages/tlschema/api-report.api.md
Do not edit this file. It is a report generated by API Extractor.
import { BaseRecord } from '@tldraw/store';
import { Expand } from '@tldraw/utils';
import { IndexKey } from '@tldraw/utils';
import { JsonObject } from '@tldraw/utils';
import { LegacyMigrations } from '@tldraw/store';
import { MakeUndefinedOptional } from '@tldraw/utils';
import { MigrationId } from '@tldraw/store';
import { MigrationSequence } from '@tldraw/store';
import { RecordId } from '@tldraw/store';
import { RecordType } from '@tldraw/store';
import { SerializedStore } from '@tldraw/store';
import { Signal } from '@tldraw/state';
import { StandaloneDependsOn } from '@tldraw/store';
import { Store } from '@tldraw/store';
import { StoreSchema } from '@tldraw/store';
import { StoreSnapshot } from '@tldraw/store';
import { StoreValidator } from '@tldraw/store';
import { T } from '@tldraw/validate';
import { UnknownRecord } from '@tldraw/store';
// @public
export const arrowBindingMigrations: TLPropsMigrations;
// @public
export const arrowBindingProps: RecordProps<TLArrowBinding>;
// @public
export const arrowBindingVersions: {
AddSnap: `com.tldraw.binding.arrow/${number}`;
};
// @public
export const ArrowShapeArrowheadEndStyle: EnumStyleProp<"arrow" | "bar" | "diamond" | "dot" | "inverted" | "none" | "pipe" | "square" | "triangle">;
// @public
export const ArrowShapeArrowheadStartStyle: EnumStyleProp<"arrow" | "bar" | "diamond" | "dot" | "inverted" | "none" | "pipe" | "square" | "triangle">;
// @public
export const ArrowShapeKindStyle: EnumStyleProp<"arc" | "elbow">;
// @public
export const arrowShapeMigrations: MigrationSequence;
// @public
export const arrowShapeProps: RecordProps<TLArrowShape>;
// @public
export const arrowShapeVersions: {
readonly AddElbow: "com.tldraw.shape.arrow/6";
readonly AddIsPrecise: "com.tldraw.shape.arrow/2";
readonly AddLabelColor: "com.tldraw.shape.arrow/1";
readonly AddLabelPosition: "com.tldraw.shape.arrow/3";
readonly AddRichText: "com.tldraw.shape.arrow/7";
readonly AddRichTextAttrs: "com.tldraw.shape.arrow/8";
readonly AddScale: "com.tldraw.shape.arrow/5";
readonly ExtractBindings: "com.tldraw.shape.arrow/4";
};
// @public
export const assetIdValidator: T.Validator<TLAssetId>;
// @public
export const assetMigrations: MigrationSequence;
// @public
export const AssetRecordType: RecordType<TLAsset, "props" | "type">;
// @public
export const assetValidator: T.Validator<TLAsset>;
// @public
export class b64Vecs {
static decodeFirstPoint(b64Points: string): null | VecModel;
static decodeLastPoint(b64Points: string): null | VecModel;
static decodePoints(base64: string): VecModel[];
static encodePoints(points: VecModel[]): string;
// @internal
static _legacyDecodePoints(base64: string): VecModel[];
// @internal
static _legacyEncodePoint(x: number, y: number, z: number): string;
// @internal
static _legacyEncodePoints(points: VecModel[]): string;
}
// @public
export const bindingIdValidator: T.Validator<TLBindingId>;
// @public
export const bookmarkShapeMigrations: TLPropsMigrations;
// @public
export const bookmarkShapeProps: RecordProps<TLBookmarkShape>;
// @public
export interface BoxModel {
// (undocumented)
h: number;
// (undocumented)
w: number;
// (undocumented)
x: number;
// (undocumented)
y: number;
}
// @public
export const boxModelValidator: T.ObjectValidator<BoxModel>;
// @public
export const CameraRecordType: RecordType<TLCamera, never>;
// @public
export const canvasUiColorTypeValidator: T.Validator<"accent" | "black" | "laser" | "muted-1" | "selection-fill" | "selection-stroke" | "white">;
// @public
export function compressLegacySegments(segments: {
points: VecModel[];
type: 'free' | 'straight';
}[]): TLDrawShapeSegment[];
// @public
export function createAssetValidator<Type extends string, Props extends JsonObject>(type: Type, props: T.Validator<Props>): T.ObjectValidator<Expand< { [P in "id" | "meta" | "typeName" | (undefined extends Props ? never : "props") | (undefined extends Type ? never : "type")]: {
id: TLAssetId;
meta: JsonObject;
props: Props;
type: Type;
typeName: "asset";
}[P]; } & { [P in (undefined extends Props ? "props" : never) | (undefined extends Type ? "type" : never)]?: {
id: TLAssetId;
meta: JsonObject;
props: Props;
type: Type;
typeName: "asset";
}[P] | undefined; }>>;
// @public
export function createBindingId(id?: string): TLBindingId;
// @public
export function createBindingPropsMigrationIds<S extends string, T extends Record<string, number>>(bindingType: S, ids: T): {
[k in keyof T]: `com.tldraw.binding.${S}/${T[k]}`;
};
// @public
export function createBindingPropsMigrationSequence(migrations: TLPropsMigrations): TLPropsMigrations;
// @public
export function createBindingValidator<Type extends string, Props extends JsonObject, Meta extends JsonObject>(type: Type, props?: {
[K in keyof Props]: T.Validatable<Props[K]>;
}, meta?: {
[K in keyof Meta]: T.Validatable<Meta[K]>;
}): T.ObjectValidator<Expand< { [P in "fromId" | "id" | "meta" | "toId" | "typeName" | (undefined extends Props ? never : "props") | (undefined extends Type ? never : "type")]: TLBaseBinding<Type, Props>[P]; } & { [P in (undefined extends Props ? "props" : never) | (undefined extends Type ? "type" : never)]?: TLBaseBinding<Type, Props>[P] | undefined; }>>;
// @public
export function createPresenceStateDerivation($user: Signal<TLPresenceUserInfo>, instanceId?: TLInstancePresence['id']): (store: TLStore) => Signal<null | TLInstancePresence, unknown>;
// @public
export function createShapeId(id?: string): TLShapeId;
// @public
export function createShapePropsMigrationIds<const S extends string, const T extends Record<string, number>>(shapeType: S, ids: T): {
[k in keyof T]: `com.tldraw.shape.${S}/${T[k]}`;
};
// @public
export function createShapePropsMigrationSequence(migrations: TLPropsMigrations): TLPropsMigrations;
// @public
export function createShapeValidator<Type extends string, Props extends JsonObject, Meta extends JsonObject>(type: Type, props?: {
[K in keyof Props]: T.Validatable<Props[K]>;
}, meta?: {
[K in keyof Meta]: T.Validatable<Meta[K]>;
}): T.ObjectValidator<Expand< { [P in "id" | "index" | "isLocked" | "meta" | "opacity" | "parentId" | "rotation" | "typeName" | "x" | "y" | (undefined extends Props ? never : "props") | (undefined extends Type ? never : "type")]: TLBaseShape<Type, Props>[P]; } & { [P in (undefined extends Props ? "props" : never) | (undefined extends Type ? "type" : never)]?: TLBaseShape<Type, Props>[P] | undefined; }>>;
// @public
export function createTLSchema({ shapes, bindings, migrations }?: {
bindings?: Record<string, SchemaPropsInfo>;
migrations?: readonly MigrationSequence[];
shapes?: Record<string, SchemaPropsInfo>;
}): TLSchema;
// @public
export const defaultBindingSchemas: {
arrow: {
migrations: TLPropsMigrations;
props: RecordProps<TLArrowBinding>;
};
};
// @public
export const defaultColorNames: readonly ["black", "grey", "light-violet", "violet", "blue", "light-blue", "yellow", "orange", "green", "light-green", "light-red", "red", "white"];
// @public
export const DefaultColorStyle: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "white" | "yellow">;
// @public
export const DefaultColorThemePalette: {
darkMode: TLDefaultColorTheme;
lightMode: TLDefaultColorTheme;
};
// @public
export const DefaultDashStyle: EnumStyleProp<"dashed" | "dotted" | "draw" | "solid">;
// @public
export const DefaultFillStyle: EnumStyleProp<"fill" | "lined-fill" | "none" | "pattern" | "semi" | "solid">;
// @public
export const DefaultFontFamilies: {
draw: string;
mono: string;
sans: string;
serif: string;
};
// @public
export const DefaultFontStyle: EnumStyleProp<"draw" | "mono" | "sans" | "serif">;
// @public
export const DefaultHorizontalAlignStyle: EnumStyleProp<"end-legacy" | "end" | "middle-legacy" | "middle" | "start-legacy" | "start">;
// @public
export const DefaultLabelColorStyle: EnumStyleProp<"black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "white" | "yellow">;
// @public
export const defaultShapeSchemas: {
arrow: {
migrations: MigrationSequence;
props: RecordProps<TLArrowShape>;
};
bookmark: {
migrations: TLPropsMigrations;
props: RecordProps<TLBookmarkShape>;
};
draw: {
migrations: TLPropsMigrations;
props: RecordProps<TLDrawShape>;
};
embed: {
migrations: TLPropsMigrations;
props: RecordProps<TLEmbedShape>;
};
frame: {
migrations: TLPropsMigrations;
props: RecordProps<TLFrameShape>;
};
geo: {
migrations: TLPropsMigrations;
props: RecordProps<TLGeoShape>;
};
group: {
migrations: TLPropsMigrations;
props: RecordProps<TLGroupShape>;
};
highlight: {
migrations: TLPropsMigrations;
props: RecordProps<TLHighlightShape>;
};
image: {
migrations: TLPropsMigrations;
props: RecordProps<TLImageShape>;
};
line: {
migrations: TLPropsMigrations;
props: RecordProps<TLLineShape>;
};
note: {
migrations: TLPropsMigrations;
props: RecordProps<TLNoteShape>;
};
text: {
migrations: TLPropsMigrations;
props: RecordProps<TLTextShape>;
};
video: {
migrations: TLPropsMigrations;
props: RecordProps<TLVideoShape>;
};
};
// @public
export const DefaultSizeStyle: EnumStyleProp<"l" | "m" | "s" | "xl">;
// @public
export const DefaultTextAlignStyle: EnumStyleProp<"end" | "middle" | "start">;
// @public
export const DefaultVerticalAlignStyle: EnumStyleProp<"end" | "middle" | "start">;
// @public
export const DocumentRecordType: RecordType<TLDocument, never>;
// @public
export const drawShapeMigrations: TLPropsMigrations;
// @public (undocumented)
export const drawShapeProps: RecordProps<TLDrawShape>;
// @public
export const ElbowArrowSnap: T.Validator<"center" | "edge-point" | "edge" | "none">;
// @public
export type ElbowArrowSnap = T.TypeOf<typeof ElbowArrowSnap>;
// @public
export const embedShapeMigrations: TLPropsMigrations;
// @public
export const embedShapeProps: RecordProps<TLEmbedShape>;
// @public
export class EnumStyleProp<T> extends StyleProp<T> {
// @internal
constructor(id: string, defaultValue: T, values: readonly T[]);
// (undocumented)
readonly values: readonly T[];
}
// @public
export type ExtractShapeByProps<P> = Extract<TLShape, {
props: P;
}>;
// @public
export const frameShapeMigrations: TLPropsMigrations;
// @public
export const frameShapeProps: RecordProps<TLFrameShape>;
// @public
export const GeoShapeGeoStyle: EnumStyleProp<"arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "check-box" | "cloud" | "diamond" | "ellipse" | "heart" | "hexagon" | "octagon" | "oval" | "pentagon" | "rectangle" | "rhombus-2" | "rhombus" | "star" | "trapezoid" | "triangle" | "x-box">;
// @public
export const geoShapeMigrations: TLPropsMigrations;
// @public
export const geoShapeProps: RecordProps<TLGeoShape>;
// @public
export function getColorValue(theme: TLDefaultColorTheme, color: TLDefaultColorStyle, variant: keyof TLDefaultColorThemeColor): string;
// @public
export function getDefaultColorTheme(opts: {
isDarkMode: boolean;
}): TLDefaultColorTheme;
// @public
export function getDefaultTranslationLocale(): TLLanguage['locale'];
// @public
export function getDefaultUserPresence(store: TLStore, user: TLPresenceUserInfo): {
brush: BoxModel | null;
camera: {
x: number;
y: number;
z: number;
};
chatMessage: string;
color: string;
currentPageId: TLPageId;
cursor: {
rotation: number;
type: string;
x: number;
y: number;
};
followingUserId: null | string;
lastActivityTimestamp: number;
meta: {};
screenBounds: BoxModel;
scribbles: TLScribble[];
selectedShapeIds: TLShapeId[];
userId: string;
userName: string;
} | null;
// @internal
export function getShapePropKeysByStyle(props: Record<string, T.Validatable<any>>): Map<StyleProp<unknown>, string>;
// @public
export const groupShapeMigrations: TLPropsMigrations;
// @public
export const groupShapeProps: RecordProps<TLGroupShape>;
// @public
export const highlightShapeMigrations: TLPropsMigrations;
// @public (undocumented)
export const highlightShapeProps: RecordProps<TLHighlightShape>;
// @public
export function idValidator<Id extends RecordId<UnknownRecord>>(prefix: Id['__type__']['typeName']): T.Validator<Id>;
// @public
export const ImageShapeCrop: T.ObjectValidator<TLShapeCrop>;
// @public
export const imageShapeMigrations: TLPropsMigrations;
// @public
export const imageShapeProps: RecordProps<TLImageShape>;
// @public
export const InstancePageStateRecordType: RecordType<TLInstancePageState, "pageId">;
// @public
export const InstancePresenceRecordType: RecordType<TLInstancePresence, "currentPageId" | "userId" | "userName">;
// @public
export function isBinding(record?: UnknownRecord): record is TLBinding;
// @public
export function isBindingId(id?: string): id is TLBindingId;
// @public
export function isDocument(record?: UnknownRecord): record is TLDocument;
// @public
export function isPageId(id: string): id is TLPageId;
// @public
export function isShape(record?: UnknownRecord): record is TLShape;
// @public
export function isShapeId(id?: string): id is TLShapeId;
// @public (undocumented)
export const LANGUAGES: readonly [{
readonly label: "Bahasa Indonesia";
readonly locale: "id";
}, {
readonly label: "Bahasa Melayu";
readonly locale: "ms";
}, {
readonly label: "Català";
readonly locale: "ca";
}, {
readonly label: "Čeština";
readonly locale: "cs";
}, {
readonly label: "Danish";
readonly locale: "da";
}, {
readonly label: "Deutsch";
readonly locale: "de";
}, {
readonly label: "English";
readonly locale: "en";
}, {
readonly label: "Español";
readonly locale: "es";
}, {
readonly label: "Filipino";
readonly locale: "tl";
}, {
readonly label: "Français";
readonly locale: "fr";
}, {
readonly label: "Galego";
readonly locale: "gl";
}, {
readonly label: "Hrvatski";
readonly locale: "hr";
}, {
readonly label: "Italiano";
readonly locale: "it";
}, {
readonly label: "Magyar";
readonly locale: "hu";
}, {
readonly label: "Nederlands";
readonly locale: "nl";
}, {
readonly label: "Norwegian";
readonly locale: "no";
}, {
readonly label: "Polski";
readonly locale: "pl";
}, {
readonly label: "Português - Brasil";
readonly locale: "pt-br";
}, {
readonly label: "Português - Europeu";
readonly locale: "pt-pt";
}, {
readonly label: "Română";
readonly locale: "ro";
}, {
readonly label: "Slovenščina";
readonly locale: "sl";
}, {
readonly label: "Somali";
readonly locale: "so";
}, {
readonly label: "Suomi";
readonly locale: "fi";
}, {
readonly label: "Svenska";
readonly locale: "sv";
}, {
readonly label: "Tiếng Việt";
readonly locale: "vi";
}, {
readonly label: "Türkçe";
readonly locale: "tr";
}, {
readonly label: "Ελληνικά";
readonly locale: "el";
}, {
readonly label: "Русский";
readonly locale: "ru";
}, {
readonly label: "Українська";
readonly locale: "uk";
}, {
readonly label: "עברית";
readonly locale: "he";
}, {
readonly label: "اردو";
readonly locale: "ur";
}, {
readonly label: "عربي";
readonly locale: "ar";
}, {
readonly label: "فارسی";
readonly locale: "fa";
}, {
readonly label: "नेपाली";
readonly locale: "ne";
}, {
readonly label: "मराठी";
readonly locale: "mr";
}, {
readonly label: "हिन्दी";
readonly locale: "hi-in";
}, {
readonly label: "বাংলা";
readonly locale: "bn";
}, {
readonly label: "ਪੰਜਾਬੀ";
readonly locale: "pa";
}, {
readonly label: "ગુજરાતી";
readonly locale: "gu-in";
}, {
readonly label: "தமிழ்";
readonly locale: "ta";
}, {
readonly label: "తెలుగు";
readonly locale: "te";
}, {
readonly label: "ಕನ್ನಡ";
readonly locale: "kn";
}, {
readonly label: "മലയാളം";
readonly locale: "ml";
}, {
readonly label: "ภาษาไทย";
readonly locale: "th";
}, {
readonly label: "ភាសាខ្មែរ";
readonly locale: "km-kh";
}, {
readonly label: "한국어";
readonly locale: "ko-kr";
}, {
readonly label: "日本語";
readonly locale: "ja";
}, {
readonly label: "简体中文";
readonly locale: "zh-cn";
}, {
readonly label: "繁體中文 (台灣)";
readonly locale: "zh-tw";
}];
// @public
export const lineShapeMigrations: TLPropsMigrations;
// @public
export const lineShapeProps: RecordProps<TLLineShape>;
// @public
export const LineShapeSplineStyle: EnumStyleProp<"cubic" | "line">;
// @public
export const noteShapeMigrations: TLPropsMigrations;
// @public
export const noteShapeProps: RecordProps<TLNoteShape>;
// @public
export const opacityValidator: T.Validator<number>;
// @public
export const pageIdValidator: T.Validator<TLPageId>;
// @public
export const PageRecordType: RecordType<TLPage, "index" | "name">;
// @public
export const parentIdValidator: T.Validator<TLParentId>;
// @internal
export function pluckPreservingValues(val?: null | TLInstance): null | Partial<TLInstance>;
// @public
export const PointerRecordType: RecordType<TLPointer, never>;
// @public
export type RecordProps<R extends UnknownRecord & {
props: object;
}> = {
[K in keyof R['props']]: T.Validatable<R['props'][K]>;
};
// @public
export type RecordPropsType<Config extends Record<string, T.Validatable<any>>> = MakeUndefinedOptional<{
[K in keyof Config]: T.TypeOf<Config[K]>;
}>;
// @public
export const richTextValidator: T.ObjectValidator<{
attrs?: any;
content: unknown[];
type: string;
}>;
// @public
export const rootBindingMigrations: MigrationSequence;
// @public
export const rootShapeMigrations: MigrationSequence;
// @public
export interface SchemaPropsInfo {
meta?: Record<string, StoreValidator<any>>;
migrations?: LegacyMigrations | MigrationSequence | TLPropsMigrations;
props?: Record<string, StoreValidator<any>>;
}
// @public
export const scribbleValidator: T.ObjectValidator<TLScribble>;
// @public
export type SetValue<T extends Set<any>> = T extends Set<infer U> ? U : never;
// @public
export const shapeIdValidator: T.Validator<TLShapeId>;
// @public
export type ShapeWithCrop = ExtractShapeByProps<{
crop: null | TLShapeCrop;
h: number;
w: number;
}>;
// @public
export class StyleProp<Type> implements T.Validatable<Type> {
// @internal
protected constructor(id: string, defaultValue: Type, type: T.Validatable<Type>);
// (undocumented)
defaultValue: Type;
static define<Type>(uniqueId: string, options: {
defaultValue: Type;
type?: T.Validatable<Type>;
}): StyleProp<Type>;
static defineEnum<const Values extends readonly unknown[]>(uniqueId: string, options: {
defaultValue: Values[number];
values: Values;
}): EnumStyleProp<Values[number]>;
// (undocumented)
readonly id: string;
// (undocumented)
setDefaultValue(value: Type): void;
// (undocumented)
readonly type: T.Validatable<Type>;
// (undocumented)
validate(value: unknown): Type;
// (undocumented)
validateUsingKnownGoodVersion(prevValue: Type, newValue: unknown): Type;
}
// @public (undocumented)
export type StylePropValue<T extends StyleProp<any>> = T extends StyleProp<infer U> ? U : never;
// @public
export const textShapeMigrations: TLPropsMigrations;
// @public
export const textShapeProps: RecordProps<TLTextShape>;
// @public
export const TL_CANVAS_UI_COLOR_TYPES: Set<"accent" | "black" | "laser" | "muted-1" | "selection-fill" | "selection-stroke" | "white">;
// @public
export const TL_CURSOR_TYPES: Set<string>;
// @public
export const TL_HANDLE_TYPES: Set<"clone" | "create" | "vertex" | "virtual">;
// @public
export const TL_SCRIBBLE_STATES: Set<"active" | "complete" | "paused" | "starting" | "stopping">;
// @public
export type TLArrowBinding = TLBaseBinding<'arrow', TLArrowBindingProps>;
// @public
export interface TLArrowBindingProps {
isExact: boolean;
isPrecise: boolean;
normalizedAnchor: VecModel;
snap: ElbowArrowSnap;
terminal: 'end' | 'start';
}
// @public
export type TLArrowShape = TLBaseShape<'arrow', TLArrowShapeProps>;
// @public
export type TLArrowShapeArrowheadStyle = T.TypeOf<typeof ArrowShapeArrowheadStartStyle>;
// @public
export type TLArrowShapeKind = T.TypeOf<typeof ArrowShapeKindStyle>;
// @public
export interface TLArrowShapeProps {
// (undocumented)
arrowheadEnd: TLArrowShapeArrowheadStyle;
// (undocumented)
arrowheadStart: TLArrowShapeArrowheadStyle;
// (undocumented)
bend: number;
// (undocumented)
color: TLDefaultColorStyle;
// (undocumented)
dash: TLDefaultDashStyle;
// (undocumented)
elbowMidPoint: number;
// (undocumented)
end: VecModel;
// (undocumented)
fill: TLDefaultFillStyle;
// (undocumented)
font: TLDefaultFontStyle;
// (undocumented)
kind: TLArrowShapeKind;
// (undocumented)
labelColor: TLDefaultColorStyle;
// (undocumented)
labelPosition: number;
// (undocumented)
richText: TLRichText;
// (undocumented)
scale: number;
// (undocumented)
size: TLDefaultSizeStyle;
// (undocumented)
start: VecModel;
}
// @public
export type TLAsset = TLBookmarkAsset | TLImageAsset | TLVideoAsset;
// @public
export interface TLAssetContext {
dpr: number;
networkEffectiveType: null | string;
screenScale: number;
shouldResolveToOriginal: boolean;
steppedScreenScale: number;
}
// @public
export type TLAssetId = RecordId<TLBaseAsset<any, any>>;
// @public
export type TLAssetPartial<T extends TLAsset = TLAsset> = T extends T ? {
id: TLAssetId;
meta?: Partial<T['meta']>;
props?: Partial<T['props']>;
type: T['type'];
} & Partial<Omit<T, 'id' | 'meta' | 'props' | 'type'>> : never;
// @public
export type TLAssetShape = ExtractShapeByProps<{
assetId: TLAssetId;
}>;
// @public
export interface TLAssetStore {
remove?(assetIds: TLAssetId[]): Promise<void>;
resolve?(asset: TLAsset, ctx: TLAssetContext): null | Promise<null | string> | string;
upload(asset: TLAsset, file: File, abortSignal?: AbortSignal): Promise<{
meta?: JsonObject;
src: string;
}>;
}
// @public
export interface TLBaseAsset<Type extends string, Props> extends BaseRecord<'asset', TLAssetId> {
meta: JsonObject;
props: Props;
type: Type;
}
// @public
export interface TLBaseBinding<Type extends string, Props extends object> {
fromId: TLShapeId;
// (undocumented)
readonly id: TLBindingId;
meta: JsonObject;
props: Props;
toId: TLShapeId;
type: Type;
// (undocumented)
readonly typeName: 'binding';
}
// @public
export interface TLBaseShape<Type extends string, Props extends object> {
// (undocumented)
readonly id: TLShapeId;
// (undocumented)
index: IndexKey;
// (undocumented)
isLocked: boolean;
// (undocumented)
meta: JsonObject;
// (undocumented)
opacity: TLOpacityType;
// (undocumented)
parentId: TLParentId;
// (undocumented)
props: Props;
// (undocumented)
rotation: number;
// (undocumented)
type: Type;
// (undocumented)
readonly typeName: 'shape';
// (undocumented)
x: number;
// (undocumented)
y: number;
}
// @public
export type TLBinding<K extends keyof TLIndexedBindings = keyof TLIndexedBindings> = TLIndexedBindings[K];
// @public
export type TLBindingCreate<T extends TLBinding = TLBinding> = T extends T ? {
fromId: T['fromId'];
id?: TLBindingId;
meta?: Partial<T['meta']>;
props?: Partial<T['props']>;
toId: T['toId'];
type: T['type'];
typeName?: T['typeName'];
} : never;
// @public
export type TLBindingId = RecordId<TLBinding>;
// @public
export type TLBindingUpdate<T extends TLBinding = TLBinding> = T extends T ? {
fromId?: T['fromId'];
id: TLBindingId;
meta?: Partial<T['meta']>;
props?: Partial<T['props']>;
toId?: T['toId'];
type: T['type'];
typeName?: T['typeName'];
} : never;
// @public
export type TLBookmarkAsset = TLBaseAsset<'bookmark', {
description: string;
favicon: string;
image: string;
src: null | string;
title: string;
}>;
// @public
export type TLBookmarkShape = TLBaseShape<'bookmark', TLBookmarkShapeProps>;
// @public
export interface TLBookmarkShapeProps {
assetId: null | TLAssetId;
h: number;
url: string;
w: number;
}
// @public
export interface TLCamera extends BaseRecord<'camera', TLCameraId> {
meta: JsonObject;
x: number;
y: number;
z: number;
}
// @public
export type TLCameraId = RecordId<TLCamera>;
// @public
export type TLCanvasUiColor = SetValue<typeof TL_CANVAS_UI_COLOR_TYPES>;
// @public
export type TLCreateShapePartial<T extends TLShape = TLShape> = T extends T ? {
meta?: Partial<T['meta']>;
props?: Partial<T['props']>;
type: T['type'];
} & Partial<Omit<T, 'meta' | 'props' | 'type'>> : never;
// @public
export interface TLCursor {
rotation: number;
type: TLCursorType;
}
// @public
export type TLCursorType = SetValue<typeof TL_CURSOR_TYPES>;
// @public
export type TLDefaultBinding = TLArrowBinding;
// @public
export type TLDefaultColorStyle = T.TypeOf<typeof DefaultColorStyle>;
// @public
export type TLDefaultColorTheme = Expand<{
background: string;
id: 'dark' | 'light';
solid: string;
text: string;
} & Record<(typeof defaultColorNames)[number], TLDefaultColorThemeColor>>;
// @public
export interface TLDefaultColorThemeColor {
// (undocumented)
fill: string;
// (undocumented)
frameFill: string;
// (undocumented)
frameHeadingFill: string;
// (undocumented)
frameHeadingStroke: string;
// (undocumented)
frameStroke: string;
// (undocumented)
frameText: string;
// (undocumented)
highlightP3: string;
// (undocumented)
highlightSrgb: string;
// (undocumented)
linedFill: string;
// (undocumented)
noteFill: string;
// (undocumented)
noteText: string;
// (undocumented)
pattern: string;
// (undocumented)
semi: string;
// (undocumented)
solid: string;
}
// @public
export type TLDefaultDashStyle = T.TypeOf<typeof DefaultDashStyle>;
// @public
export type TLDefaultFillStyle = T.TypeOf<typeof DefaultFillStyle>;
// @public
export type TLDefaultFontStyle = T.TypeOf<typeof DefaultFontStyle>;
// @public
export type TLDefaultHorizontalAlignStyle = T.TypeOf<typeof DefaultHorizontalAlignStyle>;
// @public
export type TLDefaultShape = TLArrowShape | TLBookmarkShape | TLDrawShape | TLEmbedShape | TLFrameShape | TLGeoShape | TLGroupShape | TLHighlightShape | TLImageShape | TLLineShape | TLNoteShape | TLTextShape | TLVideoShape;
// @public
export type TLDefaultSizeStyle = T.TypeOf<typeof DefaultSizeStyle>;
// @public
export type TLDefaultTextAlignStyle = T.TypeOf<typeof DefaultTextAlignStyle>;
// @public
export type TLDefaultVerticalAlignStyle = T.TypeOf<typeof DefaultVerticalAlignStyle>;
// @public
export interface TLDocument extends BaseRecord<'document', RecordId<TLDocument>> {
gridSize: number;
meta: JsonObject;
name: string;
}
// @public
export const TLDOCUMENT_ID: RecordId<TLDocument>;
// @public
export type TLDrawShape = TLBaseShape<'draw', TLDrawShapeProps>;
// @public
export interface TLDrawShapeProps {
color: TLDefaultColorStyle;
dash: TLDefaultDashStyle;
fill: TLDefaultFillStyle;
isClosed: boolean;
isComplete: boolean;
isPen: boolean;
scale: number;
scaleX: number;
scaleY: number;
segments: TLDrawShapeSegment[];
size: TLDefaultSizeStyle;
}
// @public
export interface TLDrawShapeSegment {
path: string;
type: 'free' | 'straight';
}
// @public
export type TLEmbedShape = TLBaseShape<'embed', TLEmbedShapeProps>;
// @public
export interface TLEmbedShapeProps {
h: number;
url: string;
w: number;
}
// @public
export type TLFrameShape = TLBaseShape<'frame', TLFrameShapeProps>;
// @public
export interface TLFrameShapeProps {
color: TLDefaultColorStyle;
h: number;
name: string;
w: number;
}
// @public
export type TLGeoShape = TLBaseShape<'geo', TLGeoShapeProps>;
// @public
export type TLGeoShapeGeoStyle = T.TypeOf<typeof GeoShapeGeoStyle>;
// @public
export interface TLGeoShapeProps {
align: TLDefaultHorizontalAlignStyle;
color: TLDefaultColorStyle;
dash: TLDefaultDashStyle;
fill: TLDefaultFillStyle;
font: TLDefaultFontStyle;
geo: TLGeoShapeGeoStyle;
growY: number;
h: number;
labelColor: TLDefaultColorStyle;
richText: TLRichText;
scale: number;
size: TLDefaultSizeStyle;
url: string;
verticalAlign: TLDefaultVerticalAlignStyle;
w: number;
}
// @public (undocumented)
export interface TLGlobalBindingPropsMap {
}
// @public (undocumented)
export interface TLGlobalShapePropsMap {
}
// @public
export type TLGroupShape = TLBaseShape<'group', TLGroupShapeProps>;
// @public
export interface TLGroupShapeProps {
}
// @public
export interface TLHandle {
// @deprecated (undocumented)
canSnap?: boolean;
id: string;
index: IndexKey;
label?: string;
snapReferenceHandleId?: string;
snapType?: 'align' | 'point';
type: TLHandleType;
x: number;
y: number;
}
// @public
export type TLHandleType = SetValue<typeof TL_HANDLE_TYPES>;
// @public
export type TLHighlightShape = TLBaseShape<'highlight', TLHighlightShapeProps>;
// @public
export interface TLHighlightShapeProps {
color: TLDefaultColorStyle;
isComplete: boolean;
isPen: boolean;
scale: number;
scaleX: number;
scaleY: number;
segments: TLDrawShapeSegment[];
size: TLDefaultSizeStyle;
}
// @public
export type TLImageAsset = TLBaseAsset<'image', {
fileSize?: number;
h: number;
isAnimated: boolean;
mimeType: null | string;
name: string;
pixelRatio?: number;
src: null | string;
w: number;
}>;
// @public
export type TLImageShape = TLBaseShape<'image', TLImageShapeProps>;
// @public
export interface TLImageShapeProps {
altText: string;
assetId: null | TLAssetId;
crop: null | TLShapeCrop;
flipX: boolean;
flipY: boolean;
h: number;
playing: boolean;
url: string;
w: number;
}
// @public (undocumented)
export type TLIndexedBindings = {
[K in keyof TLGlobalBindingPropsMap | TLDefaultBinding['type'] as K extends TLDefaultBinding['type'] ? K extends keyof TLGlobalBindingPropsMap ? TLGlobalBindingPropsMap[K] extends null | undefined ? never : K : K : K]: K extends TLDefaultBinding['type'] ? K extends keyof TLGlobalBindingPropsMap ? TLBaseBinding<K, TLGlobalBindingPropsMap[K]> : Extract<TLDefaultBinding, {
type: K;
}> : TLBaseBinding<K, TLGlobalBindingPropsMap[K & keyof TLGlobalBindingPropsMap]>;
};
// @public (undocumented)
export type TLIndexedShapes = {
[K in keyof TLGlobalShapePropsMap | TLDefaultShape['type'] as K extends TLDefaultShape['type'] ? K extends 'group' ? K : K extends keyof TLGlobalShapePropsMap ? TLGlobalShapePropsMap[K] extends null | undefined ? never : K : K : K]: K extends 'group' ? Extract<TLDefaultShape, {
type: K;
}> : K extends TLDefaultShape['type'] ? K extends keyof TLGlobalShapePropsMap ? TLBaseShape<K, TLGlobalShapePropsMap[K]> : Extract<TLDefaultShape, {
type: K;
}> : TLBaseShape<K, TLGlobalShapePropsMap[K & keyof TLGlobalShapePropsMap]>;
};
// @public
export interface TLInstance extends BaseRecord<'instance', TLInstanceId> {
// (undocumented)
brush: BoxModel | null;
cameraState: 'idle' | 'moving';
// (undocumented)
chatMessage: string;
// (undocumented)
currentPageId: TLPageId;
// (undocumented)
cursor: TLCursor;
// (undocumented)
devicePixelRatio: number;
// (undocumented)
duplicateProps: {
offset: {
x: number;
y: number;
};
shapeIds: TLShapeId[];
} | null;
// (undocumented)
exportBackground: boolean;
// (undocumented)
followingUserId: null | string;
// (undocumented)
highlightedUserIds: string[];
// (undocumented)
insets: boolean[];
// (undocumented)
isChangingStyle: boolean;
// (undocumented)
isChatting: boolean;
isCoarsePointer: boolean;
// (undocumented)
isDebugMode: boolean;
// (undocumented)
isFocused: boolean;
// (undocumented)
isFocusMode: boolean;
// (undocumented)
isGridMode: boolean;
isHoveringCanvas: boolean | null;
// (undocumented)
isPenMode: boolean;
// (undocumented)
isReadonly: boolean;
// (undocumented)
isToolLocked: boolean;
// (undocumented)
meta: JsonObject;
// (undocumented)
opacityForNextShape: TLOpacityType;
// (undocumented)
openMenus: string[];
// (undocumented)
screenBounds: BoxModel;
// (undocumented)
scribbles: TLScribble[];
// (undocumented)
stylesForNextShape: Record<string, unknown>;
// (undocumented)
zoomBrush: BoxModel | null;
}
// @public
export const TLINSTANCE_ID: TLInstanceId;
// @public
export type TLInstanceId = RecordId<TLInstance>;
// @public
export interface TLInstancePageState extends BaseRecord<'instance_page_state', TLInstancePageStateId> {
// (undocumented)
croppingShapeId: null | TLShapeId;
// (undocumented)
editingShapeId: null | TLShapeId;
// (undocumented)
erasingShapeIds: TLShapeId[];
// (undocumented)
focusedGroupId: null | TLShapeId;
// (undocumented)
hintingShapeIds: TLShapeId[];
// (undocumented)
hoveredShapeId: null | TLShapeId;
// (undocumented)
meta: JsonObject;
// (undocumented)
pageId: RecordId<TLPage>;
// (undocumented)
selectedShapeIds: TLShapeId[];
}
// @public
export type TLInstancePageStateId = RecordId<TLInstancePageState>;
// @public
export interface TLInstancePresence extends BaseRecord<'instance_presence', TLInstancePresenceID> {
// (undocumented)
brush: BoxModel | null;
// (undocumented)
camera: {
x: number;
y: number;
z: number;
} | null;
// (undocumented)
chatMessage: string;
// (undocumented)
color: string;
// (undocumented)
currentPageId: TLPageId;
// (undocumented)
cursor: {
rotation: number;
type: TLCursor['type'];
x: number;
y: number;
} | null;
// (undocumented)
followingUserId: null | string;
// (undocumented)
lastActivityTimestamp: null | number;
// (undocumented)
meta: JsonObject;
// (undocumented)
screenBounds: BoxModel | null;
// (undocumented)
scribbles: TLScribble[];
// (undocumented)
selectedShapeIds: TLShapeId[];
// (undocumented)
userId: string;
// (undocumented)
userName: string;
}
// @public
export type TLInstancePresenceID = RecordId<TLInstancePresence>;
// @public
export type TLLanguage = (typeof LANGUAGES)[number];
// @public
export type TLLineShape = TLBaseShape<'line', TLLineShapeProps>;
// @public
export interface TLLineShapePoint {
id: string;
index: IndexKey;
x: number;
y: number;
}
// @public
export interface TLLineShapeProps {
color: TLDefaultColorStyle;
dash: TLDefaultDashStyle;
points: Record<string, TLLineShapePoint>;
scale: number;
size: TLDefaultSizeStyle;
spline: TLLineShapeSplineStyle;
}
// @public
export type TLLineShapeSplineStyle = T.TypeOf<typeof LineShapeSplineStyle>;
// @public
export type TLNoteShape = TLBaseShape<'note', TLNoteShapeProps>;
// @public
export interface TLNoteShapeProps {
align: TLDefaultHorizontalAlignStyle;
color: TLDefaultColorStyle;
font: TLDefaultFontStyle;
fontSizeAdjustment: number;
growY: number;
labelColor: TLDefaultColorStyle;
richText: TLRichText;
scale: number;
size: TLDefaultSizeStyle;
url: string;
verticalAlign: TLDefaultVerticalAlignStyle;
}
// @public
export type TLOpacityType = number;
// @public
export interface TLPage extends BaseRecord<'page', TLPageId> {
// (undocumented)
index: IndexKey;
// (undocumented)
meta: JsonObject;
// (undocumented)
name: string;
}
// @public
export type TLPageId = RecordId<TLPage>;
// @public
export type TLParentId = TLPageId | TLShapeId;
// @public
export interface TLPointer extends BaseRecord<'pointer', TLPointerId> {
// (undocumented)
lastActivityTimestamp: number;
// (undocumented)
meta: JsonObject;
// (undocumented)
x: number;
// (undocumented)
y: number;
}
// @public
export const TLPOINTER_ID: TLPointerId;
// @public
export type TLPointerId = RecordId<TLPointer>;
// @public
export type TLPresenceStateInfo = Parameters<(typeof InstancePresenceRecordType)['create']>[0];
// @public
export interface TLPresenceUserInfo {
color?: null | string;
id: string;
name?: null | string;
}
// @public
export interface TLPropsMigration {
// (undocumented)
readonly dependsOn?: MigrationId[];
readonly down?: 'none' | 'retired' | ((props: any) => any);
// (undocumented)
readonly id: MigrationId;
// (undocumented)
readonly up: (props: any) => any;
}
// @public
export interface TLPropsMigrations {
// (undocumented)
readonly sequence: Array<StandaloneDependsOn | TLPropsMigration>;
}
// @public
export type TLRecord = TLAsset | TLBinding | TLCamera | TLDocument | TLInstance | TLInstancePageState | TLInstancePresence | TLPage | TLPointer | TLShape;
// @public
export type TLRichText = T.TypeOf<typeof richTextValidator>;
// @public
export type TLSchema = StoreSchema<TLRecord, TLStoreProps>;
// @public
export interface TLScribble {
color: TLCanvasUiColor;
delay: number;
id: string;
opacity: number;
points: VecModel[];
shrink: number;
size: number;
state: SetValue<typeof TL_SCRIBBLE_STATES>;
taper: boolean;
}
// @public
export type TLSerializedStore = SerializedStore<TLRecord>;
// @public
export type TLShape<K extends keyof TLIndexedShapes = keyof TLIndexedShapes> = TLIndexedShapes[K];
// @public
export interface TLShapeCrop {
// (undocumented)
bottomRight: VecModel;
// (undocumented)
isCircle?: boolean;
// (undocumented)
topLeft: VecModel;
}
// @public
export type TLShapeId = RecordId<TLShape>;
// @public
export type TLShapePartial<T extends TLShape = TLShape> = T extends T ? {
id: TLShapeId;
meta?: Partial<T['meta']>;
props?: Partial<T['props']>;
type: T['type'];
} & Partial<Omit<T, 'id' | 'meta' | 'props' | 'type'>> : never;
// @public
export type TLStore = Store<TLRecord, TLStoreProps>;
// @public
export interface TLStoreProps {
assets: Required<TLAssetStore>;
collaboration?: {
mode?: null | Signal<'readonly' | 'readwrite'>;
status: null | Signal<'offline' | 'online'>;
};
defaultName: string;
onMount(editor: unknown): (() => void) | void;
}
// @public
export type TLStoreSchema = StoreSchema<TLRecord, TLStoreProps>;
// @public
export type TLStoreSnapshot = StoreSnapshot<TLRecord>;
// @public
export type TLTextShape = TLBaseShape<'text', TLTextShapeProps>;
// @public
export interface TLTextShapeProps {
// (undocumented)
autoSize: boolean;
// (undocumented)
color: TLDefaultColorStyle;
// (undocumented)
font: TLDefaultFontStyle;
// (undocumented)
richText: TLRichText;
// (undocumented)
scale: number;
// (undocumented)
size: TLDefaultSizeStyle;
// (undocumented)
textAlign: TLDefaultTextAlignStyle;
// (undocumented)
w: number;
}
// @public
export type TLUnknownBinding = TLBaseBinding<string, object>;
// @public
export type TLUnknownShape = TLBaseShape<string, object>;
// @public
export type TLVideoAsset = TLBaseAsset<'video', {
fileSize?: number;
h: number;
mimeType: null | string;
name: string;
src: null | string;
w: number;
isAnimated: boolean;
}>;
// @public
export type TLVideoShape = TLBaseShape<'video', TLVideoShapeProps>;
// @public
export interface TLVideoShapeProps {
// (undocumented)
altText: string;
// (undocumented)
assetId: null | TLAssetId;
// (undocumented)
autoplay: boolean;
// (undocumented)
h: number;
// (undocumented)
playing: boolean;
// (undocumented)
time: number;
// (undocumented)
url: string;
// (undocumented)
w: number;
}
// @public
export function toRichText(text: string): TLRichText;
// @public
export interface VecModel {
// (undocumented)
x: number;
// (undocumented)
y: number;
// (undocumented)
z?: number;
}
// @public
export const vecModelValidator: T.ObjectValidator<VecModel>;
// @public
export const videoShapeMigrations: TLPropsMigrations;
// @public
export const videoShapeProps: RecordProps<TLVideoShape>;
// (No @packageDocumentation comment for this package)