about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-05-24 19:51:48 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-05-24 19:51:48 +0300
commitb68ee51b4aa2d7909f396055bf02b44c43f300dc (patch)
treea015d488190623e259270718cd7ead4e3b234268 /src
parent4500a513b971a6eafb3f240f9014e531777a763f (diff)
downloadthe-epube-b68ee51b4aa2d7909f396055bf02b44c43f300dc.tar.gz
the-epube-b68ee51b4aa2d7909f396055bf02b44c43f300dc.tar.xz
add type definition for EpubeApp and move common stuff to index.d.ts
Diffstat (limited to 'src')
-rw-r--r--src/app.d.ts2
-rw-r--r--src/index.d.ts15
-rw-r--r--src/reader.d.ts2
3 files changed, 15 insertions, 4 deletions
diff --git a/src/app.d.ts b/src/app.d.ts
index 2a1dbe7..e69de29 100644
--- a/src/app.d.ts
+++ b/src/app.d.ts
@@ -1,2 +0,0 @@
-declare var EpubeApp: any;
-declare var localforage: LocalForage;
diff --git a/src/index.d.ts b/src/index.d.ts
new file mode 100644
index 0000000..6f25e34
--- /dev/null
+++ b/src/index.d.ts
@@ -0,0 +1,15 @@
+declare interface EpubeApp {
+	setPage(page: 'PAGE_LIBRARY' | 'PAGE_FAVORITES' | 'PAGE_READER' | 'PAGE_OFFLINE' | 'PAGE_LOGIN'): void;
+	setTitle(title: string): void;
+	showActionBar(visible: boolean): void;
+	toggleActionBar(): void;
+	isNightMode(): boolean;
+	isOnline(): boolean;
+	setStatusBarColor(r: number, g: number, b: number): void;
+	setAccentColor(r: number, g: number, b: number): void;
+	setOffline(offline: boolean): void;
+}
+
+declare var EpubeApp: EpubeApp;
+
+declare var localforage: LocalForage;
diff --git a/src/reader.d.ts b/src/reader.d.ts
index 2995c12..ecda2db 100644
--- a/src/reader.d.ts
+++ b/src/reader.d.ts
@@ -1,5 +1,3 @@
-declare var EpubeApp: any;
-declare var localforage: LocalForage;
 declare var createHyphenator: any;
 
 declare var hyphenationPatternsEnUs: any;