Tldraw/packages/editor/src/lib/editor/types/emit-types.ts

21 wiersze
572 B
TypeScript

import { HistoryEntry } from '@tldraw/store'
import { TLPageId, TLRecord } from '@tldraw/tlschema'
import { TLEventInfo } from './event-types'
/** @public */
export interface TLEventMap {
// Lifecycle / Internal
mount: []
'max-shapes': [{ name: string; pageId: TLPageId; count: number }]
change: [HistoryEntry<TLRecord>]
crash: [{ error: unknown }]
'stop-camera-animation': []
'stop-following': []
event: [TLEventInfo]
tick: [number]
frame: [number]
}
/** @public */
export type TLEventMapHandler<T extends keyof TLEventMap> = (...args: TLEventMap[T]) => void