UNPKG

@tldraw/tlschema

Version:

tldraw infinite canvas SDK (schema).

8 lines (7 loc) 2.11 kB
{ "version": 3, "sources": ["../../src/shapes/TLGroupShape.ts"], "sourcesContent": ["import { createShapePropsMigrationSequence } from '../records/TLShape'\nimport { RecordProps } from '../recordsWithProps'\nimport { TLBaseShape } from './TLBaseShape'\n\n/**\n * Properties for a group shape. Group shapes are used to organize and manage collections of shapes as a single unit.\n * Group shapes themselves have no visual properties and serve only as containers.\n *\n * @public\n * @example\n * ```ts\n * const groupProps: TLGroupShapeProps = {}\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface TLGroupShapeProps {}\n\n/**\n * A group shape that acts as a container for organizing multiple shapes into a single logical unit.\n * Groups enable users to move, transform, and manage collections of shapes together while maintaining\n * their relative positions and properties.\n *\n * @public\n * @example\n * ```ts\n * const groupShape: TLGroupShape = {\n * id: 'shape:group1',\n * type: 'group',\n * x: 100,\n * y: 100,\n * rotation: 0,\n * index: 'a1',\n * parentId: 'page:main',\n * isLocked: false,\n * opacity: 1,\n * props: {},\n * meta: {},\n * typeName: 'shape'\n * }\n * ```\n */\nexport type TLGroupShape = TLBaseShape<'group', TLGroupShapeProps>\n\n/**\n * Validation schema for group shape properties. Since group shapes have no visual properties,\n * this is an empty object that serves as a placeholder for the schema system.\n *\n * @public\n * @example\n * ```ts\n * import { groupShapeProps } from '@tldraw/tlschema'\n *\n * // Used internally by the validation system\n * const validator = T.object(groupShapeProps)\n * ```\n */\nexport const groupShapeProps: RecordProps<TLGroupShape> = {}\n\n/**\n * Migration sequence for group shapes. Currently contains no migrations.\n *\n * @public\n */\nexport const groupShapeMigrations = createShapePropsMigrationSequence({ sequence: [] })\n"], "mappings": "AAAA,SAAS,yCAAyC;AAwD3C,MAAM,kBAA6C,CAAC;AAOpD,MAAM,uBAAuB,kCAAkC,EAAE,UAAU,CAAC,EAAE,CAAC;", "names": [] }