excol
Options
All
  • Public
  • Public/Protected
  • All
Menu

excol

Build Status codecov

Library to mock excel(-like) solutions in Javascript.

Why

You may (should) write your own tests before deploying your code to solution like Google sheet or Office 365.

WORK IN PROGRESS

Index

Enumerations

Classes

Interfaces

Variables

Functions

Object literals

Variables

A1_VALIDATOR_REGEXP

A1_VALIDATOR_REGEXP: RegExp = /^([A-Z]*[0-9]*,?:?)*$/

A_CHAR_CODE

A_CHAR_CODE: 65 = 65

CHAR_COUNT

CHAR_COUNT: 26 = 26

COLUMN

COLUMN: ":" = ":"

COLUMN_REGEXP

COLUMN_REGEXP: RegExp = /^[A-z]+/

COMMA

COMMA: "," = ","

DIMENSION

DIMENSION: 20 = 20

DefaultEmptyString

DefaultEmptyString: string = ""

DefaultFontLine

DefaultFontLine: string = "none"

DefaultFontSize

DefaultFontSize: number = 10

DefaultFontStyle

DefaultFontStyle: string = "normal"

DefaultFontWeight

DefaultFontWeight: string = "normal"

EMPTY

EMPTY: "" = ""

SPACE_REGEXP

SPACE_REGEXP: RegExp = / /g

email

email: string = "test@com.net"

format

format: stringify = JSON.stringify

multipleCoordinate

multipleCoordinate: Array<Array<number>> = [[1, 1], [5, 2]]

multipleMatrix

multipleMatrix: Array<Array<string>> = [['1,1'], ['5,2']]

multipleMixedCoordinate

multipleMixedCoordinate: Array<Array<number> | Array<Array<number>>> = [[1, 1], [1, -1], [[1, 1], [5, 2]], [-1, 6]]

multipleMixedMatrix

multipleMixedMatrix: Array<Array<string>> = [['1,1'], ['1', '1'], ['1,1', '5,2'], ['F', 'F']]

multipleRangeCoordinate

multipleRangeCoordinate: Array<Array<Array<number>>> = [[[1, 1], [5, 2]], [[1, 1], [5, 2]]]

multipleRangeMatrix

multipleRangeMatrix: Array<Array<string>> = [['1,1', '5,2'], ['1,1', '5,2']]

multipleRangeSingleColumnCoordinate

multipleRangeSingleColumnCoordinate: Array<Array<number>> = [[-1, 1], [-1, 3], [-1, 6]]

multipleRangeSingleColumnMatrix

multipleRangeSingleColumnMatrix: Array<Array<string>> = [['A', 'A'], ['C', 'C'], ['F', 'F']]

multipleSingleRowCoordinate

multipleSingleRowCoordinate: Array<Array<number>> = [[1, -1], [3, -1], [8, -1]]

multipleSingleRowMatrix

multipleSingleRowMatrix: Array<Array<string>> = [['1', '1'], ['3', '3'], ['8', '8']]

name

name: "newSpreadsheet" = "newSpreadsheet"

name1

name1: "newSpreadsheet1" = "newSpreadsheet1"

namedRange

namedRange: NamedRange = spreadSheet.addNamedRanges(namedRangeName, range)

namedRangeName

namedRangeName: "myNamedRange" = "myNamedRange"

range

range: Range = spreadSheet.getRange('A1:B5')

rangeColumnCoordinate

rangeColumnCoordinate: Array<Array<Array<number>>> = [[[-1, 1], [-1, 3]]]

rangeColumnMatrix

rangeColumnMatrix: Array<Array<string>> = [['A', 'C']]

rangeCoordinate

rangeCoordinate: Array<Array<Array<number>>> = [[[1, 1], [5, 2]]]

rangeMatrix

rangeMatrix: Array<Array<string>> = [['1,1', '5,2']]

rangeRowCoordinate

rangeRowCoordinate: Array<Array<Array<number>>> = [[[1, -1], [5, -1]]]

rangeRowMatrix

rangeRowMatrix: Array<Array<string>> = [['1', '5']]

singleColumnCoordinate

singleColumnCoordinate: Array<Array<number>> = [[-1, 1]]

singleColumnMatrix

singleColumnMatrix: Array<Array<string>> = [['A', 'A']]

singleCoordinate

singleCoordinate: Array<Array<number>> = [[1, 1]]

singleMatrix

singleMatrix: Array<Array<string>> = [['1,1']]

singleRowCoordinate

singleRowCoordinate: Array<Array<number>> = [[1, -1]]

singleRowMatrix

singleRowMatrix: Array<Array<string>> = [['1', '1']]

spreadSheet

spreadSheet: Spreadsheet = new Spreadsheet({name:'sheet1', numRows: 5, numColumns: 5})

