/** * @license * Copyright (c) 2025 Handsoncode. All rights reserved. */ import { SimpleCellRange } from '../AbsoluteCellRange'; import { SimpleCellAddress } from '../Cell'; import { Maybe } from '../Maybe'; import { CellAddress } from './CellAddress'; import { ColumnAddress } from './ColumnAddress'; import { RowAddress } from './RowAddress'; export declare type SheetIndexMappingFn = (sheetIndex: number) => Maybe; export declare type ResolveSheetReferenceFn = (sheetName: string) => Maybe; /** * Computes R0C0 representation of cell address based on it's string representation and base address. * * @param {string} stringAddress - string representation of cell address, e.g., 'C64' * @param {SimpleCellAddress} baseAddress - base address for R0C0 conversion * @param {ResolveSheetReferenceFn} resolveSheetReference - mapping function needed to change name of a sheet to index * @returns {Maybe} object representation of address or `undefined` if the sheet cannot be resolved */ export declare const cellAddressFromString: (stringAddress: string, baseAddress: SimpleCellAddress, resolveSheetReference: ResolveSheetReferenceFn) => Maybe; export declare const columnAddressFromString: (stringAddress: string, baseAddress: SimpleCellAddress, resolveSheetReference: ResolveSheetReferenceFn) => Maybe; export declare const rowAddressFromString: (stringAddress: string, baseAddress: SimpleCellAddress, resolveSheetReference: ResolveSheetReferenceFn) => Maybe; /** * Computes simple (absolute) address of a cell address based on its string representation. * - If sheet name is present in the string representation but is not present in sheet mapping, returns `undefined`. * - If sheet name is not present in the string representation, returns {@param contextSheetId} as sheet number. * * @param {ResolveSheetReferenceFn} resolveSheetReference - mapping function needed to change name of a sheet to index * @param {string} stringAddress - string representation of cell address, e.g., 'C64' * @param {number} contextSheetId - sheet in context of which we should parse the address * @returns {Maybe} absolute representation of address, e.g., { sheet: 0, col: 1, row: 1 } */ export declare const simpleCellAddressFromString: (resolveSheetReference: ResolveSheetReferenceFn, stringAddress: string, contextSheetId: number) => Maybe; export declare const simpleCellRangeFromString: (resolveSheetReference: ResolveSheetReferenceFn, stringAddress: string, contextSheetId: number) => Maybe; /** * Returns string representation of absolute address * If sheet index is not present in sheet mapping, returns undefined */ export declare const simpleCellAddressToString: (sheetIndexMapping: SheetIndexMappingFn, address: SimpleCellAddress, sheetIndex: number) => Maybe; export declare const simpleCellRangeToString: (sheetIndexMapping: SheetIndexMappingFn, address: SimpleCellRange, sheetIndex: number) => Maybe; /** * Converts column index to label * * @param column - address to convert * @returns string representation, e.g., 'AAB' */ export declare function columnIndexToLabel(column: number): string; export declare function sheetIndexToString(sheetId: number, sheetMappingFn: SheetIndexMappingFn): Maybe;