mwoffliner 1.14.2 → 1.15.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.
Files changed (129) hide show
  1. package/README.md +19 -42
  2. package/docs/functional_architecture.md +62 -0
  3. package/eslint.config.js +24 -0
  4. package/lib/DOMUtils.js +3 -0
  5. package/lib/DOMUtils.js.map +1 -1
  6. package/lib/Downloader.d.ts +45 -17
  7. package/lib/Downloader.js +267 -94
  8. package/lib/Downloader.js.map +1 -1
  9. package/lib/Dump.d.ts +5 -5
  10. package/lib/Dump.js +8 -32
  11. package/lib/Dump.js.map +1 -1
  12. package/lib/Logger.js.map +1 -1
  13. package/lib/MediaWiki.d.ts +17 -12
  14. package/lib/MediaWiki.js +79 -45
  15. package/lib/MediaWiki.js.map +1 -1
  16. package/lib/RedisStore.d.ts +1 -284
  17. package/lib/RedisStore.js +0 -2
  18. package/lib/RedisStore.js.map +1 -1
  19. package/lib/S3.d.ts +2 -2
  20. package/lib/S3.js +3 -3
  21. package/lib/S3.js.map +1 -1
  22. package/lib/Templates.d.ts +4 -1
  23. package/lib/Templates.js +8 -1
  24. package/lib/Templates.js.map +1 -1
  25. package/lib/cli.d.ts +1 -1
  26. package/lib/cli.js +6 -11
  27. package/lib/cli.js.map +1 -1
  28. package/lib/config.d.ts +7 -1
  29. package/lib/config.js +14 -1
  30. package/lib/config.js.map +1 -1
  31. package/lib/error.manager.d.ts +25 -0
  32. package/lib/error.manager.js +202 -0
  33. package/lib/error.manager.js.map +1 -0
  34. package/lib/mutex.d.ts +3 -0
  35. package/lib/mutex.js +4 -0
  36. package/lib/mutex.js.map +1 -0
  37. package/lib/mwoffliner.lib.d.ts +0 -1
  38. package/lib/mwoffliner.lib.js +117 -118
  39. package/lib/mwoffliner.lib.js.map +1 -1
  40. package/lib/parameterList.d.ts +1 -0
  41. package/lib/parameterList.js +3 -2
  42. package/lib/parameterList.js.map +1 -1
  43. package/lib/renderers/abstract.renderer.d.ts +17 -2
  44. package/lib/renderers/abstract.renderer.js +25 -14
  45. package/lib/renderers/abstract.renderer.js.map +1 -1
  46. package/lib/renderers/abstractDesktop.render.d.ts +2 -1
  47. package/lib/renderers/abstractDesktop.render.js +20 -7
  48. package/lib/renderers/abstractDesktop.render.js.map +1 -1
  49. package/lib/renderers/abstractMobile.render.js +15 -14
  50. package/lib/renderers/abstractMobile.render.js.map +1 -1
  51. package/lib/renderers/action-parse.renderer.d.ts +9 -0
  52. package/lib/renderers/action-parse.renderer.js +110 -0
  53. package/lib/renderers/action-parse.renderer.js.map +1 -0
  54. package/lib/renderers/renderer.builder.d.ts +2 -4
  55. package/lib/renderers/renderer.builder.js +35 -8
  56. package/lib/renderers/renderer.builder.js.map +1 -1
  57. package/lib/renderers/rendering.context.d.ts +10 -0
  58. package/lib/renderers/rendering.context.js +38 -0
  59. package/lib/renderers/rendering.context.js.map +1 -0
  60. package/lib/renderers/rest-api.renderer.js +4 -4
  61. package/lib/renderers/rest-api.renderer.js.map +1 -1
  62. package/lib/renderers/visual-editor.renderer.js +21 -26
  63. package/lib/renderers/visual-editor.renderer.js.map +1 -1
  64. package/lib/renderers/wikimedia-mobile.renderer.d.ts +2 -1
  65. package/lib/renderers/wikimedia-mobile.renderer.js +11 -4
  66. package/lib/renderers/wikimedia-mobile.renderer.js.map +1 -1
  67. package/lib/sanitize-argument.js +35 -36
  68. package/lib/sanitize-argument.js.map +1 -1
  69. package/lib/util/RedisKvs.js +1 -0
  70. package/lib/util/RedisKvs.js.map +1 -1
  71. package/lib/util/Timer.js.map +1 -1
  72. package/lib/util/builders/url/action-parse.director.d.ts +9 -0
  73. package/lib/util/builders/url/action-parse.director.js +19 -0
  74. package/lib/util/builders/url/action-parse.director.js.map +1 -0
  75. package/lib/util/builders/url/api.director.d.ts +1 -0
  76. package/lib/util/builders/url/api.director.js +3 -0
  77. package/lib/util/builders/url/api.director.js.map +1 -1
  78. package/lib/util/builders/url/basic.director.js.map +1 -1
  79. package/lib/util/builders/url/url.builder.js.map +1 -1
  80. package/lib/util/categories.d.ts +3 -4
  81. package/lib/util/categories.js +11 -13
  82. package/lib/util/categories.js.map +1 -1
  83. package/lib/util/const.d.ts +0 -1
  84. package/lib/util/const.js +2 -3
  85. package/lib/util/const.js.map +1 -1
  86. package/lib/util/dump.d.ts +7 -7
  87. package/lib/util/dump.js +58 -87
  88. package/lib/util/dump.js.map +1 -1
  89. package/lib/util/metaData.js.map +1 -1
  90. package/lib/util/misc.d.ts +6 -8
  91. package/lib/util/misc.js +45 -23
  92. package/lib/util/misc.js.map +1 -1
  93. package/lib/util/mw-api.d.ts +4 -5
  94. package/lib/util/mw-api.js +50 -27
  95. package/lib/util/mw-api.js.map +1 -1
  96. package/lib/util/rewriteUrls.js +14 -20
  97. package/lib/util/rewriteUrls.js.map +1 -1
  98. package/lib/util/saveArticles.d.ts +3 -4
  99. package/lib/util/saveArticles.js +81 -89
  100. package/lib/util/saveArticles.js.map +1 -1
  101. package/lib/util/url.helper.js +2 -2
  102. package/lib/util/url.helper.js.map +1 -1
  103. package/lib/version.d.ts +1 -1
  104. package/lib/version.js +1 -1
  105. package/package.json +62 -68
  106. package/res/DMSans-Regular.ttf +0 -0
  107. package/res/article_not_found.svg +1 -0
  108. package/res/download_error_placeholder.css +165 -0
  109. package/res/external-link.svg +6 -0
  110. package/res/footer.css +15 -0
  111. package/res/script.js +3 -3
  112. package/res/templates/article_list_home.html +2 -2
  113. package/res/templates/download_error_placeholder.html +26 -0
  114. package/res/templates/footer.html +1 -1
  115. package/res/templates/pageVector2022.html +31 -0
  116. package/res/templates/pageVectorLegacy.html +25 -0
  117. package/res/vector-2022.css +15 -0
  118. package/res/vector.css +3 -0
  119. package/res/webpHandler.js +165 -0
  120. package/translation/en.json +17 -4
  121. package/translation/fr.json +3 -1
  122. package/translation/he.json +0 -1
  123. package/translation/id.json +12 -1
  124. package/translation/it.json +8 -2
  125. package/translation/ko.json +3 -1
  126. package/translation/lb.json +2 -1
  127. package/translation/qqq.json +14 -2
  128. package/translation/zh-hans.json +16 -2
  129. package/translation/zh-hant.json +12 -1
