Skip to content

Commit

Permalink
Use specific tile type for TileClickEvent and TileActionEvent
Browse files Browse the repository at this point in the history
374090
  • Loading branch information
tgygax committed May 21, 2024
1 parent bda0653 commit a2b401a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions eclipse-scout-core/src/tile/TileGridEventMap.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
/*
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
* Copyright (c) 2010, 2024 BSI Business Systems Integration AG
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
import {Event, Menu, PropertyChangeEvent, Tile, TileGrid, TileGridLayoutConfig, WidgetEventMap} from '../index';
import {Event, Menu, PropertyChangeEvent, Tile, TileAccordion, TileGrid, TileGridLayoutConfig, WidgetEventMap} from '../index';

export interface TileActionEvent<T = TileGrid> extends Event<T> {
tile: Tile;
tile: TileOf<T>;
}

export interface TileClickEvent<T = TileGrid> extends Event<T> {
tile: Tile;
tile: TileOf<T>;
mouseButton: number;
originalEvent: JQuery.ClickEvent;
}

export type TileOf<T> = T extends TileGrid<infer TTile> | TileAccordion<infer TTile> ? TTile : Tile;

export interface TileGridEventMap extends WidgetEventMap {
'tileAction': TileActionEvent;
'tileClick': TileClickEvent;
Expand Down

0 comments on commit a2b401a

Please sign in to comment.