import { AnchorLocation } from '@sheetxl/utils'; import { Bounds } from '@sheetxl/utils'; import { CellEditorProps } from '@sheetxl/grid-react'; import { CellRendererProps } from '@sheetxl/grid-react'; import { CommandButtonProps } from '@sheetxl/utils-react'; import { Context } from 'react'; import { CopyPasteProps } from '@sheetxl/utils-react'; import { CopyPasteResults } from '@sheetxl/utils-react'; import { default as default_2 } from 'react'; import { EditState } from '@sheetxl/grid-react'; import { FocusWindowOptions } from '@sheetxl/utils-react'; import { FrozenEdge } from '@sheetxl/grid-react'; import { GridProps } from '@sheetxl/grid-react'; import { GridStyle } from '@sheetxl/grid-react'; import { GridSurfaceStyle } from '@sheetxl/grid-react'; import { IAutoFilter } from '@sheetxl/sdk'; import { IBorder } from '@sheetxl/sdk'; import { ICell } from '@sheetxl/sdk'; import { ICellEditorElement } from '@sheetxl/grid-react'; import { ICellLayout } from '@sheetxl/utils-react'; import { ICellRange } from '@sheetxl/sdk'; import { ICellRanges } from '@sheetxl/sdk'; import { IChart } from '@sheetxl/sdk'; import { IColor } from '@sheetxl/sdk'; import { ICommand } from '@sheetxl/utils-react'; import { ICommands } from '@sheetxl/utils-react'; import { IFunction } from '@sheetxl/sdk'; import { IGridElement } from '@sheetxl/grid-react'; import { IGridView } from '@sheetxl/grid-react'; import { IListener } from '@sheetxl/sdk'; import { IModule } from '@sheetxl/sdk'; import { IMovable } from '@sheetxl/sdk'; import { IMovableCollection } from '@sheetxl/sdk'; import { IMovableSelection } from '@sheetxl/sdk'; import { INamedCollection } from '@sheetxl/sdk'; import { IPicture } from '@sheetxl/sdk'; import { IRange } from '@sheetxl/sdk'; import { IScript } from '@sheetxl/sdk'; import { IScrollbarElement } from '@sheetxl/utils-react'; import { ISheet } from '@sheetxl/sdk'; import { ISheetHeader } from '@sheetxl/sdk'; import { ISheetView } from '@sheetxl/sdk'; import { IShowToolTipProperties } from '@sheetxl/utils-react'; import { IStyle } from '@sheetxl/sdk'; import { IStyleCollection } from '@sheetxl/sdk'; import { ITable } from '@sheetxl/sdk'; import { ITheme } from '@sheetxl/sdk'; import { IThemeCollection } from '@sheetxl/sdk'; import { ITransaction } from '@sheetxl/sdk'; import { IWorkbook } from '@sheetxl/sdk'; import { JSX } from 'react/jsx-runtime'; import { LicenseDetails } from '@sheetxl/sdk'; import { LicenseManager } from '@sheetxl/sdk'; import { ReactNode } from 'react'; import { ReferenceableClipboard } from '@sheetxl/utils'; import { RemoveListener } from '@sheetxl/utils'; import { ScrollableViewport } from '@sheetxl/utils-react'; import { ScrollbarOrientation } from '@sheetxl/utils-react'; import { ScrollButtonProps } from '@sheetxl/utils-react'; import { ScrollPaneProps } from '@sheetxl/utils-react'; import { SelectionProps } from '@sheetxl/grid-react'; import { SelectionResults } from '@sheetxl/grid-react'; import { StartEditEvent } from '@sheetxl/grid-react'; import { TopLeft } from '@sheetxl/utils'; import { VirtualScrollbarProps } from '@sheetxl/utils-react'; export declare interface ActivateFrameOptions { /** * If not provided then will drive autoFocus */ autoFocus?: boolean | string | FocusWindowOptions; } declare interface Border { readonly darkMode: boolean; readonly autoColor: IColor; readonly autoStyle: IBorder.StrokeStyle; readonly quickBorder: Partial; readonly schemeLookup: IColor.SchemeLookup; createTemporaryBorder: (update: IBorder.Properties) => IBorder; onBorderSelect: (border: Partial) => void; } export declare interface BorderOverlayProps { /** * Returns a list of visible cells. * * @param view - {@link IGridView} * @returns An array of visible coords */ getVisibleCells: (view: IGridView) => ({ coords: ICell.Coords; value?: any; range?: IRange.Coords; })[]; /** * For finding the border. The value is the value returned from getVisibleCells and the index is the index found. * * @param value - ? * @param index - ? * @returns The IBorder at the location. */ getBorderAt: (value: any, index: number) => IBorder; /** * Allow users to customize border rendering. * Note - This is wrapped in a single SVG so must be an SVG Element type (like a path). */ rendererBorder?: (props: BorderRenderProps) => default_2.ReactNode; defaultColor?: string; darkMode?: boolean; /** * Force all rendering to be a single border line. * Use for previews. */ forceThinBorder?: boolean; /** * A special flag to shift large borders */ shiftIfWide?: boolean; } export declare interface BorderRenderProps { stroke: IBorder.IStroke; range: IRange.Coords; points: number[]; darkMode: boolean; /** * @deprecated */ key: string; /** * Int Hint to tell the border the direction that it is rendering */ isVertical?: boolean; /** * Shift the borders if greater than 2 width */ shiftIfWide?: boolean; /** * Hint to tell render that we are rendering a small small */ forceThinBorder?: boolean; /** * Used for generating corners for wide borders. If not provided then borders will simply overlap. */ layout?: ICellLayout; /** * Used for generating corners for wide borders. If not provided then borders will simply overlap. */ intersections?: { stroke: IBorder.IStroke; range: IRange.Coords; }[]; } export declare interface BordersOverlayResults { /** * Array of functions that return components to overlay */ renderOverlay?: (view: IGridView) => default_2.ReactNode; } /* Excluded from this release type: ChartAreaIcon */ /* Excluded from this release type: ChartAreaStackedIcon */ /* Excluded from this release type: ChartAreaStackedPercentIcon */ /* Excluded from this release type: ChartBarIcon */ /* Excluded from this release type: ChartBarStackedIcon */ /* Excluded from this release type: ChartBarStackedPercentIcon */ /* Excluded from this release type: ChartBubble3DIcon */ /* Excluded from this release type: ChartBubbleIcon */ /* Excluded from this release type: ChartColumnIcon */ /* Excluded from this release type: ChartColumnStackedIcon */ /* Excluded from this release type: ChartColumnStackedPercentIcon */ /** * Placeholder for chart editors. */ export declare const ChartEditor: default_2.NamedExoticComponent & default_2.RefAttributes>; export declare interface ChartEditorAttributes { isChartEditor: () => true; } export declare interface ChartEditorProps extends MovableElementProps { chart: IChart; ref?: default_2.Ref; } /* Excluded from this release type: ChartLineIcon */ /* Excluded from this release type: ChartLineMarkersIcon */ /* Excluded from this release type: ChartLineStackedIcon */ /* Excluded from this release type: ChartLineStackedMarkersIcon */ /* Excluded from this release type: ChartLineStackedPercentIcon */ /* Excluded from this release type: ChartLineStackedPercentMarkersIcon */ /* Excluded from this release type: ChartPieDoughnutIcon */ /* Excluded from this release type: ChartPieIcon */ /* Excluded from this release type: ChartScatterLinesIcon */ /* Excluded from this release type: ChartScatterLinesMarkersIcon */ /* Excluded from this release type: ChartScatterLinesMarkersSmoothIcon */ /* Excluded from this release type: ChartScatterLinesSmoothIcon */ /* Excluded from this release type: ChartScatterMarkersIcon */ /** * For providing Adjustable Color Commands additional rendering capabilities. */ declare interface Color { readonly darkMode: boolean; readonly schemeLookup: IColor.SchemeLookup; readonly autoColor: IColor; readonly quickColor?: IColor; recentColors: readonly IColor[] | (() => readonly IColor[]); addRecentColor: (color: IColor) => readonly IColor[]; clearRecentColors: () => void; onColorSelect: (color: IColor) => void; } export declare namespace CommandContext { export { Color, Border, NamedStyle, Table, Theme, NamedReference, ResizeHeaderOptions, ResizeHeaderContext, NewTable, SelectedRange, FormulaFunction, FindScopeOptions, FindReplaceOptions } } export declare const CornerTriangle: default_2.MemoExoticComponent<(props: CornerTriangleProps) => JSX.Element>; export declare interface CornerTriangleProps extends default_2.SVGProps { /** * @defaultValue AnchorLocation.TopLeft */ anchorLocation?: AnchorLocation; /** * defaults based on corner */ fill?: string; /** * The right sides of the triangle. * @defaultValue 7 */ size?: number; /** * inset within the cell * @defaultValue 1 */ inset?: number; cellWidth?: number; cellHeight?: number; darkMode?: boolean; propsPath?: default_2.SVGProps; } export declare const createCellEditStateFromCell: (clean: () => ICell, dirty?: string) => EditState<() => ICell, string>; export declare const DefaultTaskPaneRegistry: TaskPaneRegistry; export declare const DocThemesContext: Context; /** * This component takes a `themes` prop. * It makes the `themes` available down the React tree thanks to React context. * This component should preferably be used at **the root of your component tree**. */ export declare const DocThemesProvider: (props: DocThemesProviderProps) => JSX.Element; export declare interface DocThemesProviderProps { /** * A custom list of DocThemes to use. */ themes: IThemeCollection; children: default_2.ReactElement>; } export declare const EditableLabel: default_2.NamedExoticComponent & default_2.RefAttributes>; export declare interface EditableLabelAttributes { startEdit(): void; cancel(): void; } export declare interface EditableLabelProps extends Omit, "onSubmit" | "onChange"> { value?: string; styleHover?: default_2.CSSProperties; dragging?: boolean; disabled?: boolean; readOnly?: boolean; maxLength?: number; onChange?: (value: string) => void; onSubmit?: (value: string) => boolean | void; onCancel?: () => void; renderInput?: (props: any) => default_2.ReactElement; /** * Reference to the HTMLInputElement (or other) used for editing */ ref?: default_2.Ref; } export declare interface EditorStateAndCoords { sheet: ISheet; coords: ICell.Coords; editState: EditState; } /** * Placeholder for movable frames. */ export declare const EmptyFrame: default_2.NamedExoticComponent & default_2.RefAttributes>; export declare interface EmptyFrameAttributes { isEmptyFrame: () => true; } export declare interface EmptyFrameProps extends MovableElementProps { description: string; ref?: default_2.Ref; } /** * The default FilterButton */ export declare const FilterButton: (props: FilterButtonProps) => default_2.ReactElement; /** * Property for the filter button */ export declare interface FilterButtonProps extends default_2.HTMLAttributes { renderBounds: Bounds; zoom: number; disabled: boolean; darkMode: boolean; filter: IAutoFilter.IColumn; onFilterButtonMouseDown: (e: default_2.MouseEvent, filter: IAutoFilter.IColumn) => void; } /** * Used for the find/replace dialog. */ declare interface FindReplaceOptions { /** * Options for find. */ findOptions?: ICellRange.FindOptions; /** * If replacing with null then set to true. */ replace?: boolean; /** * The text to replace the found text with. */ replaceText?: string | null; /** * Options for replace. */ replaceOptions?: IWorkbook.ReplaceOptions; /** * If true the operation will signal to the ui container to * autoFocus. * * @remarks * For replaceAll this is ignored. */ autoFocus?: boolean; /** * Default value 'Sheet' */ scope?: FindScopeOptions; } declare const FindScopeOptions: { /** * Search the entire workbook */ readonly Workbook: "workbook"; /** * Search the current sheet or range */ readonly Sheet: "sheet"; }; declare type FindScopeOptions = typeof FindScopeOptions[keyof typeof FindScopeOptions]; declare interface FormulaFunction { searchByCategory: (category: string) => Promise; } export declare interface IChartEditorElement extends HTMLDivElement, ChartEditorAttributes { } /** * Type returned via ref property */ export declare interface IEditableLabelElement extends HTMLDivElement, EditableLabelAttributes { } export declare interface IEmptyFrameElement extends HTMLDivElement, EmptyFrameAttributes { } export declare interface IFrame { addListener: (listener: IFrameContainerListener) => RemoveListener; close: () => void; focus: (options?: FocusWindowOptions) => void; } export declare interface IFrameContainerListener { onShow?: () => void; onBeforeHide?: () => void | Promise; onHide?: () => void; } export declare interface IMovableAreaElement extends HTMLDivElement, MovableAreaAttributes { } export declare interface IPictureEditorAttributes { isPictureEditor: () => true; } export declare interface IPictureEditorElement extends HTMLDivElement, IPictureEditorAttributes { } /** * Used by the Script editor to interface with the repo for the Scripts */ export declare namespace IScriptEditor { /** * This is used by the Monaco Script editor and the command manager to enabled scripts to be * execute and saved. */ export interface Context { /** * Add listeners to the container. * * @remarks * If this throws a listener save will be aborted. */ addContainerListener(listener: IScriptEditor.ContainerListener): IListener.Remove; /** * Set by the script editor when a function is selected. This may be null. */ setSelectedFunction(selected: Promise): void; /** * Set by the script editor when a function is selected. This may be null. */ quickInsertFunction(functionName: string): void; /** * Return the selected. * * @remarks * This is done because multiple clients share the same Context. */ getSelectedFunction: () => Promise | null; /** * The the script editor. */ setEditor(editor: IScriptEditor.Editor): void; /** * Returns the script editor. * * @remarks * If the editor is not loaded this will return null. */ getEditor: () => IScriptEditor.Editor | null; /** * Decode a range from an address. Will return null if unable to decode. * * @remarks * Used by the tooltips and range highlighting. */ getRanges: (address: IWorkbook.RangesAddress) => ICellRanges | null; /** * Returns the IFunctionDescriptor Executable. * * @remarks * This is used to enable the UI to display the available functions. */ getScripts(): IScript; /** * Save the source. * * @param source The source to save. */ saveSource(source: string): Promise; } export interface ContainerListener { /** * Hook to listen for save events. */ onBeforeSave?: () => Promise | void; /** * If the status of the script has changed. */ onReadonlyChange?: () => void; /** * If the script has changed. */ onScriptChange?: () => void; } /** * Implemented by the editor to allow for ui interactions. */ export interface Editor { /** * Insert a snippet of text into the editor. * * @remarks * Inserts the snippet before the current function. */ insertSnippet: (snippet: string) => void; /** * Closes the editor. * @returns A promise that resolves when the editor is closed. */ close: () => Promise; } /** * The current function that is selected. */ export interface SelectedFunction { /** * The selected function. */ name: string; /** * Needed for JIT. */ source: string; } /** * Provides status of the editor. */ export interface Status { /** * The message to display. */ message: string; /** * The cursor position. */ cursor: string; /** * If the script is unsaved. */ dirty: boolean; } } /** * Type returned via ref property */ export declare interface IScriptEditorElement extends ScriptEditorAttributes, HTMLDivElement { } /** * Attributes and methods available on the sheet element beyond the HTMLDivElement. */ export declare type ISheetAttributes = { getGridElement: () => IGridElement; getRowHeaderElement: () => ISheetHeaderElement; getColumnHeaderElement: () => ISheetHeaderElement; rowHeaderHeight: () => number; colHeaderWidth: () => number; startEdit(event?: StartEditEvent): void; submitEdit(): void; cancelEdit(): void; isEditing: boolean; contains(element: Node | null): boolean; invalidate: (coords?: ICell.Coords | null) => void; /** * Focus the sheet */ focusSheet(options?: FocusOptions): void; /** * Focus a specific float. * If not provided will focus the first selected float. * * @remarks * The focusMovable does not scroll. * TODO - have this honor focus scroll options. */ focusMovable(movable?: IMovable): Promise; getSheet: () => ISheet; /** * For runtime introspection */ isSheetElement: () => true; }; /** * Type returned via ref property */ export declare interface ISheetElement extends HTMLDivElement, ISheetAttributes { } declare type ISheetHeaderAttributes = { forceRender: () => void; getGridElement: () => IGridElement; }; /** * Type returned via ref property */ declare interface ISheetHeaderElement extends HTMLDivElement, ISheetHeaderAttributes { } export declare interface ITaskPaneArea { /** * This will show and focus a task pane by key. * @param key The task pane key. */ activateTaskPane: (key: string, options?: ActivateFrameOptions) => void; } export declare interface ITaskPaneAreaElement extends HTMLDivElement, ITaskPaneArea { } export declare interface ITaskPaneRegistry { /** * Registers a task pane container. * @param entry The task pane entry. * @param replace Whether to replace an existing task pane. Default is false. */ registerTaskPane(entry: TaskPaneEntry, replace?: boolean): void; /** * Unregister a task pane container. * * @param key The unique key for the task pane. */ unregisterTaskPane(key: string): void; /** * Gets a registered task pane container. * * @param key The unique key for the task pane. * @returns The registered task pane or null if not found. */ getRegisteredTaskPane(key: string): TaskPaneEntry | null; /** * Finds contributions for a specific entry. * @param contributionKey */ findContributions(contributionKey: string): TaskPaneEntry[]; } export declare interface ITaskPaneStrip extends HTMLDivElement, TaskPaneStripAttributes { } export { LicenseDetails } export { LicenseManager } export declare const LogoNoPaddingIcon: (props: default_2.SVGProps) => JSX.Element; /* Excluded from this release type: LogoTextNoPaddingIcon */ export declare interface ModalFrame extends IFrame { onCancel?: () => void; onDone?: (results?: any) => void; } export declare const MovableArea: default_2.NamedExoticComponent & default_2.RefAttributes>; export declare interface MovableAreaAttributes { /** * Will put focus on the the movable object. * @remarks * This does not handle scrolling. This must be done by the virtual container. */ focusMovable: (movable: IMovable) => Promise; /** * For runtime introspection. */ isMovableArea: () => true; } export declare interface MovableAreaProps extends default_2.HTMLAttributes { /** * The container to retrieve movable objects */ movables: IMovableCollection; /** * The container view to retrieve selection information about the movables. */ movablesView: IMovableSelection; /** * Callback to render the movable. * * @param props MovableElementProps * @returns A React Element representing the IMovable. */ renderMovable: (props: MovableElementProps) => default_2.ReactElement; /** * The gridView */ view: IGridView; /** * If provided this will be used start and stop transactions on being/end move. */ transactional: ITransaction.ITransactional; /** * Called when the final movable is unselected. */ onUnFocus?: () => void; /** * Called when the final movable is unselected. */ onFocus?: () => void; /** * If disabled then movable selection will not be allowed and frames will be passed disabled. * @defaultValue false */ disabled?: boolean; /** * If disabled then unable to move. * @defaultValue false */ disableDrag?: boolean; /** * If disabled then unable to resize. * @defaultValue false */ disableResize?: boolean; /** * Provider the anchor element to render. */ renderDirections?: string[]; /** * Called after the first render of a movable. */ onFirstRender?: () => void; /** * Forwards the ref to the underlying element. */ ref?: default_2.Ref; } export declare interface MovableElementProps extends React.HTMLAttributes { movable?: IMovable; /** * The view to use for the movable. * // TODO - this should not be the IGridView, rather a simpler interface that doesn't have a grid dependency. */ view: IGridView; /** * Called when the movable is hidden from view. * * @remarks * * If this returns a false the movable will not be unmounted but will * still have a style opacity property of 0 (and pointerEvents of none). * * Keeping a movable mounted is useful for elements that take a long of time to render but * increase the memory footprint of the application. */ onHide: (hide: (movable: IMovable) => boolean | Promise | void) => void; /** * Call when the movable is returned to the view. */ onShow: (show: (movable: IMovable) => void) => void; /** * If true then the component is disabled. * @defaultValue false * @remarks * To see if an element is readonly check the IMovable.isProtected() method. */ disabled?: boolean; /** * Indicator for dragging. * @defaultValue false */ isDragging?: boolean; } declare interface NamedReference { /** used when creating new names */ selection: () => ICellRanges; getNames: () => INamedCollection; } declare interface NamedStyle { readonly named: () => IStyle.INamed; readonly styles: () => IStyleCollection; readonly bodyStyle: () => GridSurfaceStyle; createTemporaryCell: (update: ICell.Update) => ICell; } declare interface NewTable { ranges: ICellRanges; hasHeader?: boolean; } export declare const PictureEditor: default_2.NamedExoticComponent & default_2.RefAttributes>; export declare interface PictureEditorProps extends MovableElementProps { /** * The underlying model for the picture. */ picture: IPicture; /** * Usable for alt text or loading */ description?: string; /** * Provide an optional loading panel. */ loadingPanel?: default_2.ReactNode; /** * Ref for the Element. */ ref?: default_2.Ref; } export declare interface RangeContainer { getRange(address: ICellRange.Address, options?: ICellRange.GetRangeOptions): ICellRange; } declare interface ResizeHeaderContext { getOrientation(): IRange.Orientation; getUnitText(): string; toUnits?(value: number): number; toPixels?(value: number): number; } declare interface ResizeHeaderOptions { size: number; unit?: string; } /** * This tracks the selection of the sheet and * updates the a named range editor and a sheet cell editor. */ export declare const ScriptEditor: default_2.FC; export declare type ScriptEditorAttribute = { ref?: default_2.Ref; }; export declare interface ScriptEditorAttributes { getEditor(): IScriptEditor.Editor; isScriptEditorElement(): true; close(): void; } /** * Move this to another project. Automation-Editor */ export declare interface ScriptEditorProps extends default_2.HTMLAttributes { /** * Command Map */ commands?: ICommands.IGroup; /** * If the values can be modified */ readOnly?: boolean; /** * Handle to the frame */ frame?: IFrame; /** * Allows for component to be autoFocused. */ /** * If provided then a custom loading panel will be used. */ loadingPanel?: default_2.ReactElement; /** * Called for status change events. */ onStatusChange?: (status: Partial) => void; /** * Monaco theme */ darkMode?: boolean; } declare interface SelectedRange { range: ICellRange; cell?: ICell.Address; } /** * SheetCellEditor * Controlled cell editor for updating state. */ export declare const SheetCellEditor: default_2.NamedExoticComponent & default_2.RefAttributes>; export declare interface SheetCellEditorProps extends CellEditorProps<() => ICell, string> { /** * Used for commands will be removed. */ sheet?: ISheet; /** * Used for commands will be removed. */ activeCoords?: ICell.Coords | null; /** * The parent commandGroup */ commands?: ICommands.IGroup; /** * Styling for the grid that this editor is one. * This is used to determine darkMode only but should be used for other items.. */ bodyStyle?: GridSurfaceStyle; /** * Returns the number of lines to display. The minimum is 1. * @defaultValue 'The number of lines required to display the text' */ linesVisible?: number; } /** * CellRender that has advanced rendering for an ICell. * Some of the features are: * 1. Fill (Solid, Gradient, Pattern) * 2. Horizontal Alignment (Left, Right, Center, Justify) * 3. Vertical Alignment (Top, Middle, Bottom) * 4. Spacing formatting (*, ?) * 5. Decimal rounding * 6. Overflow Character * 7. Text Wrapping * 8. Text Rotation * 8. Indentions * 9. Text Color * 10. Underline (Accounting, Standard, Double, Single) * 11. Scaling * 12. Super/Subscript * 13. Indicators (Warning, Comments, Error, etc) * 14. Filter buttons * 15. Formulas * * @param props */ export declare const SheetCellRenderer: default_2.FC; export declare interface SheetCellRendererProps extends CellRendererProps { /** * If true, prefer to show the formulas over values */ showFormulas?: boolean; /** * If true, show zero values */ showZeros?: boolean; /** * Ability to query the theme colors. * Note - There are also css variables that can be used to style using doc theme colors * @see https://www.sheetxl.com/docs */ docTheme?: ITheme; /** * Generalize application theming. The docTheme is a specific theme for the sheet. */ bodyStyle?: GridSurfaceStyle; /** * An optimization that tells the render all of the styling is normal. And doesn't need to * be overwritten. */ normalStyle?: IStyle; /** * Callback for when a link has been clicked. * * @param event - The mouse event */ onLinkMouseDown?: (event: default_2.MouseEvent) => void; /** * Callback for when a filter has been clicked. * * @param event - The mouse event */ onFilterButtonMouseDown?: (event: default_2.MouseEvent, filter: IAutoFilter.IColumn) => void; /** * Custom properties for the filter button */ propsFilterButton?: FilterButtonProps; /** * Callback for creating a custom filter button. * * @returns A React Element representing the FilterButton. */ renderFilterButton?: (props: FilterButtonProps) => default_2.ReactElement; } export declare interface SheetCopyPasteProps extends Omit { /** * Sheet element */ element: () => HTMLElement; sheet: ISheet; sheetView: ISheetView; /** * Allow users to customize selected cells design */ renderSelection?: (props: SelectionProps) => default_2.ReactNode; /** * Color for the foreground */ copyForegroundColor?: string; cutForegroundColor?: string; /** * Color for the background */ copyBackgroundColor?: string; cutBackgroundColor?: string; } export declare interface SheetCopyPasteResults extends CopyPasteResults { /** * Array of functions that return components to overlay */ overlays?: (view: IGridView) => default_2.ReactNode[]; } /** * @see ISheet * * UI representation for ISheet. * */ export declare const SheetElement: default_2.NamedExoticComponent & default_2.RefAttributes>; /** * TODO - We may not need the grid ref if we use the headers directly to measure. */ declare interface SheetHeaderProps extends default_2.HTMLAttributes { /** * The underlying data model for the SheetHeader. */ sheetHeader: ISheetHeader; /** * Access grid functions */ gridRef: default_2.RefObject; /** * Allow the sheet to be accessed. */ sheetElement: ISheetElement; /** * The height or width in the opposite direction (for example a column headers height) */ oppositeSize: number; containerWidth: number; containerHeight: number; /** * FrozenEdge */ freezeStart?: number | FrozenEdge; /** * Parent commands for the sheet */ commands?: ICommands.IGroup; /** * The selectionResults from use hook */ selectionMain?: SelectionResults; gridStyle?: GridStyle; /** * @see HeaderRenderer#verticalPadding */ verticalPadding?: number; /** * @see HeaderRenderer#horizontalPadding */ horizontalPadding?: number; /** Fired when a contentMenu is requested */ onSheetContextMenu?: (location: SheetLocation) => void; onResizeHeadersStart?: (index: number, prevSize: number, description: string) => void; /** * Called during resize of a header. * If there is a negative newSize then these headers will have been hidden * This is for the specific header being resized. * Note - Other headers may also have been resized if hiding */ onResizeHeaders?: (index: number, newSize: number, prevSize: number) => void; /** * Called after resize of a header. * If there is a positive newSize and a single selection then those * headers will also have been resized. * * Note - Other colHeaderRuns may also have been resized if expanding * Note - If this was autoFit then newSize and prevSize will be null. */ onResizeHeadersEnd?: (index: number, newSize: number, description: string) => void; onResizeHeadersDown?: (index: number, size: number) => void; onResizeHeadersUp?: (index: number) => void; /** * Override the default headerText. If not provided then typical Sheet labeling is used. */ headerText?: (index: number) => string; /** * Scroll location */ scrollPoint?: Partial; /** * Callback when selection is manually started */ onSelectionStart?: () => void; /** * Callback when selection is manually changed */ onSelectionEnd?: () => void; /** * Ref for the HTMLDivElement */ ref?: default_2.Ref; } export declare interface SheetLocation { clientX: number; clientY: number; originalEvent?: any; clientWidth?: number; clientHeight?: number; rowIndex?: number; colIndex?: number; } export declare interface SheetPasteOptions extends ReferenceableClipboard.PasteOptions, ICellRange.CopyOptions { } /** * Props for the SheetElement component. */ export declare interface SheetProps extends React.HTMLAttributes { /** * The `ISheet` to render. */ sheet: ISheet; /** * Style used for grid */ gridStyle?: GridStyle; /** * Style used for headers */ headersStyle?: GridStyle; /** * Show the row headers */ showRowHeaders?: boolean; /** * Properties for the row headers */ propsRowHeader?: Partial; /** * Show the column headers */ showColumnHeaders?: boolean; /** * Properties for the column headers */ propsColumnHeader?: Partial; /** * Show the scrollbars */ showScrollbars?: boolean; /** * Allow for customizations of scrollbar */ propsScrollPane?: ScrollPaneProps; /** * Fired when the view port changes. * This is in pixel coordinates and slightly different then viewable cells because off screen location bounds could change */ onViewportChange?: (view: ScrollableViewport) => void; /** * Fire when a contentMenu is requested */ onSheetContextMenu?: (location: SheetLocation) => void; /** * Called once when the sheet has been loaded but before it is rendered. */ onElementLoad?: () => void; /** * Inject custom editors based on a cell. * This should not return null but rather can canEdit. * This is called during placement after scrolling and other bookkeeping has occurred */ getCellEditor?: (props: CellEditorProps<() => ICell, string>, coords: ICell.Coords) => React.ReactElement ICell, string>>; /** * Parent commands for the sheet */ commands?: ICommands.IGroup; /** * Notify that there is a new repeatable command */ onRepeatCommandChange?: (command: ICommand) => void; /** * Fixed component that is layered within the viewport. * * @remarks Useful for dialogs and items that you want to place relative to the grid. */ viewportComponent?: React.ReactNode; /** * Render components for movable elements. * * @param props - {@link MovableElementProps} * @returns A React Element representing the IMovable. */ renderMovable?: (props: MovableElementProps) => React.ReactElement; /** * Render an element directly onto a gridView. */ overlays?: ((view: IGridView) => React.ReactNode)[]; /** * To show the tooltip * * @param props */ onShowTooltip?: (props: IShowToolTipProperties) => void; onShowColumnTooltip?: (props: IShowToolTipProperties) => void; onShowRowTooltip?: (props: IShowToolTipProperties) => void; onCloseTooltip?: () => void; /** * Customize the grid. * * @remarks * Not all props are passed through. */ propsGrid?: GridProps; /** * Allow for custom rendering of cell props. * * @remarks * This is used to customize filterButton popup action and any other customizations desired. * This does not invalidate the rendering */ propsCellRender?: Partial; /** * Ref to the sheet element. */ ref?: React.Ref; } export declare const SheetScrollbar: default_2.NamedExoticComponent & default_2.RefAttributes>; export declare interface SheetScrollbarProps extends VirtualScrollbarProps { /** * The `ISheet` for the given scrollbar. */ sheet: ISheet; /** * The direction of the scrollbar. */ orientation: ScrollbarOrientation; /** * @defaultValue false */ showCustomScrollButtons?: boolean; /** * To show the tooltip * @param properties */ onShowTooltip?: (properties: IShowToolTipProperties) => void; /** * Called to close the tooltip. Required is onShowTip is provided */ onCloseTooltip?: () => void; } /** * Render a grid border using a border property as an input. Useful * when wanting to render either a single cell or a border template. * All cells are the same height/width. */ export declare const StaticBorderRenderer: default_2.MemoExoticComponent<(props: StaticBorderRendererProps) => JSX.Element>; export declare interface StaticBorderRendererProps extends default_2.HTMLAttributes { /** * Returns a border for the given value and index. */ getBorderAt?: (value: any, index: number) => IBorder; rowCount?: number; columnCount?: number; /** * Allow for the border width to be set. * If this is not set then the border width will be the same as the cell size. * Note - Measuring the child will need to wait until a render which can cause a flicker * @defaultValue childSize */ width?: number; /** * Allow for the border height to be set. * If this is not set then the border width will be the same as the cell size. * Note - Measuring the child will need to wait until a render which can cause a flicker * @defaultValue childSize */ height?: number; darkMode?: boolean; forceThinBorder?: boolean; } export declare const StyledStrokePath: (props: StyledStrokePathProps) => default_2.ReactElement; export declare interface StyledStrokePathProps extends default_2.SVGProps { dashArray?: number[]; isDouble?: boolean; isAngled?: boolean; dashArrayAdditional?: number[]; length?: number; width?: number; offsetX?: number; offsetY?: number; isVertical?: boolean; } export declare const Tab: default_2.NamedExoticComponent>; declare interface Table { readonly table: () => ITable; readonly styles: () => IStyleCollection; readonly bodyStyle: () => GridSurfaceStyle; /** * Need so that we can add the table to the names. */ getNames: () => INamedCollection; } export declare interface TabProps extends Omit, "onSubmit" | "onChange"> { value: any; index: number; editing: boolean; editable: boolean; disabled: boolean; selectedIndex: number; background: string; activeColor?: IColor; borderColor?: string | IColor; borderWidth?: number; dragging: boolean; } /** * TabStrip component for displaying and managing tabs. */ export declare const TabStrip: default_2.NamedExoticComponent>; export declare interface TabStripProps extends Omit, "onSubmit" | "onChange"> { selectedTabIndex: number; tabNames: string[]; onSelectedTabIndexChange?: (index: number) => void; onTabNameChange?: (index: number, tabName: string) => void; onTabMove?: (indexFrom: number, indexTo: number) => void; renderScrollButtonStart?: (props: ScrollButtonProps) => default_2.ReactElement; renderScrollButtonEnd?: (props: ScrollButtonProps) => default_2.ReactElement; renderScrollButtonEdge?: (props: ScrollButtonProps) => default_2.ReactElement; renderTabButton?: (props: TabProps) => default_2.ReactElement; renderTabDivider?: (props: default_2.HTMLAttributes & default_2.Attributes) => default_2.ReactElement; propsEditLabel?: EditableLabelProps; disabled?: boolean; disableDrag?: boolean; /** * Default background color of tabs */ background?: string; /** * Currently '2022' css does not allow for scrollPanes to be hidden in one axis and overflow in another. * To support tab scrolling and create a visual notch for the selected tab * We create a border/divider for all elements except the selected. */ borderWidth?: number; borderColor?: string; activeColor?: IColor; } export declare interface TabStripRef extends HTMLDivElement { startEdit(index: number): void; cancel(index: number): void; } /** * The TaskPaneArea is a React component that renders multiple task panes. * * Container component implements 2 interfaces. If * implements the ITaskPaneArea interface to be given to the TaskPaneProvider * and it implement the ITaskPaneParent to be given to the TaskPane component. * This provides a simple implementation but can be swapped out later. */ export declare const TaskPaneArea: default_2.NamedExoticComponent, "ref"> & default_2.RefAttributes>; export declare interface TaskPaneAreaProps extends default_2.HTMLAttributes { /** * The model to pass to taskpane */ model?: T; /** * The commands to use for the toolbar. */ commands?: ICommands.IGroup; /** * Called when the task pane is should open. * * @remarks * This is called when the first task pane is activated but it does not actually open. */ onOpen?: () => void; /** * Called when the task pane is closed. * * @remarks * This is called when the last task pane is deactivated but it does not actually close. */ onClose?: () => void; /** * Props that can be injected to pane */ propsPane?: default_2.HTMLAttributes; /** * Allows users to Wrap pane children in Top level Context */ wrapperPane?: (children: default_2.ReactNode) => default_2.ReactNode; /** * Wrap frame in a context */ wrapperFrame?: (children: default_2.ReactNode) => default_2.ReactNode; /** * Props that can be injected to the frame */ propsFrame?: default_2.HTMLAttributes; /** * Override the default title renderer. * * @remarks * If the registry also provides a custom title renderer that will be used instead. */ renderTaskPanelTitle?(props: TaskPaneTitleProps): default_2.ReactElement; /** * Override the default task pane strip renderer. * */ renderTaskPaneStrip?(props: TaskPaneStripProps): default_2.ReactElement; /** * Allow for custom registry of task panes. */ registry?: ITaskPaneRegistry; /** * If true always show the strip even with one pane. */ alwaysShowStrip?: boolean; /** * Reference to the underlying element. */ ref?: default_2.Ref; } export declare interface TaskPaneEntry { /** * The unique key for the task pane. * * @remarks * * Must not change. */ readonly key: string; /** * The command paths to use to open the task pane. * * @remarks * * Must not change. * If this is not provided the task pane can only be opened programmatically. */ readonly contributionPoints?: string[]; /** * The title to display to identify the task pane. */ getTitle(): string; /** * The icon to display to identify the task pane. * * @remarks * This can be either a string (iconKey) or a React element. */ getIcon?(): React.ReactElement | string; /** * Renders the task pane. * * @param props The props for the task pane. * @param ref The ref to the task pane container. */ renderTaskPane(props: TaskPaneProps, ref: React.Ref): React.ReactElement; /** * Optional function to render a custom title for the task pane. */ renderTaskPanelTitle?(props: TaskPaneTitleProps): React.ReactElement; createCommand?(taskPaneArea: ITaskPaneArea): ICommand; /** * Optional function to create a button that can be placed in the command bar. * * @remarks * If not provided a default button will be created. */ createCommandButton?(props: CommandButtonProps): React.ReactElement; } export declare interface TaskPaneProps { /** * The key used to register the taskPane. */ entryKey: string; model?: T; frame?: IFrame; commands?: ICommands.IGroup; } export declare const TaskPaneProvider: default_2.FC; /** * Context provider for task panes. Allows custom task pane manager * to be provided to components within the provider tree. * * ```tsx * } * onUpdateArea={(area) => { }} * > * * * ``` */ export declare interface TaskPaneProviderProps { children: ReactNode; renderArea: (props: TaskPaneAreaProps) => default_2.ReactElement; onUpdateArea: (area: default_2.ReactElement) => void; registry?: ITaskPaneRegistry; } declare class TaskPaneRegistry implements ITaskPaneRegistry { protected _taskPanes: Map; /** @inheritdoc ITaskPaneRegistry.registerTaskPane */ registerTaskPane(entry: TaskPaneEntry, replace?: boolean): void; /** @inheritdoc ITaskPaneRegistry.unregisterTaskPane */ unregisterTaskPane(key: string): void; /** @inheritdoc ITaskPaneRegistry.getRegisteredTaskPane */ getRegisteredTaskPane(key: string): TaskPaneEntry | null; findContributions(contributionKey: string): TaskPaneEntry[]; } export declare const TaskPaneStrip: default_2.NamedExoticComponent & default_2.RefAttributes>; export declare interface TaskPaneStripAttributes { isTaskPaneStrip: () => true; } export declare interface TaskPaneStripProps extends Omit, 'onSelect' | 'selected'> { taskPanes: string[]; onSelect(key: string): void; selected: string; /** * Allow for custom registry of task panes. */ registry?: ITaskPaneRegistry; /** * If true, only show icons in the strip (no text). */ iconsOnly?: boolean; /** * Ref to the task pane strip element. */ ref?: default_2.Ref; } export declare const TaskPaneTitle: default_2.NamedExoticComponent & default_2.RefAttributes>; export declare interface TaskPaneTitleProps extends Omit, 'title'> { title: default_2.ReactNode; icon: default_2.ReactNode; onClose: () => void; readOnly: boolean; /** * If the task pane is focused */ focused: boolean; /** * Reference to the underlying element. */ ref?: default_2.Ref; } declare interface Theme { readonly theme: ITheme; readonly themes: IThemeCollection; readonly darkMode: boolean; } /** * useBordersOverlay * Renders borders by combining individual cells border attributes. */ export declare const useBordersOverlay: ({ getBorderAt, rendererBorder, getVisibleCells: propGetVisibleCells, darkMode, forceThinBorder, defaultColor, shiftIfWide }: BorderOverlayProps) => BordersOverlayResults; export declare const useDocThemes: () => IThemeCollection; /** * React hook for subscribing to model-level events (workbooks, sheets, etc.). * * @template SOURCE - The model type (e.g., IWorkbook, ISheet) * @template EVENTS - The listener interface type (e.g., ISheet.IListeners) * * @param source - The model instance to listen to * @param listeners - Object containing listener callbacks for various events * @param options - Optional configuration * * @remarks * This hook automatically manages the listener lifecycle: * - Subscribes when the component mounts or `source` changes * - Unsubscribes when the component unmounts or `source` changes * - Prevents unnecessary re-subscriptions when the `listeners` object reference changes * (as long as the shape/keys remain consistent) * * By default (`fireOnModelChange: true`), all listeners are called once immediately * on mount with the current source state, allowing you to initialize component state * based on the model's current values. * * @example * ```tsx * function SheetComponent({ sheet }: { sheet: ISheet }) { * useModelListener(sheet, { * onSave(source, json) { * console.log('Sheet saved:', json); * }, * }); * * return
Sheet: {sheet.getName()}
; * } * ``` */ export declare const useModelListener: (source: IListener.ISource, listeners: IListener.Callbacks, options?: useModelListenerOptions) => void; /** * Options for `useModelListener` hook. * * @remarks * This is extends IListener.Options but removes 'once' since hooks are * evaluated on render and adds a `fireOnModelChange` option. */ export declare interface useModelListenerOptions extends Omit { /** * If `true` (default), fires all listeners once immediately when the component mounts * or when the source changes, allowing initialization based on current model state. * * @defaultValue true */ fireOnModelChange?: boolean; } /** * Hook for observing movable commands. This hook will observe a combination * of sheet events and an options selection. */ export declare const useMovableCommands: (props: useMovableCommandsOptions) => ICommands.IGroup; export declare interface useMovableCommandsOptions { commands: ICommands.IGroup; target: () => ICommand.ITarget; /** * Notify that there is a new repeatable command */ onRepeatCommandChange?: (command: ICommand) => void; /** * The collection to retrieve movable objects */ movables: IMovableCollection; /** * The view to retrieve selection information about the movables. */ movablesView: IMovableSelection; /** * If provided this will be used start and stop transactions on being/end move. */ transactional: ITransaction.ITransactional; } /** * This hook delegates to the an model that contains a getRange(address) method. * * @param model * @param listener */ export declare const useRangeListener: (model: RangeContainer, address: ICellRange.Address, listener: ICellRange.Listener, options?: useRangeListenerOptions) => void; export declare interface useRangeListenerOptions extends ICellRange.ListenerOptions { fireOnAddressChange: boolean; } /** * Hook for observing sheet commands. This hook will observe a combination * of sheet events and an options selection. * * Note - * If a sheetSelection is provided then the commands will be confirmed using the provided selections. * This is done to allow for context specific (right-click, etc) commands. * * Continue to review until we have them all. * https://www.excelcampus.com/shortcuts/#:~:text=For%20example%2C%20to%20press%20the,Then%20release%20all%20keys. (great list) * https://support.microsoft.com/en-us/office/keyboard-shortcuts-in-excel-1798d9d5-842a-42b8-9c99-9b7213f0040f * https://corporatefinanceinstitute.com/resources/excel/shortcuts/excel-shortcuts-pc-mac/ * * TODO - * Insert Bullet - Alt 7/9 while in edit mode * Ctrl+Shift+F / Ctrl+Shift+P - Open Font Dialog * CTRL+SHIFT+DELETE === cut ? (not seeing this happen) * * Formulas * Ctrl + / Select current array ? * (other formula shortcuts) */ export declare function useSheetCommands(props: useSheetCommandsOptions): ICommands.IGroup; export declare interface useSheetCommandsOptions { /** * The sheet. */ sheet: ISheet; commands: ICommands.IGroup; target: () => ICommand.ITarget; /** * Notify that there is a new repeatable command */ onRepeatCommandChange?: (command: ICommand) => void; onStartEdit?: (event: Partial) => void; bodyStyle?: GridSurfaceStyle; /** * Returns the current viewport. */ getViewport?: () => ScrollableViewport; } /** * Copy paste hook for `ISheet`. */ export declare const useSheetCopyPaste: ({ element, sheet, sheetView, commands, onClipboardUpdate: propOnClipboardUpdate, onPaste: propOnPaste, renderSelection: propRenderSelection, copyForegroundColor, cutForegroundColor, copyBackgroundColor, cutBackgroundColor, ...rest }: SheetCopyPasteProps) => SheetCopyPasteResults; /** * Hook to get the task pane manager directly. * Useful for registering new task panes or managing instances. */ export declare const useTaskPaneArea: () => ITaskPaneArea; export { }