package/README.md CHANGED
@@ -41,7 +41,7 @@ Run `mwoffliner --help` to get all the possible options.
41
41
 
42
42
  - *NIX Operating System (GNU/Linux, macOS, ...)
43
43
  - [Redis](https://redis.io/)
44
- - [NodeJS](https://nodejs.org/en/) version 16 or greater
44
+ - [NodeJS](https://nodejs.org/en/) version 22 (we support only one single Node.JS version, other versions might work or not)
45
45
  - [Libzim](https://github.com/openzim/libzim) (On GNU/Linux & macOS we automatically download it)
46
46
  - Various build tools which are probably already installed on your
47
47
  machine (packages `libjpeg-dev`, `libglu1`, `autoconf`, `automake`, `gcc` on
@@ -51,35 +51,38 @@ Run `mwoffliner --help` to get all the possible options.
51
51
 
52
52
  ## Usage
53
53
 
54
- To install MWoffliner globally:
54
+ To install latest released MWoffliner version from NPM repo (use `-g` to install globally, not only in current folder):
55
55
  ```bash
56
56
  npm i -g mwoffliner
57
57
  ```
58
58
 
59
- You might need to run this command with the `sudo` command, depending
60
- how your `npm` is configured.
59
+ > [!WARNING]
60
+ > Note that you might need to run this command with the `sudo` command, depending
61
+ how your `npm` / OS is configured. `npm` permission checking can be a bit annoying for a
62
+ newcomer. Please read the documentation carefully if you hit problems: https://docs.npmjs.com/cli/v7/using-npm/scripts#user
61
63
 
62
- `npm` permission checking can be a bit annoying for a
63
- newcomer. Please read the documentation carefully if you hit
64
- problems: https://docs.npmjs.com/cli/v7/using-npm/scripts#user
65
-
66
- Then to run it:
64
+ Then you can run the scraper:
67
65
  ```bash
68
66
  mwoffliner --help
69
67
  ```
70
68
 
71
- To install and run it locally:
72
- ```bash
73
- npm i
74
- npm run mwoffliner -- --help
75
- ```
76
-
77
69
  To use MWoffliner with a S3 cache, you should provide a S3 URL like
78
70
  this:
79
71
  ```bash
80
72
  --optimisationCacheUrl="https://wasabisys.com/?bucketName=my-bucket&keyId=my-key-id&secretAccessKey=my-sac"
81
73
  ```
82
74
 
75
+ ## Contribute
76
+
77
+ If you've retrieved mwoffliner source code (e.g. with a git clone of our repo), you can then install and run it locally (including with your local modifications):
78
+
79
+ ```bash
80
+ npm i
81
+ npm run mwoffliner -- --help
82
+ ```
83
+
84
+ Detailed [contribution documentation and guidelines](CONTRIBUTING.md) are available.
85
+
83
86
  ## API
84
87
 
85
88
  MWoffliner provides also an API and therefore can be used as a NodeJS
@@ -107,33 +110,7 @@ Complementary information about MWoffliner:
107
110
  * Wikitext is the name of the markup language that MediaWiki uses.
108
111
  * MediaWiki includes a parser for WikiText into HTML, and this
109
112
  parser creates the HTML pages displayed in your browser.
110
-
111
- ### GNU/Linux - Debian based distributions
112
-
113
- Install NodeJS:
114
- Read https://nodejs.org/en/download/current/
115
-
116
- Install Redis:
117
- ```bash
118
- sudo apt-get install redis-server
119
- ```
120
-
121
- ## Troubleshooting
122
-
123
- Older GNU/Linux distributions and/or versions of Node.js might be
124
- shipped with a deprecated version of `npm`. Older versions of `npm`
125
- have incompatbilities with certain versions of Node.js and might
126
- simply fail to install `mwoffliner` package.
127
-
128
- We recommend to use a recent version of `npm`. Recent versions can
129
- perfectly deal with older Node.js 10. Do install the packaged
130
- version of `npm` and then use it to install a newer version like:
131
-
132
- ```bash
133
- sudo npm install --unsafe-perm -g npm
134
- ```
135
-
136
- Don't forget to remove the packaged version of `npm` afterward.
113
+ * Have a look at the scraper [functional architecture](docs/functional_architecture.md)
137
114
 
138
115
  License
139
116
  -------
@@ -0,0 +1,62 @@
1
+ # Functional Architecture
2
+
3
+ This document describes a high-level overview of how mwoffliner scraper works.
4
+
5
+ At a high level, mwoffliner is divided into following sequence of actions.
6
+
7
+ - retrieve list of articles to include and their metadata
8
+ - for every article:
9
+ - retrieve its parsed HTML (Wikitext transformed into HTML) and JS/CSS dependencie
10
+ - adapt / render it for proper operation within the ZIM file (includes detection of media dependencies)
11
+ - save rendered article HTML into the ZIM
12
+ - for every file dependency (JS/CSS/media)
13
+ - if its an image, download it either from S3 cache (images only) or from online and recompress when possible
14
+ - otherwise download it from online
15
+ - save them into the ZIM file
16
+
17
+ The scraper supports flavours, which are variants of the ZIM (e.g. without images, with images but without videos, ...).
18
+
19
+ The process above is repeated for every flavour requested.
20
+
21
+ ## Retrieving article HTML and rendering
22
+
23
+ In order to retrieve article HTML and render it, multiple solutions have been identified.
24
+
25
+ As of today, 5 renderers (way to download article + render it to ZIM compatible HTML) are implemented:
26
+
27
+ - WikimediaDesktop
28
+ - WikimediaMobile
29
+ - RestApi
30
+ - VisualEditor
31
+ - ActionParse
32
+
33
+ WikimediaDesktop and WikimediaMobile are only available on Wikimedia Mediawikis.
34
+
35
+ Availability of RestApi and VisualEditor is subject to Mediawiki admin decision to support it or not. RestApi is available by default but might be blocked by admin. VisualEditor is an extension which might be installed or not.
36
+
37
+ ActionParse is available since 1.16.0 (2010) and is anyway a requirement for other APIs.
38
+
39
+ Only ActionParse (most recent renderer) implements a thorough skin support (see below about skin).
40
+
41
+ All renderers but ActionParse needs two HTTP queries: one to retrieve the article HTML and one to retrieve its metadata (to a 'simplified' ActionParse URL in fact).
42
+
43
+ Renderer is automatically selected based on its availability and mwoffliner own preference. ActionParse is the preferred renderer since 1.15.0 due to its general availability and support of skins.
44
+
45
+ ### Skins
46
+
47
+ In Mediwikis, rendering of Wikitext into HTML works around a concept of skin. A skin is a mix of HTML template and CSS+JS dependencies. It defines both the visual appareance of the rendered Wikitext but also everything "around it".
48
+
49
+ Since most wikis have adapted their content to their skin (and vice versa), it is mostly mandatory to use the skin inside the ZIM, both for proper rendering and for a visual appareance similar to online website (users don't mind about technical details, they want the wiki to be the same inside the ZIM than online).
50
+
51
+ Skin detection is automated in mwoffliner for now (see https://github.com/openzim/mwoffliner/issues/2213).
52
+
53
+ For now, only `vector` (legacy) and `vector-2022` are supported, and only with ActionParse renderer. Only `vector-2022` is the truely responsive skin, providing ultimate rendering on mostly all screen sizes.
54
+
55
+
56
+ ### JS / CSS dependencies
57
+
58
+ ActionParse API is returning the list of JS and CSS dependencies for a given article, by inspecting what Wikitext is using.
59
+
60
+ The special `startup` JS module is missing from results because always used anyway.
61
+
62
+ There are still some known hiccups around this (see https://github.com/openzim/mwoffliner/issues/2212 and https://github.com/openzim/mwoffliner/issues/2215 for instance), and probably more to come, this is a complex area of Mediawiki.
@@ -0,0 +1,24 @@
1
+ import js from '@eslint/js'
2
+ import eslint from '@eslint/js'
3
+ import tseslint from 'typescript-eslint'
4
+ import tsparser from '@typescript-eslint/parser'
5
+ import { globalIgnores } from 'eslint/config'
6
+
7
+ export default [
8
+ js.configs.recommended,
9
+ globalIgnores(['lib/**', 'res/**', '**/*.js', '**/*.cjs']),
10
+ eslint.configs.recommended,
11
+ ...tseslint.configs.recommended,
12
+ {
13
+ languageOptions: {
14
+ parser: tsparser,
15
+ parserOptions: {
16
+ project: 'tsconfig.json',
17
+ sourceType: 'module',
18
+ },
19
+ },
20
+ rules: {
21
+ '@typescript-eslint/no-explicit-any': 'off',
22
+ },
23
+ },
24
+ ]
package/lib/DOMUtils.js CHANGED
@@ -1,5 +1,8 @@
1
1
  const DOMUtils = {
2
2
  deleteNode(node) {
3
+ if (!node) {
4
+ return;
5
+ }
3
6
  if (node.parentNode) {
4
7
  node.parentNode.removeChild(node);
5
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DOMUtils.js","sourceRoot":"","sources":["../src/DOMUtils.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;IACf,UAAU,CAAC,IAAmB;QAC5B,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;SAClC;aAAM;YACL,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;SACpB;QACD,IAAI,GAAG,SAAS,CAAA;IAClB,CAAC;IAED,YAAY,CAAC,IAAmB,EAAE,IAAY,EAAE,GAAQ;QACtD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;QAClD,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,QAAe,CAAC,CAAA;IAC1C,CAAC;IAED,kBAAkB,CAAC,IAAmB;QACpC,IAAI,OAAO,GAAG,IAAI,CAAC,WAAW,CAAA;QAC9B,OAAO,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC,CAAC,kBAAkB,EAAE;YAC3D,OAAO,GAAG,OAAO,CAAC,WAAW,CAAA;SAC9B;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAA;AAED,eAAe,QAAQ,CAAA"}
1
+ {"version":3,"file":"DOMUtils.js","sourceRoot":"","sources":["../src/DOMUtils.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;IACf,UAAU,CAAC,IAAmB;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAM;QACR,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACnC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QACrB,CAAC;QACD,IAAI,GAAG,SAAS,CAAA;IAClB,CAAC;IAED,YAAY,CAAC,IAAmB,EAAE,IAAY,EAAE,GAAQ;QACtD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;QAClD,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,QAAe,CAAC,CAAA;IAC1C,CAAC;IAED,kBAAkB,CAAC,IAAmB;QACpC,IAAI,OAAO,GAAG,IAAI,CAAC,WAAW,CAAA;QAC9B,OAAO,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC,CAAC,kBAAkB,EAAE,CAAC;YAC5D,OAAO,GAAG,OAAO,CAAC,WAAW,CAAA;QAC/B,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAA;AAED,eAAe,QAAQ,CAAA"}
@@ -1,8 +1,8 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import type { BackoffStrategy } from 'backoff';
3
2
  import { AxiosRequestConfig, AxiosResponse } from 'axios';
4
3
  import S3 from './S3.js';
5
4
  import { Dump } from './Dump.js';
5
+ import { Renderer } from './renderers/abstract.renderer.js';
6
6
  interface DownloaderOpts {
7
7
  uaString: string;
8
8
  speed: number;
@@ -20,34 +20,58 @@ interface BackoffOptions {
20
20
  retryIf: (error?: any) => boolean;
21
21
  backoffHandler: (number: number, delay: number, error?: any) => void;
22
22
  }
23
+ export declare class DownloadError extends Error {
24
+ urlCalled: string | null;
25
+ httpReturnCode: number | null;
26
+ responseContentType: string | null;
27
+ responseData: any;
28
+ constructor(message: string, urlCalled: string | null, httpReturnCode: number | null, responseContentType: string | null, responseData: any);
29
+ }
30
+ export interface DownloadErrorContext {
31
+ urlCalled: string;
32
+ errorCode: string | null;
33
+ httpReturnCode: number | null;
34
+ responseContentType: string | null;
35
+ responseData: any;
36
+ }
23
37
  /**
24
38
  * Downloader is a class providing content retrieval functionalities for both Mediawiki and S3 remote instances.
25
39
  */
26
40
  declare class Downloader {
41
+ private static instance;
42
+ static getInstance(): Downloader;
27
43
  loginCookie: string;
28
- readonly speed: number;
44
+ private _speed;
29
45
  cssDependenceUrls: KVS<boolean>;
30
- readonly webp: boolean;
31
- readonly requestTimeout: number;
32
- readonly basicRequestOptions: AxiosRequestConfig;
33
- readonly arrayBufferRequestOptions: AxiosRequestConfig;
34
- readonly jsonRequestOptions: AxiosRequestConfig;
35
- readonly streamRequestOptions: AxiosRequestConfig;
46
+ private _webp;
47
+ private _requestTimeout;
48
+ private _basicRequestOptions;
49
+ private _arrayBufferRequestOptions;
50
+ private _jsonRequestOptions;
51
+ private _streamRequestOptions;
36
52
  wikimediaMobileJsDependenciesList: string[];
37
53
  wikimediaMobileStyleDependenciesList: string[];
38
- private readonly uaString;
54
+ private uaString;
39
55
  private activeRequests;
40
56
  private maxActiveRequests;
41
- private readonly backoffOptions;
42
- private readonly optimisationCacheUrl;
57
+ private backoffOptions;
58
+ private optimisationCacheUrl;
43
59
  private s3;
44
60
  private apiUrlDirector;
45
61
  private articleUrlDirector;
46
62
  private mainPageUrlDirector;
47
- private readonly insecure;
48
- constructor({ uaString, speed, reqTimeout, optimisationCacheUrl, s3, webp, backoffOptions, insecure }: DownloaderOpts);
63
+ private insecure;
64
+ get speed(): number;
65
+ get webp(): boolean;
66
+ get requestTimeout(): number;
67
+ get basicRequestOptions(): AxiosRequestConfig<any>;
68
+ get arrayBufferRequestOptions(): AxiosRequestConfig<any>;
69
+ get jsonRequestOptions(): AxiosRequestConfig<any>;
70
+ get streamRequestOptions(): AxiosRequestConfig<any>;
71
+ set init({ uaString, speed, reqTimeout, optimisationCacheUrl, s3, webp, backoffOptions, insecure }: DownloaderOpts);
72
+ private reset;
49
73
  private getUrlDirector;
50
- setUrlsDirectors(mainPageRenderer: any, articlesRenderer: any): void;
74
+ setUrlsDirectors(mainPageRenderer: Renderer, articlesRenderer: Renderer): void;
51
75
  getArticleUrl(articleId: string): string;
52
76
  getMainPageUrl(articleId: string): string;
53
77
  removeEtagWeakPrefix(etag: string): string;
@@ -57,7 +81,8 @@ declare class Downloader {
57
81
  gapContinue: string;
58
82
  articleDetails: QueryMwRet;
59
83
  }>;
60
- getArticle(webp: boolean, _moduleDependencies: any, articleId: string, articleDetailXId: RKVS<ArticleDetail>, articleRenderer: any, articleUrl: any, dump: Dump, articleDetail?: ArticleDetail, isMainPage?: boolean): Promise<any>;
84
+ getLogEvents(letype: string, articleId: string): Promise<any>;
85
+ getArticle(articleId: string, articleDetailXId: RKVS<ArticleDetail>, articleRenderer: Renderer, articleUrl: any, dump: Dump, articleDetail?: ArticleDetail, isMainPage?: boolean): Promise<any>;
61
86
  getJSON<T>(_url: string): Promise<T>;
62
87
  request<T = any, R extends AxiosResponse<T> = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
63
88
  downloadContent(_url: string, kind: DonwloadKind, retry?: boolean): Promise<{
@@ -82,8 +107,11 @@ declare class Downloader {
82
107
  getModuleDependencies(title: string): Promise<{
83
108
  jsConfigVars: string;
84
109
  jsDependenciesList: string[];
85
- styleDependenciesList: string[];
110
+ styleDependenciesList: any[];
86
111
  }>;
87
112
  private streamToBuffer;
113
+ static extractJsConfigVars(headhtml: string): string;
88
114
  }
89
- export default Downloader;
115
+ export { Downloader as DownloaderClass };
116
+ declare const _default: Downloader;
117
+ export default _default;