UNPKG

25.1 kBTypeScriptView Raw
1export const __esModule: boolean;
2/**
3 * Function that creates a PNG data url for a column of SWU
4 * @function swu.columnPng
5 * @param {ColumnData} swuColumn - an array of SWU signs and punctuation with coordinates
6 * @param {ColumnOptions} options - an object of column options
7 * @returns {string} column png data url
8 * @example
9 * swu.columnPng([
10 * {
11 * "x": 56,
12 * "y": 20,
13 * "minX": 481,
14 * "minY": 471,
15 * "width": 37,
16 * "height": 58,
17 * "lane": 0,
18 * "padding": 0,
19 * "segment": "sign",
20 * "text": "𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻",
21 * "zoom": 1
22 * },
23 * {
24 * "x": 57,
25 * "y": 118,
26 * "minX": 482,
27 * "minY": 468,
28 * "width": 36,
29 * "height": 65,
30 * "lane": 0,
31 * "padding": 0,
32 * "segment": "sign",
33 * "text": "𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦",
34 * "zoom": 1
35 * },
36 * {
37 * "x": 39,
38 * "y": 203,
39 * "minX": 464,
40 * "minY": 496,
41 * "width": 72,
42 * "height": 8,
43 * "lane": 0,
44 * "padding": 0,
45 * "segment": "symbol",
46 * "text": "񏌁𝣢𝤂",
47 * "zoom": 1
48 * }
49 * ],
50 * {
51 * "height": 250,
52 * "width": 150,
53 * })
54 *
55 * return 'data:image/png;base64,iVBORw...'
56 */
57export function columnPng(swuColumn: ColumnData, options: ColumnOptions): string;
58/**
59 * Function that creates an SVG image for a column of SWU
60 * @function swu.columnSvg
61 * @param {ColumnData} swuColumn - an array of objects with information about FSW signs and punctuation
62 * @param {ColumnOptions} options - an object of column options
63 * @returns {string} column svg
64 * @example
65 * swu.columnSvg([
66 * {
67 * "x": 56,
68 * "y": 20,
69 * "minX": 481,
70 * "minY": 471,
71 * "width": 37,
72 * "height": 58,
73 * "lane": 0,
74 * "padding": 0,
75 * "segment": "sign",
76 * "text": "𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻",
77 * "zoom": 1
78 * },
79 * {
80 * "x": 57,
81 * "y": 118,
82 * "minX": 482,
83 * "minY": 468,
84 * "width": 36,
85 * "height": 65,
86 * "lane": 0,
87 * "padding": 0,
88 * "segment": "sign",
89 * "text": "𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦",
90 * "zoom": 1
91 * },
92 * {
93 * "x": 39,
94 * "y": 203,
95 * "minX": 464,
96 * "minY": 496,
97 * "width": 72,
98 * "height": 8,
99 * "lane": 0,
100 * "padding": 0,
101 * "segment": "symbol",
102 * "text": "񏌁𝣢𝤂",
103 * "zoom": 1
104 * }
105 * ],
106 * {
107 * "height": 250,
108 * "width": 150,
109 * })
110 *
111 * return `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="150" height="250" viewBox="0 0 150 250">
112 * <g transform="translate(56,20) scale(1) translate(-481,-471) ">
113 * <text font-size="0">𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻-D_black,white_Z1</text>
114 * <g transform="translate(481,471)">
115 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􁲥</text>
116 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󹲥</text>
117 * </g>
118 * <g transform="translate(503,489)">
119 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􈊧</text>
120 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󸊧</text>
121 * </g>
122 * </g>
123 * <g transform="translate(57,118) scale(1) translate(-482,-468) ">
124 * <text font-size="0">𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦-D_black,white_Z1</text>
125 * <g transform="translate(489,515)">
126 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􃊫</text>
127 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󳊫</text>
128 * </g>
129 * <g transform="translate(482,490)">
130 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􃊢</text>
131 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󳊢</text>
132 * </g>
133 * <g transform="translate(508,496)">
134 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􆇡</text>
135 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󶇡</text>
136 * </g>
137 * <g transform="translate(500,468)">
138 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋛕</text>
139 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻛕</text>
140 * </g>
141 * </g>
142 * <g transform="translate(39,203) scale(1) translate(-464,-496) ">
143 * <text font-size="0">񏌁𝣢𝤂-D_black,white_Z1</text>
144 * <g transform="translate(464,496)">
145 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􏌁</text>
146 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󿌁</text>
147 * </g>
148 * </g>
149 * </svg>`
150 */
151export function columnSvg(swuColumn: ColumnData, options: ColumnOptions): string;
152/**
153 * Function that creates an SVG image for a column of SWU
154 * @function swu.columnsPng
155 * @param {string} swuText - an array of SWU signs and punctuation with coordinates
156 * @param {ColumnOptions} options - an object of column options
157 * @returns {string[]} array of PNG data urls
158 * @example
159 * swu.columnsPng('𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻 𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦 񏌁𝣢𝤂',{
160 * "height": 250,
161 * "width": 150,
162 * })
163 *
164 * return ['data:image/png;base64,iVBORw...']
165 */
166export function columnsPng(swuText: string, options: ColumnOptions): string[];
167/**
168 * Function that creates an array of SVG column images for an SWU text
169 * @function swu.columnsSvg
170 * @param {string} swuText - a text of SWU signs and punctuation
171 * @param {ColumnOptions} options - an object of column options
172 * @returns {string[]} array of SVG columns
173 * @example
174 * swu.columnsSvg('𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻 𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦 񏌁𝣢𝤂',{
175 * "height": 250,
176 * "width": 150,
177 * })
178 *
179 * return [`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="150" height="250" viewBox="0 0 150 250">
180 * <g transform="translate(56,20) scale(1) translate(-481,-471) ">
181 * <text font-size="0">𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻-D_black,white_Z1</text>
182 * <g transform="translate(481,471)">
183 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􁲥</text>
184 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󹲥</text>
185 * </g>
186 * <g transform="translate(503,489)">
187 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􈊧</text>
188 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󸊧</text>
189 * </g>
190 * </g>
191 * <g transform="translate(57,118) scale(1) translate(-482,-468) ">
192 * <text font-size="0">𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦-D_black,white_Z1</text>
193 * <g transform="translate(489,515)">
194 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􃊫</text>
195 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󳊫</text>
196 * </g>
197 * <g transform="translate(482,490)">
198 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􃊢</text>
199 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󳊢</text>
200 * </g>
201 * <g transform="translate(508,496)">
202 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􆇡</text>
203 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󶇡</text>
204 * </g>
205 * <g transform="translate(500,468)">
206 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋛕</text>
207 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻛕</text>
208 * </g>
209 * </g>
210 * <g transform="translate(39,203) scale(1) translate(-464,-496) ">
211 * <text font-size="0">񏌁𝣢𝤂-D_black,white_Z1</text>
212 * <g transform="translate(464,496)">
213 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􏌁</text>
214 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󿌁</text>
215 * </g>
216 * </g>
217 * </svg>`]
218 */
219export function columnsSvg(swuText: string, options: ColumnOptions): string[];
220/**
221 * Function that normalizes an SWU sign for a center of 500,500
222 * @function swu.signNormalize
223 * @param {string} swuSign - an SWU sign with optional style string
224 * @returns {string} normalized SWU sign
225 * @example
226 * swu.signNormalize('𝠀񀀒񀀚񋚥񋛩𝠃𝤟𝤩񋛩𝣵𝤐񀀒𝤇𝣤񋚥𝤐𝤆񀀚𝣮𝣭')
227 *
228 * return '𝠀񀀒񀀚񋚥񋛩𝠃𝤟𝤩񋛩𝣵𝤐񀀒𝤇𝣤񋚥𝤐𝤆񀀚𝣮𝣭'
229 */
230export function signNormalize(swuSign: string): string;
231/**
232 * Function that creates a PNG data url from an SWU sign with an optional style string
233 * @function swu.signPng
234 * @param {string} swuSign - an SWU sign with optional style string
235 * @returns {string} png image for sign as data url
236 * @example
237 * swu.signPng('𝠀񀀒񀀚񋚥񋛩𝠃𝤟𝤩񋛩𝣵𝤐񀀒𝤇𝣤񋚥𝤐𝤆񀀚𝣮𝣭')
238 *
239 * return 'data:image/png;base64,iVBORw...'
240 */
241export function signPng(swuSign: string): string;
242/**
243 * Function that creates an SVG image from an SWU sign with an optional style string
244 * @function swu.signSvg
245 * @param {string} swuSign - an SWU sign with optional style string
246 * @returns {string} SVG for sign
247 * @example
248 * swu.signSvg('M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475')
249 *
250 * return `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="49" height="69" viewBox="476 466 49 69">
251 * <text font-size="0">M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475</text>
252 * <g transform="translate(483,510)">
253 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋛩</text>
254 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻛩</text>
255 * </g>
256 * <g transform="translate(501,466)">
257 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀒</text>
258 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀒</text>
259 * </g>
260 * <g transform="translate(510,500)">
261 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋚥</text>
262 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻚥</text>
263 * </g>
264 * <g transform="translate(476,475)">
265 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀚</text>
266 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀚</text>
267 * </g>
268 * </svg>`
269 */
270export function signSvg(swuSign: string): string;
271/**
272 * Function that creates an SVG image from an SWU sign with an optional style string
273 * @function swu.signSvgBody
274 * @param {string} swuSign - an SWU sign with optional style string
275 * @returns {string} body of SVG for sign
276 * @example
277 * swu.signSvgBody('M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475')
278 *
279 * return `<text font-size="0">M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475</text>
280 * <g transform="translate(483,510)">
281 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋛩</text>
282 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻛩</text>
283 * </g>
284 * <g transform="translate(501,466)">
285 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀒</text>
286 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀒</text>
287 * </g>
288 * <g transform="translate(510,500)">
289 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋚥</text>
290 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻚥</text>
291 * </g>
292 * <g transform="translate(476,475)">
293 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀚</text>
294 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀚</text>
295 * </g>`
296 */
297export function signSvgBody(swuSign: string): string;
298/**
299 * Function that returns a plane 165 character for a symbol fill using an SWU symbol character
300 * @function swu.symbolFill
301 * @param {string} swu - an SWU symbol character
302 * @returns {string} character for symbol fill
303 * @example
304 * swu.symbolFill('񀀁')
305 *
306 * return '􀀁'
307 */
308export function symbolFill(swu: string): string;
309/**
310 * Function that changes the fill of a symbol
311 * @function swu.symbolFlop
312 * @param {string} swuSym - an SWU symbol with optional coordinate and style string
313 * @param {boolean} [positive=true] - increase the symbol fill
314 * @returns {string} SWU symbol with changed fill
315 * @example
316 * swu.symbolFlop('񀀁')
317 *
318 * return '񀀑'
319 */
320export function symbolFlop(swuSym: string, positive?: boolean): string;
321/**
322 * Function that returns a plane 15 character for a symbol line using an SWU symbol character
323 * @function swu.symbolLine
324 * @param {string} swu - an SWU symbol character
325 * @returns {string} character for symbol line
326 * @example
327 * swu.symbolLine('񀀁')
328 *
329 * return '󰀁'
330 */
331export function symbolLine(swu: string): string;
332/**
333 * Function that mirrors a symbol
334 * @function swu.symbolMirror
335 * @param {string} swuSym - an SWU symbol with optional coordinate and style string
336 * @returns {string} mirrored SWU symbol
337 * @example
338 * swu.symbolMirror('񀀁')
339 *
340 * return '񀀉'
341 */
342export function symbolMirror(swuSym: string): string;
343/**
344 * Function that normalizes a symbol with a minimum coordinate for a center of 500,500
345 * @function swu.symbolNormalize
346 * @param {string} swuSym - an SWU symbol character with optional coordinate and style string
347 * @returns {string} normalized SWU symbol
348 * @example
349 * swu.symbolNormalize('񀀁')
350 *
351 * return '񀀁𝣿𝣷'
352 */
353export function symbolNormalize(swuSym: string): string;
354/**
355 * Function that creates a PNG data url from an SWU symbol character with an optional style string
356 * @function swu.symbolPng
357 * @param {string} swuSym - an SWU symbol character with optional style string
358 * @returns {string} png image for symbol as data url
359 * @example
360 * swu.symbolPng('񀀁-CP10G_green_Z2')
361 *
362 * return 'data:image/png;base64,iVBORw...'
363 */
364export function symbolPng(swuSym: string): string;
365/**
366 * Function that rotates a symbol
367 * @function swu.symbolRotate
368 * @param {string} swuSym - an SWU symbol with optional coordinate and style string
369 * @param {boolean} [clockwise=true] - rotate the symbol clockwise
370 * @returns {string} rotated SWU symbol
371 * @example
372 * swu.symbolRotate('񀀁')
373 *
374 * return '񀀈'
375 */
376export function symbolRotate(swuSym: string, clockwise?: boolean): string;
377/**
378 * Function that changes the base of a symbol
379 * @function swu.symbolScroll
380 * @param {string} swuSym - an SWU symbol with optional coordinate and style string
381 * @param {boolean} [positive=true] - increase the symbol base
382 * @returns {string} SWU symbol with changed base
383 * @example
384 * swu.symbolScroll('񀀁')
385 *
386 * return '񀁡'
387 */
388export function symbolScroll(swuSym: string, positive?: boolean): string;
389/**
390 * Function that returns the size of a symbol using an SWU symbol character
391 * @function swu.symbolSize
392 * @param {string} swu - an SWU symbol character
393 * @returns {number[]} width and height of symbol
394 * @example
395 * swu.symbolSize("񀀁")
396 *
397 * return [15,30]
398 */
399export function symbolSize(swu: string): number[];
400/**
401 * Function that creates an SVG image from an SWU symbol key with an optional style string
402 * @function swu.symbolSvg
403 * @param {string} swuSym - an SWU symbol key with optional style string
404 * @returns {string} SVG for symbol
405 * @example
406 * swu.symbolSvg('S10000')
407 *
408 * return `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="15" height="30" viewBox="500 500 15 30">
409 * <text font-size="0">S10000</text>
410 * <g transform="translate(500,500)">
411 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀁</text>
412 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀁</text>
413 * </g>
414 * </svg>`
415 */
416export function symbolSvg(swuSym: string): string;
417/**
418 * Function that creates an SVG image from an SWU symbol key with an optional style string
419 * @function swu.symbolSvgBody
420 * @param {string} swuSym - an SWU symbol key with optional style string
421 * @returns {string} body of SVG for symbol
422 * @example
423 * swu.symbolSvgBody('S10000')
424 *
425 * return `<text font-size="0">S10000</text>
426 * <g transform="translate(500,500)">
427 * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀁</text>
428 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀁</text>
429 * </g>`
430 */
431export function symbolSvgBody(swuSym: string): string;
432/**
433 * Function that creates two text elements for a symbol using an SWU symbol character
434 * @function swu.symbolText
435 * @param {string} swu - an SWU symbol character
436 * @returns {string} svg segment for line and fill
437 * @example
438 * swu.symbolText('񀀁')
439 *
440 * return ` <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀁</text>
441 * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀁</text>`
442 */
443export function symbolText(swu: string): string;
444/**
445 * Object of query elements with regular expression identification.
446 */
447type QueryObject = {
448 /**
449 * - required true for query object
450 */
451 query: boolean;
452 /**
453 * - an object for prefix elements
454 */
455 prefix?: {
456 required: boolean;
457 parts?: (string | string[] | (string | string[])[])[];
458 };
459 /**
460 * - array of objects for symbols, ranges, and list of symbols or ranges, with optional coordinates
461 */
462 signbox?: (QuerySignboxSymbol | QuerySignboxRange | QuerySignboxOr)[];
463 /**
464 * - amount that x or y coordinates can vary and find a match, defaults to 20
465 */
466 variance?: number;
467 /**
468 * - boolean value for including style string in matches
469 */
470 style?: boolean;
471};
472type QuerySignboxSymbol = {
473 /**
474 * - a symbol
475 */
476 symbol: string;
477 /**
478 * - an optional coordinate
479 */
480 coord?: number[];
481};
482type QuerySignboxRange = {
483 /**
484 * - an array of two symbols
485 */
486 range: string[];
487 /**
488 * - an optional coordinate
489 */
490 coord?: number[];
491};
492type QuerySignboxOr = {
493 /**
494 * - an array of symbol strings and range arrays
495 */
496 or: (string | string[])[];
497 /**
498 * - an optional coordinate
499 */
500 coord?: number[];
501};
502type ColumnOptions = {
503 /**
504 * - the height of the columns
505 */
506 height?: number;
507 /**
508 * - the widths of the columns
509 */
510 width?: number;
511 /**
512 * - the lane offset for left and right lanes
513 */
514 offset?: number;
515 /**
516 * - amount of padding before and after signs as well as at top, left, and right of columns
517 */
518 pad?: number;
519 /**
520 * - amount of space at bottom of column that is not available
521 */
522 margin?: number;
523 /**
524 * - enables variable width columns
525 */
526 dynamic?: boolean;
527 /**
528 * - background color for columns
529 */
530 background?: string;
531 /**
532 * - an object of style options
533 */
534 style?: StyleObject;
535 /**
536 * - an object of punctuation options
537 */
538 punctuation?: {
539 spacing?: boolean;
540 pad?: number;
541 pull?: boolean;
542 };
543};
544type ColumnData = ColumnSegment[];
545type ColumnSegment = {
546 /**
547 * - the x position in the column
548 */
549 x: number;
550 /**
551 * - the y position in the column
552 */
553 y: number;
554 /**
555 * - the min x value within the segment
556 */
557 minX: number;
558 /**
559 * - the min y value within the segment
560 */
561 minY: number;
562 /**
563 * - the width of the text segment
564 */
565 width: number;
566 /**
567 * - the height of the text segment
568 */
569 height: number;
570 /**
571 * - Left as -1, Middle as 0, Right as 1
572 */
573 lane: number;
574 /**
575 * - the padding of the text segment affects colored background
576 */
577 padding: number;
578 /**
579 * - "sign" or "symbol"
580 */
581 segment: string;
582 /**
583 * - the text of the sign or symbol with optional style string
584 */
585 text: string;
586 /**
587 * - the zoom size of the segment
588 */
589 zoom: number;
590};
591type SegmentInfo = {
592 /**
593 * - the min x value within the segment
594 */
595 minX: number;
596 /**
597 * - the min y value within the segment
598 */
599 minY: number;
600 /**
601 * - the width of the text segment
602 */
603 width: number;
604 /**
605 * - the height of the text segment
606 */
607 height: number;
608 /**
609 * - Left as -1, Middle as 0, Right as 1
610 */
611 lane: number;
612 /**
613 * - the padding of the text segment affects colored background
614 */
615 padding: number;
616 /**
617 * - "sign" or "symbol"
618 */
619 segment: string;
620 /**
621 * - the zoom size of the segment
622 */
623 zoom: number;
624};
625/**
626 * The elements of a style string
627 */
628type StyleObject = {
629 /**
630 * - boolean to use standardized colors for symbol groups
631 */
632 colorize?: boolean;
633 /**
634 * - integer value for padding around symbol or sign
635 */
636 padding?: number;
637 /**
638 * - css name or hex color for background
639 */
640 background?: string;
641 /**
642 * - array for css name or hex color for line and optional fill
643 */
644 detail?: string[];
645 /**
646 * - decimal value for zoom level
647 */
648 zoom?: number;
649 /**
650 * - custom colors for individual symbols
651 */
652 detailsym?: {
653 index: number;
654 detail: string[];
655 };
656 /**
657 * - list of class names separated with spaces used for SVG
658 */
659 classes?: string;
660 /**
661 * - id name used for SVG
662 */
663 id?: string;
664};
665/**
666 * The elements of a symbol string
667 */
668type SymbolObject = {
669 /**
670 * - symbol identifier
671 */
672 symbol?: string;
673 /**
674 * - x,y coordinate
675 */
676 coord?: number[];
677 /**
678 * - style string
679 */
680 style?: string;
681};
682/**
683 * The elements of a sign string
684 */
685type SignObject = {
686 /**
687 * - array of symbols
688 */
689 sequence?: string[];
690 /**
691 * - signbox marker or lane
692 */
693 box?: string;
694 /**
695 * - preprocessed x,y coordinate
696 */
697 max?: number[];
698 /**
699 * - array of symbols with coordinates
700 */
701 spatials?: {
702 symbol: string;
703 coord: number[];
704 }[];
705 /**
706 * - style string
707 */
708 style?: string;
709};