import { type BasePubSubService } from '@slickgrid-universal/event-pub-sub'; import { SlickEventHandler, type SlickEventData, type SlickGrid } from '../core/index.js'; import type { Column, EditCommand, GridOption, OnBeforeEditCellEventArgs, OnRowsOrCountChangedEventArgs, OnSetOptionsEventArgs, RowBasedEditOptions } from '../interfaces/index.js'; import type { GridService } from '../services/grid.service.js'; import type { ExtensionUtility } from './extensionUtility.js'; export declare const ROW_BASED_EDIT_ROW_HIGHLIGHT_CLASS = "slick-rbe-editmode"; export declare const ROW_BASED_EDIT_UNSAVED_CELL = "slick-rbe-unsaved-cell"; export declare const ROW_BASED_EDIT_UNSAVED_HIGHLIGHT_PREFIX = "slick-rbe-unsaved-highlight"; export declare const BTN_ACTION_DELETE = "action-btns--delete"; export declare const BTN_ACTION_EDIT = "action-btns--edit"; export declare const BTN_ACTION_UPDATE = "action-btns--update"; export declare const BTN_ACTION_CANCEL = "action-btns--cancel"; export interface EditedRowDetails { columns: Column[]; editCommands: EditCommand[]; cssStyleKeys: string[]; } interface ButtonTranslation { btnUpdateTitle: string; btnEditTitle: string; btnDeleteTitle: string; btnCancelTitle: string; } /** * Row based edit plugin to add edit/delete buttons to each row and only allow editing rows currently in editmode */ export declare class SlickRowBasedEdit { protected readonly extensionUtility: ExtensionUtility; protected readonly pubSubService: BasePubSubService; readonly pluginName = "RowBasedEdit"; protected _addonOptions?: RowBasedEditOptions; protected _eventHandler: SlickEventHandler; protected _grid: SlickGrid; protected _gridService?: GridService; protected _defaults: RowBasedEditOptions; protected _editedRows: Map; private _existingEditCommandHandler; protected _currentLang: string; private _translations; /** Constructor of the SlickGrid 3rd party plugin, it can optionally receive options */ constructor(extensionUtility: ExtensionUtility, pubSubService: BasePubSubService, options?: RowBasedEditOptions); get addonOptions(): RowBasedEditOptions; get gridOptions(): GridOption; get eventHandler(): SlickEventHandler; /** Initialize plugin. */ init(grid: SlickGrid, gridService: GridService): void; destroy(): void; /** Dispose (destroy) the SlickGrid 3rd party plugin */ dispose(): void; create(columns: Column[], gridOptions: GridOption): SlickRowBasedEdit | null; getColumnDefinition(): Column; rowBasedEditCommandHandler(item: any, column: Column, editCommand: EditCommand): void; /** * Translate with current locale when `enableTranslate` is set or use title texts provided by user. * We want to translate only once to avoid having to translate on each dataset item, we'll just reuse the translations if it was already translated earlier. * User could optionally force a retranslate even if it was already translated * @param {Boolean} [forceRetranslate] - even if it was already translate, force a retranslate */ translate(forceRetranslate?: boolean): ButtonTranslation; protected checkOptionsRequirements(options: GridOption): void; protected undoRowEdit(item: any): void; protected renderUnsavedCellStyling(id: any, column: Column): void; protected handleAllRowRerender(_e: SlickEventData, _args: OnRowsOrCountChangedEventArgs): void; protected removeUnsavedStylingFromCell(column: Column, row: number): void; protected removeUnsavedStylingFromRow(row: number): void; protected optionsUpdatedHandler(_e: SlickEventData, args: OnSetOptionsEventArgs): void; protected onCellClickHandler(event: Event, args: any): Promise; protected actionColumnFormatter(_row: number, _cell: number, _value: any, _columnDef: Column, dataContext: any): DocumentFragment; protected onBeforeEditCellHandler: (_e: SlickEventData, args: OnBeforeEditCellEventArgs) => boolean; protected toggleEditmode(dataContext: any, editMode: boolean): void; protected updateItemMetadata(previousItemMetadata: any): (rowNumber: number) => { cssClasses: string; }; /** * Get button tooltip text 1 of these 3 options: * 1. from `btnAbcTitleKey` when `enableTranslate` is set * 2. from `btnAbcTitle` when no title Key is found and/or `enableTranslate` is disabled * 3. or finally use default title fallback provided * @param key - button title key * @param defaultTitle - fallback title * @returns - final tooltip title text */ protected getTitleOrDefault(key: ActionButtonTitles, defaultTitle: string): string; } type IsDefined = T extends undefined ? never : T; type ActionButtonTitles = keyof { [K in keyof IsDefined as K extends `${string}Title` ? K : never]: IsDefined[K]; }; export {}; //# sourceMappingURL=slickRowBasedEdit.d.ts.map