2021-08-10 16:12:55 +00:00
|
|
|
import type { TLPage, TLPageState, TLSettings } from '@tldraw/core'
|
|
|
|
import type {
|
|
|
|
TLDrawShape,
|
|
|
|
ShapeStyles,
|
|
|
|
TLDrawShapeType,
|
|
|
|
TLDrawToolType,
|
2021-08-12 13:39:41 +00:00
|
|
|
TLDrawBinding,
|
2021-08-10 16:12:55 +00:00
|
|
|
} from './shape'
|
|
|
|
|
|
|
|
export interface TLDrawDocument {
|
|
|
|
id: string
|
2021-08-12 13:39:41 +00:00
|
|
|
pages: Record<string, TLPage<TLDrawShape, TLDrawBinding>>
|
2021-08-10 16:12:55 +00:00
|
|
|
pageStates: Record<string, TLPageState>
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface TLDrawSettings extends TLSettings {
|
|
|
|
isReadonlyMode: boolean
|
|
|
|
nudgeDistanceSmall: number
|
|
|
|
nudgeDistanceLarge: number
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Data {
|
2021-08-12 13:39:41 +00:00
|
|
|
page: TLPage<TLDrawShape, TLDrawBinding>
|
2021-08-10 16:12:55 +00:00
|
|
|
pageState: TLPageState
|
|
|
|
settings: TLDrawSettings
|
|
|
|
appState: {
|
|
|
|
currentStyle: ShapeStyles
|
|
|
|
currentPageId: string
|
|
|
|
activeTool: TLDrawShapeType | 'select'
|
|
|
|
activeToolType?: TLDrawToolType | 'select'
|
|
|
|
isToolLocked: boolean
|
|
|
|
isStyleOpen: boolean
|
|
|
|
isEmptyCanvas: boolean
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum MoveType {
|
|
|
|
Backward = 'backward',
|
|
|
|
Forward = 'forward',
|
|
|
|
ToFront = 'toFront',
|
|
|
|
ToBack = 'toBack',
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum AlignType {
|
|
|
|
Top = 'top',
|
|
|
|
CenterVertical = 'centerVertical',
|
|
|
|
Bottom = 'bottom',
|
|
|
|
Left = 'left',
|
|
|
|
CenterHorizontal = 'centerHorizontal',
|
|
|
|
Right = 'right',
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum StretchType {
|
|
|
|
Horizontal = 'horizontal',
|
|
|
|
Vertical = 'vertical',
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum DistributeType {
|
|
|
|
Horizontal = 'horizontal',
|
|
|
|
Vertical = 'vertical',
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum FlipType {
|
|
|
|
Horizontal = 'horizontal',
|
|
|
|
Vertical = 'vertical',
|
|
|
|
}
|