Work with A1 notation like "A1" or "A1:B2"
npm install @flighter/a1-notation
npm i @flighter/a1-notation -d
`
Or
`
yarn add @flighter/a1-notation
`$3
[4]: dist/index.next.min.js
[5]: dist/index.js[ESNext.min(5 KB)][4], [ESM(20 KB)][5]
$3
[12]: src/converters.ts#L13
[13]: src/converters.ts#L30
* converter 1 or converter 2? The difference is in the algorithm of convertation. You can compare [the first method][12] with [the second method][13].
* ".min"? Minified version.
* Default version in npm is ESM. This version is not transpiled and minified, so you need to transpile and minify it.
Initialization
`js
import A1 from '@flighter/a1-notation';
`API
Note: A1 string could be represented in any register.
A1 === a1, A1:B2 === a1:b2 === A1:b2 === a1:B2`- static isValid(a1: string): boolean
- static getCol(a1: string, converter: 1 | 2 = 1): number
- static getLastCol(a1: string, converter: 1 | 2 = 1): number
- static getRow(a1: string): number
- static getLastRow(a1: string): number
- static getWidth(a1: string, converter: 1 | 2 = 1): number
- static getHeight(a1: string): number
- static toCol(col: number): string
- static toRow(row: number): string
- constructor
- get(): string
- toString(): string
- toJSON(): result
- getCol(): number
- getLastCol(): number
- getRow(): number
- getLastRow(): number
- getWidth(): number
- getHeight(): number
- setCol(val: string | number): this
- setLastCol(val: string | number): this
- setRow(val: string | number): this
- setLastRow(val: string | number): this
- copy(): A1
- addX(count: number): this
- addY(count: number): this
- add(countX: number, countY: number): this
- removeX(count: number): this
- removeY(count: number): this
- remove(countX: number, countY: number): this
- shiftX(offset: number): this
- shiftY(offset: number): this
- shift(offsetX: number, offsetY: number): this