export const __esModule: boolean;
/**
* Function that creates a PNG data url for a column of FSW
* @function fsw.columnPng
* @param {ColumnData} fswColumn - an array of objects with information about FSW signs and punctuation
* @param {ColumnOptions} options - an object of column options
* @returns {string} column png data url
* @example
* fsw.columnPng([
* {
* "x": 56,
* "y": 20,
* "minX": 481,
* "minY": 471,
* "width": 37,
* "height": 58,
* "lane": 0,
* "padding": 0,
* "segment": "sign",
* "text": "AS14c20S27106M518x529S14c20481x471S27106503x489",
* "zoom": 1
* },
* {
* "x": 57,
* "y": 118,
* "minX": 482,
* "minY": 468,
* "width": 36,
* "height": 65,
* "lane": 0,
* "padding": 0,
* "segment": "sign",
* "text": "AS18701S1870aS2e734S20500M518x533S1870a489x515S18701482x490S20500508x496S2e734500x468",
* "zoom": 1
* },
* {
* "x": 39,
* "y": 203,
* "minX": 464,
* "minY": 496,
* "width": 72,
* "height": 8,
* "lane": 0,
* "padding": 0,
* "segment": "symbol",
* "text": "S38800464x496",
* "zoom": 1
* }
* ],
* {
* "height": 250,
* "width": 150,
* })
*
* return 'data:image/png;base64,iVBORw...'
*/
export function columnPng(fswColumn: ColumnData, options: ColumnOptions): string;
/**
* Function that creates an SVG image for a column of FSW
* @function fsw.columnSvg
* @param {ColumnData} fswColumn - an array of objects with information about FSW signs and punctuation
* @param {ColumnOptions} options - an object of column options
* @returns {string} column svg
* @example
* fsw.columnSvg([
* {
* "x": 56,
* "y": 20,
* "minX": 481,
* "minY": 471,
* "width": 37,
* "height": 58,
* "lane": 0,
* "padding": 0,
* "segment": "sign",
* "text": "AS14c20S27106M518x529S14c20481x471S27106503x489",
* "zoom": 1
* },
* {
* "x": 57,
* "y": 118,
* "minX": 482,
* "minY": 468,
* "width": 36,
* "height": 65,
* "lane": 0,
* "padding": 0,
* "segment": "sign",
* "text": "AS18701S1870aS2e734S20500M518x533S1870a489x515S18701482x490S20500508x496S2e734500x468",
* "zoom": 1
* },
* {
* "x": 39,
* "y": 203,
* "minX": 464,
* "minY": 496,
* "width": 72,
* "height": 8,
* "lane": 0,
* "padding": 0,
* "segment": "symbol",
* "text": "S38800464x496",
* "zoom": 1
* }
* ],
* {
* "height": 250,
* "width": 150,
* })
*
* return ``
*/
export function columnSvg(fswColumn: ColumnData, options: ColumnOptions): string;
/**
* Function that creates an array of PNG data urls for an FSW text
* @function fsw.columnsPng
* @param {string} fswText - a text of FSW signs and punctuation
* @param {ColumnOptions} options - an object of column options
* @returns {string[]} array of PNG data urls
* @example
* fsw.columnsPng('AS14c20S27106M518x529S14c20481x471S27106503x489 AS18701S1870aS2e734S20500M518x533S1870a489x515S18701482x490S20500508x496S2e734500x468 S38800464x496',{
* "height": 250,
* "width": 150,
* })
*
* return ['data:image/png;base64,iVBORw...']
*/
export function columnsPng(fswText: string, options: ColumnOptions): string[];
/**
* Function that creates an array of SVG column images for an FSW text
* @function fsw.columnsSvg
* @param {string} fswText - a text of FSW signs and punctuation
* @param {ColumnOptions} options - an object of column options
* @returns {string[]} array of SVG columns
* @example
* fsw.columnsSvg('AS14c20S27106M518x529S14c20481x471S27106503x489 AS18701S1870aS2e734S20500M518x533S1870a489x515S18701482x490S20500508x496S2e734500x468 S38800464x496',{
* "height": 250,
* "width": 150,
* })
*
* return [``]
*/
export function columnsSvg(fswText: string, options: ColumnOptions): string[];
/**
* Function that normalizes an FSW sign for a center of 500,500
* @function fsw.signNormalize
* @param {string} fswSign - an FSW sign with optional style string
* @returns {string} normalized FSW sign
* @example
* fsw.signNormalize('M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475')
*
* return 'M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475'
*/
export function signNormalize(fswSign: string): string;
/**
* Function that creates a PNG data url from an FSW sign with an optional style string
* @function fsw.signPng
* @param {string} fswSign - an FSW sign with optional style string
* @returns {string} png image for sign as data url
* @example
* fsw.signPng('M525x535S2e748483x510S10011501x466S20544510x500S10019476x475')
*
* return 'data:image/png;base64,iVBORw...'
*/
export function signPng(fswSign: string): string;
/**
* Function that creates an SVG image from an FSW sign with an optional style string
* @function fsw.signSvg
* @param {string} fswSign - an FSW sign with optional style string
* @returns {string} SVG for sign
* @example
* fsw.signSvg('M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475')
*
* return ``
*/
export function signSvg(fswSign: string): string;
/**
* Function that creates an SVG image from an FSW sign with an optional style string
* @function fsw.signSvgBody
* @param {string} fswSign - an FSW sign with optional style string
* @returns {string} body of SVG for sign
* @example
* fsw.signSvgBody('M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475')
*
* return `M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* `
*/
export function signSvgBody(fswSign: string): string;
/**
* Function that returns a plane 16 character for a symbol fill using an FSW symbol key
* @function fsw.symbolFill
* @param {string} fsw - an FSW symbol key
* @returns {string} character for symbol fill
* @example
* font.symbolFill('S10000')
*
* return ''
*/
export function symbolFill(fsw: string): string;
/**
* Function that changes the fill of a symbol
* @function fsw.symbolFlop
* @param {string} fswSym - an FSW symbol key with optional coordinate and style string
* @param {boolean} [positive=true] - increase the symbol fill
* @returns {string} FSW symbol with changed fill
* @example
* fsw.symbolFlop('S10000')
*
* return 'S10010'
*/
export function symbolFlop(fswSym: string, positive?: boolean): string;
/**
* Function that returns a plane 15 character for a symbol line using an FSW symbol key
* @function fsw.symbolLine
* @param {string} fsw - an FSW symbol key
* @returns {string} character for symbol line
* @example
* fsw.symbolLine('S10000')
*
* return ''
*/
export function symbolLine(fsw: string): string;
/**
* Function that mirrors a symbol
* @function fsw.symbolMirror
* @param {string} fswSym - an FSW symbol key with optional coordinate and style string
* @returns {string} mirrored FSW symbol
* @example
* fsw.symbolMirror('S10000')
*
* return 'S10008'
*/
export function symbolMirror(fswSym: string): string;
/**
* Function that normalizes a symbol with a minimum coordinate for a center of 500,500
* @function fsw.symbolNormalize
* @param {string} fswSym - an FSW symbol key with optional coordinate and style string
* @returns {string} normalized FSW symbol
* @example
* fsw.symbolNormalize('S10000-CP10G_green_Z2')
*
* return 'S10000493x485-CP10G_green_Z2'
*/
export function symbolNormalize(fswSym: string): string;
/**
* Function that creates a PNG data url from an FSW symbol key with an optional style string
* @function fsw.symbolPng
* @param {string} fswSym - an FSW symbol key with optional style string
* @returns {string} png image for symbol as data url
* @example
* fsw.symbolPng('S10000')
*
* return 'data:image/png;base64,iVBORw...'
*/
export function symbolPng(fswSym: string): string;
/**
* Function that rotates a symbol
* @function fsw.symbolRotate
* @param {string} fswSym - an FSW symbol key with optional coordinate and style string
* @param {boolean} [clockwise=true] - rotate the symbol clockwise
* @returns {string} rotated FSW symbol
* @example
* fsw.symbolRotate('S10000')
*
* return 'S10007'
*/
export function symbolRotate(fswSym: string, clockwise?: boolean): string;
/**
* Function that changes the base of a symbol
* @function fsw.symbolScroll
* @param {string} fswSym - an FSW symbol key with optional coordinate and style string
* @param {boolean} [positive=true] - increase the symbol base
* @returns {string} FSW symbol with changed base
* @example
* fsw.symbolScroll('S10000')
*
* return 'S10100'
*/
export function symbolScroll(fswSym: string, positive?: boolean): string;
/**
* Function that returns the size of a symbol using an FSW symbol key
* @function fsw.symbolSize
* @param {string} fsw - an FSW symbol key
* @returns {number[]} width and height of symbol
* @example
* fsw.symbolSize("S10000")
*
* return [15,30]
*/
export function symbolSize(fsw: string): number[];
/**
* Function that creates an SVG image from an FSW symbol key with an optional style string
* @function fsw.symbolSvg
* @param {string} fswSym - an FSW symbol key with optional style string
* @returns {string} SVG for symbol
* @example
* fsw.symbolSvg('S10000')
*
* return ``
*/
export function symbolSvg(fswSym: string): string;
/**
* Function that creates an SVG image from an FSW symbol key with an optional style string
* @function fsw.symbolSvgBody
* @param {string} fswSym - an FSW symbol key with optional style string
* @returns {string} body of SVG for symbol
* @example
* fsw.symbolSvgBody('S10000')
*
* return `S10000
*
*
*
* `
*/
export function symbolSvgBody(fswSym: string): string;
/**
* Function that creates two text elements for a symbol using an FSW symbol key
* @function fsw.symbolText
* @param {string} fsw - an FSW symbol key
* @returns {string} svg segment for line and fill
* @example
* fsw.symbolText('S10000')
*
* return `
* `
*/
export function symbolText(fsw: 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;
};