UNPKG

@sutton-signwriting/font-ttf

Version:

a javascript package for node that generates SVG and PNG images for individual symbols, complete signs, and structured text. The package covers the entire set of the International SignWritnig Alphabet 2010 (ISWA 2010).

755 lines (754 loc) • 26.1 kB
export const __esModule: boolean; /** * Function that creates a PNG data url for a column of SWU * @function swu.columnPng * @param {ColumnData} swuColumn - an array of SWU signs and punctuation with coordinates * @param {ColumnOptions} options - an object of column options * @returns {string} column png data url * @example * swu.columnPng([ * { * "x": 56, * "y": 20, * "minX": 481, * "minY": 471, * "width": 37, * "height": 58, * "lane": 0, * "padding": 0, * "segment": "sign", * "text": "𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻", * "zoom": 1 * }, * { * "x": 57, * "y": 118, * "minX": 482, * "minY": 468, * "width": 36, * "height": 65, * "lane": 0, * "padding": 0, * "segment": "sign", * "text": "𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦", * "zoom": 1 * }, * { * "x": 39, * "y": 203, * "minX": 464, * "minY": 496, * "width": 72, * "height": 8, * "lane": 0, * "padding": 0, * "segment": "symbol", * "text": "񏌁𝣢𝤂", * "zoom": 1 * } * ], * { * "height": 250, * "width": 150, * }) * * return 'data:image/png;base64,iVBORw...' */ export function columnPng(swuColumn: ColumnData, options: ColumnOptions): string; /** * Function that creates an SVG image for a column of SWU * @function swu.columnSvg * @param {ColumnData} swuColumn - an array of objects with information about FSW signs and punctuation * @param {ColumnOptions} options - an object of column options * @returns {string} column svg * @example * swu.columnSvg([ * { * "x": 56, * "y": 20, * "minX": 481, * "minY": 471, * "width": 37, * "height": 58, * "lane": 0, * "padding": 0, * "segment": "sign", * "text": "𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻", * "zoom": 1 * }, * { * "x": 57, * "y": 118, * "minX": 482, * "minY": 468, * "width": 36, * "height": 65, * "lane": 0, * "padding": 0, * "segment": "sign", * "text": "𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦", * "zoom": 1 * }, * { * "x": 39, * "y": 203, * "minX": 464, * "minY": 496, * "width": 72, * "height": 8, * "lane": 0, * "padding": 0, * "segment": "symbol", * "text": "񏌁𝣢𝤂", * "zoom": 1 * } * ], * { * "height": 250, * "width": 150, * }) * * return `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="150" height="250" viewBox="0 0 150 250"> * <g transform="translate(56,20) scale(1) translate(-481,-471) "> * <text font-size="0">𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻-D_black,white_Z1</text> * <g transform="translate(481,471)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􁲡</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󱲡</text> * </g> * <g transform="translate(503,489)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􈩧</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󸩧</text> * </g> * </g> * <g transform="translate(57,118) scale(1) translate(-482,-468) "> * <text font-size="0">𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦-D_black,white_Z1</text> * <g transform="translate(489,515)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􃊫</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󳊫</text> * </g> * <g transform="translate(482,490)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􃊢</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󳊢</text> * </g> * <g transform="translate(508,496)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􆇡</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󶇡</text> * </g> * <g transform="translate(500,468)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋛕</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻛕</text> * </g> * </g> * <g transform="translate(39,203) scale(1) translate(-464,-496) "> * <text font-size="0">񏌁𝣢𝤂-D_black,white_Z1</text> * <g transform="translate(464,496)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􏌁</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󿌁</text> * </g> * </g> * </svg>` */ export function columnSvg(swuColumn: ColumnData, options: ColumnOptions): string; /** * Function that creates an SVG image for a column of SWU * @function swu.columnsPng * @param {string} swuText - an array of SWU signs and punctuation with coordinates * @param {ColumnOptions} options - an object of column options * @returns {string[]} array of PNG data urls * @example * swu.columnsPng('𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻 𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦 񏌁𝣢𝤂',{ * "height": 250, * "width": 150, * }) * * return ['data:image/png;base64,iVBORw...'] */ export function columnsPng(swuText: string, options: ColumnOptions): string[]; /** * Function that creates an array of SVG column images for an SWU text * @function swu.columnsSvg * @param {string} swuText - a text of SWU signs and punctuation * @param {ColumnOptions} options - an object of column options * @returns {string[]} array of SVG columns * @example * swu.columnsSvg('𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻 𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦 񏌁𝣢𝤂',{ * "height": 250, * "width": 150, * }) * * return [`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="150" height="250" viewBox="0 0 150 250"> * <g transform="translate(56,20) scale(1) translate(-481,-471) "> * <text font-size="0">𝠀񁲡񈩧𝠃𝤘𝤣񁲡𝣳𝣩񈩧𝤉𝣻-D_black,white_Z1</text> * <g transform="translate(481,471)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􁲡</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󱲡</text> * </g> * <g transform="translate(503,489)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􈩧</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󸩧</text> * </g> * </g> * <g transform="translate(57,118) scale(1) translate(-482,-468) "> * <text font-size="0">𝠀񃊢񃊫񋛕񆇡𝠃𝤘𝤧񃊫𝣻𝤕񃊢𝣴𝣼񆇡𝤎𝤂񋛕𝤆𝣦-D_black,white_Z1</text> * <g transform="translate(489,515)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􃊫</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󳊫</text> * </g> * <g transform="translate(482,490)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􃊢</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󳊢</text> * </g> * <g transform="translate(508,496)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􆇡</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󶇡</text> * </g> * <g transform="translate(500,468)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋛕</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻛕</text> * </g> * </g> * <g transform="translate(39,203) scale(1) translate(-464,-496) "> * <text font-size="0">񏌁𝣢𝤂-D_black,white_Z1</text> * <g transform="translate(464,496)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􏌁</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󿌁</text> * </g> * </g> * </svg>`] */ export function columnsSvg(swuText: string, options: ColumnOptions): string[]; /** * Function that normalizes an SWU sign for a center of 500,500 * @function swu.signNormalize * @param {string} swuSign - an SWU sign with optional style string * @returns {string} normalized SWU sign * @example * swu.signNormalize('𝠀񀀒񀀚񋚥񋛩𝠃𝤟𝤩񋛩𝣵𝤐񀀒𝤇𝣤񋚥𝤐𝤆񀀚𝣮𝣭') * * return '𝠀񀀒񀀚񋚥񋛩𝠃𝤟𝤩񋛩𝣵𝤐񀀒𝤇𝣤񋚥𝤐𝤆񀀚𝣮𝣭' */ export function signNormalize(swuSign: string): string; /** * Function that creates a PNG data url from an SWU sign with an optional style string * @function swu.signPng * @param {string} swuSign - an SWU sign with optional style string * @returns {string} png image for sign as data url * @example * swu.signPng('𝠀񀀒񀀚񋚥񋛩𝠃𝤟𝤩񋛩𝣵𝤐񀀒𝤇𝣤񋚥𝤐𝤆񀀚𝣮𝣭') * * return 'data:image/png;base64,iVBORw...' */ export function signPng(swuSign: string): string; /** * Function that creates an SVG image from an SWU sign with an optional style string * @function swu.signSvg * @param {string} swuSign - an SWU sign with optional style string * @returns {string} SVG for sign * @example * swu.signSvg('M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475') * * return `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="49" height="69" viewBox="476 466 49 69"> * <text font-size="0">M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475</text> * <g transform="translate(483,510)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋛩</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻛩</text> * </g> * <g transform="translate(501,466)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀒</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀒</text> * </g> * <g transform="translate(510,500)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋚥</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻚥</text> * </g> * <g transform="translate(476,475)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀚</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀚</text> * </g> * </svg>` */ export function signSvg(swuSign: string): string; /** * Function that creates an SVG image from an SWU sign with an optional style string * @function swu.signSvgBody * @param {string} swuSign - an SWU sign with optional style string * @returns {string} body of SVG for sign * @example * swu.signSvgBody('M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475') * * return `<text font-size="0">M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475</text> * <g transform="translate(483,510)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋛩</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻛩</text> * </g> * <g transform="translate(501,466)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀒</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀒</text> * </g> * <g transform="translate(510,500)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􋚥</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󻚥</text> * </g> * <g transform="translate(476,475)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀚</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀚</text> * </g>` */ export function signSvgBody(swuSign: string): string; /** * Function that returns a plane 165 character for a symbol fill using an SWU symbol character * @function swu.symbolFill * @param {string} swu - an SWU symbol character * @returns {string} character for symbol fill * @example * swu.symbolFill('񀀁') * * return '􀀁' */ export function symbolFill(swu: string): string; /** * Function that changes the fill of a symbol * @function swu.symbolFlop * @param {string} swuSym - an SWU symbol with optional coordinate and style string * @param {boolean} [positive=true] - increase the symbol fill * @returns {string} SWU symbol with changed fill * @example * swu.symbolFlop('񀀁') * * return '񀀑' */ export function symbolFlop(swuSym: string, positive?: boolean): string; /** * Function that inverts a symbol * @function swu.symbolInvert * @param {string} swuSym - an SWU symbol with optional coordinate and style string * @returns {string} inverted SWU symbol * @example * swu.symbolInvert('񀀁') * * return '񀀍' */ export function symbolInvert(swuSym: string): string; /** * Function that returns a plane 15 character for a symbol line using an SWU symbol character * @function swu.symbolLine * @param {string} swu - an SWU symbol character * @returns {string} character for symbol line * @example * swu.symbolLine('񀀁') * * return '󰀁' */ export function symbolLine(swu: string): string; /** * Function that mirrors a symbol * @function swu.symbolMirror * @param {string} swuSym - an SWU symbol with optional coordinate and style string * @returns {string} mirrored SWU symbol * @example * swu.symbolMirror('񀀁') * * return '񀀉' */ export function symbolMirror(swuSym: string): string; /** * Function that normalizes a symbol with a minimum coordinate for a center of 500,500 * @function swu.symbolNormalize * @param {string} swuSym - an SWU symbol character with optional coordinate and style string * @returns {string} normalized SWU symbol * @example * swu.symbolNormalize('񀀁') * * return '񀀁𝣿𝣷' */ export function symbolNormalize(swuSym: string): string; /** * Function that creates a PNG data url from an SWU symbol character with an optional style string * @function swu.symbolPng * @param {string} swuSym - an SWU symbol character with optional style string * @returns {string} png image for symbol as data url * @example * swu.symbolPng('񀀁-CP10G_green_Z2') * * return 'data:image/png;base64,iVBORw...' */ export function symbolPng(swuSym: string): string; /** * Function that rotates a symbol * @function swu.symbolRotate * @param {string} swuSym - an SWU symbol with optional coordinate and style string * @param {boolean} [clockwise=true] - rotate the symbol clockwise * @returns {string} rotated SWU symbol * @example * swu.symbolRotate('񀀁') * * return '񀀈' */ export function symbolRotate(swuSym: string, clockwise?: boolean): string; /** * Function that changes the base of a symbol * @function swu.symbolScroll * @param {string} swuSym - an SWU symbol with optional coordinate and style string * @param {boolean} [positive=true] - increase the symbol base * @returns {string} SWU symbol with changed base * @example * swu.symbolScroll('񀀁') * * return '񀁡' */ export function symbolScroll(swuSym: string, positive?: boolean): string; /** * Function that returns the size of a symbol using an SWU symbol character * @function swu.symbolSize * @param {string} swu - an SWU symbol character * @returns {number[]} width and height of symbol * @example * swu.symbolSize("񀀁") * * return [15,30] */ export function symbolSize(swu: string): number[]; /** * Function that creates an SVG image from an SWU symbol key with an optional style string * @function swu.symbolSvg * @param {string} swuSym - an SWU symbol key with optional style string * @returns {string} SVG for symbol * @example * swu.symbolSvg('S10000') * * return `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="15" height="30" viewBox="500 500 15 30"> * <text font-size="0">S10000</text> * <g transform="translate(500,500)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀁</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀁</text> * </g> * </svg>` */ export function symbolSvg(swuSym: string): string; /** * Function that creates an SVG image from an SWU symbol key with an optional style string * @function swu.symbolSvgBody * @param {string} swuSym - an SWU symbol key with optional style string * @returns {string} body of SVG for symbol * @example * swu.symbolSvgBody('S10000') * * return `<text font-size="0">S10000</text> * <g transform="translate(500,500)"> * <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀁</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀁</text> * </g>` */ export function symbolSvgBody(swuSym: string): string; /** * Function that creates two text elements for a symbol using an SWU symbol character * @function swu.symbolText * @param {string} swu - an SWU symbol character * @returns {string} svg segment for line and fill * @example * swu.symbolText('񀀁') * * return ` <text class="sym-fill" fill="white" style="pointer-events:none;font-family:'SuttonSignWritingFill';font-size:30px;">􀀁</text> * <text class="sym-line" fill="black" style="pointer-events:none;font-family:'SuttonSignWritingLine';font-size:30px;">󰀁</text>` */ export function symbolText(swu: string): string; /** * Object of query elements with regular expression identification. */ type QueryObject = { /** * - required true for query object */ query: boolean; /** * - an object for prefix elements */ prefix?: { required: boolean; parts?: (string | string[] | (string | string[])[])[]; }; /** * - array of objects for symbols, ranges, and list of symbols or ranges, with optional coordinates */ signbox?: (QuerySignboxSymbol | QuerySignboxRange | QuerySignboxOr)[]; /** * - amount that x or y coordinates can vary and find a match, defaults to 20 */ variance?: number; /** * - boolean value for including style string in matches */ style?: boolean; }; type QuerySignboxSymbol = { /** * - a symbol */ symbol: string; /** * - an optional coordinate */ coord?: number[]; }; type QuerySignboxRange = { /** * - an array of two symbols */ range: string[]; /** * - an optional coordinate */ coord?: number[]; }; type QuerySignboxOr = { /** * - an array of symbol strings and range arrays */ or: (string | string[])[]; /** * - an optional coordinate */ coord?: number[]; }; type ColumnOptions = { /** * - the height of the columns */ height?: number; /** * - the widths of the columns */ width?: number; /** * - the lane offset for left and right lanes */ offset?: number; /** * - amount of padding before and after signs as well as at top, left, and right of columns */ pad?: number; /** * - amount of space at bottom of column that is not available */ margin?: number; /** * - enables variable width columns */ dynamic?: boolean; /** * - background color for columns */ background?: string; /** * - an object of style options */ style?: StyleObject; /** * - an object of punctuation options */ punctuation?: { spacing?: boolean; pad?: number; pull?: boolean; }; }; type ColumnData = ColumnSegment[]; type ColumnSegment = { /** * - the x position in the column */ x: number; /** * - the y position in the column */ y: number; /** * - the min x value within the segment */ minX: number; /** * - the min y value within the segment */ minY: number; /** * - the width of the text segment */ width: number; /** * - the height of the text segment */ height: number; /** * - Left as -1, Middle as 0, Right as 1 */ lane: number; /** * - the padding of the text segment affects colored background */ padding: number; /** * - "sign" or "symbol" */ segment: string; /** * - the text of the sign or symbol with optional style string */ text: string; /** * - the zoom size of the segment */ zoom: number; }; type SegmentInfo = { /** * - the min x value within the segment */ minX: number; /** * - the min y value within the segment */ minY: number; /** * - the width of the text segment */ width: number; /** * - the height of the text segment */ height: number; /** * - Left as -1, Middle as 0, Right as 1 */ lane: number; /** * - the padding of the text segment affects colored background */ padding: number; /** * - "sign" or "symbol" */ segment: string; /** * - the zoom size of the segment */ zoom: number; }; /** * The elements of a style string */ type StyleObject = { /** * - boolean to use standardized colors for symbol groups */ colorize?: boolean; /** * - integer value for padding around symbol or sign */ padding?: number; /** * - css name or hex color for background */ background?: string; /** * - array for css name or hex color for line and optional fill */ detail?: string[]; /** * - decimal value for zoom level */ zoom?: number; /** * - custom colors for individual symbols */ detailsym?: { index: number; detail: string[]; }; /** * - list of class names separated with spaces used for SVG */ classes?: string; /** * - id name used for SVG */ id?: string; }; /** * The elements of a symbol string */ type SymbolObject = { /** * - symbol identifier */ symbol?: string; /** * - x,y coordinate */ coord?: number[]; /** * - style string */ style?: string; }; /** * The elements of a sign string */ type SignObject = { /** * - array of symbols */ sequence?: string[]; /** * - signbox marker or lane */ box?: string; /** * - preprocessed x,y coordinate */ max?: number[]; /** * - array of symbols with coordinates */ spatials?: { symbol: string; coord: number[]; }[]; /** * - style string */ style?: string; }; type TokenizerObject = { /** * - Index to string mapping */ i2s: any; /** * - String to index mapping */ s2i: any; /** * - Total number of tokens */ length: number; /** * - Returns array of all tokens */ vocab: Function; /** * - Encodes a string of SignWriting to token indices */ encode: Function; /** * - Decodes token indices to a string of SignWriting */ decode: Function; /** * - Encodes an array of token strings to token indices */ encodeTokens: Function; /** * - Decodes an array of token indices to token strings */ decodeTokens: Function; };