twitter-snap 0.0.80 → 0.1.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 (102) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +141 -138
  3. package/bin/dev.cmd +3 -3
  4. package/bin/dev.js +5 -6
  5. package/bin/run.cmd +3 -3
  6. package/bin/run.js +5 -5
  7. package/dist/app.d.ts +76 -41
  8. package/dist/app.d.ts.map +1 -1
  9. package/dist/app.js +170 -191
  10. package/dist/app.js.map +1 -1
  11. package/dist/commands/index.d.ts +23 -49
  12. package/dist/commands/index.d.ts.map +1 -1
  13. package/dist/commands/index.js +128 -136
  14. package/dist/commands/index.js.map +1 -1
  15. package/dist/config.d.ts +41 -36
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/config.js +2 -0
  18. package/dist/config.js.map +1 -1
  19. package/dist/hooks/interactive.d.ts.map +1 -1
  20. package/dist/hooks/interactive.js +10 -17
  21. package/dist/hooks/interactive.js.map +1 -1
  22. package/dist/service/core.d.ts +12 -11
  23. package/dist/service/core.d.ts.map +1 -1
  24. package/dist/service/core.js +21 -62
  25. package/dist/service/core.js.map +1 -1
  26. package/dist/service/pixiv/app.d.ts.map +1 -1
  27. package/dist/service/pixiv/app.js +84 -73
  28. package/dist/service/pixiv/app.js.map +1 -1
  29. package/dist/service/pixiv/render/image.d.ts +3 -3
  30. package/dist/service/pixiv/render/image.d.ts.map +1 -1
  31. package/dist/service/pixiv/render/image.js +13 -11
  32. package/dist/service/pixiv/render/image.js.map +1 -1
  33. package/dist/service/pixiv/render/video.d.ts +3 -3
  34. package/dist/service/pixiv/render/video.d.ts.map +1 -1
  35. package/dist/service/pixiv/type.d.ts +5 -5
  36. package/dist/service/pixiv/type.d.ts.map +1 -1
  37. package/dist/service/twitter/app.d.ts +2 -1
  38. package/dist/service/twitter/app.d.ts.map +1 -1
  39. package/dist/service/twitter/app.js +100 -88
  40. package/dist/service/twitter/app.js.map +1 -1
  41. package/dist/service/twitter/render/basic/image.d.ts +12 -7
  42. package/dist/service/twitter/render/basic/image.d.ts.map +1 -1
  43. package/dist/service/twitter/render/basic/image.js +634 -631
  44. package/dist/service/twitter/render/basic/image.js.map +1 -1
  45. package/dist/service/twitter/render/basic/video.d.ts +3 -3
  46. package/dist/service/twitter/render/basic/video.d.ts.map +1 -1
  47. package/dist/service/twitter/render/basic/video.js +90 -89
  48. package/dist/service/twitter/render/basic/video.js.map +1 -1
  49. package/dist/service/twitter/render/makeItAQuote/image.d.ts +4 -4
  50. package/dist/service/twitter/render/makeItAQuote/image.d.ts.map +1 -1
  51. package/dist/service/twitter/render/makeItAQuote/image.js +99 -101
  52. package/dist/service/twitter/render/makeItAQuote/image.js.map +1 -1
  53. package/dist/service/twitter/render/utils/utils.d.ts +32 -5
  54. package/dist/service/twitter/render/utils/utils.d.ts.map +1 -1
  55. package/dist/service/twitter/render/utils/utils.js +11 -6
  56. package/dist/service/twitter/render/utils/utils.js.map +1 -1
  57. package/dist/service/twitter/utils.d.ts +1 -1
  58. package/dist/service/twitter/utils.d.ts.map +1 -1
  59. package/dist/utils/cache.d.ts +1 -1
  60. package/dist/utils/cache.d.ts.map +1 -1
  61. package/dist/utils/cache.js.map +1 -1
  62. package/dist/utils/cookies.d.ts +1 -1
  63. package/dist/utils/cookies.d.ts.map +1 -1
  64. package/dist/utils/cookies.js +2 -1
  65. package/dist/utils/cookies.js.map +1 -1
  66. package/dist/utils/element.d.ts +1 -1
  67. package/dist/utils/element.d.ts.map +1 -1
  68. package/dist/utils/element.js +168 -166
  69. package/dist/utils/element.js.map +1 -1
  70. package/dist/utils/file.d.ts +2 -2
  71. package/dist/utils/file.d.ts.map +1 -1
  72. package/dist/utils/file.js +44 -42
  73. package/dist/utils/file.js.map +1 -1
  74. package/dist/utils/font.d.ts +2 -2
  75. package/dist/utils/font.d.ts.map +1 -1
  76. package/dist/utils/font.js +1 -0
  77. package/dist/utils/font.js.map +1 -1
  78. package/dist/utils/logger.d.ts +30 -31
  79. package/dist/utils/logger.d.ts.map +1 -1
  80. package/dist/utils/logger.js +31 -31
  81. package/dist/utils/logger.js.map +1 -1
  82. package/dist/utils/login.d.ts +2 -2
  83. package/dist/utils/login.d.ts.map +1 -1
  84. package/dist/utils/login.js +30 -31
  85. package/dist/utils/login.js.map +1 -1
  86. package/dist/utils/markdown.js +12 -21
  87. package/dist/utils/markdown.js.map +1 -1
  88. package/dist/utils/path.d.ts.map +1 -1
  89. package/dist/utils/path.js +5 -0
  90. package/dist/utils/path.js.map +1 -1
  91. package/dist/utils/render.d.ts +8 -9
  92. package/dist/utils/render.d.ts.map +1 -1
  93. package/dist/utils/render.js +16 -25
  94. package/dist/utils/render.js.map +1 -1
  95. package/dist/utils/replace.d.ts +1 -1
  96. package/dist/utils/video.d.ts +7 -12
  97. package/dist/utils/video.d.ts.map +1 -1
  98. package/dist/utils/video.js +63 -60
  99. package/dist/utils/video.js.map +1 -1
  100. package/oclif.manifest.json +12 -1
  101. package/package.json +41 -51
  102. package/dist/tsconfig.build.tsbuildinfo +0 -1
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 [yuki](https://yuki0311.com/)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2023 [yuki](https://yuki0311.com/)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,111 +1,111 @@
1
- # twitter-snap
2
-
3
- Create beautiful Tweet images fast.
4
- Fast, good design, Browser is not a dependency.
5
-
6
- ```shell
7
- npx twitter-snap@latest https://twitter.com/elonmusk/status/1770222178279252062
8
- ```
9
-
10
- <p float="left">
11
- <img src="./docs/img/output-1.png" width="49%" />
12
- <img src="./docs/img/output-2.png" width="49%" />
13
- <img src="./docs/img/output-3.png" width="49%" />
14
- <img src="./docs/img/output-4.png" width="49%" />
15
- </p>
16
-
17
- <p float="left">
18
- <img src="./docs/img/output-1-1.png" width="49%" />
19
- </p>
20
-
21
- [More Samples](https://github.com/fa0311/twitter-snap/issues/47)
22
-
23
- ```shell
24
- # Interactive mode
25
- npx twitter-snap@latest -i
26
- ```
27
-
28
- <img src="./docs/img/input-1.png" width="49%" />
29
-
30
- ---
31
-
32
- ```shell
33
- # Login with cookies
34
- npx twitter-snap@latest https://twitter.com/elonmusk/status/1349129669258448897 --session-type file --cookies-file cookies.json
35
- # Login with puppeteer
36
- npx twitter-snap@latest https://twitter.com/elonmusk/status/1349129669258448897 --session-type browser
37
-
38
- # Output the API response directly to a file in raw JSON format.
39
- npx twitter-snap@latest --theme Json https://x.com/elonmusk/status/1349129669258448897 -o output/data.json
40
- # Download the media file and save it directly to a file in its raw format.
41
- npx twitter-snap@latest --theme Media https://x.com/elonmusk/status/1349129669258448897 -o output/{count}
42
- # Use chatgpt to summarize the data in this tweet.
43
- npx twitter-snap@latest --theme LiteJson -o {stdout} https://x.com/elonmusk | chatgpt -p 'Summarize the data in this tweet.'
44
- ```
45
-
46
- ## Install
47
-
48
- `npm -g i twitter-snap@latest`
49
-
50
- ## Docker
51
-
52
- ```shell
53
- docker run -it --rm -v $(pwd)/output:/app/output ghcr.io/fa0311/twitter-snap/twitter-snap-docker:latest https://x.com/elonmusk/status/1349129669258448897
54
- ```
55
-
56
- ```shell
57
- docker run -it --rm -v $(pwd)/output:/app/output -v $(pwd)/cookies.json:/app/cookies.json ghcr.io/fa0311/twitter-snap/twitter-snap-docker:latest https://x.com/elonmusk/status/1349129669258448897 --session-type file
58
- ```
59
-
60
- `--session-type=browser` is not supported.
61
-
62
- `GPU` is not supported.
63
-
64
- # Use as a package
65
-
66
- ```shell
67
- npm i twitter-snap
68
- ```
69
-
70
- ```typescript
71
- import {getSnapAppRender} from 'twitter-snap'
72
-
73
- const snap = getSnapAppRender({url: 'https://x.com/elonmusk/status/1349129669258448897'})
74
- const font = await snap.getFont()
75
- const session = await snap.login({sessionType: 'guest'})
76
- const render = await snap.getRender({limit: 1, session})
77
-
78
- await snap.run(render, async (run) => {
79
- const res = await run({
80
- width: 650,
81
- theme: 'RenderOceanBlueColor',
82
- font,
83
- output: 'temp/{id}-{count}.{if-type:png:mp4:json:}',
84
- })
85
- await res.file.tempCleanup()
86
- })
87
- ```
88
-
89
- ```typescript
90
- import {getSnapAppRenderWithCache} from 'twitter-snap'
91
-
92
- const snap = getSnapAppRenderWithCache({})
93
- const res = await snap({
94
- url: 'https://x.com/elonmusk/status/1349129669258448897',
95
- callback: async (run) => {
96
- const res = await run({
97
- width: 1440,
98
- scale: 2,
99
- theme: 'RenderOceanBlueColor',
100
- output: 'temp/{id}-{count}.{if-type:png:mp4:json:}',
101
- })
102
- await res.file.tempCleanup()
103
- },
104
- })
105
- ```
106
-
107
- # Usage
108
-
1
+ # twitter-snap
2
+
3
+ Create beautiful Tweet images fast.
4
+ Fast, good design, Browser is not a dependency.
5
+
6
+ ```shell
7
+ npx twitter-snap@latest https://twitter.com/elonmusk/status/1770222178279252062
8
+ ```
9
+
10
+ <p float="left">
11
+ <img src="./docs/img/output-1.png" width="49%" />
12
+ <img src="./docs/img/output-2.png" width="49%" />
13
+ <img src="./docs/img/output-3.png" width="49%" />
14
+ <img src="./docs/img/output-4.png" width="49%" />
15
+ </p>
16
+
17
+ <p float="left">
18
+ <img src="./docs/img/output-1-1.png" width="49%" />
19
+ </p>
20
+
21
+ [More Samples](https://github.com/fa0311/twitter-snap/issues/47)
22
+
23
+ ```shell
24
+ # Interactive mode
25
+ npx twitter-snap@latest -i
26
+ ```
27
+
28
+ <img src="./docs/img/input-1.png" width="49%" />
29
+
30
+ ---
31
+
32
+ ```shell
33
+ # Login with cookies
34
+ npx twitter-snap@latest https://twitter.com/elonmusk/status/1349129669258448897 --session-type file --cookies-file cookies.json
35
+ # Login with puppeteer
36
+ npx twitter-snap@latest https://twitter.com/elonmusk/status/1349129669258448897 --session-type browser
37
+
38
+ # Output the API response directly to a file in raw JSON format.
39
+ npx twitter-snap@latest --theme Json https://x.com/elonmusk/status/1349129669258448897 -o output/data.json
40
+ # Download the media file and save it directly to a file in its raw format.
41
+ npx twitter-snap@latest --theme Media https://x.com/elonmusk/status/1349129669258448897 -o output/{count}
42
+ # Use chatgpt to summarize the data in this tweet.
43
+ npx twitter-snap@latest --theme LiteJson -o {stdout} https://x.com/elonmusk | chatgpt -p 'Summarize the data in this tweet.'
44
+ ```
45
+
46
+ ## Install
47
+
48
+ `npm -g i twitter-snap@latest`
49
+
50
+ ## Docker
51
+
52
+ ```shell
53
+ docker run -it --rm -v $(pwd)/output:/app/output ghcr.io/fa0311/twitter-snap/twitter-snap-docker:latest https://x.com/elonmusk/status/1349129669258448897
54
+ ```
55
+
56
+ ```shell
57
+ docker run -it --rm -v $(pwd)/output:/app/output -v $(pwd)/cookies.json:/app/cookies.json ghcr.io/fa0311/twitter-snap/twitter-snap-docker:latest https://x.com/elonmusk/status/1349129669258448897 --session-type file
58
+ ```
59
+
60
+ `--session-type=browser` is not supported.
61
+
62
+ `GPU` is not supported.
63
+
64
+ # Use as a package
65
+
66
+ ```shell
67
+ npm i twitter-snap
68
+ ```
69
+
70
+ ```typescript
71
+ import {getSnapAppRender} from 'twitter-snap'
72
+
73
+ const snap = getSnapAppRender({url: 'https://x.com/elonmusk/status/1349129669258448897'})
74
+ const font = await snap.getFont()
75
+ const session = await snap.login({sessionType: 'guest'})
76
+ const render = await snap.getRender({limit: 1, session})
77
+
78
+ await snap.run(render, async (run) => {
79
+ const res = await run({
80
+ width: 650,
81
+ theme: 'RenderOceanBlueColor',
82
+ font,
83
+ output: 'temp/{id}-{count}.{if-type:png:mp4:json:}',
84
+ })
85
+ await res.file.tempCleanup()
86
+ })
87
+ ```
88
+
89
+ ```typescript
90
+ import {getSnapAppRenderWithCache} from 'twitter-snap'
91
+
92
+ const snap = getSnapAppRenderWithCache({})
93
+ const res = await snap({
94
+ url: 'https://x.com/elonmusk/status/1349129669258448897',
95
+ callback: async (run) => {
96
+ const res = await run({
97
+ width: 1440,
98
+ scale: 2,
99
+ theme: 'RenderOceanBlueColor',
100
+ output: 'temp/{id}-{count}.{if-type:png:mp4:json:}',
101
+ })
102
+ await res.file.tempCleanup()
103
+ },
104
+ })
105
+ ```
106
+
107
+ # Usage
108
+
109
109
  <!-- COMMANDS_PLACEHOLDER_START -->
110
110
 
111
111
  ```shell
@@ -117,14 +117,14 @@ USAGE
117
117
  <value>] [--cookiesFile <value>] [--debug] [--interactive]
118
118
  [--ffmpegAdditonalOption <value>] [--ffmpegTimeout <value>] [--ffmpegPath
119
119
  <value>] [--ffprobePath <value>] [--fontPath <value>] [--limit <value>]
120
- [--noCleanup] [-o <value>] [--sessionType browser|file|guest] [--simpleLog]
121
- [--sleep <value>] [--theme RenderOceanBlueColor|RenderOceanBlueDarkColor|Ren
122
- derSunsetGardenColor|RenderSunsetGardenDarkColor|RenderDawnBlossomColor|Rend
123
- erDawnBlossomDarkColor|RenderFierySunsetColor|RenderFierySunsetDarkColor|Ren
124
- derTwilightSkyColor|RenderTwilightSkyDarkColor|RenderPlainColor|RenderPlainD
125
- arkColor|RenderTransparent|RenderTransparentDark|RenderTransparentShadow|Ren
126
- derTransparentShadowDark|Json|LiteJson|Media|RenderMakeItAQuote] [--width
127
- <value>] [--scale <value>]
120
+ [--noCleanup] [--outputPrefix <value>] [-o <value>] [--sessionType
121
+ browser|file|guest] [--simpleLog] [--sleep <value>] [--theme
122
+ RenderOceanBlueColor|RenderOceanBlueDarkColor|RenderSunsetGardenColor|Render
123
+ SunsetGardenDarkColor|RenderDawnBlossomColor|RenderDawnBlossomDarkColor|Rend
124
+ erFierySunsetColor|RenderFierySunsetDarkColor|RenderTwilightSkyColor|RenderT
125
+ wilightSkyDarkColor|RenderPlainColor|RenderPlainDarkColor|RenderTransparent|
126
+ RenderTransparentDark|RenderTransparentShadow|RenderTransparentShadowDark|Js
127
+ on|LiteJson|Media|RenderMakeItAQuote] [--width <value>] [--scale <value>]
128
128
 
129
129
  ARGUMENTS
130
130
  URL Twitter url
@@ -169,6 +169,9 @@ FLAGS
169
169
  --noCleanup
170
170
  Cleanup
171
171
 
172
+ --outputPrefix=<value>
173
+ Output file name prefix
174
+
172
175
  --scale=<value>
173
176
  [default: 1] Scale
174
177
 
@@ -210,25 +213,25 @@ EXAMPLES
210
213
 
211
214
  ```
212
215
 
213
- <!-- COMMANDS_PLACEHOLDER_END -->
214
-
215
- # Features
216
-
217
- - `https?://(www.)?(mobile.)?(x|twitter).com`
218
-
219
- - `/:user/status/:id`
220
- - `/search?:params`
221
- - `/home`
222
- - `/i/lists/:id`
223
- - `/:user/with_replies`
224
- - `/:user/media`
225
- - `/:user/likes`
226
- - `/:user`
227
- - `/i/bookmarks`
228
-
229
- - `https?://(www.)?pixiv.net`
230
- - `/artworks/:id`
231
-
232
- ## Dependence
233
-
234
- - [ffmpeg](https://ffmpeg.org/) (for video)
216
+ <!-- COMMANDS_PLACEHOLDER_END -->
217
+
218
+ # Features
219
+
220
+ - `https?://(www.)?(mobile.)?(x|twitter).com`
221
+
222
+ - `/:user/status/:id`
223
+ - `/search?:params`
224
+ - `/home`
225
+ - `/i/lists/:id`
226
+ - `/:user/with_replies`
227
+ - `/:user/media`
228
+ - `/:user/likes`
229
+ - `/:user`
230
+ - `/i/bookmarks`
231
+
232
+ - `https?://(www.)?pixiv.net`
233
+ - `/artworks/:id`
234
+
235
+ ## Dependence
236
+
237
+ - [ffmpeg](https://ffmpeg.org/) (for video)
package/bin/dev.cmd CHANGED
@@ -1,3 +1,3 @@
1
- @echo off
2
-
3
- node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
1
+ @echo off
2
+
3
+ node --import tsx --disable-warning=ExperimentalWarning "%~dp0\dev" %*
package/bin/dev.js CHANGED
@@ -1,6 +1,5 @@
1
- #!/usr/bin/env -S node --loader ts-node/esm --disable-warning=ExperimentalWarning
2
-
3
- // eslint-disable-next-line n/shebang
4
- import {execute} from '@oclif/core'
5
-
6
- await execute({development: true, dir: import.meta.url})
1
+ #!/usr/bin/env -S node --import tsx --disable-warning=ExperimentalWarning
2
+
3
+ import {execute} from '@oclif/core'
4
+
5
+ await execute({development: true, dir: import.meta.url})
package/bin/run.cmd CHANGED
@@ -1,3 +1,3 @@
1
- @echo off
2
-
3
- node "%~dp0\run" %*
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
package/bin/run.js CHANGED
@@ -1,5 +1,5 @@
1
- #!/usr/bin/env node
2
-
3
- import {execute} from '@oclif/core'
4
-
5
- await execute({dir: import.meta.url})
1
+ #!/usr/bin/env node
2
+
3
+ import {execute} from '@oclif/core'
4
+
5
+ await execute({dir: import.meta.url})
package/dist/app.d.ts CHANGED
@@ -1,22 +1,39 @@
1
- import { ColorThemeType, themeList } from './config.js';
2
- import { FontOptions, FontUtils } from './utils/font.js';
3
- import { Logger } from './utils/logger.js';
4
- import { SnapAppBrowserUtils } from './utils/login.js';
5
- import { SnapRenderBaseUtils, SnapRenderColorUtils, SnapRenderUtils } from './utils/render.js';
6
- import { FileReplace } from './utils/replace.js';
1
+ import type { ReactElement } from 'react';
2
+ import { type ColorThemeType, type ThemeOf, themeList } from './config.js';
3
+ import type { FontOptions, FontUtils } from './utils/font.js';
4
+ import type { Logger } from './utils/logger.js';
5
+ import type { SnapAppBrowserUtils } from './utils/login.js';
6
+ import { type SnapRenderBaseUtils, SnapRenderColorUtils, SnapRenderUtils } from './utils/render.js';
7
+ import { type FileReplace } from './utils/replace.js';
7
8
  export declare const includeColorTheme: (theme: string) => theme is ColorThemeType;
8
9
  export declare const includeTheme: (theme: string) => theme is keyof typeof themeList;
9
- type ExtractGroups<T extends string> = T extends `${infer _Start}(?<${infer GroupName}>${infer _Rest})${infer Tail}` ? {
10
+ export type ExtractGroups<T extends string> = T extends `${infer _Start}(?<${infer GroupName}>${infer _Rest})${infer Tail}` ? {
10
11
  [K in GroupName | keyof ExtractGroups<Tail>]: string;
11
- } : {};
12
- type SnapAppCallback<T1, V1 extends string, V2> = (utils: {
12
+ } : Record<never, never>;
13
+ type SnapAppCallback<T1, V1 extends string> = (utils: {
13
14
  limit: number;
14
- }, api: T1, match: ExtractGroups<V1>) => Promise<SnapRenderChild<V2>>;
15
+ }, api: T1, match: ExtractGroups<V1>) => Promise<SnapRenderStream>;
15
16
  export declare class Session<T1> {
16
17
  api: T1;
17
18
  constructor(api: T1);
18
19
  }
19
- export declare class SnapApp<T1> {
20
+ export type SnapSession = {
21
+ render: (url: string, utils: {
22
+ limit: number;
23
+ }) => Promise<SnapRenderStream>;
24
+ };
25
+ export type SnapAppInfo = {
26
+ name: string;
27
+ pattern: RegExp;
28
+ routes: RegExp[];
29
+ fonts: (utils: FontUtils) => Promise<FontOptions>;
30
+ init: ({ logger }: {
31
+ logger: Logger;
32
+ }) => Promise<void>;
33
+ test: (url: string) => boolean;
34
+ login: (utils: SnapAppBrowserUtils) => Promise<SnapSession>;
35
+ };
36
+ export declare class SnapApp<T1> implements SnapAppInfo {
20
37
  name: string;
21
38
  callback: (util: SnapAppBrowserUtils) => Promise<Session<T1>>;
22
39
  fonts: (utils: FontUtils) => Promise<FontOptions>;
@@ -24,33 +41,42 @@ export declare class SnapApp<T1> {
24
41
  logger: Logger;
25
42
  }) => Promise<void>;
26
43
  pattern: RegExp;
27
- callbackList: [RegExp, SnapAppCallback<T1, string, any>][];
44
+ routes: RegExp[];
45
+ private callbackList;
28
46
  constructor(name: string, pattern: string, callback: (util: SnapAppBrowserUtils) => Promise<Session<T1>>, fonts: (utils: FontUtils) => Promise<FontOptions>, init: ({ logger }: {
29
47
  logger: Logger;
30
48
  }) => Promise<void>);
31
- call<V1 extends string, V2>(pattern: V1, callback: SnapAppCallback<T1, V1, V2>): void;
49
+ call<V1 extends string>(pattern: V1, callback: SnapAppCallback<T1, V1>): void;
50
+ test(url: string): boolean;
51
+ private route;
52
+ login(utils: SnapAppBrowserUtils): Promise<SnapSession>;
32
53
  }
33
- type CallbackImage<T1> = (data: T1, utils: SnapRenderColorUtils) => Promise<React.ReactElement>;
54
+ type CallbackImage<T1> = (data: T1, utils: SnapRenderColorUtils) => Promise<ReactElement>;
34
55
  type CallbackVideo<T1> = (data: T1, utils: SnapRenderColorUtils) => Promise<void>;
35
56
  type CallbackOther<T1> = (data: T1, utils: SnapRenderUtils, placeholder: FileReplace[], output: string) => Promise<void>;
36
- type CallbackJson<T1> = (data: T1, utils: SnapRenderUtils) => Promise<any>;
57
+ type CallbackJson<T1> = (data: T1, utils: SnapRenderUtils) => Promise<unknown>;
37
58
  type CallbackMedia<T1> = (data: T1, utils: SnapRenderUtils) => Promise<void>;
38
- export declare class SnapRender<T1> {
59
+ export type SnapRenderDefinition<T1> = {
39
60
  isImage: (data: T1) => boolean;
40
61
  placeholder: (data: T1) => FileReplace[];
41
- imageCallback: [string, CallbackImage<T1>][];
42
- videoCallback: [string, CallbackVideo<T1>][];
43
- otherCallback: [string, CallbackOther<T1>][];
44
- jsonCallback: [string, CallbackJson<T1>][];
45
- constructor(isImage: (data: T1) => boolean, placeholder: (data: T1) => FileReplace[], image: CallbackImage<T1>, video: CallbackVideo<T1>);
46
- run: (data: AsyncGenerator<T1, any, any>) => SnapRenderChild<T1>;
47
- add: (theme: string, image: CallbackImage<T1>, video: CallbackVideo<T1>) => void;
48
- other: (theme: string, callback: CallbackOther<T1>) => void;
49
- json: (theme: string, json: CallbackJson<T1>) => void;
50
- media: <T2>(theme: string, media: (data: T1) => T2[], mediaPlaceholder: (data: T2) => FileReplace[], callback: CallbackMedia<T2>) => void;
62
+ color: {
63
+ image: CallbackImage<T1>;
64
+ video: CallbackVideo<T1>;
65
+ };
66
+ element?: Partial<Record<Exclude<ThemeOf<'element'>, ColorThemeType>, {
67
+ image: CallbackImage<T1>;
68
+ video: CallbackVideo<T1>;
69
+ }>>;
70
+ json?: Partial<Record<ThemeOf<'json'>, CallbackJson<T1>>>;
71
+ other?: Partial<Record<ThemeOf<'other'>, CallbackOther<T1>>>;
72
+ };
73
+ export declare class SnapRender<T1> {
74
+ definition: SnapRenderDefinition<T1>;
75
+ constructor(definition: SnapRenderDefinition<T1>);
76
+ run: (data: AsyncGenerator<T1>) => SnapRenderChild<T1>;
51
77
  }
52
- export type SnapRenderChildNextParam<T1> = {
53
- data: T1;
78
+ export declare const mediaCallback: <T1, T2>(media: (data: T1) => T2[], mediaPlaceholder: (data: T2) => FileReplace[], callback: CallbackMedia<T2>) => CallbackOther<T1>;
79
+ export type SnapRenderNextParam = {
54
80
  ffmpegAdditonalOption?: string[];
55
81
  ffmpegPath?: string;
56
82
  ffmpegTimeout?: number;
@@ -62,21 +88,30 @@ export type SnapRenderChildNextParam<T1> = {
62
88
  theme: string;
63
89
  width: number;
64
90
  };
65
- export declare class SnapRenderChild<T1> {
91
+ export type SnapRenderItem = {
92
+ next: (param: SnapRenderNextParam) => Promise<SnapRenderBaseUtils>;
93
+ image: (theme: ThemeOf<'element'>, utils: SnapRenderColorUtils) => Promise<ReactElement>;
94
+ video: (theme: ThemeOf<'element'>, utils: SnapRenderColorUtils) => Promise<void>;
95
+ };
96
+ export type SnapRenderStream = AsyncIterable<SnapRenderItem>;
97
+ export declare class SnapRenderChild<T1> implements SnapRenderStream {
98
+ definition: SnapRenderDefinition<T1>;
99
+ data: AsyncGenerator<T1>;
100
+ count: number;
101
+ constructor(definition: SnapRenderDefinition<T1>, data: AsyncGenerator<T1>);
102
+ [Symbol.asyncIterator](): AsyncGenerator<SnapRenderItem, void, unknown>;
103
+ item: (data: T1) => SnapRenderItem;
104
+ element: (theme: ThemeOf<'element'>) => {
105
+ image: CallbackImage<T1>;
106
+ video: CallbackVideo<T1>;
107
+ };
108
+ image: (theme: ThemeOf<'element'>) => CallbackImage<T1>;
109
+ video: (theme: ThemeOf<'element'>) => CallbackVideo<T1>;
110
+ other: (theme: ThemeOf<'other'>) => CallbackOther<T1>;
111
+ json: (theme: ThemeOf<'json'>) => CallbackJson<T1>;
66
112
  isImage: (data: T1) => boolean;
67
113
  placeholder: (data: T1) => FileReplace[];
68
- imageCallback: [string, CallbackImage<T1>][];
69
- videoCallback: [string, CallbackVideo<T1>][];
70
- otherCallback: [string, CallbackOther<T1>][];
71
- jsonCallback: [string, CallbackJson<T1>][];
72
- data: AsyncGenerator<T1, any, any>;
73
- count: number;
74
- constructor(isImage: (data: T1) => boolean, placeholder: (data: T1) => FileReplace[], imageCallback: [string, CallbackImage<T1>][], videoCallback: [string, CallbackVideo<T1>][], otherCallback: [string, CallbackOther<T1>][], jsonCallback: [string, CallbackJson<T1>][], data: AsyncGenerator<T1, any, any>);
75
- image: (theme: string) => CallbackImage<T1>;
76
- video: (theme: string) => CallbackVideo<T1>;
77
- other: (theme: string) => CallbackOther<T1>;
78
- json: (theme: string) => CallbackJson<T1>;
79
- next: (flag: SnapRenderChildNextParam<T1>) => Promise<SnapRenderBaseUtils>;
114
+ next: (data: T1, param: SnapRenderNextParam) => Promise<SnapRenderBaseUtils>;
80
115
  }
81
116
  export {};
82
117
  //# sourceMappingURL=app.d.ts.map
package/dist/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAkB,SAAS,EAAC,MAAM,aAAa,CAAA;AAGrE,OAAO,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAC,mBAAmB,EAAE,oBAAoB,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAA;AAC5F,OAAO,EAAC,WAAW,EAAU,MAAM,oBAAoB,CAAA;AAGvD,eAAO,MAAM,iBAAiB,UAAW,MAAM,KAAG,KAAK,IAAI,cAE1D,CAAA;AAED,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,KAAK,IAAI,MAAM,OAAO,SAElE,CAAA;AAED,KAAK,aAAa,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC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