UNPKG

8.59 kBTypeScriptView Raw
1export const __esModule: boolean;
2/** The font module contains functions for handing the TrueType fonts.
3 * @module font
4 */
5declare var index$2: Readonly<{
6 __proto__: any;
7 cssAppend: (dir?: string) => void;
8 cssLoaded: (callback: Function) => void;
9 cssLoadedLine: (callback: Function) => void;
10 cssLoadedFill: (callback: Function) => void;
11 symbolSize: (id: number) => number[];
12 symbolLine: (id: number) => string;
13 symbolFill: (id: number) => string;
14 symbolText: (id: number) => string;
15}>;
16/** The fsw module contains functions for handling Formal SignWriitng in ASCII (FSW) characters.
17 * [FSW characters definition](https://tools.ietf.org/id/draft-slevinski-formal-signwriting-09.html#name-formal-signwriting-in-ascii)
18 * @module fsw
19 */
20declare var index$1: Readonly<{
21 __proto__: any;
22 symbolSize: (fsw: string) => number[];
23 symbolLine: (fsw: string) => string;
24 symbolFill: (fsw: string) => string;
25 symbolText: (fsw: string) => string;
26 symbolSvgBody: (fswSym: string) => string;
27 symbolSvg: (fswSym: string) => string;
28 symbolPng: (fswSym: string) => string;
29 symbolNormalize: (fswSym: string) => string;
30 symbolMirror: (fswSym: string) => string;
31 symbolRotate: (fswSym: string, clockwise?: boolean) => string;
32 symbolFlop: (fswSym: string, positive?: boolean) => string;
33 symbolScroll: (fswSym: string, positive?: boolean) => string;
34 signSvgBody: (fswSign: string) => string;
35 signSvg: (fswSign: string) => string;
36 signPng: (fswSign: string) => string;
37 signNormalize: (fswSign: string) => string;
38 columnSvg: (fswColumn: ColumnData, options: ColumnOptions) => string;
39 columnsSvg: (fswText: string, options: ColumnOptions) => string[];
40 columnPng: (fswColumn: ColumnData, options: ColumnOptions) => string;
41 columnsPng: (fswText: string, options: ColumnOptions) => string[];
42}>;
43/** The swu module contains functions for handling SignWriting in Unicode (SWU) characters.
44 * [SWU characters definition](https://tools.ietf.org/id/draft-slevinski-formal-signwriting-09.html#name-signwriting-in-unicode-swu)
45 * @module swu
46 */
47declare var index: Readonly<{
48 __proto__: any;
49 symbolSize: (swu: string) => number[];
50 symbolLine: (swu: string) => string;
51 symbolFill: (swu: string) => string;
52 symbolText: (swu: string) => string;
53 symbolSvgBody: (swuSym: string) => string;
54 symbolSvg: (swuSym: string) => string;
55 symbolPng: (swuSym: string) => string;
56 symbolNormalize: (swuSym: string) => string;
57 symbolMirror: (swuSym: string) => string;
58 symbolRotate: (swuSym: string, clockwise?: boolean) => string;
59 symbolFlop: (swuSym: string, positive?: boolean) => string;
60 symbolScroll: (swuSym: string, positive?: boolean) => string;
61 signSvgBody: (swuSign: string) => string;
62 signSvg: (swuSign: string) => string;
63 signPng: (swuSign: string) => string;
64 signNormalize: (swuSign: string) => string;
65 columnSvg: (swuColumn: ColumnData, options: ColumnOptions) => string;
66 columnsSvg: (swuText: string, options: ColumnOptions) => string[];
67 columnPng: (swuColumn: ColumnData, options: ColumnOptions) => string;
68 columnsPng: (swuText: string, options: ColumnOptions) => string[];
69}>;
70export { index$2 as font, index$1 as fsw, index as swu };
71/**
72 * Object of query elements with regular expression identification.
73 */
74type QueryObject = {
75 /**
76 * - required true for query object
77 */
78 query: boolean;
79 /**
80 * - an object for prefix elements
81 */
82 prefix?: {
83 required: boolean;
84 parts?: (string | string[] | (string | string[])[])[];
85 };
86 /**
87 * - array of objects for symbols, ranges, and list of symbols or ranges, with optional coordinates
88 */
89 signbox?: (QuerySignboxSymbol | QuerySignboxRange | QuerySignboxOr)[];
90 /**
91 * - amount that x or y coordinates can vary and find a match, defaults to 20
92 */
93 variance?: number;
94 /**
95 * - boolean value for including style string in matches
96 */
97 style?: boolean;
98};
99type QuerySignboxSymbol = {
100 /**
101 * - a symbol
102 */
103 symbol: string;
104 /**
105 * - an optional coordinate
106 */
107 coord?: number[];
108};
109type QuerySignboxRange = {
110 /**
111 * - an array of two symbols
112 */
113 range: string[];
114 /**
115 * - an optional coordinate
116 */
117 coord?: number[];
118};
119type QuerySignboxOr = {
120 /**
121 * - an array of symbol strings and range arrays
122 */
123 or: (string | string[])[];
124 /**
125 * - an optional coordinate
126 */
127 coord?: number[];
128};
129type ColumnOptions = {
130 /**
131 * - the height of the columns
132 */
133 height?: number;
134 /**
135 * - the widths of the columns
136 */
137 width?: number;
138 /**
139 * - the lane offset for left and right lanes
140 */
141 offset?: number;
142 /**
143 * - amount of padding before and after signs as well as at top, left, and right of columns
144 */
145 pad?: number;
146 /**
147 * - amount of space at bottom of column that is not available
148 */
149 margin?: number;
150 /**
151 * - enables variable width columns
152 */
153 dynamic?: boolean;
154 /**
155 * - background color for columns
156 */
157 background?: string;
158 /**
159 * - an object of style options
160 */
161 style?: StyleObject;
162 /**
163 * - an object of punctuation options
164 */
165 punctuation?: {
166 spacing?: boolean;
167 pad?: number;
168 pull?: boolean;
169 };
170};
171type ColumnData = ColumnSegment[];
172type ColumnSegment = {
173 /**
174 * - the x position in the column
175 */
176 x: number;
177 /**
178 * - the y position in the column
179 */
180 y: number;
181 /**
182 * - the min x value within the segment
183 */
184 minX: number;
185 /**
186 * - the min y value within the segment
187 */
188 minY: number;
189 /**
190 * - the width of the text segment
191 */
192 width: number;
193 /**
194 * - the height of the text segment
195 */
196 height: number;
197 /**
198 * - Left as -1, Middle as 0, Right as 1
199 */
200 lane: number;
201 /**
202 * - the padding of the text segment affects colored background
203 */
204 padding: number;
205 /**
206 * - "sign" or "symbol"
207 */
208 segment: string;
209 /**
210 * - the text of the sign or symbol with optional style string
211 */
212 text: string;
213 /**
214 * - the zoom size of the segment
215 */
216 zoom: number;
217};
218type SegmentInfo = {
219 /**
220 * - the min x value within the segment
221 */
222 minX: number;
223 /**
224 * - the min y value within the segment
225 */
226 minY: number;
227 /**
228 * - the width of the text segment
229 */
230 width: number;
231 /**
232 * - the height of the text segment
233 */
234 height: number;
235 /**
236 * - Left as -1, Middle as 0, Right as 1
237 */
238 lane: number;
239 /**
240 * - the padding of the text segment affects colored background
241 */
242 padding: number;
243 /**
244 * - "sign" or "symbol"
245 */
246 segment: string;
247 /**
248 * - the zoom size of the segment
249 */
250 zoom: number;
251};
252/**
253 * The elements of a style string
254 */
255type StyleObject = {
256 /**
257 * - boolean to use standardized colors for symbol groups
258 */
259 colorize?: boolean;
260 /**
261 * - integer value for padding around symbol or sign
262 */
263 padding?: number;
264 /**
265 * - css name or hex color for background
266 */
267 background?: string;
268 /**
269 * - array for css name or hex color for line and optional fill
270 */
271 detail?: string[];
272 /**
273 * - decimal value for zoom level
274 */
275 zoom?: number;
276 /**
277 * - custom colors for individual symbols
278 */
279 detailsym?: {
280 index: number;
281 detail: string[];
282 };
283 /**
284 * - list of class names separated with spaces used for SVG
285 */
286 classes?: string;
287 /**
288 * - id name used for SVG
289 */
290 id?: string;
291};
292/**
293 * The elements of a symbol string
294 */
295type SymbolObject = {
296 /**
297 * - symbol identifier
298 */
299 symbol?: string;
300 /**
301 * - x,y coordinate
302 */
303 coord?: number[];
304 /**
305 * - style string
306 */
307 style?: string;
308};
309/**
310 * The elements of a sign string
311 */
312type SignObject = {
313 /**
314 * - array of symbols
315 */
316 sequence?: string[];
317 /**
318 * - signbox marker or lane
319 */
320 box?: string;
321 /**
322 * - preprocessed x,y coordinate
323 */
324 max?: number[];
325 /**
326 * - array of symbols with coordinates
327 */
328 spatials?: {
329 symbol: string;
330 coord: number[];
331 }[];
332 /**
333 * - style string
334 */
335 style?: string;
336};