-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathtypes.ts
More file actions
67 lines (57 loc) · 1.8 KB
/
types.ts
File metadata and controls
67 lines (57 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import type { RenderItemFunction } from '@lit-labs/virtualizer/virtualize.js';
import type { ReactiveControllerHost, TemplateResult } from 'lit';
import type IgcComboComponent from './combo.js';
export type Keys<T> = keyof T;
export type Values<T> = T[keyof T];
export type Item<T extends object> = T | Values<T>;
export type ComboRecord<T extends object> = {
value: T;
header: boolean;
dataIndex: number;
};
export type ComboHost<T extends object> = ReactiveControllerHost &
IgcComboComponent<T>;
export type GroupingDirection = 'asc' | 'desc' | 'none';
export type ComboChangeType = 'selection' | 'deselection' | 'addition';
export type ComboRenderFunction<T extends object> = RenderItemFunction<
ComboRecord<T>
>;
export type ComboValue<T> = T | Values<T>;
/* jsonAPIPlainObject */
export interface FilteringOptions<T extends object> {
filterKey: Keys<T> | undefined;
caseSensitive?: boolean;
matchDiacritics?: boolean;
}
export interface GroupingOptions<T extends object> {
groupKey?: Keys<T>;
valueKey?: Keys<T>;
displayKey?: Keys<T>;
direction: GroupingDirection;
}
/* marshalByValue */
export interface IgcComboChangeEventArgs<T extends object = any> {
newValue: ComboValue<T>[];
/* primitiveValue */
items: T[];
/* blazorAlternateName: changeType */
type: ComboChangeType;
}
export interface IgcComboComponentEventMap {
igcChange: CustomEvent<IgcComboChangeEventArgs>;
// For analyzer meta only:
/* skipWCPrefix */
focus: FocusEvent;
/* skipWCPrefix */
blur: FocusEvent;
igcOpening: CustomEvent<void>;
igcOpened: CustomEvent<void>;
igcClosing: CustomEvent<void>;
igcClosed: CustomEvent<void>;
}
export type ComboItemTemplate<T extends object> = (
props: ComboTemplateProps<T>
) => TemplateResult;
export interface ComboTemplateProps<T extends object> {
item: T;
}