/**----------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Range, Sheet, SpreadsheetWidget, Workbook, View } from "@progress/kendo-spreadsheet-common"; import { PreventableEvent } from "@progress/kendo-angular-common"; import { SpreadsheetComponent } from "../spreadsheet.component"; import { Rectangle } from "./cell-editor-action-args"; import { SVGIcon } from "@progress/kendo-svg-icons"; /** * Provides the event data for the Spreadsheet `change` event. */ export interface SpreadsheetChangeEvent { /** * Specifies the selected `Range` in the active sheet. */ range: Range; /** * Specifies the `SpreadsheetWidget` instance used in the Spreadsheet component. */ sender: SpreadsheetWidget; } /** * Provides the event data for the Spreadsheet `excelExport` event. */ export interface SpreadsheetExcelExportEvent { /** * Specifies the `SpreadsheetWidget` instance. */ sender: SpreadsheetWidget; /** * Specifies the Excel `Workbook` configuration object. Changes to the `Workbook` are reflected in the output Excel document. */ workbook: Workbook; /** * Prevents the Spreadsheet from saving the generated file when invoked. */ preventDefault: Function; } /** * Provides the event data for the Spreadsheet `pdfExport` event. */ export declare class SpreadsheetPDFExportEvent extends PreventableEvent { /** * Specifies the `SpreadsheetWidget` instance. */ sender: SpreadsheetWidget; /** * @hidden */ constructor(sender: SpreadsheetWidget); } /** * Provides the event data for the Spreadsheet `excelImport` event. */ export interface SpreadsheetExcelImportEvent { /** * Specifies the `SpreadsheetWidget` instance. */ sender: SpreadsheetWidget; /** * Specifies the selected file. */ file: File | Blob; /** * Prevents the Spreadsheet from loading the selected file when invoked. */ preventDefault: Function; } /** * Provides the event data for the Spreadsheet `activeSheetChange` event. */ export interface SpreadsheetActiveSheetChangeEvent { /** * Specifies the `SpreadsheetWidget` instance. */ sender: SpreadsheetWidget; /** * Specifies the new active sheet. */ sheet: Sheet; } /** * Provides the event data for the Spreadsheet `cut`, `copy` and `paste` events. */ export interface SpreadsheetClipboardEvent { /** * The `SpreadsheetWidget` instance which fired the event. */ sender: SpreadsheetWidget; /** * The selected `Range` in the active sheet that is about to be copied. */ range: Range; /** * The type of the clipboard event. */ type: SpreadsheetClipboardEventType; /** * The clipboard content that is being copied, cut, or pasted. */ clipboardContent: SpreadsheetClipboardContent; /** * Prevents the default action for the event. * The Spreadsheet suppresses the built-in behavior that follows the event. */ preventDefault: Function; /** * Returns `true` if any subscriber prevented the default action. * * @returns `true` if the default action was prevented, otherwise, `false`. */ isDefaultPrevented: Function; } /** * Provides information about the clipboard content that is being copied, cut, or pasted, as well as about the merged cells within the selection. */ export interface SpreadsheetClipboardContent { /** * The data that is being copied, cut, or pasted. */ data: any[]; /** * A collection representing the merged cells contained within the selected range. */ mergedCells: string[]; } /** * Provides the event data for the Spreadsheet `contextMenu` event. */ export declare class SpreadsheetContextMenuEvent extends PreventableEvent { /** * The context menu items for the current selection. */ items: Array; /** * The Spreadsheet component instance. */ spreadsheet: SpreadsheetComponent; /** * The Spreadsheet Range object representing the currently selected cells. * Provides methods to apply values, formatting, and styling to the Spreadsheet cells using the original event's data. */ range: Range; /** * Represents the Rectangle object that provides position and dimension information about the active range, useful for custom positioning logic. */ rect: Rectangle; /** * The current Spreadsheet View instance, giving access to the broader Spreadsheet context. */ view: View; /** * The type of target that opens the context menu. */ targetType: SpreadsheetContextMenuTarget; /** * @hidden */ constructor(options: any); } export interface SpreadsheetContextMenuItem { /** * The context menu item type. */ type: SpreadsheetContextMenuAction; /** * Sets the unique identifier for the context menu item. */ id?: string | number; /** * Specifies the item text. */ text?: string; /** * Specifies the name of the font icon that will be rendered for the item. */ icon?: string; /** * Defines an SVGIcon that will be rendered for the item using a KendoSVGIcon component. */ svgIcon?: SVGIcon; /** * Specifies if the item is disabled. */ disabled?: boolean; /** * Specifies if this is a separator item. If set to true, other fields are disregarded. */ separator?: boolean; /** * Sets a function that will be invoked when the item is selected. */ action?: ContextMenuActionFn; } /** * Provides the arguments for the callback function of a context menu item. */ export interface ContextMenuArgs { /** * The item that triggered the action. */ item: SpreadsheetContextMenuItem; /** * The Spreadsheet component instance. */ spreadsheet: SpreadsheetComponent; /** * The Spreadsheet Range object representing the currently selected cells. Provides methods to apply values, formatting, and styling to the Spreadsheet cells using the original event's data. */ range: Range; /** * Represents the Rectangle object that provides position and dimension information about the active range, useful for custom positioning logic. */ rect: Rectangle; /** * The current Spreadsheet View instance, giving access to the broader Spreadsheet context. */ view: View; } /** * Represents the callback that will be invoked when a context menu item is selected. */ export type ContextMenuActionFn = (context: ContextMenuArgs) => void; /** * Defines the possible values for the `targetType` that triggered opening of the context menu. */ export type SpreadsheetContextMenuTarget = 'cell' | 'range' | 'rowHeader' | 'columnHeader'; /** * Defines the possible values for the `type` property of a context menu item. */ export type SpreadsheetContextMenuAction = 'copy' | 'paste' | 'cut' | 'mergeAll' | 'mergeHorizontally' | 'mergeVertically' | 'unmerge' | 'insertLink' | 'separator' | 'addRowAbove' | 'addRowBelow' | 'deleteRow' | 'hideRow' | 'unhideRow' | 'addColumnLeft' | 'addColumnRight' | 'deleteColumn' | 'hideColumn' | 'unhideColumn' | 'custom'; /** * Defines the possible values for the `type` property of [`SpreadsheetClipboardEvent`](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/api/spreadsheetclipboardevent). */ export type SpreadsheetClipboardEventType = 'copy' | 'cut' | 'paste';