|
| 1 | +/* eslint-disable no-undef */ |
| 2 | +import { AttributesValue } from 'ts-graphviz'; |
| 3 | + |
| 4 | +export type TableProps = { |
| 5 | + ALIGN?: 'CENTER' | 'LEFT' | 'RIGHT'; // "CENTER|LEFT|RIGHT" |
| 6 | + BGCOLOR?: AttributesValue; // "color" |
| 7 | + BORDER?: AttributesValue; // "value" |
| 8 | + CELLBORDER?: AttributesValue; // "value" |
| 9 | + CELLPADDING?: AttributesValue; // "value" |
| 10 | + CELLSPACING?: AttributesValue; // "value" |
| 11 | + COLOR?: AttributesValue; // "color" |
| 12 | + COLUMNS?: AttributesValue; // "value" |
| 13 | + FIXEDSIZE?: true; // "FALSE|TRUE" |
| 14 | + GRADIENTANGLE?: AttributesValue; // "value" |
| 15 | + HEIGHT?: AttributesValue; // "value" |
| 16 | + HREF?: AttributesValue; // "value" |
| 17 | + ID?: AttributesValue; // "value" |
| 18 | + PORT?: AttributesValue; // "portName" |
| 19 | + ROWS?: AttributesValue; // "value" |
| 20 | + SIDES?: AttributesValue; // "value" |
| 21 | + STYLE?: AttributesValue; // "value" |
| 22 | + TARGET?: AttributesValue; // "value" |
| 23 | + TITLE?: AttributesValue; // "value" |
| 24 | + TOOLTIP?: AttributesValue; // "value" |
| 25 | + VALIGN?: 'MIDDLE' | 'BOTTOM' | 'TOP'; // "MIDDLE|BOTTOM|TOP" |
| 26 | + WIDTH?: AttributesValue; // "value" |
| 27 | +}; |
| 28 | + |
| 29 | +type NoAttributes = {}; |
| 30 | + |
| 31 | +export type TrProps = NoAttributes; |
| 32 | + |
| 33 | +export type TdProps = { |
| 34 | + ALIGN?: 'CENTER' | 'LEFT' | 'RIGHT' | 'TEXT'; // "CENTER|LEFT|RIGHT|TEXT" |
| 35 | + BALIGN?: 'CENTER' | 'LEFT' | 'RIGHT'; // "CENTER|LEFT|RIGHT" |
| 36 | + BGCOLOR?: AttributesValue; // "color" |
| 37 | + BORDER?: AttributesValue; // "value" |
| 38 | + CELLPADDING?: AttributesValue; // "value" |
| 39 | + CELLSPACING?: AttributesValue; // "value" |
| 40 | + COLOR?: AttributesValue; // "color" |
| 41 | + COLSPAN?: AttributesValue; // "value" |
| 42 | + FIXEDSIZE?: boolean; // "FALSE|TRUE" |
| 43 | + GRADIENTANGLE?: AttributesValue; // "value" |
| 44 | + HEIGHT?: AttributesValue; // "value" |
| 45 | + HREF?: AttributesValue; // "value" |
| 46 | + ID?: AttributesValue; // "value" |
| 47 | + PORT?: AttributesValue; // "portName" |
| 48 | + ROWSPAN?: AttributesValue; // "value" |
| 49 | + SIDES?: AttributesValue; // "value" |
| 50 | + STYLE?: AttributesValue; // "value" |
| 51 | + TARGET?: AttributesValue; // "value" |
| 52 | + TITLE?: AttributesValue; // "value" |
| 53 | + TOOLTIP?: AttributesValue; // "value" |
| 54 | + VALIGN?: 'MIDDLE' | 'BOTTOM' | 'TOP'; // "MIDDLE|BOTTOM|TOP" |
| 55 | + WIDTH?: AttributesValue; // "value" |
| 56 | +}; |
| 57 | + |
| 58 | +export type FontProps = { |
| 59 | + color?: AttributesValue; // "color" |
| 60 | + face?: AttributesValue; // "fontname" |
| 61 | + point?: AttributesValue; // SIZE="value" |
| 62 | +}; |
| 63 | + |
| 64 | +export type BrProps = { |
| 65 | + ALIGN?: 'CENTER' | 'LEFT' | 'RIGHT'; // "CENTER|LEFT|RIGHT" |
| 66 | +}; |
| 67 | + |
| 68 | +export type ImgProps = { |
| 69 | + SCALE?: boolean | 'WIDTH' | 'HEIGHT' | 'BOTH'; // "FALSE|TRUE|WIDTH|HEIGHT|BOTH" |
| 70 | + SRC?: AttributesValue; // "value" |
| 71 | +}; |
| 72 | + |
| 73 | +export type IProps = NoAttributes; |
| 74 | + |
| 75 | +export type BProps = NoAttributes; |
| 76 | + |
| 77 | +export type UProps = NoAttributes; |
| 78 | + |
| 79 | +export type OProps = NoAttributes; |
| 80 | +export type SubProps = NoAttributes; |
| 81 | + |
| 82 | +export type SupProps = NoAttributes; |
| 83 | +export type SProps = NoAttributes; |
| 84 | +export type HrProps = NoAttributes; |
| 85 | +export type VrProps = NoAttributes; |
| 86 | + |
| 87 | +export enum DOT { |
| 88 | + PORT = 'dot-port', |
| 89 | + TABLE = 'dot-table', |
| 90 | + TR = 'dot-tr', |
| 91 | + TD = 'dot-td', |
| 92 | + FONT = 'dot-font', |
| 93 | + BR = 'dot-br', |
| 94 | + IMG = 'dot-img', |
| 95 | + I = 'dot-i', |
| 96 | + B = 'dot-b', |
| 97 | + U = 'dot-u', |
| 98 | + O = 'dot-o', |
| 99 | + SUB = 'dot-sub', |
| 100 | + SUP = 'dot-sup', |
| 101 | + S = 'dot-s', |
| 102 | + HR = 'dot-hr', |
| 103 | + VR = 'dot-vr', |
| 104 | +} |
| 105 | + |
| 106 | +declare global { |
| 107 | + // eslint-disable-next-line @typescript-eslint/no-namespace |
| 108 | + namespace JSX { |
| 109 | + interface IntrinsicElements { |
| 110 | + [DOT.PORT]: { children: string }; |
| 111 | + [DOT.TABLE]: React.PropsWithChildren<TableProps>; |
| 112 | + [DOT.TR]: React.PropsWithChildren<TrProps>; |
| 113 | + [DOT.TD]: React.PropsWithChildren<TdProps>; |
| 114 | + [DOT.FONT]: React.PropsWithChildren<FontProps>; |
| 115 | + [DOT.BR]: BrProps; |
| 116 | + [DOT.IMG]: ImgProps; |
| 117 | + [DOT.I]: React.PropsWithChildren<IProps>; |
| 118 | + [DOT.B]: React.PropsWithChildren<BProps>; |
| 119 | + [DOT.U]: React.PropsWithChildren<UProps>; |
| 120 | + [DOT.O]: React.PropsWithChildren<OProps>; |
| 121 | + [DOT.SUB]: React.PropsWithChildren<SubProps>; |
| 122 | + [DOT.SUP]: React.PropsWithChildren<SupProps>; |
| 123 | + [DOT.S]: React.PropsWithChildren<SProps>; |
| 124 | + [DOT.HR]: HrProps; |
| 125 | + [DOT.VR]: VrProps; |
| 126 | + } |
| 127 | + } |
| 128 | +} |
0 commit comments