File size: 608 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { ElementType } from 'react'
import * as Zdog from 'react-zdog'

type ZdogExports = typeof Zdog
type ZdogElements = {
  [P in keyof ZdogExports]: P extends 'Illustration'
    ? never
    : ZdogExports[P] extends ElementType
      ? P
      : never
}[keyof ZdogExports]

export const primitives: { [key in ZdogElements]: ElementType } = {
  Anchor: Zdog.Anchor,
  Shape: Zdog.Shape,
  Group: Zdog.Group,
  Rect: Zdog.Rect,
  RoundedRect: Zdog.RoundedRect,
  Ellipse: Zdog.Ellipse,
  Polygon: Zdog.Polygon,
  Hemisphere: Zdog.Hemisphere,
  Cylinder: Zdog.Cylinder,
  Cone: Zdog.Cone,
  Box: Zdog.Box,
}