@xpadev-net/niconicomments 0.2.45 → 0.2.46
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/LICENSE +21 -21
- package/LICENSE_JP +11 -11
- package/README.en.md +43 -43
- package/README.md +43 -43
- package/dist/bundle.d.ts +443 -437
- package/dist/bundle.js +2675 -2711
- package/package.json +67 -67
package/dist/bundle.d.ts
CHANGED
|
@@ -1,229 +1,260 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare class FlashComment implements IComment {
|
|
5
|
-
private readonly context;
|
|
6
|
-
readonly comment: formattedCommentWithSize;
|
|
7
|
-
private readonly _globalScale;
|
|
8
|
-
private scale;
|
|
9
|
-
private scaleX;
|
|
10
|
-
posY: number;
|
|
11
|
-
image?: HTMLCanvasElement | null;
|
|
12
|
-
constructor(comment: formattedComment, context: CanvasRenderingContext2D);
|
|
13
|
-
get invisible(): boolean;
|
|
14
|
-
get loc(): commentLoc;
|
|
15
|
-
get long(): number;
|
|
16
|
-
get vpos(): number;
|
|
17
|
-
get width(): number;
|
|
18
|
-
get height(): number;
|
|
19
|
-
get flash(): boolean;
|
|
20
|
-
get layer(): number;
|
|
21
|
-
get owner(): boolean;
|
|
22
|
-
get mail(): string[];
|
|
23
|
-
get lineCount(): number;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
get
|
|
43
|
-
get
|
|
44
|
-
get
|
|
45
|
-
get
|
|
46
|
-
get
|
|
47
|
-
get
|
|
48
|
-
get
|
|
49
|
-
get
|
|
50
|
-
get
|
|
51
|
-
get
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
declare
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
declare
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
declare
|
|
114
|
-
declare const
|
|
115
|
-
declare
|
|
116
|
-
declare let
|
|
117
|
-
declare
|
|
118
|
-
declare const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
declare class FlashComment implements IComment {
|
|
5
|
+
private readonly context;
|
|
6
|
+
readonly comment: formattedCommentWithSize;
|
|
7
|
+
private readonly _globalScale;
|
|
8
|
+
private scale;
|
|
9
|
+
private scaleX;
|
|
10
|
+
posY: number;
|
|
11
|
+
image?: HTMLCanvasElement | null;
|
|
12
|
+
constructor(comment: formattedComment, context: CanvasRenderingContext2D);
|
|
13
|
+
get invisible(): boolean;
|
|
14
|
+
get loc(): commentLoc;
|
|
15
|
+
get long(): number;
|
|
16
|
+
get vpos(): number;
|
|
17
|
+
get width(): number;
|
|
18
|
+
get height(): number;
|
|
19
|
+
get flash(): boolean;
|
|
20
|
+
get layer(): number;
|
|
21
|
+
get owner(): boolean;
|
|
22
|
+
get mail(): string[];
|
|
23
|
+
get lineCount(): number;
|
|
24
|
+
parseCommandAndNicoscript(comment: formattedComment): formattedCommentWithFont;
|
|
25
|
+
measureText(comment: measureTextInput): measureTextResult;
|
|
26
|
+
getCommentSize(parsedData: formattedCommentWithFont): formattedCommentWithSize;
|
|
27
|
+
draw(vpos: number, showCollision: boolean, debug: boolean): void;
|
|
28
|
+
getTextImage(): HTMLCanvasElement | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
declare class HTML5Comment implements IComment {
|
|
36
|
+
private readonly context;
|
|
37
|
+
readonly comment: formattedCommentWithSize;
|
|
38
|
+
posY: number;
|
|
39
|
+
image?: HTMLCanvasElement | null;
|
|
40
|
+
constructor(comment: formattedComment, context: CanvasRenderingContext2D);
|
|
41
|
+
get invisible(): boolean;
|
|
42
|
+
get loc(): commentLoc;
|
|
43
|
+
get long(): number;
|
|
44
|
+
get vpos(): number;
|
|
45
|
+
get width(): number;
|
|
46
|
+
get height(): number;
|
|
47
|
+
get flash(): boolean;
|
|
48
|
+
get layer(): number;
|
|
49
|
+
get owner(): boolean;
|
|
50
|
+
get mail(): string[];
|
|
51
|
+
get lineCount(): number;
|
|
52
|
+
parseCommandAndNicoscript(comment: formattedComment): formattedCommentWithFont;
|
|
53
|
+
measureText(comment: measureTextInput): measureTextResult;
|
|
54
|
+
getCommentSize(parsedData: formattedCommentWithFont): formattedCommentWithSize;
|
|
55
|
+
draw(vpos: number, showCollision: boolean, debug: boolean): void;
|
|
56
|
+
getTextImage(): HTMLCanvasElement | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
declare let imageCache: {
|
|
61
|
+
[key: string]: {
|
|
62
|
+
image: HTMLCanvasElement;
|
|
63
|
+
timeout: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
declare const resetImageCache: () => void;
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
declare let nicoScripts: nicoScript;
|
|
71
|
+
declare const resetNicoScripts: () => void;
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
declare let plugins: IPlugin[];
|
|
76
|
+
declare const setPlugins: (input: IPlugin[]) => void;
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
declare const colors: {
|
|
80
|
+
white: string;
|
|
81
|
+
red: string;
|
|
82
|
+
pink: string;
|
|
83
|
+
orange: string;
|
|
84
|
+
yellow: string;
|
|
85
|
+
green: string;
|
|
86
|
+
cyan: string;
|
|
87
|
+
blue: string;
|
|
88
|
+
purple: string;
|
|
89
|
+
black: string;
|
|
90
|
+
white2: string;
|
|
91
|
+
niconicowhite: string;
|
|
92
|
+
red2: string;
|
|
93
|
+
truered: string;
|
|
94
|
+
pink2: string;
|
|
95
|
+
orange2: string;
|
|
96
|
+
passionorange: string;
|
|
97
|
+
yellow2: string;
|
|
98
|
+
madyellow: string;
|
|
99
|
+
green2: string;
|
|
100
|
+
elementalgreen: string;
|
|
101
|
+
cyan2: string;
|
|
102
|
+
blue2: string;
|
|
103
|
+
marinblue: string;
|
|
104
|
+
purple2: string;
|
|
105
|
+
nobleviolet: string;
|
|
106
|
+
black2: string;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
declare let defaultConfig: BaseConfig;
|
|
113
|
+
declare const initConfig: () => void;
|
|
114
|
+
declare const defaultOptions: BaseOptions;
|
|
115
|
+
declare let config: BaseConfig;
|
|
116
|
+
declare let options: BaseOptions;
|
|
117
|
+
declare const setConfig: (value: BaseConfig) => BaseConfig;
|
|
118
|
+
declare const setOptions: (value: BaseOptions) => BaseOptions;
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
declare const fontTemplates: {
|
|
122
|
+
arial: {
|
|
123
|
+
font: string;
|
|
124
|
+
offset: number;
|
|
125
|
+
weight: number;
|
|
126
|
+
};
|
|
127
|
+
gothic: {
|
|
128
|
+
font: string;
|
|
129
|
+
offset: number;
|
|
130
|
+
weight: number;
|
|
131
|
+
};
|
|
132
|
+
gulim: {
|
|
133
|
+
font: string;
|
|
134
|
+
offset: number;
|
|
135
|
+
weight: number;
|
|
136
|
+
};
|
|
137
|
+
mincho: {
|
|
138
|
+
font: string;
|
|
139
|
+
offset: number;
|
|
140
|
+
weight: number;
|
|
141
|
+
};
|
|
142
|
+
simsun: {
|
|
143
|
+
font: string;
|
|
144
|
+
offset: number;
|
|
145
|
+
weight: number;
|
|
146
|
+
};
|
|
147
|
+
macGothicPro6: {
|
|
148
|
+
font: string;
|
|
149
|
+
offset: number;
|
|
150
|
+
weight: number;
|
|
151
|
+
};
|
|
152
|
+
macGothicPro3: {
|
|
153
|
+
font: string;
|
|
154
|
+
offset: number;
|
|
155
|
+
weight: number;
|
|
156
|
+
};
|
|
157
|
+
macMincho: {
|
|
158
|
+
font: string;
|
|
159
|
+
offset: number;
|
|
160
|
+
weight: number;
|
|
161
|
+
};
|
|
162
|
+
macGothic1: {
|
|
163
|
+
font: string;
|
|
164
|
+
offset: number;
|
|
165
|
+
weight: number;
|
|
166
|
+
};
|
|
167
|
+
macGothic2: {
|
|
168
|
+
font: string;
|
|
169
|
+
offset: number;
|
|
170
|
+
weight: number;
|
|
171
|
+
};
|
|
172
|
+
sansSerif600: {
|
|
173
|
+
font: string;
|
|
174
|
+
offset: number;
|
|
175
|
+
weight: number;
|
|
176
|
+
};
|
|
177
|
+
sansSerif400: {
|
|
178
|
+
font: string;
|
|
179
|
+
offset: number;
|
|
180
|
+
weight: number;
|
|
181
|
+
};
|
|
182
|
+
serif: {
|
|
183
|
+
font: string;
|
|
184
|
+
offset: number;
|
|
185
|
+
weight: number;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
declare const fonts: {
|
|
189
|
+
win7: {
|
|
190
|
+
defont: FontItem;
|
|
191
|
+
gothic: FontItem;
|
|
192
|
+
mincho: FontItem;
|
|
193
|
+
};
|
|
194
|
+
win8_1: {
|
|
195
|
+
defont: FontItem;
|
|
196
|
+
gothic: FontItem;
|
|
197
|
+
mincho: FontItem;
|
|
198
|
+
};
|
|
199
|
+
win: {
|
|
200
|
+
defont: FontItem;
|
|
201
|
+
gothic: FontItem;
|
|
202
|
+
mincho: FontItem;
|
|
203
|
+
};
|
|
204
|
+
mac10_9: {
|
|
205
|
+
defont: FontItem;
|
|
206
|
+
gothic: FontItem;
|
|
207
|
+
mincho: FontItem;
|
|
208
|
+
};
|
|
209
|
+
mac10_11: {
|
|
210
|
+
defont: FontItem;
|
|
211
|
+
gothic: FontItem;
|
|
212
|
+
mincho: FontItem;
|
|
213
|
+
};
|
|
214
|
+
mac: {
|
|
215
|
+
defont: FontItem;
|
|
216
|
+
gothic: FontItem;
|
|
217
|
+
mincho: FontItem;
|
|
218
|
+
};
|
|
219
|
+
other: {
|
|
220
|
+
defont: FontItem;
|
|
221
|
+
gothic: FontItem;
|
|
222
|
+
mincho: FontItem;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
export interface IComment {
|
|
230
|
+
comment: formattedCommentWithSize;
|
|
231
|
+
invisible: boolean;
|
|
232
|
+
loc: commentLoc;
|
|
233
|
+
width: number;
|
|
234
|
+
long: number;
|
|
235
|
+
height: number;
|
|
236
|
+
vpos: number;
|
|
237
|
+
flash: boolean;
|
|
238
|
+
posY: number;
|
|
239
|
+
owner: boolean;
|
|
240
|
+
layer: number;
|
|
241
|
+
mail: string[];
|
|
242
|
+
image?: HTMLCanvasElement | null;
|
|
243
|
+
getTextImage: (vpos: number) => void;
|
|
244
|
+
draw: (vpos: number, showCollision: boolean, isDebug: boolean) => void;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
export interface IPluginConstructor {
|
|
250
|
+
id: string;
|
|
251
|
+
new (Canvas: HTMLCanvasElement, comments: formattedComment[]): IPlugin;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface IPlugin {
|
|
255
|
+
draw(vpos: number): void;
|
|
256
|
+
addComments(comments: formattedComment[]): void;
|
|
257
|
+
}
|
|
227
258
|
|
|
228
259
|
|
|
229
260
|
|
|
@@ -378,7 +409,7 @@ export type v1Thread = {
|
|
|
378
409
|
id: string;
|
|
379
410
|
fork: string;
|
|
380
411
|
commentCount: number;
|
|
381
|
-
comments:
|
|
412
|
+
comments: v1Comment[];
|
|
382
413
|
};
|
|
383
414
|
type v1Comment = {
|
|
384
415
|
id: string;
|
|
@@ -398,38 +429,6 @@ type v1Comment = {
|
|
|
398
429
|
|
|
399
430
|
|
|
400
431
|
|
|
401
|
-
export interface IComment {
|
|
402
|
-
comment: formattedCommentWithSize;
|
|
403
|
-
invisible: boolean;
|
|
404
|
-
loc: commentLoc;
|
|
405
|
-
width: number;
|
|
406
|
-
long: number;
|
|
407
|
-
height: number;
|
|
408
|
-
vpos: number;
|
|
409
|
-
flash: boolean;
|
|
410
|
-
posY: number;
|
|
411
|
-
owner: boolean;
|
|
412
|
-
layer: number;
|
|
413
|
-
mail: string[];
|
|
414
|
-
image?: HTMLCanvasElement | null;
|
|
415
|
-
getTextImage: (vpos: number) => void;
|
|
416
|
-
draw: (vpos: number, showCollision: boolean, isDebug: boolean) => void;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
export interface IPluginConstructor {
|
|
422
|
-
id: string;
|
|
423
|
-
new (Canvas: HTMLCanvasElement, comments: formattedComment[]): IPlugin;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
export interface IPlugin {
|
|
427
|
-
draw(vpos: number): void;
|
|
428
|
-
addComments(comments: formattedComment[]): void;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
432
|
|
|
434
433
|
|
|
435
434
|
|
|
@@ -489,6 +488,7 @@ type formattedCommentWithFont = {
|
|
|
489
488
|
font: commentFont;
|
|
490
489
|
color: string;
|
|
491
490
|
strokeColor?: string;
|
|
491
|
+
wakuColor?: string;
|
|
492
492
|
full: boolean;
|
|
493
493
|
ender: boolean;
|
|
494
494
|
_live: boolean;
|
|
@@ -590,6 +590,7 @@ type parsedCommand = {
|
|
|
590
590
|
fontSize: number | undefined;
|
|
591
591
|
color: string | undefined;
|
|
592
592
|
strokeColor?: string;
|
|
593
|
+
wakuColor?: string;
|
|
593
594
|
font: commentFont | undefined;
|
|
594
595
|
full: boolean;
|
|
595
596
|
ender: boolean;
|
|
@@ -623,183 +624,188 @@ type measureInput = {
|
|
|
623
624
|
lineCount: number;
|
|
624
625
|
};
|
|
625
626
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
declare const convert2formattedComment: (data: unknown, type: inputFormatType) => formattedComment[];
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
declare class NiconiComments {
|
|
634
|
-
enableLegacyPiP: boolean;
|
|
635
|
-
showCollision: boolean;
|
|
636
|
-
showFPS: boolean;
|
|
637
|
-
showCommentCount: boolean;
|
|
638
|
-
video: HTMLVideoElement | undefined;
|
|
639
|
-
private lastVpos;
|
|
640
|
-
private readonly canvas;
|
|
641
|
-
private readonly collision;
|
|
642
|
-
private readonly context;
|
|
643
|
-
private readonly timeline;
|
|
644
|
-
static typeGuard: {
|
|
645
|
-
formatted: {
|
|
646
|
-
comment: (i: unknown) => i is formattedComment;
|
|
647
|
-
comments: (i: unknown) => i is formattedComment[];
|
|
648
|
-
legacyComment: (i: unknown) => i is formattedLegacyComment;
|
|
649
|
-
legacyComments: (i: unknown) => i is formattedLegacyComment[];
|
|
650
|
-
};
|
|
651
|
-
legacy: {
|
|
652
|
-
rawApiResponses: (i: unknown) => i is rawApiResponse[];
|
|
653
|
-
apiChat: (i: unknown) => i is apiChat;
|
|
654
|
-
apiGlobalNumRes: (i: unknown) => i is apiGlobalNumRes;
|
|
655
|
-
apiLeaf: (i: unknown) => i is apiLeaf;
|
|
656
|
-
apiPing: (i: unknown) => i is apiPing;
|
|
657
|
-
apiThread: (i: unknown) => i is apiThread;
|
|
658
|
-
};
|
|
659
|
-
xmlDocument: (i: unknown) => i is XMLDocument;
|
|
660
|
-
legacyOwner: {
|
|
661
|
-
comments: (i: unknown) => i is string;
|
|
662
|
-
};
|
|
663
|
-
owner: {
|
|
664
|
-
comment: (i: unknown) => i is ownerComment;
|
|
665
|
-
comments: (i: unknown) => i is ownerComment[];
|
|
666
|
-
};
|
|
667
|
-
v1: {
|
|
668
|
-
comment: (i: unknown) => i is v1Comment;
|
|
669
|
-
thread: (i: unknown) => i is v1Thread;
|
|
670
|
-
threads: (i: unknown) => i is v1Thread[];
|
|
671
|
-
};
|
|
672
|
-
nicoScript: {
|
|
673
|
-
range: {
|
|
674
|
-
target: (i: unknown) => i is nicoScriptReverseTarget;
|
|
675
|
-
};
|
|
676
|
-
replace: {
|
|
677
|
-
range: (i: unknown) => i is nicoScriptReplaceRange;
|
|
678
|
-
target: (i: unknown) => i is nicoScriptReplaceTarget;
|
|
679
|
-
condition: (i: unknown) => i is nicoScriptReplaceCondition;
|
|
680
|
-
};
|
|
681
|
-
};
|
|
682
|
-
comment: {
|
|
683
|
-
font: (i: unknown) => i is commentFont;
|
|
684
|
-
loc: (i: unknown) => i is commentLoc;
|
|
685
|
-
size: (i: unknown) => i is commentSize;
|
|
686
|
-
command: {
|
|
687
|
-
key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
|
|
688
|
-
};
|
|
689
|
-
color: (i: unknown) => i is "white" | "red" | "pink" | "orange" | "yellow" | "green" | "cyan" | "blue" | "purple" | "black" | "white2" | "niconicowhite" | "red2" | "truered" | "pink2" | "orange2" | "passionorange" | "yellow2" | "madyellow" | "green2" | "elementalgreen" | "cyan2" | "blue2" | "marinblue" | "purple2" | "nobleviolet" | "black2";
|
|
690
|
-
colorCode: (i: unknown) => i is string;
|
|
691
|
-
};
|
|
692
|
-
config: {
|
|
693
|
-
initOptions: (item: unknown) => item is Partial<BaseOptions>;
|
|
694
|
-
};
|
|
695
|
-
};
|
|
696
|
-
static default: typeof NiconiComments;
|
|
697
|
-
constructor(canvas: HTMLCanvasElement, data: inputFormat, initOptions?: Options);
|
|
698
|
-
private preRendering;
|
|
699
|
-
private getCommentPos;
|
|
700
|
-
private sortComment;
|
|
701
|
-
addComments(...rawComments: formattedComment[]): void;
|
|
702
|
-
drawCanvas(vpos: number, forceRendering?: boolean): boolean;
|
|
703
|
-
clear(): void;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
declare const getLineHeight: (fontSize: commentSize, isFlash: boolean, resized?: boolean) => number;
|
|
709
|
-
declare const getCharSize: (fontSize: commentSize, isFlash: boolean) => number;
|
|
710
|
-
declare const measure: (comment: measureInput, context: CanvasRenderingContext2D) => {
|
|
711
|
-
height: number;
|
|
712
|
-
width: number;
|
|
713
|
-
lineWidth: number[];
|
|
714
|
-
itemWidth: number[][];
|
|
715
|
-
};
|
|
716
|
-
declare const getFontSizeAndScale: (charSize: number) => {
|
|
717
|
-
scale: number;
|
|
718
|
-
fontSize: number;
|
|
719
|
-
};
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
declare const typeGuard: {
|
|
728
|
-
formatted: {
|
|
729
|
-
comment: (i: unknown) => i is formattedComment;
|
|
730
|
-
comments: (i: unknown) => i is formattedComment[];
|
|
731
|
-
legacyComment: (i: unknown) => i is formattedLegacyComment;
|
|
732
|
-
legacyComments: (i: unknown) => i is formattedLegacyComment[];
|
|
733
|
-
};
|
|
734
|
-
legacy: {
|
|
735
|
-
rawApiResponses: (i: unknown) => i is rawApiResponse[];
|
|
736
|
-
apiChat: (i: unknown) => i is apiChat;
|
|
737
|
-
apiGlobalNumRes: (i: unknown) => i is apiGlobalNumRes;
|
|
738
|
-
apiLeaf: (i: unknown) => i is apiLeaf;
|
|
739
|
-
apiPing: (i: unknown) => i is apiPing;
|
|
740
|
-
apiThread: (i: unknown) => i is apiThread;
|
|
741
|
-
};
|
|
742
|
-
xmlDocument: (i: unknown) => i is XMLDocument;
|
|
743
|
-
legacyOwner: {
|
|
744
|
-
comments: (i: unknown) => i is string;
|
|
745
|
-
};
|
|
746
|
-
owner: {
|
|
747
|
-
comment: (i: unknown) => i is ownerComment;
|
|
748
|
-
comments: (i: unknown) => i is ownerComment[];
|
|
749
|
-
};
|
|
750
|
-
v1: {
|
|
751
|
-
comment: (i: unknown) => i is v1Comment;
|
|
752
|
-
thread: (i: unknown) => i is v1Thread;
|
|
753
|
-
threads: (i: unknown) => i is v1Thread[];
|
|
754
|
-
};
|
|
755
|
-
nicoScript: {
|
|
756
|
-
range: {
|
|
757
|
-
target: (i: unknown) => i is nicoScriptReverseTarget;
|
|
758
|
-
};
|
|
759
|
-
replace: {
|
|
760
|
-
range: (i: unknown) => i is nicoScriptReplaceRange;
|
|
761
|
-
target: (i: unknown) => i is nicoScriptReplaceTarget;
|
|
762
|
-
condition: (i: unknown) => i is nicoScriptReplaceCondition;
|
|
763
|
-
};
|
|
764
|
-
};
|
|
765
|
-
comment: {
|
|
766
|
-
font: (i: unknown) => i is commentFont;
|
|
767
|
-
loc: (i: unknown) => i is commentLoc;
|
|
768
|
-
size: (i: unknown) => i is commentSize;
|
|
769
|
-
command: {
|
|
770
|
-
key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
|
|
771
|
-
};
|
|
772
|
-
color: (i: unknown) => i is "white" | "red" | "pink" | "orange" | "yellow" | "green" | "cyan" | "blue" | "purple" | "black" | "white2" | "niconicowhite" | "red2" | "truered" | "pink2" | "orange2" | "passionorange" | "yellow2" | "madyellow" | "green2" | "elementalgreen" | "cyan2" | "blue2" | "marinblue" | "purple2" | "nobleviolet" | "black2";
|
|
773
|
-
colorCode: (i: unknown) => i is string;
|
|
774
|
-
};
|
|
775
|
-
config: {
|
|
776
|
-
initOptions: (item: unknown) => item is Partial<BaseOptions>;
|
|
777
|
-
};
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
declare const
|
|
792
|
-
declare const
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
declare const
|
|
797
|
-
declare const
|
|
798
|
-
declare const
|
|
799
|
-
declare const
|
|
800
|
-
declare const
|
|
801
|
-
declare const
|
|
802
|
-
declare const
|
|
803
|
-
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
declare const convert2formattedComment: (data: unknown, type: inputFormatType) => formattedComment[];
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
declare class NiconiComments {
|
|
635
|
+
enableLegacyPiP: boolean;
|
|
636
|
+
showCollision: boolean;
|
|
637
|
+
showFPS: boolean;
|
|
638
|
+
showCommentCount: boolean;
|
|
639
|
+
video: HTMLVideoElement | undefined;
|
|
640
|
+
private lastVpos;
|
|
641
|
+
private readonly canvas;
|
|
642
|
+
private readonly collision;
|
|
643
|
+
private readonly context;
|
|
644
|
+
private readonly timeline;
|
|
645
|
+
static typeGuard: {
|
|
646
|
+
formatted: {
|
|
647
|
+
comment: (i: unknown) => i is formattedComment;
|
|
648
|
+
comments: (i: unknown) => i is formattedComment[];
|
|
649
|
+
legacyComment: (i: unknown) => i is formattedLegacyComment;
|
|
650
|
+
legacyComments: (i: unknown) => i is formattedLegacyComment[];
|
|
651
|
+
};
|
|
652
|
+
legacy: {
|
|
653
|
+
rawApiResponses: (i: unknown) => i is rawApiResponse[];
|
|
654
|
+
apiChat: (i: unknown) => i is apiChat;
|
|
655
|
+
apiGlobalNumRes: (i: unknown) => i is apiGlobalNumRes;
|
|
656
|
+
apiLeaf: (i: unknown) => i is apiLeaf;
|
|
657
|
+
apiPing: (i: unknown) => i is apiPing;
|
|
658
|
+
apiThread: (i: unknown) => i is apiThread;
|
|
659
|
+
};
|
|
660
|
+
xmlDocument: (i: unknown) => i is XMLDocument;
|
|
661
|
+
legacyOwner: {
|
|
662
|
+
comments: (i: unknown) => i is string;
|
|
663
|
+
};
|
|
664
|
+
owner: {
|
|
665
|
+
comment: (i: unknown) => i is ownerComment;
|
|
666
|
+
comments: (i: unknown) => i is ownerComment[];
|
|
667
|
+
};
|
|
668
|
+
v1: {
|
|
669
|
+
comment: (i: unknown) => i is v1Comment;
|
|
670
|
+
thread: (i: unknown) => i is v1Thread;
|
|
671
|
+
threads: (i: unknown) => i is v1Thread[];
|
|
672
|
+
};
|
|
673
|
+
nicoScript: {
|
|
674
|
+
range: {
|
|
675
|
+
target: (i: unknown) => i is nicoScriptReverseTarget;
|
|
676
|
+
};
|
|
677
|
+
replace: {
|
|
678
|
+
range: (i: unknown) => i is nicoScriptReplaceRange;
|
|
679
|
+
target: (i: unknown) => i is nicoScriptReplaceTarget;
|
|
680
|
+
condition: (i: unknown) => i is nicoScriptReplaceCondition;
|
|
681
|
+
};
|
|
682
|
+
};
|
|
683
|
+
comment: {
|
|
684
|
+
font: (i: unknown) => i is commentFont;
|
|
685
|
+
loc: (i: unknown) => i is commentLoc;
|
|
686
|
+
size: (i: unknown) => i is commentSize;
|
|
687
|
+
command: {
|
|
688
|
+
key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
|
|
689
|
+
};
|
|
690
|
+
color: (i: unknown) => i is "white" | "red" | "pink" | "orange" | "yellow" | "green" | "cyan" | "blue" | "purple" | "black" | "white2" | "niconicowhite" | "red2" | "truered" | "pink2" | "orange2" | "passionorange" | "yellow2" | "madyellow" | "green2" | "elementalgreen" | "cyan2" | "blue2" | "marinblue" | "purple2" | "nobleviolet" | "black2";
|
|
691
|
+
colorCode: (i: unknown) => i is string;
|
|
692
|
+
};
|
|
693
|
+
config: {
|
|
694
|
+
initOptions: (item: unknown) => item is Partial<BaseOptions>;
|
|
695
|
+
};
|
|
696
|
+
};
|
|
697
|
+
static default: typeof NiconiComments;
|
|
698
|
+
constructor(canvas: HTMLCanvasElement, data: inputFormat, initOptions?: Options);
|
|
699
|
+
private preRendering;
|
|
700
|
+
private getCommentPos;
|
|
701
|
+
private sortComment;
|
|
702
|
+
addComments(...rawComments: formattedComment[]): void;
|
|
703
|
+
drawCanvas(vpos: number, forceRendering?: boolean): boolean;
|
|
704
|
+
clear(): void;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
declare const getLineHeight: (fontSize: commentSize, isFlash: boolean, resized?: boolean) => number;
|
|
710
|
+
declare const getCharSize: (fontSize: commentSize, isFlash: boolean) => number;
|
|
711
|
+
declare const measure: (comment: measureInput, context: CanvasRenderingContext2D) => {
|
|
712
|
+
height: number;
|
|
713
|
+
width: number;
|
|
714
|
+
lineWidth: number[];
|
|
715
|
+
itemWidth: number[][];
|
|
716
|
+
};
|
|
717
|
+
declare const getFontSizeAndScale: (charSize: number) => {
|
|
718
|
+
scale: number;
|
|
719
|
+
fontSize: number;
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
declare const typeGuard: {
|
|
729
|
+
formatted: {
|
|
730
|
+
comment: (i: unknown) => i is formattedComment;
|
|
731
|
+
comments: (i: unknown) => i is formattedComment[];
|
|
732
|
+
legacyComment: (i: unknown) => i is formattedLegacyComment;
|
|
733
|
+
legacyComments: (i: unknown) => i is formattedLegacyComment[];
|
|
734
|
+
};
|
|
735
|
+
legacy: {
|
|
736
|
+
rawApiResponses: (i: unknown) => i is rawApiResponse[];
|
|
737
|
+
apiChat: (i: unknown) => i is apiChat;
|
|
738
|
+
apiGlobalNumRes: (i: unknown) => i is apiGlobalNumRes;
|
|
739
|
+
apiLeaf: (i: unknown) => i is apiLeaf;
|
|
740
|
+
apiPing: (i: unknown) => i is apiPing;
|
|
741
|
+
apiThread: (i: unknown) => i is apiThread;
|
|
742
|
+
};
|
|
743
|
+
xmlDocument: (i: unknown) => i is XMLDocument;
|
|
744
|
+
legacyOwner: {
|
|
745
|
+
comments: (i: unknown) => i is string;
|
|
746
|
+
};
|
|
747
|
+
owner: {
|
|
748
|
+
comment: (i: unknown) => i is ownerComment;
|
|
749
|
+
comments: (i: unknown) => i is ownerComment[];
|
|
750
|
+
};
|
|
751
|
+
v1: {
|
|
752
|
+
comment: (i: unknown) => i is v1Comment;
|
|
753
|
+
thread: (i: unknown) => i is v1Thread;
|
|
754
|
+
threads: (i: unknown) => i is v1Thread[];
|
|
755
|
+
};
|
|
756
|
+
nicoScript: {
|
|
757
|
+
range: {
|
|
758
|
+
target: (i: unknown) => i is nicoScriptReverseTarget;
|
|
759
|
+
};
|
|
760
|
+
replace: {
|
|
761
|
+
range: (i: unknown) => i is nicoScriptReplaceRange;
|
|
762
|
+
target: (i: unknown) => i is nicoScriptReplaceTarget;
|
|
763
|
+
condition: (i: unknown) => i is nicoScriptReplaceCondition;
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
comment: {
|
|
767
|
+
font: (i: unknown) => i is commentFont;
|
|
768
|
+
loc: (i: unknown) => i is commentLoc;
|
|
769
|
+
size: (i: unknown) => i is commentSize;
|
|
770
|
+
command: {
|
|
771
|
+
key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
|
|
772
|
+
};
|
|
773
|
+
color: (i: unknown) => i is "white" | "red" | "pink" | "orange" | "yellow" | "green" | "cyan" | "blue" | "purple" | "black" | "white2" | "niconicowhite" | "red2" | "truered" | "pink2" | "orange2" | "passionorange" | "yellow2" | "madyellow" | "green2" | "elementalgreen" | "cyan2" | "blue2" | "marinblue" | "purple2" | "nobleviolet" | "black2";
|
|
774
|
+
colorCode: (i: unknown) => i is string;
|
|
775
|
+
};
|
|
776
|
+
config: {
|
|
777
|
+
initOptions: (item: unknown) => item is Partial<BaseOptions>;
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
declare const getPosY: (currentPos: number, targetComment: IComment, collision: IComment[] | undefined) => {
|
|
788
|
+
currentPos: number;
|
|
789
|
+
isChanged: boolean;
|
|
790
|
+
isBreak: boolean;
|
|
791
|
+
};
|
|
792
|
+
declare const getPosX: (width: number, vpos: number, long: number) => number;
|
|
793
|
+
declare const parseFont: (font: commentFont, size: string | number) => string;
|
|
794
|
+
declare const arrayPush: (array: {
|
|
795
|
+
[key: number]: IComment[];
|
|
796
|
+
}, key: string | number, push: IComment) => void;
|
|
797
|
+
declare const hex2rgb: (hex: string) => number[];
|
|
798
|
+
declare const hex2rgba: (hex: string) => number[];
|
|
799
|
+
declare const changeCALayer: (rawData: formattedComment[]) => formattedComment[];
|
|
800
|
+
declare const getConfig: <T>(input: configItem<T>, isFlash?: boolean) => T;
|
|
801
|
+
declare const isFlashComment: (comment: formattedComment) => boolean;
|
|
802
|
+
declare const parseCommandAndNicoScript: (comment: formattedComment) => formattedCommentWithFont;
|
|
803
|
+
declare const getStrokeColor: (comment: formattedCommentWithSize) => string;
|
|
804
|
+
declare const ArrayEqual: (a: unknown[], b: unknown[]) => boolean;
|
|
805
|
+
declare const getFlashFontIndex: (part: string) => commentContentIndex[];
|
|
806
|
+
declare const getFlashFontName: (font: string) => commentFlashFont;
|
|
807
|
+
declare const getValue: <T>(value: T | null | undefined, alternative: T) => T;
|
|
808
|
+
declare const nativeSort: <T>(getter: (input: T) => number) => (a: T, b: T) => 0 | 1 | -1;
|
|
809
|
+
|
|
804
810
|
|
|
805
811
|
export default NiconiComments;
|