grid / Exports

grid

Type Aliases

Arrow

Ƭ Arrow: Object

Arrow

Type declaration

NameTypeDescription
directionArrowDirDirection of the arrow
positionVecPosition of the arrow relative to the cell

Defined in

types.ts:16open in new window


ArrowDir

Ƭ ArrowDir: "right" | "down" | "rightdown" | "downright" | "none"

Arrow directions

Defined in

types.ts:11open in new window


Bounds

Ƭ Bounds: Object

Bounds of a word within a cell

Type declaration

NameTypeDescription
cellsCell[]All the cells of the word
endVecEnd position of the word
lengthnumberLength of the word
startVecStart position of the word

Defined in

types.ts:175open in new window


Cell

Ƭ Cell: Object

Type declaration

NameTypeDescription
arrowsArrowDir[]Arrows of the cell
definitionbooleanwether the cell is a definition cell
highlightedbooleanwether the cell is highlighted or not (editor)
spaceHbooleanWether there is a space on Horizontal direction
spaceVbooleanWether there is a space on Vertical direction
suggestionstringSuggestion for the cell (editor)
textstringText of the cell (definition and not definition)
xnumberX position of the cell
ynumberY position of the cell

Defined in

types.ts:43open in new window


DeepPartial

Ƭ DeepPartial<T>: T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T

Type parameters

Name
T

Defined in

types.ts:5open in new window


DefGrid

Ƭ DefGrid: boolean[][]

Defined in

types.ts:4open in new window


Direction

Ƭ Direction: "horizontal" | "vertical"

Defined in

types.ts:193open in new window


Format

Ƭ Format: Object

Format for printing

Type declaration

NameTypeDescription
dpinumberdots per pixels (unused)
heightnumberHeight of the paper(cm)
margin{ bottom: number ; left: number ; right: number ; top: number }Margin of the paper (cm)
margin.bottomnumber-
margin.leftnumber-
margin.rightnumber-
margin.topnumber-
orientationstringOrientation of the paper (portrait or landscape)
widthnumberWidth of the paper(cm)

Defined in

types.ts:84open in new window


GridOptions

Ƭ GridOptions: Object

Grid options defines the style of the grid

Type declaration

NameTypeDescription
arrow{ color: string ; size: number }Arrow style
arrow.colorstring-
arrow.sizenumber-
definitionTextSyle<number> & { backgroundColor: string }Definition style
grid{ borderColor: string ; borderSize: number ; cellSize: number ; outerBorderColor: string ; outerBorderSize: number ; spaceSize: number }Grid style
grid.borderColorstringColor of the lines
grid.borderSizenumberSize of the lines
grid.cellSizenumberSize of the cell
grid.outerBorderColorstringColor of the outer border
grid.outerBorderSizenumberSize of the outer border
grid.spaceSizenumberwidth of the line showind spaceV and spaceH
idstringId of the Options(db)
namestringName of the Options
paperFormatFormat for printing

Defined in

types.ts:116open in new window


GridState

Ƭ GridState: Object

JSON format of the grid Used to serialize and deserialize the grid

Type declaration

NameType
cellsCell[][]
colsnumber
commentstring
creatednumber
idstring
optionsIdstring
rowsnumber
titlestring

Defined in

types.ts:298open in new window


Lookup

Ƭ Lookup<T>: Object

Type parameters

Name
T

Index signature

▪ [key: number | string]: T

Defined in

types.ts:3open in new window


SolutionOptions

Ƭ SolutionOptions: GridOptions & { grids: { cols: number ; gridN: TextSyle ; rows: number } ; isSolution: true ; size: TextSyle ; words: TextSyle & { tolerance: number } }

Options for the solution

Defined in

types.ts:234open in new window


Vec

Ƭ Vec: Object

Type declaration

NameType
xnumber
ynumber

Defined in

types.ts:2open in new window


WordAndPosition

Ƭ WordAndPosition: Object

Type declaration

NameType
directionDirection
startVec
wordstring

Defined in

types.ts:309open in new window

Variables

DPI_TO_PIXEL

Const DPI_TO_PIXEL: 25.4

Defined in

types.ts:314open in new window


arrowDirs

Const arrowDirs: string[][]

Defined in

utils.ts:132open in new window


defaultOptions

Const defaultOptions: GridOptions

Defined in

types.ts:196open in new window


defaultSolutionOptions

Const defaultSolutionOptions: SolutionOptions

Defined in

types.ts:290open in new window


nullCell

Const nullCell: Cell

Null cell Used to represent a cell that is not in the grid

Defined in

Grid.ts:9open in new window

Functions

arrowPositions

arrowPositions(cell): { x: number = 1; y: number }[]

From a definition cell, returns the position of the arrows

Parameters

NameType
cellCell

