UNPKG

@sheetxl/sdk

Version:

SDK - A high-performance, embeddable spreadsheet engine.

1,512 lines 1.49 MB
declare module "listener/IListener" { /** * Namespace used for listeners to events. */ export namespace IListener { /** * A callback for the listener. */ interface Callback<S> { (source: S, params?: any): any; } /** * The listener objects */ type Callbacks<SOURCE, EVENTS = any> = Partial<{ [Property in keyof EVENTS]: IListener.Callback<SOURCE>; }>; /** * Additional options for a listener. */ interface Options { /** * If true, the listener will be removed after the first time it is called. * * @defaultValue false; */ once?: boolean; /** * Determines if the listeners is part of the transaction. * * @defaultValue If the listener is added during a transaction this will be true. * * @remarks * There are subtle differences between a transactional listener and a non-transactional listener. * * A transactional listener: * * Will not be fire during undo/redo. * * Will be reverted to it's original add/remove state during an undo/redo. * * A non-transactional listener: * Will not be fire on any change. */ transactional?: boolean; } interface Remove { (): void; } interface ISource<SOURCE, EVENTS = any> { /** * Add a set of callbacks to receive notification. * * @param listeners The callbacks object. * @param options Options * @returns A function that can be called to remove the listener. * * @remarks * Listeners are fired in the order that they are added. * */ addListeners(listeners: IListener.Callbacks<SOURCE, EVENTS>, options?: IListener.Options): IListener.Remove; } } } declare module "listener/index" { export * from "listener/IListener"; } declare module "i18n/i18n" { export const FLOAT_SEP_STR = "."; export const REGEX_FLOAT_STR = "\\s*([-]?[0-9e]*[.]?[0-9]+)"; export const REGEX_SIMPLE_FLOAT_STR = "\\s*([-]?[0-9e]*[.]?[0-9]+)"; } declare module "i18n/index" { export * as i18n from "i18n/i18n"; } declare module "color/_ColorUtils" { export const RegExRGB: RegExp; export const RegExRGBA: RegExp; export const RegExLRGB: RegExp; export const RegExLRGBA: RegExp; export const RegExHSL: RegExp; export const RegExHSLA: RegExp; export const RegExHEX: RegExp; export const RegExHEXA: RegExp; export const RegExIndex: RegExp; export const parseParts: (partR: string | number, partG: string | number, partB: string | number) => number[]; export const divideRGB: (input: number[], divisor?: number) => number[]; export const multiplyRGB: (input: number[], factor?: number) => number[]; export const roundRGB: (input: number[], sigFigs?: number) => number[]; export const clampRGB: (rgb: number[], linear?: boolean) => number[]; export const clampAlpha: (number: number) => number; export const clampHue: (hue: number) => number; export const srgb2lin: (rgb: number[]) => number[]; export const lin2srgb: (rgb: number[]) => number[]; /** * Convert HSL values to a RGB Color. * An array with: * * H - Hue is specified as degrees in the range 0 - 360. * * S - Saturation is specified as a percentage in the range 1 - 100. * * L - Luminance is specified as a percentage in the range 1 - 100. * @param hsl Array with [h, s, l] * @returns An array containing the 3 RGB values. */ export const hsl2rgb: (hsl: number[]) => number[]; export const hue2rgb: (p: number, q: number, h: number) => number; /** * Convert a RGB Color to it corresponding HSL values. * * @returns an array containing the 3 HSL values. */ export const rgb2hsl: (rgb: number[]) => number[]; export const HSLComponent: { readonly HUE: 0; readonly SATURATION: 1; readonly LUMINANCE: 2; }; export type HSLComponent = typeof HSLComponent[keyof typeof HSLComponent]; export const RGBAComponent: { readonly RED: 0; readonly GREEN: 1; readonly BLUE: 2; readonly ALPHA: 3; }; export type RGBAComponent = typeof RGBAComponent[keyof typeof RGBAComponent]; export const ColorShiftType: { readonly SET: 0; readonly OFF: 1; readonly MOD: 2; }; export type ColorShiftType = typeof ColorShiftType[keyof typeof ColorShiftType]; export class ColorAdjustment { _private: { name: string; amount: number; }; constructor(name: string, amount: number); get name(): string; get amount(): number; } type CompTransform = (comp: number, lrgb: number[]) => number; export const applyLRGBTransform: (srgb: number[], compTransform: CompTransform) => number[]; export const applyShade: (srgb: number[], val: number) => number[]; export const applyETint: (srgb: number[], val: number) => number[]; export const applyTint: (srgb: number[], val: number) => number[]; export const applyHSL: (space: HSLComponent, srgb: number[], val: number) => number[]; export const applyHSLOff: (space: HSLComponent, srgb: number[], val: number) => number[]; export const applyHSLMod: (space: HSLComponent, srgb: number[], val: number) => number[]; export const applyRGB: (space: RGBAComponent, srgb: number[], val: number, type: ColorShiftType) => number[]; export const applyGray: (srgb: number[]) => number[]; export const applyComplement: (srgb: number[]) => number[]; export const applyInverse: (rgb: number[], linear?: boolean) => number[]; export const applyGamma: (srgb: number[]) => number[]; export const applyInverseGamma: (srgb: number[]) => number[]; /** * Returns the hex value without the leading '#'. * * @param r Red as a value between 0 and 255. * @param g Green as a value between 0 and 255. * @param b Blue as a value between 0 and 255. */ export const rgbToHex: (r: number, g: number, b: number, a?: number) => string; /** * This rotates Hue using the same algo that CSS uses. * * This was copied from https://hg.mozilla.org/mozilla-central/file/390d478480f9/gfx/src/FilterSupport.cpp */ export const rotateHueCss: (srgb: number[], angle: number) => number[]; } declare module "color/ColorSpace" { /** * Color definitions available in various ColorSpaces. */ export namespace ColorSpace { /** * A color in the Red, Green, Blue color space. */ class RGBA { protected _private: { red: number; green: number; blue: number; alpha: number; }; constructor(red: number, green: number, blue: number, alpha?: number); get red(): number; get green(): number; get blue(): number; get alpha(): number; toString(alpha?: boolean): string; isEqual(other: ColorSpace.RGBA): boolean; isAlmostEqual(other: ColorSpace.RGBA): boolean; } /** * A color in the Hue, Saturation, Luminosity color space. */ class HSLA { private _private; constructor(hue: number, sat: number, lum: number, alpha: number); get hue(): number; get sat(): number; get lum(): number; get alpha(): number; toString(alpha?: boolean): string; isEqual(other: ColorSpace.HSLA): boolean; isAlmostEqual(other: ColorSpace.HSLA): boolean; } /** * A color (Red, Green, Blue) encoded in hexadecimal. */ class HEX extends ColorSpace.RGBA { toString(alpha?: boolean): string; } } } declare module "color/IColor" { import { ColorSpace } from "color/ColorSpace"; /** * Represents a color with optional adjustments applied. * * An `IColor` consists of: * - `baseColor`: The underlying color, which can be a scheme color (e.g., Accent1), a built-in color (e.g., 'red', 'blue'), * or defined using various color models (RGB, Hex, HSL). * - `adjustments` (optional): An ordered list of color adjustments that modify the `baseColor`. * These adjustments can include effects like grayscale, inversion, or modifications to specific color components (red, alpha, etc.). * @see * {@link AdjustmentType} */ export interface IColor { /** * The base value for the color before adjustments. */ getVal(): string; /** * Return the color adjustments. */ getAdjustments(): readonly IColor.Adjustment[]; /** * Return as RGBA with adjustments applied. * @param darkMode */ toRGBA(darkMode?: boolean): IColor.ISpace.RGBA; /** * Return as HSLA with adjustments applied. * @param darkMode */ toHSLA(darkMode?: boolean): IColor.ISpace.HSLA; /** * Return a HEX with adjustments applied. * @param darkMode */ toHex(darkMode?: boolean): IColor.ISpace.HEX; /** * Return a string usable with CSS color properties. * * @param darkMode If `true` dark colors will be used. * @param alpha If `true` alpha will be applied. */ toCSS(darkMode?: boolean, alpha?: boolean): string; /** * Returns a new color that is derived from this color with the adjustments applied. * @param adjustments An array of Adjustments */ adjust(adjustments: readonly IColor.Adjustment[]): IColor; /** * Returns the color as either 'black or white' depending on the luminance. * @param threshold The threshold to determine if the color is dark or light. @defaultValue '186' */ toBlackOrWhite(darkMode?: boolean, threshold?: number): IColor; /** * Return the color as a string. * @remarks */ toString(): string; /** * Return the type of color value used (e.g., scheme, named, index, hsl, rgb, hex). */ getType(): IColor.Type; /** * Returns true if the other color will resolve to the same rgb values as this color. * @param other The other color to compare. */ isEqual(other: any): boolean; /** * For runtime type checking. */ readonly isIColor: true; } /** * {@inheritDoc IColor} * @see * ### **Interface** * * {@link IColor} * * ### **Implementation** * * {@link IColor} */ export namespace IColor { /** * Represents a color space. */ namespace ISpace { /** * A color in the Red, Green, Blue color space. */ type RGBA = ColorSpace.RGBA; /** * A color in the Hue, Saturation, Luminosity color space. */ type HSLA = ColorSpace.HSLA; /** * A color (Red, Green, Blue) encoded in hexadecimal. */ type HEX = ColorSpace.HEX; } /** * Represents various adjustment types for color properties, allowing fine-tuned control over * attributes such as transparency, hue, saturation, luminance, and RGB components. * * The adjusts are based on the DrawML OOXML specification, with an additional adjustment type (`ETint`) * based on the Excel tint shading algorithm. * * * Adjustments can be chained to achieve complex color transformations. */ const AdjustmentType: { /** * Adjusts the transparency level of a color. */ readonly Alpha: "alpha"; /** * Adjusts the transparency offset of a color. */ readonly AlphaOff: "alphaOff"; /** * Modifies the transparency of a color by a multiplier. */ readonly AlphaMod: "alphaMod"; /** * Adjusts the hue of a color. */ readonly Hue: "hue"; /** * Adjusts the saturation of a color. */ readonly Sat: "sat"; /** * Adjusts the luminance (brightness) of a color. */ readonly Lum: "lum"; /** * Applies an offset to the hue of a color. */ readonly HueOff: "hueOff"; /** * Applies an offset to the saturation of a color. */ readonly SatOff: "satOff"; /** * Applies an offset to the luminance of a color. */ readonly LumOff: "lumOff"; /** * Modifies the hue of a color by a multiplier. */ readonly HueMod: "hueMod"; /** * Modifies the saturation of a color by a multiplier. */ readonly SatMod: "satMod"; /** * Modifies the luminance of a color by a multiplier. */ readonly LumMod: "lumMod"; /** * Adjusts the red component of a color. */ readonly Red: "red"; /** * Adjusts the green component of a color. */ readonly Green: "green"; /** * Adjusts the blue component of a color. */ readonly Blue: "blue"; /** * Applies an offset to the red component of a color. */ readonly RedOff: "redOff"; /** * Applies an offset to the green component of a color. */ readonly GreenOff: "greenOff"; /** * Applies an offset to the blue component of a color. */ readonly BlueOff: "blueOff"; /** * Modifies the red component of a color by a multiplier. */ readonly RedMod: "redMod"; /** * Modifies the green component of a color by a multiplier. */ readonly GreenMod: "greenMod"; /** * Modifies the blue component of a color by a multiplier. */ readonly BlueMod: "blueMod"; /** * Shades a color, making it darker by reducing its luminance. */ readonly Shade: "shade"; /** * Tints a color, making it lighter by increasing its luminance. */ readonly Tint: "tint"; /** * Tints a color based on Excel's specific tint shading algorithm. */ readonly ETint: "eTint"; /** * Converts a color to grayscale. */ readonly Gray: "gray"; /** * Creates a complementary color. */ readonly Comp: "comp"; /** * Inverts a color. */ readonly Inv: "inv"; /** * Applies gamma correction to a color. */ readonly Gamma: "gamma"; /** * Inverts the gamma correction of a color. */ readonly InvGamma: "invGamma"; }; type AdjustmentType = typeof AdjustmentType[keyof typeof AdjustmentType]; /** * Represents a color adjustment. * * @remarks * All percentages are expresses as 0-100 except alpha which is 0-1. */ type Adjustment = { [key in IColor.AdjustmentType]?: boolean | number; }; /** * Represents a value and adjustment. */ interface Definition { val: string; adjs?: readonly IColor.Adjustment[]; } /** * Associate a color definition with a human-readable label. * @remarks * Useful for displaying color options in a UI. */ interface DefinitionWithLabel { description: string; definition: IColor.Definition; } type Serializable = string | IColor | (string | IColor); /** * Lookup a color by the Schema key. This should consult a DocTheme if available. */ type SchemeLookup = (key: IColor.Scheme) => ColorSpace.RGBA; /** * Lookup a color by the Indexed value. * @see * {@link https://github.com/closedxml/closedxml/wiki/Excel-Indexed-Colors | Excel Indexed Colors} */ type IndexedLookup = (index: number) => ColorSpace.RGBA; /** * Named (builtin) colors defined in DrawingML aka known/system colors * * This enum provides a comprehensive list of named colors, including system-defined colors, * standard HTML colors, and additional named colors. Each color is represented as a string * corresponding to its name. * * @see * * {@link https://msdn.microsoft.com/library/system.drawing.knowncolor.aspx | KnownColor Enumeration} * * {@link https://msdn.microsoft.com/library/system.windows.media.colors.aspx | Colors Class} */ const Named: { /** * The system-defined color of the active window's border. */ readonly ActiveBorder: "activeBorder"; /** * The system-defined color of the active window's caption. */ readonly ActiveCaption: "activeCaption"; /** * The system-defined color of the text in the active window's caption. */ readonly CaptionText: "captionText"; /** * The system-defined color of the application workspace. */ readonly AppWorkspace: "appWorkspace"; /** * The system-defined color of the face of a button. */ readonly BtnFace: "btnFace"; /** * The system-defined color of the shadow of a button. */ readonly BtnShadow: "btnShadow"; /** * The system-defined color of a 3D dark shadow. */ readonly DkShadow3d: "3dDkShadow"; /** * The system-defined color of the highlight of a button. */ readonly BtnHighlight: "btnHighlight"; /** * The system-defined color of a 3D light. */ readonly Light3d: "3dLight"; /** * The system-defined color of the text on a button. */ readonly BtnText: "btnText"; /** * The system-defined color of the background. */ readonly Background: "background"; /** * The system-defined color of gray text. */ readonly GrayText: "grayText"; /** * The system-defined color of the highlight. */ readonly Highlight: "highlight"; /** * The system-defined color of the text in the highlight. */ readonly HighlightText: "highlightText"; /** * The system-defined color of a hot light. */ readonly HotLight: "hotLight"; /** * The system-defined color of the inactive window's border. */ readonly InactiveBorder: "inactiveBorder"; /** * The system-defined color of the inactive window's caption. */ readonly InactiveCaption: "inactiveCaption"; /** * The system-defined color of the text in the inactive window's caption. */ readonly InactiveCaptionText: "inactiveCaptionText"; /** * The system-defined color of the background of an information tooltip. */ readonly InfoBk: "infoBk"; /** * The system-defined color of the text in an information tooltip. */ readonly InfoText: "infoText"; /** * The system-defined color of a menu. */ readonly Menu: "menu"; /** * The system-defined color of the text in a menu. */ readonly MenuText: "menuText"; /** * The system-defined color of a scroll bar. */ readonly ScrollBar: "scrollBar"; /** * The system-defined color of a window. */ readonly Window: "window"; /** * The system-defined color of a window frame. */ readonly WindowFrame: "windowFrame"; /** * The system-defined color of the text in a window. */ readonly WindowText: "windowText"; /** * The system-defined color of transparency. */ readonly Transparent: "transparent"; /** * The color AliceBlue. */ readonly AliceBlue: "aliceBlue"; /** * The color AntiqueWhite. */ readonly AntiqueWhite: "antiqueWhite"; /** * The color Aqua. */ readonly Aqua: "aqua"; /** * The color Aquamarine. */ readonly Aquamarine: "aquamarine"; /** * The color Azure. */ readonly Azure: "azure"; /** * The color Beige. */ readonly Beige: "beige"; /** * The color Bisque. */ readonly Bisque: "bisque"; /** * The color Black. */ readonly Black: "black"; /** * The color BlanchedAlmond. */ readonly BlanchedAlmond: "blanchedAlmond"; /** * The color Blue. */ readonly Blue: "blue"; /** * The color BlueViolet. */ readonly BlueViolet: "blueViolet"; /** * The color Brown. */ readonly Brown: "brown"; /** * The color BurlyWood. */ readonly BurlyWood: "burlyWood"; /** * The color CadetBlue. */ readonly CadetBlue: "cadetBlue"; /** * The color Chartreuse. */ readonly Chartreuse: "chartreuse"; /** * The color Chocolate. */ readonly Chocolate: "chocolate"; /** * The color Coral. */ readonly Coral: "coral"; /** * The color CornflowerBlue. */ readonly CornflowerBlue: "cornflowerBlue"; /** * The color Cornsilk. */ readonly Cornsilk: "cornsilk"; /** * The color Crimson. */ readonly Crimson: "crimson"; /** * The color Cyan. */ readonly Cyan: "cyan"; /** * The color DarkBlue. */ readonly DkBlue: "dkBlue"; /** * The color DarkCyan. */ readonly DkCyan: "dkCyan"; /** * The color DarkGoldenrod. */ readonly DkGoldenrod: "dkGoldenrod"; /** * The color DarkGray. */ readonly DkGray: "dkGray"; /** * The color DarkGreen. */ readonly DkGreen: "dkGreen"; /** * The color DarkKhaki. */ readonly DkKhaki: "dkKhaki"; /** * The color DarkMagenta. */ readonly DkMagenta: "dkMagenta"; /** * The color DarkOliveGreen. */ readonly DkOliveGreen: "dkOliveGreen"; /** * The color DarkOrange. */ readonly DkOrange: "dkOrange"; /** * The color DarkOrchid. */ readonly DkOrchid: "dkOrchid"; /** * The color DarkRed. */ readonly DkRed: "dkRed"; /** * The color DarkSalmon. */ readonly DkSalmon: "dkSalmon"; /** * The color DarkSeaGreen. */ readonly DkSeaGreen: "dkSeaGreen"; /** * The color DarkSlateBlue. */ readonly DkSlateBlue: "dkSlateBlue"; /** * The color DarkSlateGray. */ readonly DkSlateGray: "dkSlateGray"; /** * The color DarkTurquoise. */ readonly DkTurquoise: "dkTurquoise"; /** * The color DarkViolet. */ readonly DkViolet: "dkViolet"; /** * The color DeepPink. */ readonly DeepPink: "deepPink"; /** * The color DeepSkyBlue. */ readonly DeepSkyBlue: "deepSkyBlue"; /** * The color DimGray. */ readonly DimGray: "dimGray"; /** * The color DodgerBlue. */ readonly DodgerBlue: "dodgerBlue"; /** * The color Firebrick. */ readonly Firebrick: "firebrick"; /** * The color FloralWhite. */ readonly FloralWhite: "floralWhite"; /** * The color ForestGreen. */ readonly ForestGreen: "forestGreen"; /** * The color Fuchsia. */ readonly Fuchsia: "fuchsia"; /** * The color Gainsboro. */ readonly Gainsboro: "gainsboro"; /** * The color GhostWhite. */ readonly GhostWhite: "ghostWhite"; /** * The color Gold. */ readonly Gold: "gold"; /** * The color Goldenrod. */ readonly Goldenrod: "goldenrod"; /** * The color Gray. */ readonly Gray: "gray"; /** * The color Green. */ readonly Green: "green"; /** * The color GreenYellow. */ readonly GreenYellow: "greenYellow"; /** * The color Honeydew. */ readonly Honeydew: "honeydew"; /** * The color HotPink. */ readonly HotPink: "hotPink"; /** * The color IndianRed. */ readonly IndianRed: "indianRed"; /** * The color Indigo. */ readonly Indigo: "indigo"; /** * The color Ivory. */ readonly Ivory: "ivory"; /** * The color Khaki. */ readonly Khaki: "khaki"; /** * The color Lavender. */ readonly Lavender: "lavender"; /** * The color LavenderBlush. */ readonly LavenderBlush: "lavenderBlush"; /** * The color LawnGreen. */ readonly LawnGreen: "lawnGreen"; /** * The color LemonChiffon. */ readonly LemonChiffon: "lemonChiffon"; /** * The color LightBlue. */ readonly LtBlue: "ltBlue"; /** * The color LightCoral. */ readonly LtCoral: "ltCoral"; /** * The color LightCyan. */ readonly LtCyan: "ltCyan"; /** * The color LightGoldenrodYellow. */ readonly LtGoldenrodYellow: "ltGoldenrodYellow"; /** * The color LightGray. */ readonly LtGray: "ltGray"; /** * The color LightGreen. */ readonly LtGreen: "ltGreen"; /** * The color LightPink. */ readonly LtPink: "ltPink"; /** * The color LightSalmon. */ readonly LtSalmon: "ltSalmon"; /** * The color LightSeaGreen. */ readonly LtSeaGreen: "ltSeaGreen"; /** * The color LightSkyBlue. */ readonly LtSkyBlue: "ltSkyBlue"; /** * The color LightSlateGray. */ readonly LtSlateGray: "ltSlateGray"; /** * The color LightSteelBlue. */ readonly LtSteelBlue: "ltSteelBlue"; /** * The color LightYellow. */ readonly LtYellow: "ltYellow"; /** * The color Lime. */ readonly Lime: "lime"; /** * The color LimeGreen. */ readonly LimeGreen: "limeGreen"; /** * The color Linen. */ readonly Linen: "linen"; /** * The color Magenta. */ readonly Magenta: "magenta"; /** * The color Maroon. */ readonly Maroon: "maroon"; /** * The color MediumAquamarine. */ readonly MedAquamarine: "medAquamarine"; /** * The color MediumBlue. */ readonly MedBlue: "medBlue"; /** * The color MediumOrchid. */ readonly MedOrchid: "medOrchid"; /** * The color MediumPurple. */ readonly MedPurple: "medPurple"; /** * The color MediumSeaGreen. */ readonly MedSeaGreen: "medSeaGreen"; /** * The color MediumSlateBlue. */ readonly MedSlateBlue: "medSlateBlue"; /** * The color MediumSpringGreen. */ readonly MedSpringGreen: "medSpringGreen"; /** * The color MediumTurquoise. */ readonly MedTurquoise: "medTurquoise"; /** * The color MediumVioletRed. */ readonly MedVioletRed: "medVioletRed"; /** * The color MidnightBlue. */ readonly MidnightBlue: "midnightBlue"; /** * The color MintCream. */ readonly MintCream: "mintCream"; /** * The color MistyRose. */ readonly MistyRose: "mistyRose"; /** * The color Moccasin. */ readonly Moccasin: "moccasin"; /** * The color NavajoWhite. */ readonly NavajoWhite: "navajoWhite"; /** * The color Navy. */ readonly Navy: "navy"; /** * The color OldLace. */ readonly OldLace: "oldLace"; /** * The color Olive. */ readonly Olive: "olive"; /** * The color OliveDrab. */ readonly OliveDrab: "oliveDrab"; /** * The color Orange. */ readonly Orange: "orange"; /** * The color OrangeRed. */ readonly OrangeRed: "orangeRed"; /** * The color Orchid. */ readonly Orchid: "orchid"; /** * The color PaleGoldenrod. */ readonly PaleGoldenrod: "paleGoldenrod"; /** * The color PaleGreen. */ readonly PaleGreen: "paleGreen"; /** * The color PaleTurquoise. */ readonly PaleTurquoise: "paleTurquoise"; /** * The color PaleVioletRed. */ readonly PaleVioletRed: "paleVioletRed"; /** * The color PapayaWhip. */ readonly PapayaWhip: "papayaWhip"; /** * The color PeachPuff. */ readonly PeachPuff: "peachPuff"; /** * The color Peru. */ readonly Peru: "peru"; /** * The color Pink. */ readonly Pink: "pink"; /** * The color Plum. */ readonly Plum: "plum"; /** * The color PowderBlue. */ readonly PowderBlue: "powderBlue"; /** * The color Purple. */ readonly Purple: "purple"; /** * The color Red. */ readonly Red: "red"; /** * The color RosyBrown. */ readonly RosyBrown: "rosyBrown"; /** * The color RoyalBlue. */ readonly RoyalBlue: "royalBlue"; /** * The color SaddleBrown. */ readonly SaddleBrown: "saddleBrown"; /** * The color Salmon. */ readonly Salmon: "salmon"; /** * The color SandyBrown. */ readonly SandyBrown: "sandyBrown"; /** * The color SeaGreen. */ readonly SeaGreen: "seaGreen"; /** * The color SeaShell. */ readonly SeaShell: "seaShell"; /** * The color Sienna. */ readonly Sienna: "sienna"; /** * The color Silver. */ readonly Silver: "silver"; /** * The color SkyBlue. */ readonly SkyBlue: "skyBlue"; /** * The color SlateBlue. */ readonly SlateBlue: "slateBlue"; /** * The color SlateGray. */ readonly SlateGray: "slateGray"; /** * The color Snow. */ readonly Snow: "snow"; /** * The color SpringGreen. */ readonly SpringGreen: "springGreen"; /** * The color SteelBlue. */ readonly SteelBlue: "steelBlue"; /** * The color Tan. */ readonly Tan: "tan"; /** * The color Teal. */ readonly Teal: "teal"; /** * The color Thistle. */ readonly Thistle: "thistle"; /** * The color Tomato. */ readonly Tomato: "tomato"; /** * The color Turquoise. */ readonly Turquoise: "turquoise"; /** * The color Violet. */ readonly Violet: "violet"; /** * The color Wheat. */ readonly Wheat: "wheat"; /** * The color White. */ readonly White: "white"; /** * The color WhiteSmoke. */ readonly WhiteSmoke: "whiteSmoke"; /** * The color Yellow. */ readonly Yellow: "yellow"; /** * The color YellowGreen. */ readonly YellowGreen: "yellowGreen"; /** * The system-defined color of the face of a button. */ readonly ButtonFace: "buttonFace"; /** * The system-defined color of the highlight of a button. */ readonly ButtonHighlight: "buttonHighlight"; /** * The system-defined color of the shadow of a button. */ readonly ButtonShadow: "buttonShadow"; /** * The system-defined color of the gradient active caption. */ readonly GradientActiveCaption: "gradientActiveCaption"; /** * The system-defined color of the gradient inactive caption. */ readonly GradientInactiveCaption: "gradientInactiveCaption"; /** * The system-defined color of the menu bar. */ readonly MenuBar: "menuBar"; /** * The system-defined color of the menu highlight. */ readonly MenuHighlight: "menuHighlight"; }; type Named = typeof Named[keyof typeof Named]; /** * Represents predefined colors from a color scheme, used in document themes. */ const Scheme: { /** * Background color 1. */ readonly Bg1: "bg1"; /** * Background color 2. */ readonly Bg2: "bg2"; /** * Text color 1. */ readonly Tx1: "tx1"; /** * Text color 2. */ readonly Tx2: "tx2"; /** * Accent color 1. */ readonly Accent1: "accent1"; /** * Accent color 2. */ readonly Accent2: "accent2"; /** * Accent color 3. */ readonly Accent3: "accent3"; /** * Accent color 4. */ readonly Accent4: "accent4"; /** * Accent color 5. */ readonly Accent5: "accent5"; /** * Accent color 6. */ readonly Accent6: "accent6"; /** * Hyperlink color. */ readonly Hlink: "hlink"; /** * Followed hyperlink color. */ readonly FolHlink: "folHlink"; }; type Scheme = typeof Scheme[keyof typeof Scheme]; /** * Indicates the Color Type used. */ const Type: { readonly Scheme: "scheme"; readonly Named: "named"; readonly Index: "index"; readonly HSL: "hsl"; readonly RGB: "rgb"; readonly LRGB: "lrgb"; readonly Hex: "hex"; }; type Type = typeof Type[keyof typeof Type]; } } declare module "color/_BuiltInIndexDefs" { import { ColorSpace } from "color/ColorSpace"; /** @internal */ export const _BuiltInIndexDefs: (index: number) => ColorSpace.RGBA; } declare module "color/_BuiltInNamedDefs" { /** * Preset colors defined in DrawingML aka known/system colors * * @see * * {@link https://msdn.microsoft.com/library/system.drawing.knowncolor.aspx | KnownColor Enumeration} * * {@link https://msdn.microsoft.com/library/system.windows.media.colors.aspx | Colors Class} */ type RGBA = { r: number; g: number; b: number; a?: number; }; type ColorMapping = { id: number; name: string; rgbaColor: RGBA; system: boolean; }; class NamedDefLookup { _lookupByName: Map<string, ColorMapping>; constructor(); valueOfName(name: string): ColorMapping; } export const _BuiltInNamedDefs: NamedDefLookup; } declare module "color/_BuiltInSchemeDefs" { import { IColor } from "color/IColor"; export type SchemeDef = { scheme: string | IColor.Scheme; description: string; }; export const _BuiltInSchemeDefs: (scheme: string) => SchemeDef | null; } declare module "color/Color" { import { ColorSpace } from "color/ColorSpace"; import { IColor } from "color/IColor"; /** * Capabilities for working with {@link IColor | colors}. * * Advanced color customization and compatibility with CSS and Office color schemes. * * Key features include: * - Accessing a collection of built-in colors (Named, Scheme, Index). * - Creating customized colors with color adjustments. * - Defining and and converting between different color models (RGB, HEX, HSL). * * @see * {@link IColor} */ export class Color implements IColor { private _private; constructor(value: string | IColor | IColor.Definition, schemeLookup?: IColor.SchemeLookup, indexedLookup?: IColor.IndexedLookup, last?: ColorSpace.RGBA); private _parse; private _forceDark; private _resolve; /** * @hidden * TODO - Rationalize this. Do we want a constructor a static parse? */ static parse(input: string | IColor, schemeLookup?: IColor.SchemeLookup, indexedLookup?: IColor.IndexedLookup, last?: ColorSpace.RGBA): IColor | null; /** * Returns the default color scheme lookup that Colors will use if none is provided. */ static getDefaultSchemeLookup(): IColor.SchemeLookup; /** {@inheritDoc IColor.isEqual} */ isEqual(other: any): boolean; /** {@inheritDoc IColor.getVal} */ getVal(): string; /** {@inheritDoc IColor.getAdjustments} */ getAdjustments(): readonly IColor.Adjustment[]; /** {@inheritDoc IColor.adjust} */ adjust(adjustments: IColor.Adjustment[]): IColor; /** {@inheritDoc IColor.getType} */ getType(): IColor.Type; /** {@inheritDoc IColor.toCSS} */ toCSS(darkMode?: boolean, alpha?: boolean): string; /** {@inheritDoc IColor.toRGBA} */ toRGBA(darkMode?: boolean): IColor.ISpace.RGBA; /** {@inheritDoc IColor.toHSLA} */ toHSLA(darkMode?: boolean): IColor.ISpace.HSLA; /** {@inheritDoc IColor.toHex} */ toHex(darkMode?: boolean): IColor.ISpace.HEX; /** {@inheritDoc IColor.toBlackOrWhite} */ toBlackOrWhite(darkMode?: boolean, threshold?: number): IColor; get [Symbol.toStringTag](): string; /** {@inheritDoc IColor.toString} */ toString(): string; /** {@inheritDoc IColor.isIColor} */ get isIColor(): true; } } declare module "color/index" { export * from "color/IColor"; export * from "color/Color"; } declare module "type/ITypes" { import type { RunCoords, Bounds, RangeCoords } from '@sheetxl/utils'; /** * A collection of types. */ export namespace ITypes { /** * Associate an optional value with a {@link RangeCoords}. */ interface RangeCoordValue<T = any> extends RangeCoords { value?: T; } /** * Associate an option value with a {@link RunCoords}. */ interface RunCoordValue<T> extends RunCoords { value?: T; } /** * Associate an option value with a {@link Bounds}. */ interface BoundsValue<T = any> extends Bounds { value?: T; } /** * Options for controlling selection behavior, including scrolling and focus. */ interface SelectOptions { /** * If `true` or if a valid `ScrollIntoViewOptions` object is provided, * the selected element will be scrolled into view. * * @remarks * - If a `ScrollIntoViewOptions` object is provided, it will control the exact scrolling behavior. * - If `false` (or omitted), the selected element will not be scrolled into view. * * @defaultValue false */ scrollIntoView?: globalThis.ScrollIntoViewOptions | boolean; /** * If `true`, the selected element will automatically receive focus after being selected. * * @remarks * - If `false` (or omitted), the element will not automatically receive focus. * * @defaultValue false */ autoFocus?: boolean; } } } declare module "type/IProperties" { import type { Scalar, IRange } from '@sheetxl/primitives'; /** * Contains interfaces for working with properties. */ export namespace IProperties { /** * Represents an interface for ranged items with customizable properties, * supporting operations such as retrieving properties at a given coordinate, * cloning with updates, splitting, and merging. * * @typeParam P - The type representing the properties associated with the range. * @typeParam J - The type representing the JSON-serializable representation of the range. */ interface ICellRanged<P> { /** * Retrieves the coordinates for the range. * * @returns The range's coordinates. * * @remarks * The coordinates are not the coordinates where this is contained but the coordinates for access getPropertiesAt. */ getCoords(): Readonly<IRange.Coords>; /** * Retrieves the properties associated with a specified cell within the range. * * @param rowIndex The row index within the range. * @param colIndex The column index within the range. * @param value The value at the coordinates. * @returns The properties associated with the specified cell as a read-only object. */ getPropertiesAt(rowIndex: number, colIndex: number, value: Scalar): Readonly<P>; /** * Creates a new instance of the range with specified updates applied. * * @param updates The updates to apply to the range's properties. * @returns A new `ICellRanged` instance with the applied updates. */ cloneWithUpdate?(updates: IProperties.ResolvableProperties<P>): this; } /** * Recursively converts a type into a derived type where any field can be a string or a function that takes the old value. */ type ResolvableProperties<T> = Partial<{ [Property in keyof T]: T[Property] | string | null | ResolvableProperties<T[Property]>; }>; } } declare module "type/ICollection" { import type { JSONSerializableAsync } from '@sheetxl/utils'; import type { IListener } from "listener/index"; /** * Interface used for all ICollections. */ export interface ICollection<T, O = ICollection.GetItemsOptions> { /** * Returns the items in the collection. */ getItems(options?: ICollection.GetItemsOptions): T[]; /** * Returns the total items available. * * @remarks * Useful as a quick escape for getItems. */ getCount(): number; } /** * {@inheritDoc ICollection} * @see * ### **Interface** * * {@link ICollection} */ export namespace ICollection { /** * Options for getting items from the collection. * * @remarks * This placeholder is extended by implementations of ICollection */ interface GetItemsOptions { } /** * Collection that can be persisted. */ interface IPersistable<J = any> { /** * Used for saving items. Returns a handler that will allow for writing JSON records * only save the items that were accessed within the persist scope. */ beginPersist(): ICollection.IPersistScope<J>; } /** * A transient scope for items to ids that can be used for references. * * @see * {@link IPersistable.beginPersist} */ interf