Functions

GetAcrossMultipleRowColumnRange

  • GetAcrossMultipleRowColumnRange(sheet: Sheet, coordinates: Array<Array<number>>): Range

GetSingleCellOrWholeRowColumnRange

  • GetSingleCellOrWholeRowColumnRange(sheet: Sheet, coordinates: Array<number>): Range

NewCell

  • NewCell(row: number, column: number, value: any): Cell

check2DimArrayOfDataValidation

  • check2DimArrayOfDataValidation(obj: any, range: Range): void

check2DimArrayOfNumbers

  • check2DimArrayOfNumbers(obj: any, range: Range): void

check2DimArrayOfStrings

  • check2DimArrayOfStrings(obj: any, range: Range): void

checkValues

  • checkValues(obj: any, range: Range): void

clearContent

  • clearContent(cell: Cell, cellValue: CellValue | undefined): void

clearFormat

  • clearFormat(cell: Cell): void

convertA1Notation

  • convertA1Notation(A1: string): string

createArray

  • createArray(length: number, length2?: undefined | number): Array<any>
  • Parameters

    • length: number
    • Optional length2: undefined | number

    Returns Array<any>

decode

  • decode(columnNumber: number): string
  • Decodes a column number and transforms it into a column name.

    Parameters

    • columnNumber: number

      The column number

    Returns string

    the column name

encode

  • encode(columnName: string): number
  • Encodes a column name and transforms it into a column number.

    Parameters

    • columnName: string

      The column name

    Returns number

    the column number

getA1Notation

  • getA1Notation(row: number, column: number): string

isNan

  • isNan(elt: string): boolean

isNullUndefined

  • isNullUndefined(o: any): boolean

isTwoDimArray

  • isTwoDimArray(o: any): void

isTwoDimArrayCorrectDimensions

  • isTwoDimArrayCorrectDimensions(o: any, rows: number, columns: number): void
  • Parameters

    • o: any
    • rows: number
    • columns: number

    Returns void

isTwoDimArrayOfDataValidation

  • isTwoDimArrayOfDataValidation(o: any, rows: number, columns: number): boolean
  • Parameters

    • o: any
    • rows: number
    • columns: number

    Returns boolean

isTwoDimArrayOfNumber

  • isTwoDimArrayOfNumber(o: any, rows: number, columns: number): boolean
  • Parameters

    • o: any
    • rows: number
    • columns: number

    Returns boolean

isTwoDimArrayOfString

  • isTwoDimArrayOfString(o: any, rows: number, columns: number): boolean
  • Parameters

    • o: any
    • rows: number
    • columns: number

    Returns boolean

toCoordinates

  • toCoordinates(__namedParameters: object): any[]

toInt

  • toInt(elt: string): number

toMatrix

  • toMatrix(__namedParameters: object): string[]
  • Encodes A1 notation to matrix notation.

    Parameters

    • __namedParameters: object
      • A1: string

    Returns string[]

validateA1

  • validateA1(__namedParameters: object): boolean

Object literals

cfg

cfg: object

id

id: number = 0

name

name: string = "test lib"

numColumns

numColumns: number = DIMENSION

numRows

numRows: number = DIMENSION

cfg2

cfg2: object

name

name: string = "test lib"

numColumns

numColumns: number = 4

numRows

numRows: number = 4

multipleA1

multipleA1: object

A1

A1: string = "A1,B5"

multipleMixedA1

multipleMixedA1: object

A1

A1: string = "A1,1:1,A1:B5,F:F"

multipleRangeA1

multipleRangeA1: object

A1

A1: string = "A1:B5, A1:B5"

multipleRangeSingleColumnA1

multipleRangeSingleColumnA1: object

A1

A1: string = "A:A,C:C,F:F"

multipleSingleRowA1

multipleSingleRowA1: object

A1

A1: string = "1:1,3:3,8:8"

rangeA1

rangeA1: object

A1

A1: string = "A1:B5"

rangeColumnA1

rangeColumnA1: object

A1

A1: string = "A:C"

rangeRowA1

rangeRowA1: object

A1

A1: string = "1:5"

sheetConfig

sheetConfig: object

id

id: number = 0

name

name: string = "Sheet"

numColumns

numColumns: number = DIMENSION

numRows

numRows: number = DIMENSION

singleA1

singleA1: object

A1

A1: string = "A1"

singleColumnA1

singleColumnA1: object

A1

A1: string = "A:A"

singleRowA1

singleRowA1: object

A1

A1: string = "1:1"

spreadsheetConfig

spreadsheetConfig: object

numColumns

numColumns: number = DIMENSION

numRows

numRows: number = DIMENSION

validators

validators: object

10

  • 10(row: any, column: any, cellValue: Object, validation: DataValidation): void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc