feat: extend navigationHistory API (#42014)

* feat: extend navigationHistory API

* refactor: simplify index checking

* refactor: rename 'getHistory' and 'replaceHistory' methods of navigationHistory

* refactor: rename delete*() methods to remove*()

* feat: remove navigationHistory.replaceHistory()

* tests: add tests for removeEntryAtIndex and getAllEntries
This commit is contained in:
Vít Černý
2024-08-19 21:46:04 +02:00
committed by GitHub
parent 4c3014944c
commit 189675575c
8 changed files with 105 additions and 6 deletions

View File

@@ -87,7 +87,7 @@ declare namespace Electron {
_print(options: any, callback?: (success: boolean, failureReason: string) => void): void;
_getPrintersAsync(): Promise<Electron.PrinterInfo[]>;
_init(): void;
_getNavigationEntryAtIndex(index: number): Electron.EntryAtIndex | null;
_getNavigationEntryAtIndex(index: number): Electron.NavigationEntry | null;
_getActiveIndex(): number;
_historyLength(): number;
_canGoBack(): boolean;
@@ -97,6 +97,8 @@ declare namespace Electron {
_goForward(): void;
_goToOffset(index: number): void;
_goToIndex(index: number): void;
_removeNavigationEntryAtIndex(index: number): boolean;
_getHistory(): Electron.NavigationEntry[];
_clearHistory():void
canGoToIndex(index: number): boolean;
destroy(): void;