koishi-plugin-rocom 1.0.18 → 1.0.19

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 (57) hide show
  1. package/lib/announcement-service.d.ts +21 -0
  2. package/lib/announcement-service.js +63 -0
  3. package/lib/async-control.d.ts +3 -0
  4. package/lib/async-control.js +48 -0
  5. package/lib/client.d.ts +48 -7
  6. package/lib/client.js +244 -125
  7. package/lib/commands/egg.js +66 -4
  8. package/lib/commands/merchant.js +144 -146
  9. package/lib/commands/query.js +148 -117
  10. package/lib/commands/ranking.d.ts +2 -0
  11. package/lib/commands/ranking.js +31 -0
  12. package/lib/commands/share-code.d.ts +2 -0
  13. package/lib/commands/share-code.js +66 -0
  14. package/lib/commands/tools.js +47 -59
  15. package/lib/egg-service.d.ts +82 -8
  16. package/lib/egg-service.js +235 -19
  17. package/lib/img//345/274/202/350/211/262.png +0 -0
  18. package/lib/img//347/202/253/345/275/251.png +0 -0
  19. package/lib/index.d.ts +5 -0
  20. package/lib/index.js +16 -3
  21. package/lib/merchant-clock.d.ts +22 -0
  22. package/lib/merchant-clock.js +95 -0
  23. package/lib/merchant-service.d.ts +24 -0
  24. package/lib/merchant-service.js +148 -0
  25. package/lib/permissions.d.ts +16 -0
  26. package/lib/permissions.js +66 -0
  27. package/lib/pet-data-service.js +7 -9
  28. package/lib/pet-size.d.ts +13 -0
  29. package/lib/pet-size.js +54 -0
  30. package/lib/player-service.d.ts +37 -0
  31. package/lib/player-service.js +201 -0
  32. package/lib/ranking-service.d.ts +46 -0
  33. package/lib/ranking-service.js +137 -0
  34. package/lib/render-templates/announcement/detail.html +8 -0
  35. package/lib/render-templates/announcement/list.html +5 -0
  36. package/lib/render-templates/announcement/style.css +1 -0
  37. package/lib/render-templates/pet-ranking/index.html +99 -0
  38. package/lib/render-templates/pet-ranking/style.css +338 -0
  39. package/lib/render-templates/player-search/index.html +7 -0
  40. package/lib/render-templates/searcheggs/index.html +1 -1
  41. package/lib/render-templates/searcheggs/size.html +70 -68
  42. package/lib/render-templates/share-code-team/index.html +105 -0
  43. package/lib/render-templates/share-code-team/style.css +345 -0
  44. package/lib/render.d.ts +15 -2
  45. package/lib/render.js +120 -37
  46. package/lib/send-image.d.ts +1 -1
  47. package/lib/send-image.js +12 -1
  48. package/lib/share-code-service.d.ts +32 -0
  49. package/lib/share-code-service.js +184 -0
  50. package/lib/subscription-runner.d.ts +6 -0
  51. package/lib/subscription-runner.js +21 -0
  52. package/lib/subscription-send.d.ts +4 -2
  53. package/lib/subscription-send.js +45 -20
  54. package/lib/types.d.ts +5 -0
  55. package/lib/user.d.ts +5 -0
  56. package/package.json +4 -1
  57. package/readme.md +145 -124
