wip イベント整理

This commit is contained in:
samunohito 2024-01-31 19:45:48 +09:00
parent f9516e6ae1
commit 777920d739
1 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,6 @@
import { EventEmitter } from 'eventemitter3'; import { EventEmitter } from 'eventemitter3';
import { CellValidator } from '@/components/grid/cell-validators.js'; import { CellValidator } from '@/components/grid/cell-validators.js';
import { CellValue } from '@/components/grid/cell.js'; import { CellValue, GridCell } from '@/components/grid/cell.js';
export type GridSetting = { export type GridSetting = {
rowNumberVisible: boolean; rowNumberVisible: boolean;
@ -47,6 +47,28 @@ export type CellValueChangedEvent = {
value: CellValue; value: CellValue;
} }
export type GridEvent = {
current: {
selectedCell: GridCell;
rangedCells: GridCell[];
rangedRows: GridRow[];
state: GridState;
rows: GridRow[];
columns: GridColumn[];
}
}
export type GridPreKeyDownEvent = {
type: 'pre-keydown';
event: KeyboardEvent;
prevent: boolean;
} & GridEvent;
export type GridKeyDownEvent = {
type: 'keydown';
event: KeyboardEvent;
} & GridEvent;
export class GridEventEmitter extends EventEmitter<{ export class GridEventEmitter extends EventEmitter<{
'forceRefreshContentSize': void; 'forceRefreshContentSize': void;
}> { }> {