@xpadev-net/niconicomments 0.2.43 → 0.2.45
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 +436 -436
- package/dist/bundle.js +2711 -2711
- package/package.json +67 -67
package/dist/bundle.d.ts
CHANGED
|
@@ -1,264 +1,232 @@
|
|
|
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
|
+
|
|
76
|
+
declare let plugins: IPlugin[];
|
|
77
|
+
declare const setPlugins: (input: IPlugin[]) => void;
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
declare const colors: {
|
|
81
|
+
white: string;
|
|
82
|
+
red: string;
|
|
83
|
+
pink: string;
|
|
84
|
+
orange: string;
|
|
85
|
+
yellow: string;
|
|
86
|
+
green: string;
|
|
87
|
+
cyan: string;
|
|
88
|
+
blue: string;
|
|
89
|
+
purple: string;
|
|
90
|
+
black: string;
|
|
91
|
+
white2: string;
|
|
92
|
+
niconicowhite: string;
|
|
93
|
+
red2: string;
|
|
94
|
+
truered: string;
|
|
95
|
+
pink2: string;
|
|
96
|
+
orange2: string;
|
|
97
|
+
passionorange: string;
|
|
98
|
+
yellow2: string;
|
|
99
|
+
madyellow: string;
|
|
100
|
+
green2: string;
|
|
101
|
+
elementalgreen: string;
|
|
102
|
+
cyan2: string;
|
|
103
|
+
blue2: string;
|
|
104
|
+
marinblue: string;
|
|
105
|
+
purple2: string;
|
|
106
|
+
nobleviolet: string;
|
|
107
|
+
black2: string;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
declare let defaultConfig: BaseConfig;
|
|
114
|
+
declare const initConfig: () => void;
|
|
115
|
+
declare const defaultOptions: BaseOptions;
|
|
116
|
+
declare let config: BaseConfig;
|
|
117
|
+
declare let options: BaseOptions;
|
|
118
|
+
declare const setConfig: (value: BaseConfig) => BaseConfig;
|
|
119
|
+
declare const setOptions: (value: BaseOptions) => BaseOptions;
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
declare const fontTemplates: {
|
|
123
|
+
arial: {
|
|
124
|
+
font: string;
|
|
125
|
+
offset: number;
|
|
126
|
+
weight: number;
|
|
127
|
+
};
|
|
128
|
+
gothic: {
|
|
129
|
+
font: string;
|
|
130
|
+
offset: number;
|
|
131
|
+
weight: number;
|
|
132
|
+
};
|
|
133
|
+
gulim: {
|
|
134
|
+
font: string;
|
|
135
|
+
offset: number;
|
|
136
|
+
weight: number;
|
|
137
|
+
};
|
|
138
|
+
mincho: {
|
|
139
|
+
font: string;
|
|
140
|
+
offset: number;
|
|
141
|
+
weight: number;
|
|
142
|
+
};
|
|
143
|
+
simsun: {
|
|
144
|
+
font: string;
|
|
145
|
+
offset: number;
|
|
146
|
+
weight: number;
|
|
147
|
+
};
|
|
148
|
+
macGothicPro6: {
|
|
149
|
+
font: string;
|
|
150
|
+
offset: number;
|
|
151
|
+
weight: number;
|
|
152
|
+
};
|
|
153
|
+
macGothicPro3: {
|
|
154
|
+
font: string;
|
|
155
|
+
offset: number;
|
|
156
|
+
weight: number;
|
|
157
|
+
};
|
|
158
|
+
macMincho: {
|
|
159
|
+
font: string;
|
|
160
|
+
offset: number;
|
|
161
|
+
weight: number;
|
|
162
|
+
};
|
|
163
|
+
macGothic1: {
|
|
164
|
+
font: string;
|
|
165
|
+
offset: number;
|
|
166
|
+
weight: number;
|
|
167
|
+
};
|
|
168
|
+
macGothic2: {
|
|
169
|
+
font: string;
|
|
170
|
+
offset: number;
|
|
171
|
+
weight: number;
|
|
172
|
+
};
|
|
173
|
+
sansSerif600: {
|
|
174
|
+
font: string;
|
|
175
|
+
offset: number;
|
|
176
|
+
weight: number;
|
|
177
|
+
};
|
|
178
|
+
sansSerif400: {
|
|
179
|
+
font: string;
|
|
180
|
+
offset: number;
|
|
181
|
+
weight: number;
|
|
182
|
+
};
|
|
183
|
+
serif: {
|
|
184
|
+
font: string;
|
|
185
|
+
offset: number;
|
|
186
|
+
weight: number;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
declare const fonts: {
|
|
190
|
+
win7: {
|
|
191
|
+
defont: FontItem;
|
|
192
|
+
gothic: FontItem;
|
|
193
|
+
mincho: FontItem;
|
|
194
|
+
};
|
|
195
|
+
win8_1: {
|
|
196
|
+
defont: FontItem;
|
|
197
|
+
gothic: FontItem;
|
|
198
|
+
mincho: FontItem;
|
|
199
|
+
};
|
|
200
|
+
win: {
|
|
201
|
+
defont: FontItem;
|
|
202
|
+
gothic: FontItem;
|
|
203
|
+
mincho: FontItem;
|
|
204
|
+
};
|
|
205
|
+
mac10_9: {
|
|
206
|
+
defont: FontItem;
|
|
207
|
+
gothic: FontItem;
|
|
208
|
+
mincho: FontItem;
|
|
209
|
+
};
|
|
210
|
+
mac10_11: {
|
|
211
|
+
defont: FontItem;
|
|
212
|
+
gothic: FontItem;
|
|
213
|
+
mincho: FontItem;
|
|
214
|
+
};
|
|
215
|
+
mac: {
|
|
216
|
+
defont: FontItem;
|
|
217
|
+
gothic: FontItem;
|
|
218
|
+
mincho: FontItem;
|
|
219
|
+
};
|
|
220
|
+
other: {
|
|
221
|
+
defont: FontItem;
|
|
222
|
+
gothic: FontItem;
|
|
223
|
+
mincho: FontItem;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
|
|
1
227
|
|
|
2
228
|
|
|
3
229
|
|
|
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
|
-
import { IPlugin } from "@/@types/IPlugins";
|
|
76
|
-
declare let plugins: IPlugin[];
|
|
77
|
-
declare const setPlugins: (input: IPlugin[]) => void;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
declare const colors: {
|
|
81
|
-
white: string;
|
|
82
|
-
red: string;
|
|
83
|
-
pink: string;
|
|
84
|
-
orange: string;
|
|
85
|
-
yellow: string;
|
|
86
|
-
green: string;
|
|
87
|
-
cyan: string;
|
|
88
|
-
blue: string;
|
|
89
|
-
purple: string;
|
|
90
|
-
black: string;
|
|
91
|
-
white2: string;
|
|
92
|
-
niconicowhite: string;
|
|
93
|
-
red2: string;
|
|
94
|
-
truered: string;
|
|
95
|
-
pink2: string;
|
|
96
|
-
orange2: string;
|
|
97
|
-
passionorange: string;
|
|
98
|
-
yellow2: string;
|
|
99
|
-
madyellow: string;
|
|
100
|
-
green2: string;
|
|
101
|
-
elementalgreen: string;
|
|
102
|
-
cyan2: string;
|
|
103
|
-
blue2: string;
|
|
104
|
-
marinblue: string;
|
|
105
|
-
purple2: string;
|
|
106
|
-
nobleviolet: string;
|
|
107
|
-
black2: string;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
declare let defaultConfig: BaseConfig;
|
|
114
|
-
declare const initConfig: () => void;
|
|
115
|
-
declare const defaultOptions: BaseOptions;
|
|
116
|
-
declare let config: BaseConfig;
|
|
117
|
-
declare let options: BaseOptions;
|
|
118
|
-
declare const setConfig: (value: BaseConfig) => BaseConfig;
|
|
119
|
-
declare const setOptions: (value: BaseOptions) => BaseOptions;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
declare const fontTemplates: {
|
|
123
|
-
arial: {
|
|
124
|
-
font: string;
|
|
125
|
-
offset: number;
|
|
126
|
-
weight: number;
|
|
127
|
-
};
|
|
128
|
-
gothic: {
|
|
129
|
-
font: string;
|
|
130
|
-
offset: number;
|
|
131
|
-
weight: number;
|
|
132
|
-
};
|
|
133
|
-
gulim: {
|
|
134
|
-
font: string;
|
|
135
|
-
offset: number;
|
|
136
|
-
weight: number;
|
|
137
|
-
};
|
|
138
|
-
mincho: {
|
|
139
|
-
font: string;
|
|
140
|
-
offset: number;
|
|
141
|
-
weight: number;
|
|
142
|
-
};
|
|
143
|
-
simsun: {
|
|
144
|
-
font: string;
|
|
145
|
-
offset: number;
|
|
146
|
-
weight: number;
|
|
147
|
-
};
|
|
148
|
-
macGothicPro6: {
|
|
149
|
-
font: string;
|
|
150
|
-
offset: number;
|
|
151
|
-
weight: number;
|
|
152
|
-
};
|
|
153
|
-
macGothicPro3: {
|
|
154
|
-
font: string;
|
|
155
|
-
offset: number;
|
|
156
|
-
weight: number;
|
|
157
|
-
};
|
|
158
|
-
macMincho: {
|
|
159
|
-
font: string;
|
|
160
|
-
offset: number;
|
|
161
|
-
weight: number;
|
|
162
|
-
};
|
|
163
|
-
macGothic1: {
|
|
164
|
-
font: string;
|
|
165
|
-
offset: number;
|
|
166
|
-
weight: number;
|
|
167
|
-
};
|
|
168
|
-
macGothic2: {
|
|
169
|
-
font: string;
|
|
170
|
-
offset: number;
|
|
171
|
-
weight: number;
|
|
172
|
-
};
|
|
173
|
-
sansSerif600: {
|
|
174
|
-
font: string;
|
|
175
|
-
offset: number;
|
|
176
|
-
weight: number;
|
|
177
|
-
};
|
|
178
|
-
sansSerif400: {
|
|
179
|
-
font: string;
|
|
180
|
-
offset: number;
|
|
181
|
-
weight: number;
|
|
182
|
-
};
|
|
183
|
-
serif: {
|
|
184
|
-
font: string;
|
|
185
|
-
offset: number;
|
|
186
|
-
weight: number;
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
declare const fonts: {
|
|
190
|
-
win7: {
|
|
191
|
-
defont: FontItem;
|
|
192
|
-
gothic: FontItem;
|
|
193
|
-
mincho: FontItem;
|
|
194
|
-
};
|
|
195
|
-
win8_1: {
|
|
196
|
-
defont: FontItem;
|
|
197
|
-
gothic: FontItem;
|
|
198
|
-
mincho: FontItem;
|
|
199
|
-
};
|
|
200
|
-
win: {
|
|
201
|
-
defont: FontItem;
|
|
202
|
-
gothic: FontItem;
|
|
203
|
-
mincho: FontItem;
|
|
204
|
-
};
|
|
205
|
-
mac10_9: {
|
|
206
|
-
defont: FontItem;
|
|
207
|
-
gothic: FontItem;
|
|
208
|
-
mincho: FontItem;
|
|
209
|
-
};
|
|
210
|
-
mac10_11: {
|
|
211
|
-
defont: FontItem;
|
|
212
|
-
gothic: FontItem;
|
|
213
|
-
mincho: FontItem;
|
|
214
|
-
};
|
|
215
|
-
mac: {
|
|
216
|
-
defont: FontItem;
|
|
217
|
-
gothic: FontItem;
|
|
218
|
-
mincho: FontItem;
|
|
219
|
-
};
|
|
220
|
-
other: {
|
|
221
|
-
defont: FontItem;
|
|
222
|
-
gothic: FontItem;
|
|
223
|
-
mincho: FontItem;
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
export interface IComment {
|
|
231
|
-
comment: formattedCommentWithSize;
|
|
232
|
-
invisible: boolean;
|
|
233
|
-
loc: commentLoc;
|
|
234
|
-
width: number;
|
|
235
|
-
long: number;
|
|
236
|
-
height: number;
|
|
237
|
-
vpos: number;
|
|
238
|
-
flash: boolean;
|
|
239
|
-
posY: number;
|
|
240
|
-
owner: boolean;
|
|
241
|
-
layer: number;
|
|
242
|
-
mail: string[];
|
|
243
|
-
image?: HTMLCanvasElement | null;
|
|
244
|
-
getTextImage: (vpos: number) => void;
|
|
245
|
-
draw: (vpos: number, showCollision: boolean, isDebug: boolean) => void;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
import { formattedComment } from "@/@types/format.formatted";
|
|
249
|
-
|
|
250
|
-
export interface IPluginConstructor {
|
|
251
|
-
id: string;
|
|
252
|
-
new (Canvas: HTMLCanvasElement, comments: formattedComment[]): IPlugin;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
export interface IPlugin {
|
|
256
|
-
draw(vpos: number): void;
|
|
257
|
-
addComments(comments: formattedComment[]): void;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
import { IPluginConstructor } from "@/@types/IPlugins";
|
|
261
|
-
|
|
262
230
|
type configItem<T> = T | { html5: T; flash: T };
|
|
263
231
|
type configSizeItem<T> = { big: T; medium: T; small: T };
|
|
264
232
|
type configResizedItem<T> = { default: T; resized: T };
|
|
@@ -430,6 +398,38 @@ type v1Comment = {
|
|
|
430
398
|
|
|
431
399
|
|
|
432
400
|
|
|
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
433
|
|
|
434
434
|
|
|
435
435
|
|
|
@@ -623,183 +623,183 @@ type measureInput = {
|
|
|
623
623
|
lineCount: number;
|
|
624
624
|
};
|
|
625
625
|
|
|
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
|
-
declare const getPosY: (currentPos: number, targetComment: IComment, collision: IComment[] | undefined) => {
|
|
786
|
-
currentPos: number;
|
|
787
|
-
isChanged: boolean;
|
|
788
|
-
isBreak: boolean;
|
|
789
|
-
};
|
|
790
|
-
declare const getPosX: (width: number, vpos: number, long: number) => number;
|
|
791
|
-
declare const parseFont: (font: commentFont, size: string | number) => string;
|
|
792
|
-
declare const arrayPush: (array: {
|
|
793
|
-
[key: number]: IComment[];
|
|
794
|
-
}, key: string | number, push: IComment) => void;
|
|
795
|
-
declare const hex2rgb: (hex: string) => number[];
|
|
796
|
-
declare const hex2rgba: (hex: string) => number[];
|
|
797
|
-
declare const changeCALayer: (rawData: formattedComment[]) => formattedComment[];
|
|
798
|
-
declare const getConfig: <T>(input: configItem<T>, isFlash?: boolean) => T;
|
|
799
|
-
declare const isFlashComment: (comment: formattedComment) => boolean;
|
|
800
|
-
declare const parseCommandAndNicoScript: (comment: formattedComment) => formattedCommentWithFont;
|
|
801
|
-
declare const getStrokeColor: (comment: formattedCommentWithSize) => string;
|
|
802
|
-
declare const ArrayEqual: (a: unknown[], b: unknown[]) => boolean;
|
|
803
|
-
|
|
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
|
+
declare const getPosY: (currentPos: number, targetComment: IComment, collision: IComment[] | undefined) => {
|
|
786
|
+
currentPos: number;
|
|
787
|
+
isChanged: boolean;
|
|
788
|
+
isBreak: boolean;
|
|
789
|
+
};
|
|
790
|
+
declare const getPosX: (width: number, vpos: number, long: number) => number;
|
|
791
|
+
declare const parseFont: (font: commentFont, size: string | number) => string;
|
|
792
|
+
declare const arrayPush: (array: {
|
|
793
|
+
[key: number]: IComment[];
|
|
794
|
+
}, key: string | number, push: IComment) => void;
|
|
795
|
+
declare const hex2rgb: (hex: string) => number[];
|
|
796
|
+
declare const hex2rgba: (hex: string) => number[];
|
|
797
|
+
declare const changeCALayer: (rawData: formattedComment[]) => formattedComment[];
|
|
798
|
+
declare const getConfig: <T>(input: configItem<T>, isFlash?: boolean) => T;
|
|
799
|
+
declare const isFlashComment: (comment: formattedComment) => boolean;
|
|
800
|
+
declare const parseCommandAndNicoScript: (comment: formattedComment) => formattedCommentWithFont;
|
|
801
|
+
declare const getStrokeColor: (comment: formattedCommentWithSize) => string;
|
|
802
|
+
declare const ArrayEqual: (a: unknown[], b: unknown[]) => boolean;
|
|
803
|
+
|
|
804
804
|
|
|
805
805
|
export default NiconiComments;
|