@xpadev-net/niconicomments 0.2.39 → 0.2.41
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 +616 -616
- package/dist/bundle.js +2704 -2698
- package/package.json +67 -67
package/dist/bundle.d.ts
CHANGED
|
@@ -1,224 +1,244 @@
|
|
|
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
|
-
parseCommand(comment: formattedComment): parsedCommand;
|
|
25
|
-
parseCommandAndNicoscript(comment: formattedComment): formattedCommentWithFont;
|
|
26
|
-
measureText(comment: measureTextInput): measureTextResult;
|
|
27
|
-
getCommentSize(parsedData: formattedCommentWithFont): formattedCommentWithSize;
|
|
28
|
-
draw(vpos: number, showCollision: boolean, debug: boolean): void;
|
|
29
|
-
getTextImage(): HTMLCanvasElement | null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
declare class HTML5Comment implements IComment {
|
|
37
|
-
private readonly context;
|
|
38
|
-
readonly comment: formattedCommentWithSize;
|
|
39
|
-
posY: number;
|
|
40
|
-
image?: HTMLCanvasElement | null;
|
|
41
|
-
constructor(comment: formattedComment, context: CanvasRenderingContext2D);
|
|
42
|
-
get invisible(): boolean;
|
|
43
|
-
get loc():
|
|
44
|
-
get long(): number;
|
|
45
|
-
get vpos(): number;
|
|
46
|
-
get width(): number;
|
|
47
|
-
get height(): number;
|
|
48
|
-
get flash(): boolean;
|
|
49
|
-
get layer(): number;
|
|
50
|
-
get owner(): boolean;
|
|
51
|
-
get mail(): string[];
|
|
52
|
-
get lineCount(): number;
|
|
53
|
-
parseCommandAndNicoscript(comment: formattedComment): formattedCommentWithFont;
|
|
54
|
-
measureText(comment: measureTextInput): measureTextResult;
|
|
55
|
-
getCommentSize(parsedData: formattedCommentWithFont): formattedCommentWithSize;
|
|
56
|
-
draw(vpos: number, showCollision: boolean, debug: boolean): void;
|
|
57
|
-
getTextImage(): HTMLCanvasElement | null;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
declare let imageCache: {
|
|
62
|
-
[key: string]: {
|
|
63
|
-
image: HTMLCanvasElement;
|
|
64
|
-
timeout: number;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
declare const resetImageCache: () => void;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
declare let nicoScripts: nicoScript;
|
|
72
|
-
declare const resetNicoScripts: () => void;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
declare const colors: {
|
|
76
|
-
white: string;
|
|
77
|
-
red: string;
|
|
78
|
-
pink: string;
|
|
79
|
-
orange: string;
|
|
80
|
-
yellow: string;
|
|
81
|
-
green: string;
|
|
82
|
-
cyan: string;
|
|
83
|
-
blue: string;
|
|
84
|
-
purple: string;
|
|
85
|
-
black: string;
|
|
86
|
-
white2: string;
|
|
87
|
-
niconicowhite: string;
|
|
88
|
-
red2: string;
|
|
89
|
-
truered: string;
|
|
90
|
-
pink2: string;
|
|
91
|
-
orange2: string;
|
|
92
|
-
passionorange: string;
|
|
93
|
-
yellow2: string;
|
|
94
|
-
madyellow: string;
|
|
95
|
-
green2: string;
|
|
96
|
-
elementalgreen: string;
|
|
97
|
-
cyan2: string;
|
|
98
|
-
blue2: string;
|
|
99
|
-
marinblue: string;
|
|
100
|
-
purple2: string;
|
|
101
|
-
nobleviolet: string;
|
|
102
|
-
black2: string;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
declare let defaultConfig: BaseConfig;
|
|
109
|
-
declare const initConfig: () => void;
|
|
110
|
-
declare const defaultOptions: BaseOptions;
|
|
111
|
-
declare let config: BaseConfig;
|
|
112
|
-
declare let options: BaseOptions;
|
|
113
|
-
declare const setConfig: (value: BaseConfig) => BaseConfig;
|
|
114
|
-
declare const setOptions: (value: BaseOptions) => BaseOptions;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
declare const fontTemplates: {
|
|
118
|
-
arial: {
|
|
119
|
-
font: string;
|
|
120
|
-
offset: number;
|
|
121
|
-
weight: number;
|
|
122
|
-
};
|
|
123
|
-
gothic: {
|
|
124
|
-
font: string;
|
|
125
|
-
offset: number;
|
|
126
|
-
weight: number;
|
|
127
|
-
};
|
|
128
|
-
gulim: {
|
|
129
|
-
font: string;
|
|
130
|
-
offset: number;
|
|
131
|
-
weight: number;
|
|
132
|
-
};
|
|
133
|
-
mincho: {
|
|
134
|
-
font: string;
|
|
135
|
-
offset: number;
|
|
136
|
-
weight: number;
|
|
137
|
-
};
|
|
138
|
-
simsun: {
|
|
139
|
-
font: string;
|
|
140
|
-
offset: number;
|
|
141
|
-
weight: number;
|
|
142
|
-
};
|
|
143
|
-
macGothicPro6: {
|
|
144
|
-
font: string;
|
|
145
|
-
offset: number;
|
|
146
|
-
weight: number;
|
|
147
|
-
};
|
|
148
|
-
macGothicPro3: {
|
|
149
|
-
font: string;
|
|
150
|
-
offset: number;
|
|
151
|
-
weight: number;
|
|
152
|
-
};
|
|
153
|
-
macMincho: {
|
|
154
|
-
font: string;
|
|
155
|
-
offset: number;
|
|
156
|
-
weight: number;
|
|
157
|
-
};
|
|
158
|
-
macGothic1: {
|
|
159
|
-
font: string;
|
|
160
|
-
offset: number;
|
|
161
|
-
weight: number;
|
|
162
|
-
};
|
|
163
|
-
macGothic2: {
|
|
164
|
-
font: string;
|
|
165
|
-
offset: number;
|
|
166
|
-
weight: number;
|
|
167
|
-
};
|
|
168
|
-
sansSerif600: {
|
|
169
|
-
font: string;
|
|
170
|
-
offset: number;
|
|
171
|
-
weight: number;
|
|
172
|
-
};
|
|
173
|
-
sansSerif400: {
|
|
174
|
-
font: string;
|
|
175
|
-
offset: number;
|
|
176
|
-
weight: number;
|
|
177
|
-
};
|
|
178
|
-
serif: {
|
|
179
|
-
font: string;
|
|
180
|
-
offset: number;
|
|
181
|
-
weight: number;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
declare const fonts: {
|
|
185
|
-
win7: {
|
|
186
|
-
defont: FontItem;
|
|
187
|
-
gothic: FontItem;
|
|
188
|
-
mincho: FontItem;
|
|
189
|
-
};
|
|
190
|
-
win8_1: {
|
|
191
|
-
defont: FontItem;
|
|
192
|
-
gothic: FontItem;
|
|
193
|
-
mincho: FontItem;
|
|
194
|
-
};
|
|
195
|
-
win: {
|
|
196
|
-
defont: FontItem;
|
|
197
|
-
gothic: FontItem;
|
|
198
|
-
mincho: FontItem;
|
|
199
|
-
};
|
|
200
|
-
mac10_9: {
|
|
201
|
-
defont: FontItem;
|
|
202
|
-
gothic: FontItem;
|
|
203
|
-
mincho: FontItem;
|
|
204
|
-
};
|
|
205
|
-
mac10_11: {
|
|
206
|
-
defont: FontItem;
|
|
207
|
-
gothic: FontItem;
|
|
208
|
-
mincho: FontItem;
|
|
209
|
-
};
|
|
210
|
-
mac: {
|
|
211
|
-
defont: FontItem;
|
|
212
|
-
gothic: FontItem;
|
|
213
|
-
mincho: FontItem;
|
|
214
|
-
};
|
|
215
|
-
other: {
|
|
216
|
-
defont: FontItem;
|
|
217
|
-
gothic: FontItem;
|
|
218
|
-
mincho: FontItem;
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
|
|
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
|
+
parseCommand(comment: formattedComment): parsedCommand;
|
|
25
|
+
parseCommandAndNicoscript(comment: formattedComment): formattedCommentWithFont;
|
|
26
|
+
measureText(comment: measureTextInput): measureTextResult;
|
|
27
|
+
getCommentSize(parsedData: formattedCommentWithFont): formattedCommentWithSize;
|
|
28
|
+
draw(vpos: number, showCollision: boolean, debug: boolean): void;
|
|
29
|
+
getTextImage(): HTMLCanvasElement | null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
declare class HTML5Comment implements IComment {
|
|
37
|
+
private readonly context;
|
|
38
|
+
readonly comment: formattedCommentWithSize;
|
|
39
|
+
posY: number;
|
|
40
|
+
image?: HTMLCanvasElement | null;
|
|
41
|
+
constructor(comment: formattedComment, context: CanvasRenderingContext2D);
|
|
42
|
+
get invisible(): boolean;
|
|
43
|
+
get loc(): commentLoc;
|
|
44
|
+
get long(): number;
|
|
45
|
+
get vpos(): number;
|
|
46
|
+
get width(): number;
|
|
47
|
+
get height(): number;
|
|
48
|
+
get flash(): boolean;
|
|
49
|
+
get layer(): number;
|
|
50
|
+
get owner(): boolean;
|
|
51
|
+
get mail(): string[];
|
|
52
|
+
get lineCount(): number;
|
|
53
|
+
parseCommandAndNicoscript(comment: formattedComment): formattedCommentWithFont;
|
|
54
|
+
measureText(comment: measureTextInput): measureTextResult;
|
|
55
|
+
getCommentSize(parsedData: formattedCommentWithFont): formattedCommentWithSize;
|
|
56
|
+
draw(vpos: number, showCollision: boolean, debug: boolean): void;
|
|
57
|
+
getTextImage(): HTMLCanvasElement | null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
declare let imageCache: {
|
|
62
|
+
[key: string]: {
|
|
63
|
+
image: HTMLCanvasElement;
|
|
64
|
+
timeout: number;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
declare const resetImageCache: () => void;
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
declare let nicoScripts: nicoScript;
|
|
72
|
+
declare const resetNicoScripts: () => void;
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
declare const colors: {
|
|
76
|
+
white: string;
|
|
77
|
+
red: string;
|
|
78
|
+
pink: string;
|
|
79
|
+
orange: string;
|
|
80
|
+
yellow: string;
|
|
81
|
+
green: string;
|
|
82
|
+
cyan: string;
|
|
83
|
+
blue: string;
|
|
84
|
+
purple: string;
|
|
85
|
+
black: string;
|
|
86
|
+
white2: string;
|
|
87
|
+
niconicowhite: string;
|
|
88
|
+
red2: string;
|
|
89
|
+
truered: string;
|
|
90
|
+
pink2: string;
|
|
91
|
+
orange2: string;
|
|
92
|
+
passionorange: string;
|
|
93
|
+
yellow2: string;
|
|
94
|
+
madyellow: string;
|
|
95
|
+
green2: string;
|
|
96
|
+
elementalgreen: string;
|
|
97
|
+
cyan2: string;
|
|
98
|
+
blue2: string;
|
|
99
|
+
marinblue: string;
|
|
100
|
+
purple2: string;
|
|
101
|
+
nobleviolet: string;
|
|
102
|
+
black2: string;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
declare let defaultConfig: BaseConfig;
|
|
109
|
+
declare const initConfig: () => void;
|
|
110
|
+
declare const defaultOptions: BaseOptions;
|
|
111
|
+
declare let config: BaseConfig;
|
|
112
|
+
declare let options: BaseOptions;
|
|
113
|
+
declare const setConfig: (value: BaseConfig) => BaseConfig;
|
|
114
|
+
declare const setOptions: (value: BaseOptions) => BaseOptions;
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
declare const fontTemplates: {
|
|
118
|
+
arial: {
|
|
119
|
+
font: string;
|
|
120
|
+
offset: number;
|
|
121
|
+
weight: number;
|
|
122
|
+
};
|
|
123
|
+
gothic: {
|
|
124
|
+
font: string;
|
|
125
|
+
offset: number;
|
|
126
|
+
weight: number;
|
|
127
|
+
};
|
|
128
|
+
gulim: {
|
|
129
|
+
font: string;
|
|
130
|
+
offset: number;
|
|
131
|
+
weight: number;
|
|
132
|
+
};
|
|
133
|
+
mincho: {
|
|
134
|
+
font: string;
|
|
135
|
+
offset: number;
|
|
136
|
+
weight: number;
|
|
137
|
+
};
|
|
138
|
+
simsun: {
|
|
139
|
+
font: string;
|
|
140
|
+
offset: number;
|
|
141
|
+
weight: number;
|
|
142
|
+
};
|
|
143
|
+
macGothicPro6: {
|
|
144
|
+
font: string;
|
|
145
|
+
offset: number;
|
|
146
|
+
weight: number;
|
|
147
|
+
};
|
|
148
|
+
macGothicPro3: {
|
|
149
|
+
font: string;
|
|
150
|
+
offset: number;
|
|
151
|
+
weight: number;
|
|
152
|
+
};
|
|
153
|
+
macMincho: {
|
|
154
|
+
font: string;
|
|
155
|
+
offset: number;
|
|
156
|
+
weight: number;
|
|
157
|
+
};
|
|
158
|
+
macGothic1: {
|
|
159
|
+
font: string;
|
|
160
|
+
offset: number;
|
|
161
|
+
weight: number;
|
|
162
|
+
};
|
|
163
|
+
macGothic2: {
|
|
164
|
+
font: string;
|
|
165
|
+
offset: number;
|
|
166
|
+
weight: number;
|
|
167
|
+
};
|
|
168
|
+
sansSerif600: {
|
|
169
|
+
font: string;
|
|
170
|
+
offset: number;
|
|
171
|
+
weight: number;
|
|
172
|
+
};
|
|
173
|
+
sansSerif400: {
|
|
174
|
+
font: string;
|
|
175
|
+
offset: number;
|
|
176
|
+
weight: number;
|
|
177
|
+
};
|
|
178
|
+
serif: {
|
|
179
|
+
font: string;
|
|
180
|
+
offset: number;
|
|
181
|
+
weight: number;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
declare const fonts: {
|
|
185
|
+
win7: {
|
|
186
|
+
defont: FontItem;
|
|
187
|
+
gothic: FontItem;
|
|
188
|
+
mincho: FontItem;
|
|
189
|
+
};
|
|
190
|
+
win8_1: {
|
|
191
|
+
defont: FontItem;
|
|
192
|
+
gothic: FontItem;
|
|
193
|
+
mincho: FontItem;
|
|
194
|
+
};
|
|
195
|
+
win: {
|
|
196
|
+
defont: FontItem;
|
|
197
|
+
gothic: FontItem;
|
|
198
|
+
mincho: FontItem;
|
|
199
|
+
};
|
|
200
|
+
mac10_9: {
|
|
201
|
+
defont: FontItem;
|
|
202
|
+
gothic: FontItem;
|
|
203
|
+
mincho: FontItem;
|
|
204
|
+
};
|
|
205
|
+
mac10_11: {
|
|
206
|
+
defont: FontItem;
|
|
207
|
+
gothic: FontItem;
|
|
208
|
+
mincho: FontItem;
|
|
209
|
+
};
|
|
210
|
+
mac: {
|
|
211
|
+
defont: FontItem;
|
|
212
|
+
gothic: FontItem;
|
|
213
|
+
mincho: FontItem;
|
|
214
|
+
};
|
|
215
|
+
other: {
|
|
216
|
+
defont: FontItem;
|
|
217
|
+
gothic: FontItem;
|
|
218
|
+
mincho: FontItem;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
export interface IComment {
|
|
226
|
+
comment: formattedCommentWithSize;
|
|
227
|
+
invisible: boolean;
|
|
228
|
+
loc: commentLoc;
|
|
229
|
+
width: number;
|
|
230
|
+
long: number;
|
|
231
|
+
height: number;
|
|
232
|
+
vpos: number;
|
|
233
|
+
flash: boolean;
|
|
234
|
+
posY: number;
|
|
235
|
+
owner: boolean;
|
|
236
|
+
layer: number;
|
|
237
|
+
mail: string[];
|
|
238
|
+
image?: HTMLCanvasElement | null;
|
|
239
|
+
getTextImage: (vpos: number) => void;
|
|
240
|
+
draw: (vpos: number, showCollision: boolean, isDebug: boolean) => void;
|
|
241
|
+
}
|
|
222
242
|
|
|
223
243
|
type configItem<T> = T | { html5: T; flash: T };
|
|
224
244
|
type configSizeItem<T> = { big: T; medium: T; small: T };
|
|
@@ -388,400 +408,380 @@ type v1Comment = {
|
|
|
388
408
|
isMyPost: boolean;
|
|
389
409
|
};
|
|
390
410
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
owner
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
};
|
|
495
|
-
type
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
type
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
type
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
type
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
};
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
declare const getPosY: (currentPos: number, targetComment: IComment, collision: IComment[] | undefined) => {
|
|
768
|
-
currentPos: number;
|
|
769
|
-
isChanged: boolean;
|
|
770
|
-
isBreak: boolean;
|
|
771
|
-
};
|
|
772
|
-
declare const getPosX: (width: number, vpos: number, long: number) => number;
|
|
773
|
-
declare const parseFont: (font: commentFont, size: string | number) => string;
|
|
774
|
-
declare const arrayPush: (array: {
|
|
775
|
-
[key: number]: IComment[];
|
|
776
|
-
}, key: string | number, push: IComment) => void;
|
|
777
|
-
declare const hex2rgb: (hex: string) => number[];
|
|
778
|
-
declare const hex2rgba: (hex: string) => number[];
|
|
779
|
-
declare const replaceAll: (string: string, target: string, replace: string) => string;
|
|
780
|
-
declare const changeCALayer: (rawData: formattedComment[]) => formattedComment[];
|
|
781
|
-
declare const getConfig: <T>(input: configItem<T>, isFlash?: boolean) => T;
|
|
782
|
-
declare const isFlashComment: (comment: formattedComment) => boolean;
|
|
783
|
-
declare const parseCommandAndNicoScript: (comment: formattedComment) => formattedCommentWithFont;
|
|
784
|
-
declare const getStrokeColor: (comment: formattedCommentWithSize) => string;
|
|
785
|
-
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
export type inputFormatType =
|
|
418
|
+
| "XMLDocument"
|
|
419
|
+
| "niconicome"
|
|
420
|
+
| "formatted"
|
|
421
|
+
| "legacy"
|
|
422
|
+
| "legacyOwner"
|
|
423
|
+
| "owner"
|
|
424
|
+
| "v1"
|
|
425
|
+
| "empty"
|
|
426
|
+
| "default";
|
|
427
|
+
export type inputFormat =
|
|
428
|
+
| XMLDocument
|
|
429
|
+
| formattedComment[]
|
|
430
|
+
| formattedLegacyComment[]
|
|
431
|
+
| rawApiResponse[]
|
|
432
|
+
| ownerComment[]
|
|
433
|
+
| v1Thread[]
|
|
434
|
+
| string
|
|
435
|
+
| undefined;
|
|
436
|
+
type modeType = "default" | "html5" | "flash";
|
|
437
|
+
type BaseOptions = {
|
|
438
|
+
config: Config;
|
|
439
|
+
debug: boolean;
|
|
440
|
+
enableLegacyPiP: boolean;
|
|
441
|
+
format: inputFormatType;
|
|
442
|
+
formatted: boolean;
|
|
443
|
+
keepCA: boolean;
|
|
444
|
+
mode: modeType;
|
|
445
|
+
scale: number;
|
|
446
|
+
showCollision: boolean;
|
|
447
|
+
showCommentCount: boolean;
|
|
448
|
+
showFPS: boolean;
|
|
449
|
+
useLegacy: boolean;
|
|
450
|
+
video: HTMLVideoElement | undefined;
|
|
451
|
+
};
|
|
452
|
+
export type Options = Partial<BaseOptions>;
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
type formattedCommentWithFont = {
|
|
457
|
+
id: number;
|
|
458
|
+
vpos: number;
|
|
459
|
+
date: number;
|
|
460
|
+
date_usec: number;
|
|
461
|
+
owner: boolean;
|
|
462
|
+
premium: boolean;
|
|
463
|
+
mail: string[];
|
|
464
|
+
user_id: number;
|
|
465
|
+
layer: number;
|
|
466
|
+
loc: commentLoc;
|
|
467
|
+
size: commentSize;
|
|
468
|
+
fontSize: number;
|
|
469
|
+
font: commentFont;
|
|
470
|
+
color: string;
|
|
471
|
+
strokeColor?: string;
|
|
472
|
+
full: boolean;
|
|
473
|
+
ender: boolean;
|
|
474
|
+
_live: boolean;
|
|
475
|
+
long: number;
|
|
476
|
+
invisible: boolean;
|
|
477
|
+
content: commentContentItem[];
|
|
478
|
+
flash: boolean;
|
|
479
|
+
lineCount: number;
|
|
480
|
+
lineOffset: number;
|
|
481
|
+
};
|
|
482
|
+
type formattedCommentWithSize = formattedCommentWithFont & {
|
|
483
|
+
height: number;
|
|
484
|
+
width: number;
|
|
485
|
+
lineHeight: number;
|
|
486
|
+
resized: boolean;
|
|
487
|
+
resizedX: boolean;
|
|
488
|
+
resizedY: boolean;
|
|
489
|
+
content: commentMeasuredContentItem[];
|
|
490
|
+
charSize: number;
|
|
491
|
+
};
|
|
492
|
+
type parsedComment = formattedCommentWithSize & {
|
|
493
|
+
posY: number;
|
|
494
|
+
image?: HTMLCanvasElement | boolean;
|
|
495
|
+
};
|
|
496
|
+
type commentContentItem = {
|
|
497
|
+
content: string;
|
|
498
|
+
font?: commentFlashFont;
|
|
499
|
+
width?: number[];
|
|
500
|
+
};
|
|
501
|
+
type commentMeasuredContentItem = commentContentItem & {
|
|
502
|
+
width: number[];
|
|
503
|
+
};
|
|
504
|
+
type commentContentIndex = {
|
|
505
|
+
index: number;
|
|
506
|
+
font: "gothic" | "gulim" | "simsunStrong" | "simsunWeak";
|
|
507
|
+
};
|
|
508
|
+
type commentFont = "defont" | "mincho" | "gothic" | "gulim" | "simsun";
|
|
509
|
+
type commentFlashFont = "defont" | "gulim" | "simsun";
|
|
510
|
+
type commentSize = "big" | "medium" | "small";
|
|
511
|
+
type commentLoc = "ue" | "naka" | "shita";
|
|
512
|
+
type collision = { [key in collisionPos]: collisionItem };
|
|
513
|
+
type collisionPos = "ue" | "shita" | "right" | "left";
|
|
514
|
+
type collisionItem = { [p: number]: IComment[] };
|
|
515
|
+
type nicoScript = {
|
|
516
|
+
reverse: nicoScriptReverse[];
|
|
517
|
+
ban: nicoScriptBan[];
|
|
518
|
+
default: nicoScriptDefault[];
|
|
519
|
+
replace: nicoScriptReplace[];
|
|
520
|
+
};
|
|
521
|
+
type nicoScriptReverse = {
|
|
522
|
+
target: nicoScriptReverseTarget;
|
|
523
|
+
start: number;
|
|
524
|
+
end: number;
|
|
525
|
+
};
|
|
526
|
+
type nicoScriptReverseTarget = "コメ" | "投コメ" | "全";
|
|
527
|
+
type nicoScriptReplace = {
|
|
528
|
+
start: number;
|
|
529
|
+
long: number | undefined;
|
|
530
|
+
keyword: string;
|
|
531
|
+
replace: string;
|
|
532
|
+
range: nicoScriptReplaceRange;
|
|
533
|
+
target: nicoScriptReplaceTarget;
|
|
534
|
+
condition: nicoScriptReplaceCondition;
|
|
535
|
+
color: string | undefined;
|
|
536
|
+
size: commentSize | undefined;
|
|
537
|
+
font: commentFont | undefined;
|
|
538
|
+
loc: commentLoc | undefined;
|
|
539
|
+
no: number;
|
|
540
|
+
};
|
|
541
|
+
type nicoScriptReplaceRange = "単" | "全";
|
|
542
|
+
type nicoScriptReplaceTarget = "コメ" | "投コメ" | "全" | "含まない" | "含む";
|
|
543
|
+
type nicoScriptReplaceCondition = "完全一致" | "部分一致";
|
|
544
|
+
type nicoScriptBan = {
|
|
545
|
+
start: number;
|
|
546
|
+
end: number;
|
|
547
|
+
};
|
|
548
|
+
type nicoScriptDefault = {
|
|
549
|
+
start: number;
|
|
550
|
+
long: number | undefined;
|
|
551
|
+
color: string | undefined;
|
|
552
|
+
size: commentSize | undefined;
|
|
553
|
+
font: commentFont | undefined;
|
|
554
|
+
loc: commentLoc | undefined;
|
|
555
|
+
};
|
|
556
|
+
type measureTextResult = {
|
|
557
|
+
width: number;
|
|
558
|
+
height: number;
|
|
559
|
+
resized: boolean;
|
|
560
|
+
resizedX: boolean;
|
|
561
|
+
resizedY: boolean;
|
|
562
|
+
fontSize: number;
|
|
563
|
+
lineHeight: number;
|
|
564
|
+
content: commentMeasuredContentItem[];
|
|
565
|
+
charSize: number;
|
|
566
|
+
};
|
|
567
|
+
type parsedCommand = {
|
|
568
|
+
loc: commentLoc | undefined;
|
|
569
|
+
size: commentSize | undefined;
|
|
570
|
+
fontSize: number | undefined;
|
|
571
|
+
color: string | undefined;
|
|
572
|
+
strokeColor?: string;
|
|
573
|
+
font: commentFont | undefined;
|
|
574
|
+
full: boolean;
|
|
575
|
+
ender: boolean;
|
|
576
|
+
_live: boolean;
|
|
577
|
+
invisible: boolean;
|
|
578
|
+
long: number | undefined;
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
type measureTextInput = {
|
|
582
|
+
content: commentContentItem[];
|
|
583
|
+
resized?: boolean;
|
|
584
|
+
ender: boolean;
|
|
585
|
+
size: commentSize;
|
|
586
|
+
fontSize: number;
|
|
587
|
+
resizedY?: boolean;
|
|
588
|
+
resizedX?: boolean;
|
|
589
|
+
font: commentFont;
|
|
590
|
+
loc: commentLoc;
|
|
591
|
+
full: boolean;
|
|
592
|
+
flash: boolean;
|
|
593
|
+
lineCount: number;
|
|
594
|
+
lineHeight?: number;
|
|
595
|
+
charSize?: number;
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
type measureInput = {
|
|
599
|
+
font: commentFont;
|
|
600
|
+
content: commentContentItem[];
|
|
601
|
+
lineHeight: number;
|
|
602
|
+
charSize: number;
|
|
603
|
+
lineCount: number;
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
declare const convert2formattedComment: (data: unknown, type: inputFormatType) => formattedComment[];
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
declare class NiconiComments {
|
|
614
|
+
enableLegacyPiP: boolean;
|
|
615
|
+
showCollision: boolean;
|
|
616
|
+
showFPS: boolean;
|
|
617
|
+
showCommentCount: boolean;
|
|
618
|
+
video: HTMLVideoElement | undefined;
|
|
619
|
+
private lastVpos;
|
|
620
|
+
private readonly canvas;
|
|
621
|
+
private readonly collision;
|
|
622
|
+
private readonly context;
|
|
623
|
+
private readonly timeline;
|
|
624
|
+
static typeGuard: {
|
|
625
|
+
formatted: {
|
|
626
|
+
comment: (i: unknown) => i is formattedComment;
|
|
627
|
+
comments: (i: unknown) => i is formattedComment[];
|
|
628
|
+
legacyComment: (i: unknown) => i is formattedLegacyComment;
|
|
629
|
+
legacyComments: (i: unknown) => i is formattedLegacyComment[];
|
|
630
|
+
};
|
|
631
|
+
legacy: {
|
|
632
|
+
rawApiResponses: (i: unknown) => i is rawApiResponse[];
|
|
633
|
+
apiChat: (i: unknown) => i is apiChat;
|
|
634
|
+
apiGlobalNumRes: (i: unknown) => i is apiGlobalNumRes;
|
|
635
|
+
apiLeaf: (i: unknown) => i is apiLeaf;
|
|
636
|
+
apiPing: (i: unknown) => i is apiPing;
|
|
637
|
+
apiThread: (i: unknown) => i is apiThread;
|
|
638
|
+
};
|
|
639
|
+
xmlDocument: (i: unknown) => i is XMLDocument;
|
|
640
|
+
legacyOwner: {
|
|
641
|
+
comments: (i: unknown) => i is string;
|
|
642
|
+
};
|
|
643
|
+
owner: {
|
|
644
|
+
comment: (i: unknown) => i is ownerComment;
|
|
645
|
+
comments: (i: unknown) => i is ownerComment[];
|
|
646
|
+
};
|
|
647
|
+
v1: {
|
|
648
|
+
comment: (i: unknown) => i is v1Comment;
|
|
649
|
+
thread: (i: unknown) => i is v1Thread;
|
|
650
|
+
threads: (i: unknown) => i is v1Thread[];
|
|
651
|
+
};
|
|
652
|
+
nicoScript: {
|
|
653
|
+
range: {
|
|
654
|
+
target: (i: unknown) => i is nicoScriptReverseTarget;
|
|
655
|
+
};
|
|
656
|
+
replace: {
|
|
657
|
+
range: (i: unknown) => i is nicoScriptReplaceRange;
|
|
658
|
+
target: (i: unknown) => i is nicoScriptReplaceTarget;
|
|
659
|
+
condition: (i: unknown) => i is nicoScriptReplaceCondition;
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
comment: {
|
|
663
|
+
font: (i: unknown) => i is commentFont;
|
|
664
|
+
loc: (i: unknown) => i is commentLoc;
|
|
665
|
+
size: (i: unknown) => i is commentSize;
|
|
666
|
+
command: {
|
|
667
|
+
key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
|
|
668
|
+
};
|
|
669
|
+
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";
|
|
670
|
+
colorCode: (i: unknown) => i is string;
|
|
671
|
+
};
|
|
672
|
+
config: {
|
|
673
|
+
initOptions: (item: unknown) => item is Partial<BaseOptions>;
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
constructor(canvas: HTMLCanvasElement, data: inputFormat, initOptions?: Options);
|
|
677
|
+
private preRendering;
|
|
678
|
+
private getCommentPos;
|
|
679
|
+
private sortComment;
|
|
680
|
+
addComments(...rawComments: formattedComment[]): void;
|
|
681
|
+
drawCanvas(vpos: number, forceRendering?: boolean): void;
|
|
682
|
+
clear(): void;
|
|
683
|
+
}
|
|
684
|
+
declare const _default: typeof NiconiComments | {
|
|
685
|
+
default: typeof NiconiComments;
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
declare const getLineHeight: (fontSize: commentSize, isFlash: boolean, resized?: boolean) => number;
|
|
691
|
+
declare const getCharSize: (fontSize: commentSize, isFlash: boolean) => number;
|
|
692
|
+
declare const measure: (comment: measureInput, context: CanvasRenderingContext2D) => {
|
|
693
|
+
height: number;
|
|
694
|
+
width: number;
|
|
695
|
+
lineWidth: number[];
|
|
696
|
+
itemWidth: number[][];
|
|
697
|
+
};
|
|
698
|
+
declare const getFontSizeAndScale: (charSize: number) => {
|
|
699
|
+
scale: number;
|
|
700
|
+
fontSize: number;
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
declare const typeGuard: {
|
|
710
|
+
formatted: {
|
|
711
|
+
comment: (i: unknown) => i is formattedComment;
|
|
712
|
+
comments: (i: unknown) => i is formattedComment[];
|
|
713
|
+
legacyComment: (i: unknown) => i is formattedLegacyComment;
|
|
714
|
+
legacyComments: (i: unknown) => i is formattedLegacyComment[];
|
|
715
|
+
};
|
|
716
|
+
legacy: {
|
|
717
|
+
rawApiResponses: (i: unknown) => i is rawApiResponse[];
|
|
718
|
+
apiChat: (i: unknown) => i is apiChat;
|
|
719
|
+
apiGlobalNumRes: (i: unknown) => i is apiGlobalNumRes;
|
|
720
|
+
apiLeaf: (i: unknown) => i is apiLeaf;
|
|
721
|
+
apiPing: (i: unknown) => i is apiPing;
|
|
722
|
+
apiThread: (i: unknown) => i is apiThread;
|
|
723
|
+
};
|
|
724
|
+
xmlDocument: (i: unknown) => i is XMLDocument;
|
|
725
|
+
legacyOwner: {
|
|
726
|
+
comments: (i: unknown) => i is string;
|
|
727
|
+
};
|
|
728
|
+
owner: {
|
|
729
|
+
comment: (i: unknown) => i is ownerComment;
|
|
730
|
+
comments: (i: unknown) => i is ownerComment[];
|
|
731
|
+
};
|
|
732
|
+
v1: {
|
|
733
|
+
comment: (i: unknown) => i is v1Comment;
|
|
734
|
+
thread: (i: unknown) => i is v1Thread;
|
|
735
|
+
threads: (i: unknown) => i is v1Thread[];
|
|
736
|
+
};
|
|
737
|
+
nicoScript: {
|
|
738
|
+
range: {
|
|
739
|
+
target: (i: unknown) => i is nicoScriptReverseTarget;
|
|
740
|
+
};
|
|
741
|
+
replace: {
|
|
742
|
+
range: (i: unknown) => i is nicoScriptReplaceRange;
|
|
743
|
+
target: (i: unknown) => i is nicoScriptReplaceTarget;
|
|
744
|
+
condition: (i: unknown) => i is nicoScriptReplaceCondition;
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
comment: {
|
|
748
|
+
font: (i: unknown) => i is commentFont;
|
|
749
|
+
loc: (i: unknown) => i is commentLoc;
|
|
750
|
+
size: (i: unknown) => i is commentSize;
|
|
751
|
+
command: {
|
|
752
|
+
key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
|
|
753
|
+
};
|
|
754
|
+
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";
|
|
755
|
+
colorCode: (i: unknown) => i is string;
|
|
756
|
+
};
|
|
757
|
+
config: {
|
|
758
|
+
initOptions: (item: unknown) => item is Partial<BaseOptions>;
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
declare const getPosY: (currentPos: number, targetComment: IComment, collision: IComment[] | undefined) => {
|
|
768
|
+
currentPos: number;
|
|
769
|
+
isChanged: boolean;
|
|
770
|
+
isBreak: boolean;
|
|
771
|
+
};
|
|
772
|
+
declare const getPosX: (width: number, vpos: number, long: number) => number;
|
|
773
|
+
declare const parseFont: (font: commentFont, size: string | number) => string;
|
|
774
|
+
declare const arrayPush: (array: {
|
|
775
|
+
[key: number]: IComment[];
|
|
776
|
+
}, key: string | number, push: IComment) => void;
|
|
777
|
+
declare const hex2rgb: (hex: string) => number[];
|
|
778
|
+
declare const hex2rgba: (hex: string) => number[];
|
|
779
|
+
declare const replaceAll: (string: string, target: string, replace: string) => string;
|
|
780
|
+
declare const changeCALayer: (rawData: formattedComment[]) => formattedComment[];
|
|
781
|
+
declare const getConfig: <T>(input: configItem<T>, isFlash?: boolean) => T;
|
|
782
|
+
declare const isFlashComment: (comment: formattedComment) => boolean;
|
|
783
|
+
declare const parseCommandAndNicoScript: (comment: formattedComment) => formattedCommentWithFont;
|
|
784
|
+
declare const getStrokeColor: (comment: formattedCommentWithSize) => string;
|
|
785
|
+
|
|
786
786
|
|
|
787
787
|
export default NiconiComments;
|