Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/base/browser/ui/table/table.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { IListContextMenuEvent, IListEvent, IListGestureEvent, IListMouseEvent, IListRenderer, IListTouchEvent } from '../list/list.js';
7
import { Event } from '../../../common/event.js';
8
9
export interface ITableColumn<TRow, TCell> {
10
readonly label: string;
11
readonly tooltip?: string;
12
readonly weight: number;
13
readonly templateId: string;
14
15
readonly minimumWidth?: number;
16
readonly maximumWidth?: number;
17
readonly onDidChangeWidthConstraints?: Event<void>;
18
19
project(row: TRow): TCell;
20
}
21
22
export interface ITableVirtualDelegate<TRow> {
23
readonly headerRowHeight: number;
24
getHeight(row: TRow): number;
25
}
26
27
export interface ITableRenderer<TCell, TTemplateData> extends IListRenderer<TCell, TTemplateData> { }
28
29
export interface ITableEvent<TRow> extends IListEvent<TRow> { }
30
export interface ITableMouseEvent<TRow> extends IListMouseEvent<TRow> { }
31
export interface ITableTouchEvent<TRow> extends IListTouchEvent<TRow> { }
32
export interface ITableGestureEvent<TRow> extends IListGestureEvent<TRow> { }
33
export interface ITableContextMenuEvent<TRow> extends IListContextMenuEvent<TRow> { }
34
35
export class TableError extends Error {
36
37
constructor(user: string, message: string) {
38
super(`TableError [${user}] ${message}`);
39
}
40
}
41
42