2023-06-03 08:59:04 +00:00
|
|
|
import { defineMigrations } from '@tldraw/store'
|
2023-06-03 08:27:44 +00:00
|
|
|
import { T } from '@tldraw/validate'
|
2023-06-03 20:46:53 +00:00
|
|
|
import { createShapeValidator, TLBaseShape } from './TLBaseShape'
|
2023-04-25 11:01:25 +00:00
|
|
|
|
2023-06-03 20:46:53 +00:00
|
|
|
type TLFrameShapeProps = {
|
2023-04-25 11:01:25 +00:00
|
|
|
w: number
|
|
|
|
h: number
|
|
|
|
name: string
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @public */
|
|
|
|
export type TLFrameShape = TLBaseShape<'frame', TLFrameShapeProps>
|
|
|
|
|
2023-06-03 20:46:53 +00:00
|
|
|
/** @internal */
|
|
|
|
export const frameShapeValidator: T.Validator<TLFrameShape> = createShapeValidator(
|
2023-04-25 11:01:25 +00:00
|
|
|
'frame',
|
|
|
|
T.object({
|
|
|
|
w: T.nonZeroNumber,
|
|
|
|
h: T.nonZeroNumber,
|
|
|
|
name: T.string,
|
|
|
|
})
|
|
|
|
)
|
|
|
|
|
2023-06-03 20:46:53 +00:00
|
|
|
/** @internal */
|
|
|
|
export const frameShapeMigrations = defineMigrations({})
|