about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-05-24 12:58:01 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-05-24 12:58:01 +0300
commit141b6fe2b7d6ec2a74704501af71c6629d994f30 (patch)
tree05288ba751ce5268cface901f2de677359197bf3 /src
parent274f5594c30f5d128db2fd458f96b4436b1dbb66 (diff)
downloadthe-epube-141b6fe2b7d6ec2a74704501af71c6629d994f30.tar.gz
the-epube-141b6fe2b7d6ec2a74704501af71c6629d994f30.tar.xz
lint/type fixes
Diffstat (limited to 'src')
-rw-r--r--src/app.d.ts2
-rw-r--r--src/app.js4
-rw-r--r--src/csrf.js3
-rw-r--r--src/reader.d.ts4
-rw-r--r--src/reader.js12
5 files changed, 17 insertions, 8 deletions
diff --git a/src/app.d.ts b/src/app.d.ts
index 58eddc3..2a1dbe7 100644
--- a/src/app.d.ts
+++ b/src/app.d.ts
@@ -1,2 +1,2 @@
-declare var EpubeApp: class;
+declare var EpubeApp: any;
 declare var localforage: LocalForage;
diff --git a/src/app.js b/src/app.js
index c5b7c71..6c108a9 100644
--- a/src/app.js
+++ b/src/app.js
@@ -2,7 +2,7 @@
 
 'use strict';
 
-/* global localforage, EpubeApp, $ */
+/* global localforage, EpubeApp, $, setupCsrfPrefilter */
 
 class Cookie {
 	static set(name, value, lifetime) {
@@ -71,7 +71,7 @@ class AppCommon {
 	}
 }
 
-/* exported AppClass */
+/* eslint-disable-next-line no-unused-vars */
 class AppClass extends AppCommon {
 	_dl_progress_timeout;
 
diff --git a/src/csrf.js b/src/csrf.js
index f2b988d..98aa1de 100644
--- a/src/csrf.js
+++ b/src/csrf.js
@@ -2,9 +2,12 @@
 
 'use strict';
 
+/* global $ */
+
 /**
  * @param {string} token
  */
+/* eslint-disable-next-line no-unused-vars */
 function setupCsrfPrefilter(token) {
 	console.log('setting prefilter for token', token);
 
diff --git a/src/reader.d.ts b/src/reader.d.ts
index 0e9086c..cb9b8f4 100644
--- a/src/reader.d.ts
+++ b/src/reader.d.ts
@@ -9,7 +9,7 @@ declare interface HTMLElement { checked: boolean }
 declare interface Event { deltaY: Number, deltaX: Number }
 declare interface Node { data: string }
 
-export type SwipeState = {
+declare type SwipeState = {
    active: boolean,
    startX: number,
 	startY: number,
@@ -17,7 +17,7 @@ export type SwipeState = {
 	direction: 'left'|'right'|null
 }
 
-export type SwipeConfig = {
+declare type SwipeConfig = {
    minDistance: number,
    velocityThreshold: number,
    verticalDistanceThreshold: number
diff --git a/src/reader.js b/src/reader.js
index fe253ec..8623643 100644
--- a/src/reader.js
+++ b/src/reader.js
@@ -2,7 +2,7 @@
 
 'use strict';
 
-/* global localforage, EpubeApp, ePub, Cookie, AppCommon, $ */
+/* global localforage, EpubeApp, ePub, Cookie, AppCommon, $, setupCsrfPrefilter */
 
 const DEFAULT_FONT_SIZE = 16;
 const DEFAULT_FONT_FAMILY = "Arial";
@@ -12,7 +12,7 @@ const MIN_LENGTH_TO_JUSTIFY = 32; /* characters */
 const LOCATION_DIVISOR = 10;
 const PAGE_RESET_PROGRESS = -1;
 
-/* exported ReaderClass */
+/* eslint-disable-next-line no-unused-vars */
 class ReaderClass extends AppCommon {
 	csrf_token = "";
 
@@ -49,6 +49,12 @@ class ReaderClass extends AppCommon {
 		verticalDistanceThreshold: 80, // px — vertical movement before cancelling
 	};
 
+	constructor() {
+		super();
+
+		this.book = new ePub.Book();
+	}
+
 	onTouchStart(evt) {
 		const touch = evt.touches[0] || evt.changedTouches[0];
 
@@ -279,7 +285,7 @@ class ReaderClass extends AppCommon {
 	}
 
 	async openBookData(book_data) {
-		this.book = new ePub.Book();
+		//this.book = new ePub.Book();
 
 		try {
 			await this.book.open(book_data);