@sheetxl/models
Version:
Models - A Headless javascript spreadsheet library.
73 lines • 2.46 kB
TypeScript
import { SerializableProperties } from "../primitives";
import { AdjustedColor } from "../color";
/**
* Note - Excel javascript does this differently.
* They break weight and styling into two properties but...
* they only support the enums as they are defined in OOXML.
*
* @see {@link https://learn.microsoft.com/en-us/javascript/api/excel/excel.cellborder?view=excel-js-preview#excel-excel-cellborder-style-member}
*/
export declare enum BorderStrokeStyle {
None = "none",
DashDot = "dashDot",
DashDotDot = "dashDotDot",
Dashed = "dashed",
Dotted = "dotted",
Double = "double",
Hair = "hair",
Medium = "medium",
MediumDashDot = "mediumDashDot",
MediumDashDotDot = "mediumDashDotDot",
MediumDashed = "mediumDashed",
SlantDashDot = "slantDashDot",
Thick = "thick",
Thin = "thin"
}
export declare enum BorderEdge {
Left = "left",
Top = "top",
Right = "right",
Bottom = "bottom",
/** Note -
* @horizontal and @vertical properties are supported for setting values but get converted top/left/bottom/right for individual cells.
* These will always be null in the ICellStyle.
*/
Horizontal = "horizontal",
Vertical = "vertical",
DiagonalUp = "diagonalUp",
DiagonalDown = "diagonalDown"
}
export interface BorderStyleDefinition {
style: BorderStrokeStyle;
description: string;
width: number;
pattern: number[];
}
export declare const isEqualBorderStrokes: (a: BorderStroke, b: BorderStroke) => boolean;
/**
* List of Border definitions. This provides an order for display purposes.
* @see {@link PRESET_CELL_BORDERS_DEFINITIONS_MAP}
*/
export declare const PRESET_CELL_BORDERS_DEFINITIONS_ARRAY: BorderStyleDefinition[];
/**
* Provides a quick way to access border definitions by StrokeStyle.
* @see {@link PRESET_CELL_BORDERS_DEFINITIONS_ARRAY}
*/
export declare const PRESET_CELL_BORDERS_DEFINITIONS_MAP: Map<BorderStrokeStyle, BorderStyleDefinition>;
export type CellBorderValues = {
[key in BorderEdge]: BorderStroke;
};
export interface BorderStroke {
style: BorderStrokeStyle;
color: AdjustedColor;
}
export interface ICellBorder extends CellBorderValues {
/**
* If there are any borders that are not none.
*/
isEmpty(): boolean;
readonly isICellBorder: true;
toJSON(): SerializableProperties<CellBorderValues>;
}
export default CellBorderValues;
//# sourceMappingURL=ICellBorder.d.ts.map