@evidential-fortune-sheet/fortune-excel
Version:
An Excel import/export import library for FortuneSheet
133 lines (132 loc) • 4.37 kB
TypeScript
import { IfortuneSheetSelection } from "../ToFortuneSheet/IFortune";
import { IattributeList, stringToNum } from "./ICommon";
import ExcelJS from "exceljs";
export declare function getRangetxt(range: IfortuneSheetSelection, sheettxt: string): string;
export declare function getcellrange(txt: string, sheets?: IattributeList, sheetId?: string): {
row: number[];
column: number[];
sheetIndex: number;
};
/**
* @return ratio, default 0.75 1in = 2.54cm = 25.4mm = 72pt = 6pc, pt = 1/72 In, px = 1/dpi In
*/
export declare function getptToPxRatioByDPI(): number;
/**
* @emus EMUs, Excel drawing unit
* @return pixel
*/
export declare function getPxByEMUs(emus: number): number;
/**
* @dom xml attribute object
* @attr attribute name
* @d if attribute is null, return default value
* @return attribute value
*/
export declare function getXmlAttibute(dom: IattributeList, attr: string, d: string): string;
/**
* @columnWidth Excel column width
* @return pixel column width
*/
export declare function getColumnWidthPixel(columnWidth: number): number;
/**
* @rowHeight Excel row height
* @return pixel row height
*/
export declare function getRowHeightPixel(rowHeight: number): number;
export declare function LightenDarkenColor(sixColor: string, tint: number): string;
export declare function generateRandomIndex(prefix: string): string;
export declare function escapeCharacter(str: string): string;
export declare class fromulaRef {
static operator: string;
static error: {
v: string;
n: string;
na: string;
r: string;
d: string;
nm: string;
nl: string;
sp: string;
};
static operatorjson: stringToNum;
static trim(str: string): string;
static functionCopy(txt: string, mode: string, step: number): string;
static downparam(txt: string, step: number): string;
static upparam(txt: string, step: number): string;
static leftparam(txt: string, step: number): string;
static rightparam(txt: string, step: number): string;
static updateparam(orient: string, txt: string, step: number): string;
static iscelldata(txt: string): boolean;
static isfreezonFuc(txt: string): boolean[];
}
export declare function isChinese(temp: string): boolean;
export declare function isJapanese(temp: string): boolean;
export declare function isKoera(chr: any): boolean;
export declare function isContainMultiType(str: string): boolean;
/**
* multi sequence conversion
* example:
* 1、E14 -> 13_4
* 2、E14 J14 O14 T14 Y14 AD14 AI14 AN14 AS14 AX14 ->
* ['13_4', '13_9','13_14', '13_19', '13_24', '13_3', '13_8', '13_13', '13_18', '13_23']
* 3、E46:E47 -> ['45_4', '46_4']
*
* @param {string} sqref - before sequence
* @returns {string[]}
*/
export declare function getMultiSequenceToNum(sqref: string): string[];
/**
* get region sequence
* example:
* 1、[A1:C2'] -> ['A1', 'A2', 'B1', 'B2', 'C1', 'C2']
*
* @param {string[]} arr - formats arr
* @returns {string[]} - after arr
*/
export declare function getRegionSequence(arr: string[]): string[];
/**
* unified processing of conversion formats
* example:
* 1、['E38', 'A1:C2'] -> ['E38', 'A1', 'A2', 'B1', 'B2', 'C1', 'C2']
*
* @param {string[]} arr - formats arr
* @returns {string[]} - after arr
*/
export declare function getSqrefRawArrFormat(arr: string[]): string[];
/**
* single sequence to number
* example:
* 1、A1 -> 0_0
* 2、ES14 -> 13_4
*
* @param {string} sqref - before sequence
* @returns {string} - after sequence
*/
export declare function getSingleSequenceToNum(sqref: string): string;
/**
* R1C1 to Sequence
* example: sheet2!R1C1 => sheet!A1
*
* @param {string} value - R1C1 value
* @returns
*/
export declare function getTransR1C1ToSequence(value: string): string;
/**
* strip x14 format data
*
* @param {string} value
* @returns {Object} - { formula, sqref }
*/
export declare function getPeelOffX14(value: string): {
[key: string]: any;
};
/**
* get the value in the formula
*
* @param {string} value - extracted value
* @returns {string[]}
*/
export declare function getMultiFormulaValue(value: string): string[];
export declare var setMerge: (luckyMerge: {}, worksheet: ExcelJS.Worksheet) => void;
export declare var getObjType: (obj: Object) => string;
export declare var rgb2hex: (rgb: string) => string;