@@ -1,82 +1,84 @@
1
- <!DOCTYPE html>
2
- <html lang="zh-CN">
3
- <head>
4
- <meta charset="UTF-8">
5
- <link rel="stylesheet" href="{{_res_path}}render/searcheggs/style.css">
6
- <style>
7
- .result-group { margin-top: 20px; }
8
- .result-group-title { font-size: 28px; font-weight: 800; color: #4b3423; margin-bottom: 14px; }
9
- .result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
10
- .result-card { background: rgba(255,255,255,0.94); border-radius: 18px; padding: 18px; box-shadow: 0 10px 24px rgba(40, 31, 23, 0.08); }
11
- .result-card-icon { width: 64px; height: 64px; border-radius: 16px; background: rgba(248, 244, 236, 0.92); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; border: 1px solid rgba(75, 52, 35, 0.08); }
12
- .result-card-icon img { width: 56px; height: 56px; object-fit: contain; }
13
- .result-card-name { font-size: 26px; font-weight: 700; color: #4d3624; }
14
- .result-card-meta { margin-top: 8px; color: #75563d; font-size: 18px; line-height: 1.7; }
15
- .result-empty { text-align: center; color: #6f5845; padding: 44px 20px; font-size: 24px; }
16
- .pagination-footer { margin-top: 22px; display: flex; justify-content: space-between; gap: 14px; color: #8c7a61; font-size: 14px; }
17
- .pagination-hint { max-width: 70%; }
18
- .copyright { white-space: nowrap; }
19
- </style>
20
- </head>
21
- <body>
22
- <div class="searcheggs-cont page-section-main">
23
- <div class="header-card">
24
- <div class="header-main">
25
- <div class="header-title">尺寸反查</div>
26
- <div class="header-subtitle">查询条件:{{query_label}}</div>
27
- </div>
28
- </div>
29
-
30
- {{if !has_results}}
31
- <div class="result-empty">没有找到匹配当前尺寸的精灵,注意身高要使用 m,例如 0.18m。</div>
32
- {{/if}}
33
-
34
- {{if perfect_matches && perfect_matches.length}}
35
- <section class="result-group">
36
- <div class="result-group-title">完美匹配</div>
37
- <div class="result-grid">
38
- {{each perfect_matches item}}
39
- <div class="result-card">
40
- {{if item.icon}}
41
- <div class="result-card-icon"><img src="{{item.icon}}" alt="{{item.name}}" onerror="this.style.display='none'"></div>
42
- {{/if}}
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <link rel="stylesheet" href="{{_res_path}}render/searcheggs/style.css">
6
+ <style>
7
+ .result-group { margin-top: 20px; }
8
+ .result-group-title { font-size: 28px; font-weight: 800; color: #4b3423; margin-bottom: 14px; }
9
+ .result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
10
+ .result-card { background: rgba(255,255,255,0.94); border-radius: 18px; padding: 18px; box-shadow: 0 10px 24px rgba(40, 31, 23, 0.08); }
11
+ .result-card-icon { width: 64px; height: 64px; border-radius: 16px; background: rgba(248, 244, 236, 0.92); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; border: 1px solid rgba(75, 52, 35, 0.08); }
12
+ .result-card-icon img { width: 56px; height: 56px; object-fit: contain; }
13
+ .result-card-name { font-size: 26px; font-weight: 700; color: #4d3624; }
14
+ .result-card-meta { margin-top: 8px; color: #75563d; font-size: 18px; line-height: 1.7; }
15
+ .result-empty { text-align: center; color: #6f5845; padding: 44px 20px; font-size: 24px; }
16
+ .pagination-footer { margin-top: 22px; display: flex; justify-content: space-between; gap: 14px; color: #8c7a61; font-size: 14px; }
17
+ .pagination-hint { max-width: 70%; }
18
+ .copyright { white-space: nowrap; }
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <div class="searcheggs-cont page-section-main">
23
+ <div class="header-card">
24
+ <div class="header-main">
25
+ <div class="header-title">尺寸反查</div>
26
+ <div class="header-subtitle">查询条件:{{query_label}}</div>
27
+ </div>
28
+ </div>
29
+
30
+ {{if !has_results}}
31
+ <div class="result-empty">没有找到匹配当前尺寸的精灵,注意身高要使用 m,例如 0.18m。</div>
32
+ {{/if}}
33
+
34
+ {{if perfect_matches && perfect_matches.length}}
35
+ <section class="result-group">
36
+ <div class="result-group-title">完美匹配</div>
37
+ <div class="result-grid">
38
+ {{each perfect_matches item}}
39
+ <div class="result-card">
40
+ {{if item.icon}}
41
+ <div class="result-card-icon"><img src="{{item.icon}}" alt="{{item.name}}" onerror="this.style.display='none'"></div>
42
+ {{/if}}
43
43
  <div class="result-card-name">{{item.name}} #{{item.id}}</div>
44
44
  <div class="result-card-meta">
45
45
  属性:{{item.type_label}}<br>
46
46
  蛋组:{{item.egg_groups_label}}{{if item.match_info_label}} | 匹配:{{item.match_info_label}}{{/if}}<br>
47
47
  身高:{{item.height_label}} | 体重:{{item.weight_label}}
48
+ {{if item.size_variant_label}}<br><strong>{{item.size_variant_label}}</strong> · {{item.size_variant_hint}}{{/if}}
48
49
  </div>
49
50
  </div>
50
- {{/each}}
51
- </div>
52
- </section>
53
- {{/if}}
54
-
55
- {{if range_matches && range_matches.length}}
56
- <section class="result-group">
57
- <div class="result-group-title">范围匹配</div>
58
- <div class="result-grid">
59
- {{each range_matches item}}
60
- <div class="result-card">
61
- {{if item.icon}}
62
- <div class="result-card-icon"><img src="{{item.icon}}" alt="{{item.name}}" onerror="this.style.display='none'"></div>
63
- {{/if}}
51
+ {{/each}}
52
+ </div>
53
+ </section>
54
+ {{/if}}
55
+
56
+ {{if range_matches && range_matches.length}}
57
+ <section class="result-group">
58
+ <div class="result-group-title">范围匹配</div>
59
+ <div class="result-grid">
60
+ {{each range_matches item}}
61
+ <div class="result-card">
62
+ {{if item.icon}}
63
+ <div class="result-card-icon"><img src="{{item.icon}}" alt="{{item.name}}" onerror="this.style.display='none'"></div>
64
+ {{/if}}
64
65
  <div class="result-card-name">{{item.name}} #{{item.id}}</div>
65
66
  <div class="result-card-meta">
66
67
  属性:{{item.type_label}}<br>
67
68
  蛋组:{{item.egg_groups_label}}{{if item.match_info_label}} | 匹配:{{item.match_info_label}}{{/if}}<br>
68
69
  身高:{{item.height_label}} | 体重:{{item.weight_label}}
70
+ {{if item.size_variant_label}}<br><strong>{{item.size_variant_label}}</strong> · {{item.size_variant_hint}}{{/if}}
69
71
  </div>
70
72
  </div>
71
- {{/each}}
72
- </div>
73
- </section>
74
- {{/if}}
75
-
76
- <div class="pagination-footer">
77
- <span class="pagination-hint">{{commandHint}}</span>
78
- <span class="copyright">{{copyright}}</span>
79
- </div>
80
- </div>
81
- </body>
82
- </html>
73
+ {{/each}}
74
+ </div>
75
+ </section>
76
+ {{/if}}
77
+
78
+ <div class="pagination-footer">
79
+ <span class="pagination-hint">{{commandHint}}</span>
80
+ <span class="copyright">{{copyright}}</span>
81
+ </div>
82
+ </div>
83
+ </body>
84
+ </html>
@@ -0,0 +1,105 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=1200, initial-scale=1">
6
+ <title>阵容分享码</title>
7
+ <link rel="stylesheet" href="{{_res_path}}render/share-code-team/style.css">
8
+ </head>
9
+ <body>
10
+ <section class="share-code-page">
11
+ <header class="share-header">
12
+ <img class="brand-logo" src="{{_res_path}}img/eit-logo.png" alt="">
13
+ <div class="header-copy">
14
+ <div class="header-kicker">ROCOM TEAM SHARE</div>
15
+ <h1>阵容分享码</h1>
16
+ <div class="header-meta">
17
+ <span class="source-tag">{{sourceLabel}}</span>
18
+ <span>{{mode.name}}</span>
19
+ <span>版本 {{version}}</span>
20
+ <span>{{spriteCount}} 只精灵</span>
21
+ </div>
22
+ </div>
23
+ <div class="magic-block">
24
+ <div class="magic-icon-shell">
25
+ <img class="magic-fallback" src="{{_res_path}}img/感叹号,不知道哪里能用.png" alt="">
26
+ {{if magic.icon}}
27
+ <img class="magic-icon" src="{{magic.icon}}" alt="" onerror="this.style.display='none'">
28
+ {{/if}}
29
+ </div>
30
+ <span>{{magic.name}}</span>
31
+ </div>
32
+ </header>
33
+
34
+ <section class="code-strip">
35
+ <span class="code-label">分享码</span>
36
+ <code>{{shareCodePreview}}</code>
37
+ {{if parseCount}}
38
+ <span class="record-count">累计解析 {{parseCount}} 次</span>
39
+ {{/if}}
40
+ </section>
41
+
42
+ {{if parseCount}}
43
+ <section class="record-meta">
44
+ <span>首次记录 {{firstSeen}}</span>
45
+ <span>最近记录 {{lastSeen}}</span>
46
+ </section>
47
+ {{/if}}
48
+
49
+ <main class="team-grid">
50
+ {{each teams team}}
51
+ <article class="team-slot">
52
+ <div class="slot-number">{{team.slot}}</div>
53
+ <section class="pet-summary">
54
+ <div class="pet-image-shell">
55
+ <img class="pet-fallback" src="{{_res_path}}img/logo.cVSpb3sL.png" alt="">
56
+ {{if team.pet.icon}}
57
+ <img class="pet-image" src="{{team.pet.icon}}" alt="" onerror="this.style.display='none'">
58
+ {{/if}}
59
+ </div>
60
+ <div class="pet-copy">
61
+ <h2>{{team.pet.name}}</h2>
62
+ {{if team.pet.id}}<span>ID {{team.pet.id}}</span>{{/if}}
63
+ <div class="pet-tags">
64
+ <span>{{team.bloodline.name}}</span>
65
+ <span>{{team.personality.name}}</span>
66
+ </div>
67
+ </div>
68
+ </section>
69
+
70
+ <section class="ivs-section">
71
+ <div class="section-label">天赋倾向</div>
72
+ <div class="ivs-list">
73
+ {{each team.ivs iv}}
74
+ <span class="iv-tag {{if iv.configured}}configured{{/if}}">{{iv.name}}</span>
75
+ {{/each}}
76
+ </div>
77
+ </section>
78
+
79
+ <section class="skills-section">
80
+ <div class="section-label">携带技能</div>
81
+ <div class="skills-grid">
82
+ {{each team.skills skill}}
83
+ <div class="skill-item {{if skill.configured}}configured{{/if}}">
84
+ <div class="skill-icon-shell">
85
+ <img class="skill-fallback" src="{{_res_path}}img/感叹号,偏深色.png" alt="">
86
+ {{if skill.icon}}
87
+ <img class="skill-icon" src="{{skill.icon}}" alt="" onerror="this.style.display='none'">
88
+ {{/if}}
89
+ </div>
90
+ <span>{{skill.name}}</span>
91
+ </div>
92
+ {{/each}}
93
+ </div>
94
+ </section>
95
+ </article>
96
+ {{/each}}
97
+ </main>
98
+
99
+ <footer class="share-footer">
100
+ <span>{{commandHint}}</span>
101
+ <span>{{copyright}}</span>
102
+ </footer>
103
+ </section>
104
+ </body>
105
+ </html>
@@ -0,0 +1,345 @@
1
+ @font-face {
2
+ font-family: "rocom-share-code";
3
+ src: url("../../ttf/HYWenHei-85W-1.ttf") format("truetype");
4
+ font-display: swap;
5
+ }
6
+
7
+ :root {
8
+ --ink: #28251f;
9
+ --muted: #7f776a;
10
+ --paper: rgba(248, 243, 232, 0.97);
11
+ --panel: rgba(255, 255, 255, 0.68);
12
+ --line: rgba(63, 52, 40, 0.13);
13
+ --gold: #bd8633;
14
+ --green: #477d68;
15
+ --red: #a75552;
16
+ }
17
+
18
+ html,
19
+ body {
20
+ margin: 0;
21
+ padding: 24px;
22
+ background: url("../../img/bg.C8CUoi7I.jpg") no-repeat center top;
23
+ background-size: cover;
24
+ font-family: "rocom-share-code", "Microsoft YaHei", sans-serif;
25
+ letter-spacing: 0;
26
+ }
27
+
28
+ .share-code-page {
29
+ width: 1160px;
30
+ box-sizing: border-box;
31
+ margin: 0 auto;
32
+ padding: 34px 38px 28px;
33
+ color: var(--ink);
34
+ background: var(--paper);
35
+ border: 1px solid rgba(255, 255, 255, 0.72);
36
+ border-radius: 8px;
37
+ box-shadow: 0 18px 46px rgba(31, 24, 17, 0.18);
38
+ }
39
+
40
+ .share-header {
41
+ min-height: 94px;
42
+ display: grid;
43
+ grid-template-columns: 76px 1fr 150px;
44
+ gap: 20px;
45
+ align-items: center;
46
+ padding-bottom: 22px;
47
+ border-bottom: 2px solid var(--gold);
48
+ }
49
+
50
+ .brand-logo {
51
+ width: 72px;
52
+ height: 72px;
53
+ object-fit: contain;
54
+ }
55
+
56
+ .header-kicker {
57
+ margin-bottom: 4px;
58
+ font-size: 12px;
59
+ color: var(--gold);
60
+ }
61
+
62
+ .header-copy h1 {
63
+ margin: 0;
64
+ font-size: 38px;
65
+ line-height: 1.15;
66
+ }
67
+
68
+ .header-meta {
69
+ display: flex;
70
+ flex-wrap: wrap;
71
+ gap: 8px 14px;
72
+ margin-top: 10px;
73
+ color: var(--muted);
74
+ font-size: 14px;
75
+ }
76
+
77
+ .source-tag {
78
+ padding: 2px 8px;
79
+ color: #fff;
80
+ background: var(--green);
81
+ border-radius: 4px;
82
+ }
83
+
84
+ .magic-block {
85
+ display: flex;
86
+ flex-direction: column;
87
+ align-items: center;
88
+ gap: 7px;
89
+ color: var(--muted);
90
+ font-size: 13px;
91
+ }
92
+
93
+ .magic-icon-shell {
94
+ position: relative;
95
+ width: 58px;
96
+ height: 58px;
97
+ overflow: hidden;
98
+ background: #e8e0d3;
99
+ border: 1px solid var(--line);
100
+ border-radius: 8px;
101
+ }
102
+
103
+ .magic-fallback,
104
+ .magic-icon {
105
+ position: absolute;
106
+ inset: 0;
107
+ width: 100%;
108
+ height: 100%;
109
+ object-fit: contain;
110
+ }
111
+
112
+ .magic-icon {
113
+ z-index: 1;
114
+ }
115
+
116
+ .code-strip {
117
+ min-height: 54px;
118
+ display: grid;
119
+ grid-template-columns: 70px 1fr auto;
120
+ gap: 12px;
121
+ align-items: center;
122
+ margin-top: 20px;
123
+ padding: 10px 16px;
124
+ box-sizing: border-box;
125
+ background: #e9e2d5;
126
+ border-left: 4px solid var(--gold);
127
+ border-radius: 5px;
128
+ }
129
+
130
+ .code-label,
131
+ .record-count {
132
+ color: var(--muted);
133
+ font-size: 13px;
134
+ }
135
+
136
+ .code-strip code {
137
+ min-width: 0;
138
+ overflow-wrap: anywhere;
139
+ color: #3b352e;
140
+ font-family: Consolas, monospace;
141
+ font-size: 14px;
142
+ }
143
+
144
+ .record-meta {
145
+ display: flex;
146
+ justify-content: flex-end;
147
+ gap: 22px;
148
+ margin: 8px 4px 0;
149
+ color: var(--muted);
150
+ font-size: 12px;
151
+ }
152
+
153
+ .team-grid {
154
+ display: grid;
155
+ grid-template-columns: repeat(2, minmax(0, 1fr));
156
+ gap: 16px;
157
+ margin-top: 20px;
158
+ }
159
+
160
+ .team-slot {
161
+ position: relative;
162
+ min-height: 334px;
163
+ box-sizing: border-box;
164
+ padding: 20px;
165
+ overflow: hidden;
166
+ background: var(--panel);
167
+ border: 1px solid var(--line);
168
+ border-radius: 8px;
169
+ }
170
+
171
+ .slot-number {
172
+ position: absolute;
173
+ top: 14px;
174
+ right: 16px;
175
+ color: rgba(72, 62, 51, 0.18);
176
+ font-size: 42px;
177
+ font-weight: 700;
178
+ }
179
+
180
+ .pet-summary {
181
+ min-height: 112px;
182
+ display: grid;
183
+ grid-template-columns: 104px 1fr;
184
+ gap: 16px;
185
+ align-items: center;
186
+ }
187
+
188
+ .pet-image-shell {
189
+ position: relative;
190
+ width: 104px;
191
+ height: 104px;
192
+ overflow: hidden;
193
+ background: #eee7da;
194
+ border: 1px solid var(--line);
195
+ border-radius: 8px;
196
+ }
197
+
198
+ .pet-fallback,
199
+ .pet-image {
200
+ position: absolute;
201
+ inset: 0;
202
+ width: 100%;
203
+ height: 100%;
204
+ object-fit: contain;
205
+ }
206
+
207
+ .pet-image {
208
+ z-index: 1;
209
+ }
210
+
211
+ .pet-copy {
212
+ min-width: 0;
213
+ }
214
+
215
+ .pet-copy h2 {
216
+ margin: 0;
217
+ max-width: 290px;
218
+ overflow-wrap: anywhere;
219
+ font-size: 25px;
220
+ line-height: 1.2;
221
+ }
222
+
223
+ .pet-copy > span {
224
+ display: block;
225
+ margin-top: 5px;
226
+ color: var(--muted);
227
+ font-size: 12px;
228
+ }
229
+
230
+ .pet-tags {
231
+ display: flex;
232
+ flex-wrap: wrap;
233
+ gap: 7px;
234
+ margin-top: 11px;
235
+ }
236
+
237
+ .pet-tags span {
238
+ padding: 4px 8px;
239
+ color: #4f493f;
240
+ background: #e6ded0;
241
+ border: 1px solid var(--line);
242
+ border-radius: 4px;
243
+ font-size: 12px;
244
+ }
245
+
246
+ .ivs-section,
247
+ .skills-section {
248
+ margin-top: 16px;
249
+ }
250
+
251
+ .section-label {
252
+ margin-bottom: 8px;
253
+ color: var(--muted);
254
+ font-size: 12px;
255
+ }
256
+
257
+ .ivs-list {
258
+ display: grid;
259
+ grid-template-columns: repeat(3, minmax(0, 1fr));
260
+ gap: 7px;
261
+ }
262
+
263
+ .iv-tag {
264
+ min-height: 27px;
265
+ display: flex;
266
+ align-items: center;
267
+ justify-content: center;
268
+ padding: 4px 6px;
269
+ box-sizing: border-box;
270
+ color: #9a9286;
271
+ background: #eee9df;
272
+ border-radius: 4px;
273
+ font-size: 12px;
274
+ }
275
+
276
+ .iv-tag.configured {
277
+ color: #fff;
278
+ background: var(--green);
279
+ }
280
+
281
+ .skills-grid {
282
+ display: grid;
283
+ grid-template-columns: repeat(4, minmax(0, 1fr));
284
+ gap: 8px;
285
+ }
286
+
287
+ .skill-item {
288
+ min-width: 0;
289
+ display: flex;
290
+ flex-direction: column;
291
+ align-items: center;
292
+ gap: 5px;
293
+ color: #aaa296;
294
+ }
295
+
296
+ .skill-item.configured {
297
+ color: #4f493f;
298
+ }
299
+
300
+ .skill-icon-shell {
301
+ position: relative;
302
+ width: 48px;
303
+ height: 48px;
304
+ overflow: hidden;
305
+ background: #ece5d9;
306
+ border: 1px solid var(--line);
307
+ border-radius: 6px;
308
+ }
309
+
310
+ .skill-fallback,
311
+ .skill-icon {
312
+ position: absolute;
313
+ inset: 0;
314
+ width: 100%;
315
+ height: 100%;
316
+ object-fit: contain;
317
+ }
318
+
319
+ .skill-fallback {
320
+ opacity: 0.22;
321
+ }
322
+
323
+ .skill-icon {
324
+ z-index: 1;
325
+ }
326
+
327
+ .skill-item span {
328
+ width: 100%;
329
+ min-height: 30px;
330
+ overflow-wrap: anywhere;
331
+ text-align: center;
332
+ font-size: 11px;
333
+ line-height: 1.25;
334
+ }
335
+
336
+ .share-footer {
337
+ display: flex;
338
+ justify-content: space-between;
339
+ gap: 24px;
340
+ margin-top: 22px;
341
+ padding-top: 18px;
342
+ border-top: 1px solid var(--line);
343
+ color: var(--muted);
344
+ font-size: 12px;
345
+ }
package/lib/render.d.ts CHANGED
@@ -1,11 +1,24 @@
1
1
  import { Context } from 'koishi';
2
+ export interface RenderOptions {
3
+ signal?: AbortSignal;
4
+ timeoutMs?: number;
5
+ imageWaitMs?: number;
6
+ fontWaitMs?: number;
7
+ deviceScaleFactor?: number;
8
+ jpegQuality?: number;
9
+ maxPageHeight?: number;
10
+ }
11
+ export declare const lowBandwidthRenderOptions: RenderOptions;
2
12
  export declare class Renderer {
3
13
  private resPath;
4
- constructor(resPath: string);
14
+ private defaults;
15
+ constructor(resPath: string, defaults?: RenderOptions);
5
16
  resourceUrl(relativePath: string): string;
6
17
  private getPreferredResourceRoot;
7
18
  private getTemplateCandidateRoots;
8
19
  private resolveTemplatePath;
9
20
  private getStylePath;
10
- renderHtml(ctx: Context, templateName: string, data: any): Promise<Buffer | null>;
21
+ renderHtml(ctx: Context, templateName: string, data: any, options?: RenderOptions): Promise<Buffer | null>;
22
+ renderPages(ctx: Context, templateName: string, data: any, options?: RenderOptions): Promise<Buffer[] | null>;
23
+ private capture;
11
24
  }