@acanthis-dec/linovelib 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,12 +1,50 @@
1
1
  import { BinaryResponse, BrowserProfileName, FlareSolverrOptions } from "@acanthis-dec/browser-fetch";
2
- import { Novel, NovelSearchResult } from "@acanthis-dec/core";
2
+ import { ExploreHomeData, ExplorePage, ExploreSchema, Novel, NovelSearchResult, NovelStatus } from "@acanthis-dec/core";
3
3
  import { StorageService } from "@acanthis-dec/storage";
4
4
  import { Logger } from "winston";
5
+ import "cheerio";
5
6
  export declare function isUnresolvedChapterId(id: string): boolean;
6
7
  interface NovelUpdateInfo {
7
8
  coverUrl: string;
8
9
  chapterCount: number;
9
10
  }
11
+ export declare const LINOVELIB_EXPLORE_SCHEMA: ExploreSchema;
12
+ export declare const LINOVELIB_CHANNEL_IDS: ReadonlySet<string>;
13
+ export declare const LINOVELIB_RANKING_IDS: ReadonlySet<string>;
14
+ export declare const LINOVELIB_CATALOG_SORT_IDS: ReadonlySet<string>;
15
+ export declare const LINOVELIB_CATALOG_REGION_IDS: ReadonlySet<string>;
16
+ export declare const LINOVELIB_CATALOG_TAG_IDS: ReadonlySet<string>;
17
+ export declare const LINOVELIB_CATALOG_PROGRESS_IDS: ReadonlySet<string>;
18
+ export declare const LINOVELIB_CATALOG_ANIME_IDS: ReadonlySet<string>;
19
+ export declare const LINOVELIB_CATALOG_WORDS_IDS: ReadonlySet<string>;
20
+ export declare const LINOVELIB_CATALOG_UPDATED_IDS: ReadonlySet<string>;
21
+ interface LinovelibRankingOptions {
22
+ rank: string;
23
+ full?: boolean;
24
+ page?: number;
25
+ }
26
+ interface LinovelibCatalogOptions {
27
+ sort?: string;
28
+ region?: string;
29
+ tag?: string;
30
+ progress?: string;
31
+ anime?: string;
32
+ words?: string;
33
+ updated?: string;
34
+ page?: number;
35
+ }
36
+ export declare function isValidLinovelibChannel(channel: string): boolean;
37
+ export declare function isValidLinovelibRanking(rank: string, full: boolean): boolean;
38
+ export declare function normalizeCatalogOptions(options?: LinovelibCatalogOptions): Required<LinovelibCatalogOptions>;
39
+ export declare function buildCatalogUrl(options: Required<LinovelibCatalogOptions>): string;
40
+ export declare function parseCatalogHtml(html: string, page: number): ExplorePage;
41
+ export declare const LINOVELIB_DESKTOP_BASE = "https://www.linovelib.com";
42
+ export declare function extractNovelIdFromHref(href: string | undefined): string | null;
43
+ export declare function resolveDesktopCoverUrl(novelId: string, rawSrc?: string): string;
44
+ export declare function parseNovelStatusText(raw: string | undefined): NovelStatus;
45
+ export declare function parseHomeHtml(html: string, channel?: string): ExploreHomeData;
46
+ export declare function buildRankingsUrl(rank: string, full: boolean, page: number): string;
47
+ export declare function parseRankingsHtml(html: string, page: number): ExplorePage;
10
48
  type SessionOptions = {
11
49
  enabled: false;
12
50
  } | {
@@ -39,6 +77,7 @@ export declare class LinovelibClient {
39
77
  private novelChapterQueue;
40
78
  private novelInfoQueue;
41
79
  private novelMediaQueue;
80
+ private novelExploreQueue;
42
81
  private searchSession;
43
82
  private options?;
44
83
  private logger?;
@@ -60,8 +99,12 @@ export declare class LinovelibClient {
60
99
  getCover(url: string, referer?: string): Promise<BinaryResponse>;
61
100
  getIllustration(url: string, referer?: string): Promise<BinaryResponse>;
62
101
  getChapter(novelId: string, chapterId: string): Promise<string | undefined>;
102
+ getExploreSchema(): ExploreSchema;
103
+ getExploreHome(channel?: string): Promise<ExploreHomeData>;
104
+ getRankings(options: LinovelibRankingOptions): Promise<ExplorePage>;
105
+ getCatalog(options?: LinovelibCatalogOptions): Promise<ExplorePage>;
63
106
  }
64
107
  export declare function novelIdToCoverUrl(novelId: string): string;
65
108
  export declare function extractChapterIllustrationUrls(html: string): string[];
66
109
  export declare function rewriteChapterIllustrations(html: string, mapUrl: (originalUrl: string) => string): string;
67
- export type { LinovelibClientOptions, SessionOptions };
110
+ export type { LinovelibCatalogOptions, LinovelibClientOptions, LinovelibRankingOptions, SessionOptions };