electron-tabs/dist/electron-tabs.d.ts

83 lines
2.4 KiB
TypeScript
Raw Permalink Normal View History

2022-05-25 07:11:49 +00:00
import Sortable from "sortablejs";
interface TabGroupOptions {
closeButtonText: string;
defaultTab: TabOptions | ((tabGroup: TabGroup) => TabOptions);
newTabButton: boolean;
newTabButtonText: string;
sortable: boolean;
sortableOptions?: Sortable.Options;
visibilityThreshold: number;
}
interface TabOptions {
active?: boolean;
closable?: boolean;
ready?: ((tab: Tab) => void);
src?: string;
title?: string;
visible?: boolean;
webviewAttributes?: {
[key: string]: any;
};
}
export class TabGroup extends HTMLElement {
buttonContainer: HTMLDivElement;
isReady: boolean;
newTabId: number;
options: TabGroupOptions;
shadow: ShadowRoot;
tabContainer: HTMLDivElement;
tabs: Array<Tab>;
viewContainer: HTMLDivElement;
constructor();
emit(type: string, ...args: any[]): void;
on(type: string, fn: (...detail: any[]) => void): void;
once(type: string, fn: (detail: string) => void): void;
connectedCallback(): void;
initSortable(): void;
2022-05-25 07:11:49 +00:00
setDefaultTab(tab: TabOptions): void;
addTab(args?: TabOptions | ((tabGroup: TabGroup) => TabOptions)): Tab;
getTab(id: number): Tab;
getTabByPosition(position: number): Tab;
getTabByRelPosition(position: number): Tab;
getNextTab(): Tab;
getPreviousTab(): Tab;
getTabs(): Tab[];
eachTab(fn: (tab: Tab) => void): void;
getActiveTab(): Tab;
setActiveTab(tab: Tab): void;
removeTab(tab: Tab, triggerEvent?: boolean): void;
activateRecentTab(): void;
}
export class Tab extends EventTarget {
closable: boolean;
2022-05-25 13:09:18 +00:00
element: HTMLDivElement;
2022-05-25 07:11:49 +00:00
id: number;
isClosed: boolean;
isReady: boolean;
2022-05-25 13:09:18 +00:00
spans: {
2022-05-25 07:11:49 +00:00
[key: string]: HTMLSpanElement;
};
tabGroup: TabGroup;
title: string;
webview: HTMLElement;
webviewAttributes: {
[key: string]: any;
};
constructor(tabGroup: TabGroup, id: number, args: TabOptions);
emit(type: string, ...args: any[]): void;
on(type: string, fn: (...detail: any[]) => void): void;
once(type: string, fn: (detail: string) => void): void;
initWebview(): void;
setTitle(title: string): this;
getTitle(): string;
setPosition(newPosition: number): this;
2022-05-25 07:11:49 +00:00
getPosition(fromRight?: boolean): number;
activate(): this;
show(flag?: boolean): this;
hide(): this;
hasClass(classname: string): boolean;
close(force: boolean): void;
}
//# sourceMappingURL=electron-tabs.d.ts.map