Returns

{ x: number = 1; y: number }[]

Defined in

utils.ts:109open in new window


borderWidth

borderWidth(options): number

Parameters

NameType
optionsGridOptions

Returns

number

Defined in

utils.ts:30open in new window


cellAndBorderWidth

cellAndBorderWidth(options): number

Returns the width of a cell and its border

Parameters

NameType
optionsGridOptions

Returns

number

Defined in

utils.ts:41open in new window


cellWidth

cellWidth(options): number

Parameters

NameType
optionsGridOptions

Returns

number

Defined in

utils.ts:26open in new window


duplicate

duplicate(options): Object

Parameters

NameType
optionsGridOptions

Returns

Object

NameTypeDescription
arrow{ color: string ; size: number }Arrow style
arrow.colorstring-
arrow.sizenumber-
definitionTextSyle<number> & { backgroundColor: string }Definition style
grid{ borderColor: string ; borderSize: number ; cellSize: number ; outerBorderColor: string ; outerBorderSize: number ; spaceSize: number }Grid style
grid.borderColorstringColor of the lines
grid.borderSizenumberSize of the lines
grid.cellSizenumberSize of the cell
grid.outerBorderColorstringColor of the outer border
grid.outerBorderSizenumberSize of the outer border
grid.spaceSizenumberwidth of the line showind spaceV and spaceH
idstring-
namestringName of the Options
paperFormatFormat for printing

Defined in

utils.ts:134open in new window


format

format(num, unit): string

From an array of [value, unit] returns a string like 10cm

Parameters

NameTypeDescription
numnumbervalue
unitstringunit

Returns

string

the formatted string

Defined in

utils.ts:22open in new window


getAllWords

getAllWords(grids): Set<string>

From a list of grids, returns all the words

Parameters

NameType
gridsGrid[]

Returns

Set<string>

Defined in

utils.ts:180open in new window


getLines

getLines(cell): string[]

From a definition cell, returns the lines of text

Parameters

NameType
cellCell

Returns

string[]

Defined in

utils.ts:90open in new window


getWords

getWords(grid): Object

From a grid, returns all the words and their positions

Parameters

NameType
gridGrid

Returns

Object

NameType
wordsSet<string>
wordsAndBoundsWordAndPosition[]

Defined in

utils.ts:150open in new window


gridHeight

gridHeight(grid, options): number

Returns the height of the grid (without outer border)

Parameters

NameType
gridGrid
optionsGridOptions

Returns

number

Defined in

utils.ts:61open in new window


gridTotalHeight

gridTotalHeight(grid, options): number

Returns the total height of the grid (with outer border)

Parameters

NameType
gridGrid
optionsGridOptions

Returns

number

Defined in

utils.ts:82open in new window


gridTotalWidth

gridTotalWidth(grid, options): number

Returns the total width of the grid (with outer border)

Parameters

NameType
gridGrid
optionsGridOptions

Returns

number

Defined in

utils.ts:72open in new window


gridWidth

gridWidth(grid, options): number

Returns the width of the grid (without outer border)

Parameters

NameType
gridGrid
optionsGridOptions

Returns

number

Defined in

utils.ts:50open in new window


isSplited

isSplited(cell): boolean

Checks that a definition cell is splited or not

Parameters

NameTypeDescription
cellCellcell to check

Returns

boolean

wether the cell is splited or not

Defined in

Grid.ts:25open in new window


newOptions

newOptions(): Object

Returns

Object

NameTypeDescription
arrow{ color: string ; size: number }Arrow style
arrow.colorstring-
arrow.sizenumber-
definitionTextSyle<number> & { backgroundColor: string }Definition style
grid{ borderColor: string ; borderSize: number ; cellSize: number ; outerBorderColor: string ; outerBorderSize: number ; spaceSize: number }Grid style
grid.borderColorstringColor of the lines
grid.borderSizenumberSize of the lines
grid.cellSizenumberSize of the cell
grid.outerBorderColorstringColor of the outer border
grid.outerBorderSizenumberSize of the outer border
grid.spaceSizenumberwidth of the line showind spaceV and spaceH
idstring-
namestringName of the Options
paperFormatFormat for printing

Defined in

utils.ts:141open in new window


outerBorderWidth

outerBorderWidth(options): number

Parameters

NameType
optionsGridOptions

Returns

number

Defined in

utils.ts:33open in new window


parse

parse(str): [number, string]

From a string like 10cm returns [10.cm]

Parameters

NameTypeDescription
strstringinput string

Returns

[number, string]

[value, unit]

Defined in

utils.ts:10open in new window


splitIndex

splitIndex(cell): number

From a definition cell, returns where is the split

Parameters

NameType
cellCell

Returns

number

Defined in

utils.ts:98open in new window