forked from brrd/electron-tabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
66 lines (61 loc) · 1.94 KB
/
index.d.ts
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
import {EventEmitter} from 'events';
import {WebviewTag} from 'electron';
declare class ElectronTabs extends EventEmitter {
constructor(options?: ElectronTabs.TabGroupOptions);
addTab(options?: ElectronTabs.TabOptions): ElectronTabs.Tab;
getTab(id: number): ElectronTabs.Tab | null;
getTabByPosition(position: number): ElectronTabs.Tab | null;
getTabByRelPosition(position: number): ElectronTabs.Tab | null;
getActiveTab(): ElectronTabs.Tab | null;
getTabs(): ElectronTabs.Tab[];
eachTab<T extends object>(
fn: (this: T, currentTab: ElectronTabs.Tab, index: number, tabs: ElectronTabs.Tab[]) => void,
thisArg?: T,
): void;
tabContainer: HTMLElement;
}
declare namespace ElectronTabs {
export interface TabGroupOptions {
tabContainerSelector?: string;
buttonsContainerSelector?: string;
viewContainerSelector?: string;
tabClass?: string;
viewClass?: string;
closeButtonText?: string;
newTabButtonText?: string;
newTab?: TabOptions | (() => TabOptions);
ready?: (tabGroup: ElectronTabs) => void;
}
export interface TabOptions {
title?: string;
src?: string;
badge?: string;
iconURL?: string;
icon?: string;
closable?: boolean;
webviewAttributes?: {[key: string]: any};
visible?: boolean;
active?: boolean;
ready?: (tab: Tab) => void;
}
export interface Tab extends EventEmitter {
id: number;
setTitle(title: string): void;
getTitle(): string;
setBadge(badge: string): void;
getBadge(): string;
setIcon(iconURL?: string, icon?: undefined | null): void;
setIcon(iconURL: undefined | null, icon: string): void;
getIcon(): string;
setPosition(position: number): Tab | null;
getPosition(fromRight?: boolean): number;
activate(): void;
show(shown?: boolean): void;
hide(): void;
flash(shown?: boolean): void;
unflash(): void;
close(force?: boolean): void;
webview: WebviewTag;
}
}
export = ElectronTabs;