@xpadev-net/niconicomments 0.2.63 → 0.2.65

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/dist/bundle.d.ts CHANGED
@@ -1,1258 +1,1752 @@
1
- /// <reference types="node" />
2
- import * as valibot from 'valibot';
3
- import { Output } from 'valibot';
1
+ // Generated by dts-bundle-generator v9.0.0
4
2
 
5
- type ButtonList = {
6
- left: ButtonPartLeft;
7
- middle: ButtonPartMiddle[];
8
- right: ButtonPartRight;
9
- };
10
- type ButtonPartLeft = {
11
- type: "left";
12
- left: number;
13
- top: number;
14
- width: number;
15
- height: number;
16
- };
17
- type ButtonPartMiddle = {
18
- type: "middle";
19
- left: number;
20
- top: number;
21
- width: number;
22
- height: number;
23
- };
24
- type ButtonPartRight = {
25
- type: "right";
26
- right: number;
27
- top: number;
28
- height: number;
3
+ /**
4
+ * Issue reason type.
5
+ */
6
+ export type IssueReason = "any" | "array" | "bigint" | "blob" | "boolean" | "date" | "function" | "instance" | "map" | "number" | "object" | "record" | "set" | "special" | "string" | "symbol" | "tuple" | "undefined" | "unknown" | "type";
7
+ /**
8
+ * Issue origin type.
9
+ */
10
+ export type IssueOrigin = "key" | "value";
11
+ /**
12
+ * Issue type.
13
+ */
14
+ export type Issue = {
15
+ reason: IssueReason;
16
+ validation: string;
17
+ origin: IssueOrigin;
18
+ message: string;
19
+ input: any;
20
+ path?: PathItem[];
21
+ issues?: Issues;
22
+ abortEarly?: boolean;
23
+ abortPipeEarly?: boolean;
24
+ skipPipe?: boolean;
29
25
  };
30
-
31
- type Canvas = HTMLCanvasElement;
32
- type Context2D = CanvasRenderingContext2D;
33
-
34
- type DefaultCommand = {
35
- color?: string;
36
- size?: CommentSize;
37
- font?: CommentFont;
38
- loc?: CommentLoc;
26
+ /**
27
+ * Issues type.
28
+ */
29
+ export type Issues = [
30
+ Issue,
31
+ ...Issue[]
32
+ ];
33
+ /**
34
+ * Parse info type.
35
+ */
36
+ export type ParseInfo = Partial<Pick<Issue, "origin" | "abortEarly" | "abortPipeEarly" | "skipPipe">>;
37
+ /**
38
+ * Path item type.
39
+ */
40
+ export type PathItem = ObjectPathItem | RecordPathItem | TuplePathItem | MapPathItem | SetPathItem | ArrayPathItem;
41
+ /**
42
+ * Parse result type.
43
+ */
44
+ export type _ParseResult<TOutput> = {
45
+ output: TOutput;
46
+ issues?: undefined;
47
+ } | {
48
+ output?: undefined;
49
+ issues: Issues;
39
50
  };
40
-
41
- interface IRenderer {
42
- readonly canvas: HTMLCanvasElement;
43
- readonly video?: HTMLVideoElement;
44
- destroy(): void;
45
- drawVideo(enableLegacyPip: boolean): void;
46
- getFont(): string;
47
- getFillStyle(): string | CanvasGradient | CanvasPattern;
48
- setScale(scale: number, arg1?: number): void;
49
- fillRect(x: number, y: number, width: number, height: number): void;
50
- strokeRect(x: number, y: number, width: number, height: number): void;
51
- fillText(text: string, x: number, y: number): void;
52
- strokeText(text: string, x: number, y: number): void;
53
- quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
54
- clearRect(x: number, y: number, width: number, height: number): void;
55
- setFont(font: string): void;
56
- setFillStyle(color: string): void;
57
- setStrokeStyle(color: string): void;
58
- setLineWidth(width: number): void;
59
- setGlobalAlpha(alpha: number): void;
60
- setSize(width: number, height: number): void;
61
- getSize(): {
62
- width: number;
63
- height: number;
64
- };
65
- measureText(text: string): TextMetrics;
66
- beginPath(): void;
67
- closePath(): void;
68
- moveTo(x: number, y: number): void;
69
- lineTo(x: number, y: number): void;
70
- stroke(): void;
71
- save(): void;
72
- restore(): void;
73
- getCanvas(): IRenderer;
74
- drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void;
51
+ /**
52
+ * Base schema type.
53
+ */
54
+ export type BaseSchema<TInput = any, TOutput = TInput> = {
55
+ async: false;
56
+ _parse(input: unknown, info?: ParseInfo): _ParseResult<TOutput>;
57
+ _types?: {
58
+ input: TInput;
59
+ output: TOutput;
60
+ };
61
+ };
62
+ /**
63
+ * Base schema async type.
64
+ */
65
+ export type BaseSchemaAsync<TInput = any, TOutput = TInput> = {
66
+ async: true;
67
+ _parse(input: unknown, info?: ParseInfo): Promise<_ParseResult<TOutput>>;
68
+ _types?: {
69
+ input: TInput;
70
+ output: TOutput;
71
+ };
72
+ };
73
+ /**
74
+ * Input inference type.
75
+ */
76
+ export type Input<TSchema extends BaseSchema | BaseSchemaAsync> = NonNullable<TSchema["_types"]>["input"];
77
+ /**
78
+ * Output inference type.
79
+ */
80
+ export type Output<TSchema extends BaseSchema | BaseSchemaAsync> = NonNullable<TSchema["_types"]>["output"];
81
+ /**
82
+ * Resolve type.
83
+ *
84
+ * Hint: This type has no effect and is only used so that TypeScript displays
85
+ * the final type in the preview instead of the utility types used.
86
+ */
87
+ export type Resolve<T> = T;
88
+ /**
89
+ * Resolve object type.
90
+ *
91
+ * Hint: This type has no effect and is only used so that TypeScript displays
92
+ * the final type in the preview instead of the utility types used.
93
+ */
94
+ export type ResolveObject<T> = Resolve<{
95
+ [k in keyof T]: T[k];
96
+ }>;
97
+ /**
98
+ * Array schema type.
99
+ */
100
+ export type ArraySchema<TItem extends BaseSchema, TOutput = Output<TItem>[]> = BaseSchema<Input<TItem>[], TOutput> & {
101
+ type: "array";
102
+ item: TItem;
103
+ };
104
+ /**
105
+ * Array path item type.
106
+ */
107
+ export type ArrayPathItem = {
108
+ type: "array";
109
+ input: any[];
110
+ key: number;
111
+ value: any;
112
+ };
113
+ /**
114
+ * Boolean schema type.
115
+ */
116
+ export type BooleanSchema<TOutput = boolean> = BaseSchema<boolean, TOutput> & {
117
+ type: "boolean";
118
+ };
119
+ /**
120
+ * Enum type.
121
+ */
122
+ export type Enum = {
123
+ [key: string]: string | number;
124
+ [key: number]: string;
125
+ };
126
+ /**
127
+ * Native enum schema type.
128
+ */
129
+ export type EnumSchema<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSchema<TEnum[keyof TEnum], TOutput> & {
130
+ type: "enum";
131
+ enum: TEnum;
132
+ };
133
+ /**
134
+ * Native enum schema async type.
135
+ */
136
+ export type EnumSchemaAsync<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSchemaAsync<TEnum[keyof TEnum], TOutput> & {
137
+ type: "enum";
138
+ enum: TEnum;
139
+ };
140
+ /**
141
+ * Intersect options async type.
142
+ */
143
+ export type IntersectOptionsAsync = [
144
+ BaseSchema | BaseSchemaAsync,
145
+ BaseSchema | BaseSchemaAsync,
146
+ ...(BaseSchema[] | BaseSchemaAsync[])
147
+ ];
148
+ /**
149
+ * Intersect input type.
150
+ */
151
+ export type IntersectInput<TIntersectOptions extends IntersectOptions | IntersectOptionsAsync> = TIntersectOptions extends [
152
+ BaseSchema<infer TInput1, any> | BaseSchemaAsync<infer TInput1, any>,
153
+ ...infer TRest
154
+ ] ? TRest extends IntersectOptions ? TInput1 & IntersectOutput<TRest> : TRest extends [
155
+ BaseSchema<infer TInput2, any> | BaseSchemaAsync<infer TInput2, any>
156
+ ] ? TInput1 & TInput2 : never : never;
157
+ /**
158
+ * Intersect output type.
159
+ */
160
+ export type IntersectOutput<TIntersectOptions extends IntersectOptions | IntersectOptionsAsync> = TIntersectOptions extends [
161
+ BaseSchema<any, infer TOutput1> | BaseSchemaAsync<any, infer TOutput1>,
162
+ ...infer TRest
163
+ ] ? TRest extends IntersectOptions ? TOutput1 & IntersectOutput<TRest> : TRest extends [
164
+ BaseSchema<any, infer TOutput2> | BaseSchemaAsync<any, infer TOutput2>
165
+ ] ? TOutput1 & TOutput2 : never : never;
166
+ /**
167
+ * Intersect options type.
168
+ */
169
+ export type IntersectOptions = [
170
+ BaseSchema,
171
+ BaseSchema,
172
+ ...BaseSchema[]
173
+ ];
174
+ /**
175
+ * Intersect schema type.
176
+ */
177
+ export type IntersectSchema<TOptions extends IntersectOptions, TOutput = IntersectOutput<TOptions>> = BaseSchema<IntersectInput<TOptions>, TOutput> & {
178
+ type: "intersect";
179
+ options: TOptions;
180
+ };
181
+ /**
182
+ * Literal type.
183
+ */
184
+ export type Literal = number | string | boolean | symbol | bigint;
185
+ /**
186
+ * Literal schema type.
187
+ */
188
+ export type LiteralSchema<TLiteral extends Literal, TOutput = TLiteral> = BaseSchema<TLiteral, TOutput> & {
189
+ type: "literal";
190
+ literal: TLiteral;
191
+ };
192
+ /**
193
+ * Map path item type.
194
+ */
195
+ export type MapPathItem = {
196
+ type: "map";
197
+ input: Map<any, any>;
198
+ key: any;
199
+ value: any;
200
+ };
201
+ /**
202
+ * Never schema type.
203
+ */
204
+ export type NeverSchema = BaseSchema<never> & {
205
+ type: "never";
206
+ };
207
+ /**
208
+ * Never schema async type.
209
+ */
210
+ export type NeverSchemaAsync = BaseSchemaAsync<never> & {
211
+ type: "never";
212
+ };
213
+ /**
214
+ * Nullable schema type.
215
+ */
216
+ export type NullableSchema<TWrapped extends BaseSchema, TDefault extends Input<TWrapped> | undefined = undefined, TOutput = TDefault extends Input<TWrapped> ? Output<TWrapped> : Output<TWrapped> | null> = BaseSchema<Input<TWrapped> | null, TOutput> & {
217
+ type: "nullable";
218
+ wrapped: TWrapped;
219
+ getDefault: () => TDefault;
220
+ };
221
+ /**
222
+ * Number schema type.
223
+ */
224
+ export type NumberSchema<TOutput = number> = BaseSchema<number, TOutput> & {
225
+ type: "number";
226
+ };
227
+ /**
228
+ * Object entries async type.
229
+ */
230
+ export type ObjectEntriesAsync = Record<string, BaseSchema | BaseSchemaAsync>;
231
+ /**
232
+ * Object path item type.
233
+ */
234
+ export type ObjectPathItem = {
235
+ type: "object";
236
+ input: Record<string, any>;
237
+ key: string;
238
+ value: any;
239
+ };
240
+ /**
241
+ * Required object keys type.
242
+ */
243
+ export type RequiredKeys<TObject extends object> = {
244
+ [TKey in keyof TObject]: undefined extends TObject[TKey] ? never : TKey;
245
+ }[keyof TObject];
246
+ /**
247
+ * Optional object keys type.
248
+ */
249
+ export type OptionalKeys<TObject extends object> = {
250
+ [TKey in keyof TObject]: undefined extends TObject[TKey] ? TKey : never;
251
+ }[keyof TObject];
252
+ /**
253
+ * Object with question marks type.
254
+ */
255
+ export type WithQuestionMarks<TObject extends object> = Pick<TObject, RequiredKeys<TObject>> & Partial<Pick<TObject, OptionalKeys<TObject>>>;
256
+ /**
257
+ * Object input inference type.
258
+ */
259
+ export type ObjectInput<TEntries extends ObjectEntries | ObjectEntriesAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined> = TRest extends undefined | NeverSchema | NeverSchemaAsync ? ResolveObject<WithQuestionMarks<{
260
+ [TKey in keyof TEntries]: Input<TEntries[TKey]>;
261
+ }>> : TRest extends BaseSchema | BaseSchemaAsync ? ResolveObject<WithQuestionMarks<{
262
+ [TKey in keyof TEntries]: Input<TEntries[TKey]>;
263
+ }>> & Record<string, Input<TRest>> : never;
264
+ /**
265
+ * Object output inference type.
266
+ */
267
+ export type ObjectOutput<TEntries extends ObjectEntries | ObjectEntriesAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined> = TRest extends undefined | NeverSchema | NeverSchemaAsync ? ResolveObject<WithQuestionMarks<{
268
+ [TKey in keyof TEntries]: Output<TEntries[TKey]>;
269
+ }>> : TRest extends BaseSchema | BaseSchemaAsync ? ResolveObject<WithQuestionMarks<{
270
+ [TKey in keyof TEntries]: Output<TEntries[TKey]>;
271
+ }>> & Record<string, Output<TRest>> : never;
272
+ /**
273
+ * Object entries type.
274
+ */
275
+ export type ObjectEntries = Record<string, BaseSchema>;
276
+ /**
277
+ * Object schema type.
278
+ */
279
+ export type ObjectSchema<TEntries extends ObjectEntries, TRest extends BaseSchema | undefined = undefined, TOutput = ObjectOutput<TEntries, TRest>> = BaseSchema<ObjectInput<TEntries, TRest>, TOutput> & {
280
+ type: "object";
281
+ entries: TEntries;
282
+ rest: TRest;
283
+ };
284
+ /**
285
+ * Optional schema type.
286
+ */
287
+ export type OptionalSchema<TWrapped extends BaseSchema, TDefault extends Input<TWrapped> | undefined = undefined, TOutput = TDefault extends Input<TWrapped> ? Output<TWrapped> : Output<TWrapped> | undefined> = BaseSchema<Input<TWrapped> | undefined, TOutput> & {
288
+ type: "optional";
289
+ wrapped: TWrapped;
290
+ getDefault: () => TDefault;
291
+ };
292
+ /**
293
+ * Picklist options type.
294
+ */
295
+ export type PicklistOptions<TOption extends string = string> = Readonly<[
296
+ TOption,
297
+ ...TOption[]
298
+ ]> | [
299
+ TOption,
300
+ ...TOption[]
301
+ ];
302
+ /**
303
+ * Picklist schema type.
304
+ */
305
+ export type PicklistSchema<Toptions extends PicklistOptions, TOutput = Toptions[number]> = BaseSchema<Toptions[number], TOutput> & {
306
+ type: "picklist";
307
+ options: Toptions;
308
+ };
309
+ /**
310
+ * Picklist schema async type.
311
+ */
312
+ export type PicklistSchemaAsync<TOptions extends PicklistOptions, TOutput = TOptions[number]> = BaseSchemaAsync<TOptions[number], TOutput> & {
313
+ type: "picklist";
314
+ options: TOptions;
315
+ };
316
+ /**
317
+ * String schema type.
318
+ */
319
+ export type StringSchema<TOutput = string> = BaseSchema<string, TOutput> & {
320
+ type: "string";
321
+ };
322
+ /**
323
+ * String schema async type.
324
+ */
325
+ export type StringSchemaAsync<TOutput = string> = BaseSchemaAsync<string, TOutput> & {
326
+ type: "string";
327
+ };
328
+ /**
329
+ * Union options type.
330
+ */
331
+ export type UnionOptions = [
332
+ BaseSchema,
333
+ BaseSchema,
334
+ ...BaseSchema[]
335
+ ];
336
+ /**
337
+ * Union schema type.
338
+ */
339
+ export type UnionSchema<TOptions extends UnionOptions, TOutput = Output<TOptions[number]>> = BaseSchema<Input<TOptions[number]>, TOutput> & {
340
+ type: "union";
341
+ options: TOptions;
342
+ };
343
+ /**
344
+ * Union options async type.
345
+ */
346
+ export type UnionOptionsAsync = [
347
+ BaseSchema | BaseSchemaAsync,
348
+ BaseSchema | BaseSchemaAsync,
349
+ ...(BaseSchema[] | BaseSchemaAsync[])
350
+ ];
351
+ /**
352
+ * Union schema async type.
353
+ */
354
+ export type UnionSchemaAsync<TOptions extends UnionOptionsAsync, TOutput = Output<TOptions[number]>> = BaseSchemaAsync<Input<TOptions[number]>, TOutput> & {
355
+ type: "union";
356
+ options: TOptions;
357
+ };
358
+ /**
359
+ * Record key type.
360
+ */
361
+ export type RecordKeyAsync = EnumSchema<any, string | number | symbol> | EnumSchemaAsync<any, string | number | symbol> | PicklistSchema<any, string | number | symbol> | PicklistSchemaAsync<any, string | number | symbol> | StringSchema<string | number | symbol> | StringSchemaAsync<string | number | symbol> | UnionSchema<any, string | number | symbol> | UnionSchemaAsync<any, string | number | symbol>;
362
+ /**
363
+ * Record path item type.
364
+ */
365
+ export type RecordPathItem = {
366
+ type: "record";
367
+ input: Record<string | number | symbol, any>;
368
+ key: string | number | symbol;
369
+ value: any;
370
+ };
371
+ /**
372
+ * Partial key schema type.
373
+ */
374
+ export type PartialKeySchema = PicklistSchema<any> | PicklistSchemaAsync<any> | EnumSchema<any> | EnumSchemaAsync<any> | UnionSchema<any>;
375
+ /**
376
+ * Record input inference type.
377
+ */
378
+ export type RecordInput<TKey extends RecordKey | RecordKeyAsync, TValue extends BaseSchema | BaseSchemaAsync> = ResolveObject<TKey extends PartialKeySchema ? Partial<Record<Input<TKey>, Input<TValue>>> : Record<Input<TKey>, Input<TValue>>>;
379
+ /**
380
+ * Record output inference type.
381
+ */
382
+ export type RecordOutput<TKey extends RecordKey | RecordKeyAsync, TValue extends BaseSchema | BaseSchemaAsync> = ResolveObject<TKey extends PartialKeySchema ? Partial<Record<Output<TKey>, Output<TValue>>> : Record<Output<TKey>, Output<TValue>>>;
383
+ /**
384
+ * Record key type.
385
+ */
386
+ export type RecordKey = EnumSchema<any, string | number | symbol> | PicklistSchema<any, string | number | symbol> | StringSchema<string | number | symbol> | UnionSchema<any, string | number | symbol>;
387
+ /**
388
+ * Record schema type.
389
+ */
390
+ export type RecordSchema<TKey extends RecordKey, TValue extends BaseSchema, TOutput = RecordOutput<TKey, TValue>> = BaseSchema<RecordInput<TKey, TValue>, TOutput> & {
391
+ type: "record";
392
+ key: TKey;
393
+ value: TValue;
394
+ };
395
+ /**
396
+ * Set path item type.
397
+ */
398
+ export type SetPathItem = {
399
+ type: "set";
400
+ input: Set<any>;
401
+ key: number;
402
+ value: any;
403
+ };
404
+ /**
405
+ * Tuple path item type.
406
+ */
407
+ export type TuplePathItem = {
408
+ type: "tuple";
409
+ input: [
410
+ any,
411
+ ...any[]
412
+ ];
413
+ key: number;
414
+ value: any;
415
+ };
416
+ /**
417
+ * Unknown schema type.
418
+ */
419
+ export type UnknownSchema<TOutput = unknown> = BaseSchema<unknown, TOutput> & {
420
+ type: "unknown";
421
+ };
422
+ export type ButtonList = {
423
+ left: ButtonPartLeft;
424
+ middle: ButtonPartMiddle[];
425
+ right: ButtonPartRight;
426
+ };
427
+ export type ButtonPartLeft = {
428
+ type: "left";
429
+ left: number;
430
+ top: number;
431
+ width: number;
432
+ height: number;
433
+ };
434
+ export type ButtonPartMiddle = {
435
+ type: "middle";
436
+ left: number;
437
+ top: number;
438
+ width: number;
439
+ height: number;
440
+ };
441
+ export type ButtonPartRight = {
442
+ type: "right";
443
+ right: number;
444
+ top: number;
445
+ height: number;
446
+ };
447
+ export type Canvas = HTMLCanvasElement;
448
+ export type Context2D = CanvasRenderingContext2D;
449
+ export type DefaultCommand = {
450
+ color?: string;
451
+ size?: CommentSize;
452
+ font?: CommentFont;
453
+ loc?: CommentLoc;
454
+ };
455
+ export interface IRenderer {
456
+ readonly canvas: HTMLCanvasElement;
457
+ readonly video?: HTMLVideoElement;
458
+ destroy(): void;
459
+ drawVideo(enableLegacyPip: boolean): void;
460
+ getFont(): string;
461
+ getFillStyle(): string | CanvasGradient | CanvasPattern;
462
+ setScale(scale: number, arg1?: number): void;
463
+ fillRect(x: number, y: number, width: number, height: number): void;
464
+ strokeRect(x: number, y: number, width: number, height: number): void;
465
+ fillText(text: string, x: number, y: number): void;
466
+ strokeText(text: string, x: number, y: number): void;
467
+ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
468
+ clearRect(x: number, y: number, width: number, height: number): void;
469
+ setFont(font: string): void;
470
+ setFillStyle(color: string): void;
471
+ setStrokeStyle(color: string): void;
472
+ setLineWidth(width: number): void;
473
+ setGlobalAlpha(alpha: number): void;
474
+ setSize(width: number, height: number): void;
475
+ getSize(): {
476
+ width: number;
477
+ height: number;
478
+ };
479
+ measureText(text: string): TextMetrics;
480
+ beginPath(): void;
481
+ closePath(): void;
482
+ moveTo(x: number, y: number): void;
483
+ lineTo(x: number, y: number): void;
484
+ stroke(): void;
485
+ save(): void;
486
+ restore(): void;
487
+ getCanvas(): IRenderer;
488
+ drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void;
75
489
  }
76
-
77
490
  declare class BaseComment implements IComment {
78
- protected readonly renderer: IRenderer;
79
- protected cacheKey: string;
80
- comment: FormattedCommentWithSize;
81
- pos: {
82
- x: number;
83
- y: number;
84
- };
85
- posY: number;
86
- readonly pluginName: string;
87
- image?: IRenderer | null;
88
- buttonImage?: IRenderer | null;
89
- constructor(comment: FormattedComment, renderer: IRenderer);
90
- get invisible(): boolean;
91
- get loc(): "ue" | "naka" | "shita";
92
- get long(): number;
93
- get vpos(): number;
94
- get width(): number;
95
- get height(): number;
96
- get flash(): boolean;
97
- get layer(): number;
98
- get owner(): boolean;
99
- get mail(): string[];
100
- get content(): string;
101
- set content(_: string);
102
- protected getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
103
- protected parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
104
- protected parseContent(comment: string): ParseContentResult;
105
- protected measureText(comment: MeasureTextInput): MeasureTextResult;
106
- protected convertComment(comment: FormattedComment): FormattedCommentWithSize;
107
- draw(vpos: number, showCollision: boolean, cursor?: Position): void;
108
- protected _draw(posX: number, posY: number, cursor?: Position): void;
109
- protected _drawRectColor(posX: number, posY: number): void;
110
- protected _drawBackgroundColor(posX: number, posY: number): void;
111
- protected _drawDebugInfo(posX: number, posY: number): void;
112
- protected _drawCollision(posX: number, posY: number, showCollision: boolean): void;
113
- protected getTextImage(): IRenderer | null;
114
- protected _generateTextImage(): IRenderer;
115
- protected _cacheImage(image: IRenderer): void;
116
- protected getButtonImage(posX: number, posY: number, cursor?: Position): IRenderer | undefined;
117
- isHovered(cursor?: Position, posX?: number, posY?: number): boolean;
118
- protected getCacheKey(): string;
491
+ protected readonly renderer: IRenderer;
492
+ protected cacheKey: string;
493
+ comment: FormattedCommentWithSize;
494
+ pos: {
495
+ x: number;
496
+ y: number;
497
+ };
498
+ posY: number;
499
+ readonly pluginName: string;
500
+ image?: IRenderer | null;
501
+ buttonImage?: IRenderer | null;
502
+ constructor(comment: FormattedComment, renderer: IRenderer);
503
+ get invisible(): boolean;
504
+ get loc(): "ue" | "naka" | "shita";
505
+ get long(): number;
506
+ get vpos(): number;
507
+ get width(): number;
508
+ get height(): number;
509
+ get flash(): boolean;
510
+ get layer(): number;
511
+ get owner(): boolean;
512
+ get mail(): string[];
513
+ get content(): string;
514
+ set content(_: string);
515
+ protected getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
516
+ protected parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
517
+ protected parseContent(comment: string): ParseContentResult;
518
+ protected measureText(comment: MeasureTextInput): MeasureTextResult;
519
+ protected convertComment(comment: FormattedComment): FormattedCommentWithSize;
520
+ draw(vpos: number, showCollision: boolean, cursor?: Position): void;
521
+ protected _draw(posX: number, posY: number, cursor?: Position): void;
522
+ protected _drawRectColor(posX: number, posY: number): void;
523
+ protected _drawBackgroundColor(posX: number, posY: number): void;
524
+ protected _drawDebugInfo(posX: number, posY: number): void;
525
+ protected _drawCollision(posX: number, posY: number, showCollision: boolean): void;
526
+ protected getTextImage(): IRenderer | null;
527
+ protected _generateTextImage(): IRenderer;
528
+ protected _cacheImage(image: IRenderer): void;
529
+ protected getButtonImage(posX: number, posY: number, cursor?: Position): IRenderer | undefined;
530
+ isHovered(cursor?: Position, posX?: number, posY?: number): boolean;
531
+ protected getCacheKey(): string;
119
532
  }
120
-
121
533
  declare class FlashComment extends BaseComment {
122
- private _globalScale;
123
- readonly pluginName: string;
124
- buttonImage: IRenderer;
125
- constructor(comment: FormattedComment, renderer: IRenderer);
126
- get content(): string;
127
- set content(input: string);
128
- convertComment(comment: FormattedComment): FormattedCommentWithSize;
129
- getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
130
- parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
131
- parseContent(input: string, button?: ButtonParams): {
132
- content: ({
133
- type: "spacer";
134
- char: string;
135
- charWidth: number;
136
- count: number;
137
- isButton?: boolean | undefined;
138
- font?: "defont" | "gulim" | "simsun" | undefined;
139
- } | {
140
- type: "text";
141
- content: string;
142
- slicedContent: string[];
143
- isButton?: boolean | undefined;
144
- font?: "defont" | "gulim" | "simsun" | undefined;
145
- width?: number[] | undefined;
146
- })[];
147
- lineCount: number;
148
- lineOffset: number;
149
- };
150
- measureText(comment: MeasureTextInput): MeasureTextResult;
151
- private _isDoubleResize;
152
- private _measureContent;
153
- _drawCollision(posX: number, posY: number, showCollision: boolean): void;
154
- _generateTextImage(): IRenderer;
155
- getButtonImage(posX: number, posY: number, cursor?: Position): IRenderer | undefined;
156
- isHovered(_cursor?: Position, _posX?: number, _posY?: number): boolean;
157
- protected _setupCanvas(renderer: IRenderer): {
158
- renderer: IRenderer;
159
- };
534
+ private _globalScale;
535
+ readonly pluginName: string;
536
+ buttonImage: IRenderer;
537
+ constructor(comment: FormattedComment, renderer: IRenderer);
538
+ get content(): string;
539
+ set content(input: string);
540
+ convertComment(comment: FormattedComment): FormattedCommentWithSize;
541
+ getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
542
+ parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
543
+ parseContent(input: string, button?: ButtonParams): {
544
+ content: ({
545
+ type: "spacer";
546
+ char: string;
547
+ charWidth: number;
548
+ count: number;
549
+ isButton?: boolean | undefined;
550
+ font?: "defont" | "gulim" | "simsun" | undefined;
551
+ } | {
552
+ type: "text";
553
+ content: string;
554
+ slicedContent: string[];
555
+ isButton?: boolean | undefined;
556
+ font?: "defont" | "gulim" | "simsun" | undefined;
557
+ width?: number[] | undefined;
558
+ })[];
559
+ lineCount: number;
560
+ lineOffset: number;
561
+ };
562
+ measureText(comment: MeasureTextInput): MeasureTextResult;
563
+ private _isDoubleResize;
564
+ private _measureContent;
565
+ _drawCollision(posX: number, posY: number, showCollision: boolean): void;
566
+ _generateTextImage(): IRenderer;
567
+ getButtonImage(posX: number, posY: number, cursor?: Position): IRenderer | undefined;
568
+ isHovered(_cursor?: Position, _posX?: number, _posY?: number): boolean;
569
+ protected _setupCanvas(renderer: IRenderer): {
570
+ renderer: IRenderer;
571
+ };
160
572
  }
161
-
162
573
  declare class HTML5Comment extends BaseComment {
163
- readonly pluginName: string;
164
- constructor(comment: FormattedComment, context: IRenderer);
165
- get content(): string;
166
- set content(input: string);
167
- convertComment(comment: FormattedComment): FormattedCommentWithSize;
168
- getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
169
- parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
170
- parseContent(input: string, font?: HTML5Fonts): {
171
- content: {
172
- type: "text";
173
- content: string;
174
- slicedContent: string[];
175
- isButton?: boolean | undefined;
176
- font?: "defont" | "gulim" | "simsun" | undefined;
177
- width?: number[] | undefined;
178
- }[];
179
- lineCount: number;
180
- lineOffset: number;
181
- };
182
- measureText(comment: MeasureTextInput): MeasureTextResult;
183
- private _measureComment;
184
- private _processResizeX;
185
- _drawCollision(posX: number, posY: number, showCollision: boolean): void;
186
- _generateTextImage(): IRenderer;
187
- getButtonImage(): undefined;
188
- isHovered(): boolean;
574
+ readonly pluginName: string;
575
+ constructor(comment: FormattedComment, context: IRenderer);
576
+ get content(): string;
577
+ set content(input: string);
578
+ convertComment(comment: FormattedComment): FormattedCommentWithSize;
579
+ getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
580
+ parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
581
+ parseContent(input: string, font?: HTML5Fonts): {
582
+ content: {
583
+ type: "text";
584
+ content: string;
585
+ slicedContent: string[];
586
+ isButton?: boolean | undefined;
587
+ font?: "defont" | "gulim" | "simsun" | undefined;
588
+ width?: number[] | undefined;
589
+ }[];
590
+ lineCount: number;
591
+ lineOffset: number;
592
+ };
593
+ measureText(comment: MeasureTextInput): MeasureTextResult;
594
+ private _measureComment;
595
+ private _processResizeX;
596
+ _drawCollision(posX: number, posY: number, showCollision: boolean): void;
597
+ _generateTextImage(): IRenderer;
598
+ getButtonImage(): undefined;
599
+ isHovered(): boolean;
189
600
  }
190
-
191
- type index_d$4_BaseComment = BaseComment;
601
+ export type index_d$4_BaseComment = BaseComment;
192
602
  declare const index_d$4_BaseComment: typeof BaseComment;
193
- type index_d$4_FlashComment = FlashComment;
603
+ export type index_d$4_FlashComment = FlashComment;
194
604
  declare const index_d$4_FlashComment: typeof FlashComment;
195
- type index_d$4_HTML5Comment = HTML5Comment;
605
+ export type index_d$4_HTML5Comment = HTML5Comment;
196
606
  declare const index_d$4_HTML5Comment: typeof HTML5Comment;
197
607
  declare namespace index_d$4 {
198
- export { index_d$4_BaseComment as BaseComment, index_d$4_FlashComment as FlashComment, index_d$4_HTML5Comment as HTML5Comment };
608
+ export { index_d$4_BaseComment as index_d$4_BaseComment, index_d$4_FlashComment as index_d$4_FlashComment, index_d$4_HTML5Comment as index_d$4_HTML5Comment };
199
609
  }
200
-
201
- type ConfigItem<T> = T | MultiConfigItem<T>;
202
- type MultiConfigItem<T> = {
203
- html5: T;
204
- flash: T;
205
- };
206
- type ConfigSizeItem<T> = {
207
- big: T;
208
- medium: T;
209
- small: T;
210
- };
211
- type ConfigResizedItem<T> = {
212
- default: T;
213
- resized: T;
214
- };
215
- type ConfigFlashFontItem<T> = {
216
- gulim: T;
217
- simsun: T;
218
- defont: T;
219
- };
220
- type ConfigHTML5FontItem<T> = {
221
- gothic: T;
222
- mincho: T;
223
- defont: T;
224
- };
225
- type CommentStageSize = {
226
- width: number;
227
- fullWidth: number;
228
- height: number;
229
- };
230
- type FlashCharList = {
231
- [key in "simsunStrong" | "simsunWeak" | "gulim" | "gothic"]: string;
232
- };
233
- type FlashMode = "xp" | "vista";
234
- type FlashScriptChar = {
235
- [key in "super" | "sub"]: string;
236
- };
237
- type FontList = {
238
- [key in "gulim" | "simsun"]: string;
239
- };
240
- type LineCounts = {
241
- [key in "default" | "resized" | "doubleResized"]: ConfigSizeItem<number>;
242
- };
243
- type BaseConfig = {
244
- cacheAge: number;
245
- canvasHeight: number;
246
- canvasWidth: number;
247
- collisionRange: {
248
- [key in "left" | "right"]: number;
249
- };
250
- collisionPadding: number;
251
- colors: {
252
- [key: string]: string;
253
- };
254
- commentDrawPadding: number;
255
- commentDrawRange: number;
256
- commentScale: ConfigItem<number>;
257
- commentStageSize: ConfigItem<CommentStageSize>;
258
- flashCommentYOffset: ConfigSizeItem<ConfigResizedItem<number>>;
259
- flashCommentYPaddingTop: ConfigResizedItem<number>;
260
- contextFillLiveOpacity: number;
261
- contextLineWidth: ConfigItem<number>;
262
- contextStrokeColor: string;
263
- contextStrokeInversionColor: string;
264
- contextStrokeOpacity: number;
265
- flashChar: FlashCharList;
266
- flashMode: FlashMode;
267
- flashScriptChar: FlashScriptChar;
268
- flashThreshold: number;
269
- fonts: {
270
- flash: FontList;
271
- html5: PlatformFont;
272
- };
273
- fontSize: ConfigItem<ConfigSizeItem<ConfigResizedItem<number>>>;
274
- fpsInterval: number;
275
- html5HiResCommentCorrection: number;
276
- html5LineCounts: ConfigItem<LineCounts>;
277
- lineHeight: ConfigItem<ConfigSizeItem<ConfigResizedItem<number>>>;
278
- html5MinFontSize: number;
279
- sameCAGap: number;
280
- sameCAMinScore: number;
281
- sameCARange: number;
282
- sameCATimestampRange: number;
283
- flashLetterSpacing: number;
284
- flashScriptCharOffset: number;
285
- plugins: IPluginConstructor[];
286
- commentPlugins: {
287
- class: typeof BaseComment;
288
- condition: (comment: FormattedComment) => boolean;
289
- }[];
290
- commentLimit: number | undefined;
291
- hideCommentOrder: "asc" | "desc";
292
- lineBreakCount: {
293
- [key in CommentSize]: number;
294
- };
295
- nakaCommentSpeedOffset: number;
296
- atButtonPadding: number;
297
- atButtonRadius: number;
298
- flashDoubleResizeHeights: Partial<ConfigSizeItem<{
299
- [key: number]: number;
300
- }>>;
301
- flashLineBreakScale: ConfigSizeItem<number>;
302
- compatSpacer: {
303
- flash: {
304
- [key: string]: Partial<ConfigFlashFontItem<number>>;
305
- };
306
- html5: {
307
- [key: string]: Partial<ConfigHTML5FontItem<number>>;
308
- };
309
- };
310
- };
311
- type Config = Partial<BaseConfig>;
312
-
313
- type Position = {
314
- x: number;
315
- y: number;
610
+ export type ConfigItem<T> = T | MultiConfigItem<T>;
611
+ export type MultiConfigItem<T> = {
612
+ html5: T;
613
+ flash: T;
316
614
  };
317
-
318
- interface CommentEventBase {
319
- type: CommentEventName;
320
- timeStamp: number;
321
- vpos: number;
615
+ export type ConfigSizeItem<T> = {
616
+ big: T;
617
+ medium: T;
618
+ small: T;
619
+ };
620
+ export type ConfigResizedItem<T> = {
621
+ default: T;
622
+ resized: T;
623
+ };
624
+ export type ConfigFlashFontItem<T> = {
625
+ gulim: T;
626
+ simsun: T;
627
+ defont: T;
628
+ };
629
+ export type ConfigHTML5FontItem<T> = {
630
+ gothic: T;
631
+ mincho: T;
632
+ defont: T;
633
+ };
634
+ export type CommentStageSize = {
635
+ width: number;
636
+ fullWidth: number;
637
+ height: number;
638
+ };
639
+ export type FlashCharList = {
640
+ [key in "simsunStrong" | "simsunWeak" | "gulim" | "gothic"]: string;
641
+ };
642
+ export type FlashMode = "xp" | "vista";
643
+ export type FlashScriptChar = {
644
+ [key in "super" | "sub"]: string;
645
+ };
646
+ export type FontList = {
647
+ [key in "gulim" | "simsun"]: string;
648
+ };
649
+ export type LineCounts = {
650
+ [key in "default" | "resized" | "doubleResized"]: ConfigSizeItem<number>;
651
+ };
652
+ export type BaseConfig = {
653
+ cacheAge: number;
654
+ canvasHeight: number;
655
+ canvasWidth: number;
656
+ collisionRange: {
657
+ [key in "left" | "right"]: number;
658
+ };
659
+ collisionPadding: number;
660
+ colors: {
661
+ [key: string]: string;
662
+ };
663
+ commentDrawPadding: number;
664
+ commentDrawRange: number;
665
+ commentScale: ConfigItem<number>;
666
+ commentStageSize: ConfigItem<CommentStageSize>;
667
+ flashCommentYOffset: ConfigSizeItem<ConfigResizedItem<number>>;
668
+ flashCommentYPaddingTop: ConfigResizedItem<number>;
669
+ contextFillLiveOpacity: number;
670
+ contextLineWidth: ConfigItem<number>;
671
+ contextStrokeColor: string;
672
+ contextStrokeInversionColor: string;
673
+ contextStrokeOpacity: number;
674
+ flashChar: FlashCharList;
675
+ flashMode: FlashMode;
676
+ flashScriptChar: FlashScriptChar;
677
+ flashThreshold: number;
678
+ fonts: {
679
+ flash: FontList;
680
+ html5: PlatformFont;
681
+ };
682
+ fontSize: ConfigItem<ConfigSizeItem<ConfigResizedItem<number>>>;
683
+ fpsInterval: number;
684
+ html5HiResCommentCorrection: number;
685
+ html5LineCounts: ConfigItem<LineCounts>;
686
+ lineHeight: ConfigItem<ConfigSizeItem<ConfigResizedItem<number>>>;
687
+ html5MinFontSize: number;
688
+ sameCAGap: number;
689
+ sameCAMinScore: number;
690
+ sameCARange: number;
691
+ sameCATimestampRange: number;
692
+ flashLetterSpacing: number;
693
+ flashScriptCharOffset: number;
694
+ plugins: IPluginConstructor[];
695
+ commentPlugins: {
696
+ class: typeof BaseComment;
697
+ condition: (comment: FormattedComment) => boolean;
698
+ }[];
699
+ commentLimit: number | undefined;
700
+ hideCommentOrder: "asc" | "desc";
701
+ lineBreakCount: {
702
+ [key in CommentSize]: number;
703
+ };
704
+ nakaCommentSpeedOffset: number;
705
+ atButtonPadding: number;
706
+ atButtonRadius: number;
707
+ flashDoubleResizeHeights: Partial<ConfigSizeItem<{
708
+ [key: number]: number;
709
+ }>>;
710
+ flashLineBreakScale: ConfigSizeItem<number>;
711
+ compatSpacer: {
712
+ flash: {
713
+ [key: string]: Partial<ConfigFlashFontItem<number>>;
714
+ };
715
+ html5: {
716
+ [key: string]: Partial<ConfigHTML5FontItem<number>>;
717
+ };
718
+ };
719
+ };
720
+ export type Config = Partial<BaseConfig>;
721
+ export type Position = {
722
+ x: number;
723
+ y: number;
724
+ };
725
+ export interface CommentEventBase {
726
+ type: CommentEventName;
727
+ timeStamp: number;
728
+ vpos: number;
322
729
  }
323
- interface SeekDisableEvent extends CommentEventBase {
324
- type: "seekDisable";
730
+ export interface SeekDisableEvent extends CommentEventBase {
731
+ type: "seekDisable";
325
732
  }
326
- type SeekDisableEventHandler = (event: SeekDisableEvent) => unknown;
327
- interface SeekEnableEvent extends CommentEventBase {
328
- type: "seekEnable";
733
+ export type SeekDisableEventHandler = (event: SeekDisableEvent) => unknown;
734
+ export interface SeekEnableEvent extends CommentEventBase {
735
+ type: "seekEnable";
329
736
  }
330
- type SeekEnableEventHandler = (event: SeekEnableEvent) => unknown;
331
- interface CommentDisableEvent extends CommentEventBase {
332
- type: "commentDisable";
737
+ export type SeekEnableEventHandler = (event: SeekEnableEvent) => unknown;
738
+ export interface CommentDisableEvent extends CommentEventBase {
739
+ type: "commentDisable";
333
740
  }
334
- type CommentDisableEventHandler = (event: CommentDisableEvent) => unknown;
335
- interface CommentEnableEvent extends CommentEventBase {
336
- type: "commentEnable";
741
+ export type CommentDisableEventHandler = (event: CommentDisableEvent) => unknown;
742
+ export interface CommentEnableEvent extends CommentEventBase {
743
+ type: "commentEnable";
337
744
  }
338
- type CommentEnableEventHandler = (event: CommentEnableEvent) => unknown;
339
- interface JumpEvent extends CommentEventBase {
340
- type: "jump";
341
- to: string;
342
- message?: string;
745
+ export type CommentEnableEventHandler = (event: CommentEnableEvent) => unknown;
746
+ export interface JumpEvent extends CommentEventBase {
747
+ type: "jump";
748
+ to: string;
749
+ message?: string;
343
750
  }
344
- type JumpEventHandler = (event: JumpEvent) => unknown;
345
- type CommentEventName = "seekDisable" | "seekEnable" | "commentDisable" | "commentEnable" | "jump";
346
- type CommentEventHandler = SeekDisableEventHandler | SeekEnableEventHandler | CommentDisableEventHandler | CommentEnableEventHandler | JumpEventHandler;
347
- interface CommentEventHandlerMap {
348
- seekDisable: SeekDisableEventHandler;
349
- seekEnable: SeekEnableEventHandler;
350
- commentDisable: CommentDisableEventHandler;
351
- commentEnable: CommentEnableEventHandler;
352
- jump: JumpEventHandler;
751
+ export type JumpEventHandler = (event: JumpEvent) => unknown;
752
+ export type CommentEventName = "seekDisable" | "seekEnable" | "commentDisable" | "commentEnable" | "jump";
753
+ export type CommentEventHandler = SeekDisableEventHandler | SeekEnableEventHandler | CommentDisableEventHandler | CommentEnableEventHandler | JumpEventHandler;
754
+ export interface CommentEventHandlerMap {
755
+ seekDisable: SeekDisableEventHandler;
756
+ seekEnable: SeekEnableEventHandler;
757
+ commentDisable: CommentDisableEventHandler;
758
+ commentEnable: CommentEnableEventHandler;
759
+ jump: JumpEventHandler;
353
760
  }
354
- interface CommentEventMap {
355
- seekDisable: SeekDisableEvent;
356
- seekEnable: SeekEnableEvent;
357
- commentDisable: CommentDisableEvent;
358
- commentEnable: CommentEnableEvent;
359
- jump: JumpEvent;
761
+ export interface CommentEventMap {
762
+ seekDisable: SeekDisableEvent;
763
+ seekEnable: SeekEnableEvent;
764
+ commentDisable: CommentDisableEvent;
765
+ commentEnable: CommentEnableEvent;
766
+ jump: JumpEvent;
360
767
  }
361
-
362
- type Platform = "win7" | "win8_1" | "win" | "mac10_9" | "mac10_11" | "mac" | "other";
363
- declare const ZHTML5Fonts: valibot.UnionSchema<[valibot.LiteralSchema<"gothic", "gothic">, valibot.LiteralSchema<"mincho", "mincho">, valibot.LiteralSchema<"defont", "defont">], "defont" | "mincho" | "gothic">;
364
- type HTML5Fonts = Output<typeof ZHTML5Fonts>;
365
- type FontItem = {
366
- font: string;
367
- offset: number;
368
- weight: number;
768
+ export type Platform = "win7" | "win8_1" | "win" | "mac10_9" | "mac10_11" | "mac" | "other";
769
+ export declare const ZHTML5Fonts: UnionSchema<[
770
+ LiteralSchema<"gothic", "gothic">,
771
+ LiteralSchema<"mincho", "mincho">,
772
+ LiteralSchema<"defont", "defont">
773
+ ], "defont" | "mincho" | "gothic">;
774
+ export type HTML5Fonts = Output<typeof ZHTML5Fonts>;
775
+ export type FontItem = {
776
+ font: string;
777
+ offset: number;
778
+ weight: number;
369
779
  };
370
- type PlatformFont = {
371
- [key in HTML5Fonts]: FontItem;
780
+ export type PlatformFont = {
781
+ [key in HTML5Fonts]: FontItem;
372
782
  };
373
-
374
- declare const ZFormattedComment: valibot.ObjectSchema<{
375
- id: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
376
- vpos: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
377
- content: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
378
- date: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
379
- date_usec: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
380
- owner: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
381
- premium: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
382
- mail: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<string>, string[]>, never[], string[]>;
383
- user_id: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
384
- layer: valibot.OptionalSchema<valibot.NumberSchema<number>, -1, number>;
385
- is_my_post: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
783
+ export declare const ZFormattedComment: ObjectSchema<{
784
+ id: OptionalSchema<NumberSchema<number>, 0, number>;
785
+ vpos: OptionalSchema<NumberSchema<number>, 0, number>;
786
+ content: OptionalSchema<StringSchema<string>, "", string>;
787
+ date: OptionalSchema<NumberSchema<number>, 0, number>;
788
+ date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
789
+ owner: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
790
+ premium: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
791
+ mail: OptionalSchema<ArraySchema<StringSchema<string>, string[]>, never[], string[]>;
792
+ user_id: OptionalSchema<NumberSchema<number>, 0, number>;
793
+ layer: OptionalSchema<NumberSchema<number>, -1, number>;
794
+ is_my_post: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
386
795
  }, undefined, {
387
- owner: boolean;
388
- content: string;
389
- id: number;
390
- vpos: number;
391
- date: number;
392
- date_usec: number;
393
- premium: boolean;
394
- mail: string[];
395
- user_id: number;
396
- layer: number;
397
- is_my_post: boolean;
796
+ owner: boolean;
797
+ content: string;
798
+ id: number;
799
+ vpos: number;
800
+ date: number;
801
+ date_usec: number;
802
+ premium: boolean;
803
+ mail: string[];
804
+ user_id: number;
805
+ layer: number;
806
+ is_my_post: boolean;
398
807
  }>;
399
- type FormattedComment = Output<typeof ZFormattedComment>;
400
- declare const ZFormattedLegacyComment: valibot.ObjectSchema<Omit<{
401
- id: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
402
- vpos: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
403
- content: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
404
- date: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
405
- date_usec: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
406
- owner: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
407
- premium: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
408
- mail: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<string>, string[]>, never[], string[]>;
409
- user_id: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
410
- layer: valibot.OptionalSchema<valibot.NumberSchema<number>, -1, number>;
411
- is_my_post: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
808
+ export type FormattedComment = Output<typeof ZFormattedComment>;
809
+ export declare const ZFormattedLegacyComment: ObjectSchema<Omit<{
810
+ id: OptionalSchema<NumberSchema<number>, 0, number>;
811
+ vpos: OptionalSchema<NumberSchema<number>, 0, number>;
812
+ content: OptionalSchema<StringSchema<string>, "", string>;
813
+ date: OptionalSchema<NumberSchema<number>, 0, number>;
814
+ date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
815
+ owner: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
816
+ premium: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
817
+ mail: OptionalSchema<ArraySchema<StringSchema<string>, string[]>, never[], string[]>;
818
+ user_id: OptionalSchema<NumberSchema<number>, 0, number>;
819
+ layer: OptionalSchema<NumberSchema<number>, -1, number>;
820
+ is_my_post: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
412
821
  }, "user_id" | "layer" | "is_my_post">, undefined, {
413
- owner: boolean;
414
- content: string;
415
- id: number;
416
- vpos: number;
417
- date: number;
418
- date_usec: number;
419
- premium: boolean;
420
- mail: string[];
822
+ owner: boolean;
823
+ content: string;
824
+ id: number;
825
+ vpos: number;
826
+ date: number;
827
+ date_usec: number;
828
+ premium: boolean;
829
+ mail: string[];
421
830
  }>;
422
- type FormattedLegacyComment = Output<typeof ZFormattedLegacyComment>;
423
- type formattedComment = FormattedComment;
424
- type formattedLegacyComment = FormattedLegacyComment;
425
-
426
- declare const ZApiChat: valibot.ObjectSchema<{
427
- thread: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
428
- no: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
429
- vpos: valibot.NumberSchema<number>;
430
- date: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
431
- date_usec: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
432
- nicoru: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
433
- premium: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
434
- anonymity: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
435
- user_id: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
436
- mail: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
437
- content: valibot.StringSchema<string>;
438
- deleted: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
831
+ export type FormattedLegacyComment = Output<typeof ZFormattedLegacyComment>;
832
+ export type formattedComment = FormattedComment;
833
+ export type formattedLegacyComment = FormattedLegacyComment;
834
+ export declare const ZApiChat: ObjectSchema<{
835
+ thread: OptionalSchema<StringSchema<string>, "", string>;
836
+ no: OptionalSchema<NumberSchema<number>, 0, number>;
837
+ vpos: NumberSchema<number>;
838
+ date: OptionalSchema<NumberSchema<number>, 0, number>;
839
+ date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
840
+ nicoru: OptionalSchema<NumberSchema<number>, 0, number>;
841
+ premium: OptionalSchema<NumberSchema<number>, 0, number>;
842
+ anonymity: OptionalSchema<NumberSchema<number>, 0, number>;
843
+ user_id: OptionalSchema<StringSchema<string>, "", string>;
844
+ mail: OptionalSchema<StringSchema<string>, "", string>;
845
+ content: StringSchema<string>;
846
+ deleted: OptionalSchema<NumberSchema<number>, 0, number>;
439
847
  }, undefined, {
440
- content: string;
441
- vpos: number;
442
- date: number;
443
- date_usec: number;
444
- premium: number;
445
- mail: string;
446
- user_id: string;
447
- thread: string;
448
- no: number;
449
- nicoru: number;
450
- anonymity: number;
451
- deleted: number;
848
+ content: string;
849
+ vpos: number;
850
+ date: number;
851
+ date_usec: number;
852
+ premium: number;
853
+ mail: string;
854
+ user_id: string;
855
+ thread: string;
856
+ no: number;
857
+ nicoru: number;
858
+ anonymity: number;
859
+ deleted: number;
452
860
  }>;
453
- type ApiChat = Output<typeof ZApiChat>;
454
- declare const ZRawApiResponse: valibot.UnionSchema<[valibot.ObjectSchema<{
455
- chat: valibot.ObjectSchema<{
456
- thread: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
457
- no: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
458
- vpos: valibot.NumberSchema<number>;
459
- date: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
460
- date_usec: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
461
- nicoru: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
462
- premium: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
463
- anonymity: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
464
- user_id: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
465
- mail: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
466
- content: valibot.StringSchema<string>;
467
- deleted: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
468
- }, undefined, {
469
- content: string;
470
- vpos: number;
471
- date: number;
472
- date_usec: number;
473
- premium: number;
474
- mail: string;
475
- user_id: string;
476
- thread: string;
477
- no: number;
478
- nicoru: number;
479
- anonymity: number;
480
- deleted: number;
481
- }>;
482
- }, undefined, {
483
- chat: {
484
- content: string;
485
- vpos: number;
486
- date: number;
487
- date_usec: number;
488
- premium: number;
489
- mail: string;
490
- user_id: string;
491
- thread: string;
492
- no: number;
493
- nicoru: number;
494
- anonymity: number;
495
- deleted: number;
496
- };
497
- }>, valibot.RecordSchema<valibot.StringSchema<string>, valibot.UnknownSchema<unknown>, {
498
- [x: string]: unknown;
499
- }>], {
500
- chat: {
501
- content: string;
502
- vpos: number;
503
- date: number;
504
- date_usec: number;
505
- premium: number;
506
- mail: string;
507
- user_id: string;
508
- thread: string;
509
- no: number;
510
- nicoru: number;
511
- anonymity: number;
512
- deleted: number;
513
- };
861
+ export type ApiChat = Output<typeof ZApiChat>;
862
+ export declare const ZRawApiResponse: UnionSchema<[
863
+ ObjectSchema<{
864
+ chat: ObjectSchema<{
865
+ thread: OptionalSchema<StringSchema<string>, "", string>;
866
+ no: OptionalSchema<NumberSchema<number>, 0, number>;
867
+ vpos: NumberSchema<number>;
868
+ date: OptionalSchema<NumberSchema<number>, 0, number>;
869
+ date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
870
+ nicoru: OptionalSchema<NumberSchema<number>, 0, number>;
871
+ premium: OptionalSchema<NumberSchema<number>, 0, number>;
872
+ anonymity: OptionalSchema<NumberSchema<number>, 0, number>;
873
+ user_id: OptionalSchema<StringSchema<string>, "", string>;
874
+ mail: OptionalSchema<StringSchema<string>, "", string>;
875
+ content: StringSchema<string>;
876
+ deleted: OptionalSchema<NumberSchema<number>, 0, number>;
877
+ }, undefined, {
878
+ content: string;
879
+ vpos: number;
880
+ date: number;
881
+ date_usec: number;
882
+ premium: number;
883
+ mail: string;
884
+ user_id: string;
885
+ thread: string;
886
+ no: number;
887
+ nicoru: number;
888
+ anonymity: number;
889
+ deleted: number;
890
+ }>;
891
+ }, undefined, {
892
+ chat: {
893
+ content: string;
894
+ vpos: number;
895
+ date: number;
896
+ date_usec: number;
897
+ premium: number;
898
+ mail: string;
899
+ user_id: string;
900
+ thread: string;
901
+ no: number;
902
+ nicoru: number;
903
+ anonymity: number;
904
+ deleted: number;
905
+ };
906
+ }>,
907
+ RecordSchema<StringSchema<string>, UnknownSchema<unknown>, {
908
+ [x: string]: unknown;
909
+ }>
910
+ ], {
911
+ chat: {
912
+ content: string;
913
+ vpos: number;
914
+ date: number;
915
+ date_usec: number;
916
+ premium: number;
917
+ mail: string;
918
+ user_id: string;
919
+ thread: string;
920
+ no: number;
921
+ nicoru: number;
922
+ anonymity: number;
923
+ deleted: number;
924
+ };
514
925
  } | {
515
- [x: string]: unknown;
926
+ [x: string]: unknown;
516
927
  }>;
517
- type RawApiResponse = Output<typeof ZRawApiResponse>;
518
- declare const ZApiPing: valibot.ObjectSchema<{
519
- content: valibot.StringSchema<string>;
928
+ export type RawApiResponse = Output<typeof ZRawApiResponse>;
929
+ export declare const ZApiPing: ObjectSchema<{
930
+ content: StringSchema<string>;
520
931
  }, undefined, {
521
- content: string;
932
+ content: string;
522
933
  }>;
523
- type ApiPing = Output<typeof ZApiPing>;
524
- declare const ZApiThread: valibot.ObjectSchema<{
525
- resultcode: valibot.NumberSchema<number>;
526
- thread: valibot.StringSchema<string>;
527
- server_time: valibot.NumberSchema<number>;
528
- ticket: valibot.StringSchema<string>;
529
- revision: valibot.NumberSchema<number>;
934
+ export type ApiPing = Output<typeof ZApiPing>;
935
+ export declare const ZApiThread: ObjectSchema<{
936
+ resultcode: NumberSchema<number>;
937
+ thread: StringSchema<string>;
938
+ server_time: NumberSchema<number>;
939
+ ticket: StringSchema<string>;
940
+ revision: NumberSchema<number>;
530
941
  }, undefined, {
531
- thread: string;
532
- resultcode: number;
533
- server_time: number;
534
- ticket: string;
535
- revision: number;
942
+ thread: string;
943
+ resultcode: number;
944
+ server_time: number;
945
+ ticket: string;
946
+ revision: number;
536
947
  }>;
537
- type ApiThread = Output<typeof ZApiThread>;
538
- declare const ZApiLeaf: valibot.ObjectSchema<{
539
- thread: valibot.StringSchema<string>;
540
- count: valibot.NumberSchema<number>;
948
+ export type ApiThread = Output<typeof ZApiThread>;
949
+ export declare const ZApiLeaf: ObjectSchema<{
950
+ thread: StringSchema<string>;
951
+ count: NumberSchema<number>;
541
952
  }, undefined, {
542
- count: number;
543
- thread: string;
953
+ count: number;
954
+ thread: string;
544
955
  }>;
545
- type ApiLeaf = Output<typeof ZApiLeaf>;
546
- declare const ZApiGlobalNumRes: valibot.ObjectSchema<{
547
- thread: valibot.StringSchema<string>;
548
- num_res: valibot.NumberSchema<number>;
956
+ export type ApiLeaf = Output<typeof ZApiLeaf>;
957
+ export declare const ZApiGlobalNumRes: ObjectSchema<{
958
+ thread: StringSchema<string>;
959
+ num_res: NumberSchema<number>;
549
960
  }, undefined, {
550
- thread: string;
551
- num_res: number;
961
+ thread: string;
962
+ num_res: number;
552
963
  }>;
553
- type ApiGlobalNumRes = Output<typeof ZApiGlobalNumRes>;
554
- type rawApiResponse = RawApiResponse;
555
-
556
- declare const ZOwnerComment: valibot.ObjectSchema<{
557
- time: valibot.StringSchema<string>;
558
- command: valibot.StringSchema<string>;
559
- comment: valibot.StringSchema<string>;
964
+ export type ApiGlobalNumRes = Output<typeof ZApiGlobalNumRes>;
965
+ export type rawApiResponse = RawApiResponse;
966
+ export declare const ZOwnerComment: ObjectSchema<{
967
+ time: StringSchema<string>;
968
+ command: StringSchema<string>;
969
+ comment: StringSchema<string>;
560
970
  }, undefined, {
561
- time: string;
562
- command: string;
563
- comment: string;
971
+ time: string;
972
+ command: string;
973
+ comment: string;
564
974
  }>;
565
- type OwnerComment = Output<typeof ZOwnerComment>;
566
- type ownerComment = OwnerComment;
567
-
568
- declare const ZV1Comment: valibot.ObjectSchema<{
569
- id: valibot.StringSchema<string>;
570
- no: valibot.NumberSchema<number>;
571
- vposMs: valibot.NumberSchema<number>;
572
- body: valibot.StringSchema<string>;
573
- commands: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
574
- userId: valibot.StringSchema<string>;
575
- isPremium: valibot.BooleanSchema<boolean>;
576
- score: valibot.NumberSchema<number>;
577
- postedAt: valibot.StringSchema<string>;
578
- nicoruCount: valibot.NumberSchema<number>;
579
- nicoruId: valibot.NullableSchema<valibot.StringSchema<string>, undefined, string | null>;
580
- source: valibot.StringSchema<string>;
581
- isMyPost: valibot.BooleanSchema<boolean>;
975
+ export type OwnerComment = Output<typeof ZOwnerComment>;
976
+ export type ownerComment = OwnerComment;
977
+ export declare const ZV1Comment: ObjectSchema<{
978
+ id: StringSchema<string>;
979
+ no: NumberSchema<number>;
980
+ vposMs: NumberSchema<number>;
981
+ body: StringSchema<string>;
982
+ commands: ArraySchema<StringSchema<string>, string[]>;
983
+ userId: StringSchema<string>;
984
+ isPremium: BooleanSchema<boolean>;
985
+ score: NumberSchema<number>;
986
+ postedAt: StringSchema<string>;
987
+ nicoruCount: NumberSchema<number>;
988
+ nicoruId: NullableSchema<StringSchema<string>, undefined, string | null>;
989
+ source: StringSchema<string>;
990
+ isMyPost: BooleanSchema<boolean>;
582
991
  }, undefined, {
583
- id: string;
584
- no: number;
585
- vposMs: number;
586
- body: string;
587
- commands: string[];
588
- userId: string;
589
- isPremium: boolean;
590
- score: number;
591
- postedAt: string;
592
- nicoruCount: number;
593
- nicoruId: string | null;
594
- source: string;
595
- isMyPost: boolean;
992
+ id: string;
993
+ no: number;
994
+ vposMs: number;
995
+ body: string;
996
+ commands: string[];
997
+ userId: string;
998
+ isPremium: boolean;
999
+ score: number;
1000
+ postedAt: string;
1001
+ nicoruCount: number;
1002
+ nicoruId: string | null;
1003
+ source: string;
1004
+ isMyPost: boolean;
596
1005
  }>;
597
- type V1Comment = Output<typeof ZV1Comment>;
598
- declare const ZV1Thread: valibot.ObjectSchema<{
599
- id: valibot.UnknownSchema<unknown>;
600
- fork: valibot.StringSchema<string>;
601
- commentCount: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
602
- comments: valibot.ArraySchema<valibot.ObjectSchema<{
603
- id: valibot.StringSchema<string>;
604
- no: valibot.NumberSchema<number>;
605
- vposMs: valibot.NumberSchema<number>;
606
- body: valibot.StringSchema<string>;
607
- commands: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
608
- userId: valibot.StringSchema<string>;
609
- isPremium: valibot.BooleanSchema<boolean>;
610
- score: valibot.NumberSchema<number>;
611
- postedAt: valibot.StringSchema<string>;
612
- nicoruCount: valibot.NumberSchema<number>;
613
- nicoruId: valibot.NullableSchema<valibot.StringSchema<string>, undefined, string | null>;
614
- source: valibot.StringSchema<string>;
615
- isMyPost: valibot.BooleanSchema<boolean>;
616
- }, undefined, {
617
- id: string;
618
- no: number;
619
- vposMs: number;
620
- body: string;
621
- commands: string[];
622
- userId: string;
623
- isPremium: boolean;
624
- score: number;
625
- postedAt: string;
626
- nicoruCount: number;
627
- nicoruId: string | null;
628
- source: string;
629
- isMyPost: boolean;
630
- }>, {
631
- id: string;
632
- no: number;
633
- vposMs: number;
634
- body: string;
635
- commands: string[];
636
- userId: string;
637
- isPremium: boolean;
638
- score: number;
639
- postedAt: string;
640
- nicoruCount: number;
641
- nicoruId: string | null;
642
- source: string;
643
- isMyPost: boolean;
644
- }[]>;
1006
+ export type V1Comment = Output<typeof ZV1Comment>;
1007
+ export declare const ZV1Thread: ObjectSchema<{
1008
+ id: UnknownSchema<unknown>;
1009
+ fork: StringSchema<string>;
1010
+ commentCount: OptionalSchema<NumberSchema<number>, 0, number>;
1011
+ comments: ArraySchema<ObjectSchema<{
1012
+ id: StringSchema<string>;
1013
+ no: NumberSchema<number>;
1014
+ vposMs: NumberSchema<number>;
1015
+ body: StringSchema<string>;
1016
+ commands: ArraySchema<StringSchema<string>, string[]>;
1017
+ userId: StringSchema<string>;
1018
+ isPremium: BooleanSchema<boolean>;
1019
+ score: NumberSchema<number>;
1020
+ postedAt: StringSchema<string>;
1021
+ nicoruCount: NumberSchema<number>;
1022
+ nicoruId: NullableSchema<StringSchema<string>, undefined, string | null>;
1023
+ source: StringSchema<string>;
1024
+ isMyPost: BooleanSchema<boolean>;
1025
+ }, undefined, {
1026
+ id: string;
1027
+ no: number;
1028
+ vposMs: number;
1029
+ body: string;
1030
+ commands: string[];
1031
+ userId: string;
1032
+ isPremium: boolean;
1033
+ score: number;
1034
+ postedAt: string;
1035
+ nicoruCount: number;
1036
+ nicoruId: string | null;
1037
+ source: string;
1038
+ isMyPost: boolean;
1039
+ }>, {
1040
+ id: string;
1041
+ no: number;
1042
+ vposMs: number;
1043
+ body: string;
1044
+ commands: string[];
1045
+ userId: string;
1046
+ isPremium: boolean;
1047
+ score: number;
1048
+ postedAt: string;
1049
+ nicoruCount: number;
1050
+ nicoruId: string | null;
1051
+ source: string;
1052
+ isMyPost: boolean;
1053
+ }[]>;
645
1054
  }, undefined, {
646
- fork: string;
647
- commentCount: number;
648
- comments: {
649
- id: string;
650
- no: number;
651
- vposMs: number;
652
- body: string;
653
- commands: string[];
654
- userId: string;
655
- isPremium: boolean;
656
- score: number;
657
- postedAt: string;
658
- nicoruCount: number;
659
- nicoruId: string | null;
660
- source: string;
661
- isMyPost: boolean;
662
- }[];
663
- id?: unknown;
1055
+ fork: string;
1056
+ commentCount: number;
1057
+ comments: {
1058
+ id: string;
1059
+ no: number;
1060
+ vposMs: number;
1061
+ body: string;
1062
+ commands: string[];
1063
+ userId: string;
1064
+ isPremium: boolean;
1065
+ score: number;
1066
+ postedAt: string;
1067
+ nicoruCount: number;
1068
+ nicoruId: string | null;
1069
+ source: string;
1070
+ isMyPost: boolean;
1071
+ }[];
1072
+ id?: unknown;
664
1073
  }>;
665
- type V1Thread = Output<typeof ZV1Thread>;
666
- type v1Thread = V1Thread;
667
-
668
- interface IComment {
669
- comment: FormattedCommentWithSize;
670
- invisible: boolean;
671
- loc: CommentLoc;
672
- width: number;
673
- long: number;
674
- height: number;
675
- vpos: number;
676
- flash: boolean;
677
- posY: number;
678
- owner: boolean;
679
- layer: number;
680
- mail: string[];
681
- content: string;
682
- image?: IRenderer | null;
683
- draw: (vpos: number, showCollision: boolean, cursor?: Position) => void;
684
- isHovered: (cursor?: Position, posX?: number, posY?: number) => boolean;
1074
+ export type V1Thread = Output<typeof ZV1Thread>;
1075
+ export type v1Thread = V1Thread;
1076
+ export interface IComment {
1077
+ comment: FormattedCommentWithSize;
1078
+ invisible: boolean;
1079
+ loc: CommentLoc;
1080
+ width: number;
1081
+ long: number;
1082
+ height: number;
1083
+ vpos: number;
1084
+ flash: boolean;
1085
+ posY: number;
1086
+ owner: boolean;
1087
+ layer: number;
1088
+ mail: string[];
1089
+ content: string;
1090
+ image?: IRenderer | null;
1091
+ draw: (vpos: number, showCollision: boolean, cursor?: Position) => void;
1092
+ isHovered: (cursor?: Position, posX?: number, posY?: number) => boolean;
685
1093
  }
686
-
687
- interface IPluginConstructor {
688
- id: string;
689
- new (Canvas: IRenderer, comments: IComment[]): IPlugin;
1094
+ export interface IPluginConstructor {
1095
+ id: string;
1096
+ new (Canvas: IRenderer, comments: IComment[]): IPlugin;
690
1097
  }
691
- interface IPlugin {
692
- draw?: (vpos: number) => void;
693
- addComments?: (comments: IComment[]) => void;
694
- transformComments?: (comments: IComment[]) => IComment[];
1098
+ export interface IPlugin {
1099
+ draw?: (vpos: number) => void;
1100
+ addComments?: (comments: IComment[]) => void;
1101
+ transformComments?: (comments: IComment[]) => IComment[];
695
1102
  }
696
- type IPluginList = {
697
- instance: IPlugin;
698
- canvas: IRenderer;
1103
+ export type IPluginList = {
1104
+ instance: IPlugin;
1105
+ canvas: IRenderer;
699
1106
  }[];
700
-
701
- type InputFormatType = "XMLDocument" | "niconicome" | "formatted" | "legacy" | "legacyOwner" | "owner" | "v1" | "empty" | "default";
702
- type InputFormat = XMLDocument | FormattedComment[] | FormattedLegacyComment[] | RawApiResponse[] | OwnerComment[] | V1Thread[] | string | undefined;
703
- type ModeType = "default" | "html5" | "flash";
704
- type BaseOptions = {
705
- config: Config;
706
- debug: boolean;
707
- enableLegacyPiP: boolean;
708
- format: InputFormatType;
709
- formatted: boolean;
710
- keepCA: boolean;
711
- mode: ModeType;
712
- scale: number;
713
- showCollision: boolean;
714
- showCommentCount: boolean;
715
- showFPS: boolean;
716
- useLegacy: boolean;
717
- video: HTMLVideoElement | undefined;
718
- };
719
- type Options = Partial<BaseOptions>;
720
- type inputFormatType = InputFormatType;
721
- type inputFormat = InputFormat;
722
-
723
- type FormattedCommentWithFont = {
724
- id: number;
725
- vpos: number;
726
- date: number;
727
- date_usec: number;
728
- owner: boolean;
729
- premium: boolean;
730
- mail: string[];
731
- user_id: number;
732
- layer: number;
733
- loc: CommentLoc;
734
- size: CommentSize;
735
- fontSize: number;
736
- font: CommentFont;
737
- color: string;
738
- strokeColor?: string;
739
- wakuColor?: string;
740
- fillColor?: string;
741
- full: boolean;
742
- ender: boolean;
743
- _live: boolean;
744
- long: number;
745
- invisible: boolean;
746
- content: CommentContentItem[];
747
- rawContent: string;
748
- flash: boolean;
749
- lineCount: number;
750
- lineOffset: number;
751
- is_my_post: boolean;
752
- button?: ButtonParams;
753
- };
754
- type FormattedCommentWithSize = FormattedCommentWithFont & {
755
- height: number;
756
- width: number;
757
- lineHeight: number;
758
- resized: boolean;
759
- resizedX: boolean;
760
- resizedY: boolean;
761
- content: CommentMeasuredContentItem[];
762
- charSize: number;
763
- scale: number;
764
- scaleX: number;
765
- buttonObjects?: ButtonList;
766
- };
767
- type ParseContentResult = {
768
- content: CommentContentItem[];
769
- lineCount: number;
770
- lineOffset: number;
771
- };
772
- type ParseCommandAndNicoScriptResult = {
773
- flash: boolean;
774
- loc: CommentLoc;
775
- size: CommentSize;
776
- fontSize: number;
777
- color: string;
778
- strokeColor?: string;
779
- wakuColor?: string;
780
- fillColor?: string;
781
- font: CommentFont;
782
- full: boolean;
783
- ender: boolean;
784
- _live: boolean;
785
- invisible: boolean;
786
- long: number;
787
- button?: ButtonParams;
788
- };
789
- declare const ZCommentFont: valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"mincho", "mincho">, valibot.LiteralSchema<"gothic", "gothic">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "mincho" | "gothic" | "gulim" | "simsun">;
790
- type CommentFont = Output<typeof ZCommentFont>;
791
- declare const ZCommentHTML5Font: valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"mincho", "mincho">, valibot.LiteralSchema<"gothic", "gothic">], "defont" | "mincho" | "gothic">;
792
- type CommentHTML5Font = Output<typeof ZCommentHTML5Font>;
793
- declare const ZCommentFlashFont: valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">;
794
- type CommentFlashFont = Output<typeof ZCommentFlashFont>;
795
- declare const ZCommentContentItemSpacer: valibot.ObjectSchema<{
796
- type: valibot.LiteralSchema<"spacer", "spacer">;
797
- char: valibot.StringSchema<string>;
798
- charWidth: valibot.NumberSchema<number>;
799
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
800
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
801
- count: valibot.NumberSchema<number>;
1107
+ export type InputFormatType = "XMLDocument" | "niconicome" | "formatted" | "legacy" | "legacyOwner" | "owner" | "v1" | "empty" | "default";
1108
+ export type InputFormat = XMLDocument | FormattedComment[] | FormattedLegacyComment[] | RawApiResponse[] | OwnerComment[] | V1Thread[] | string | undefined;
1109
+ export type ModeType = "default" | "html5" | "flash";
1110
+ export type BaseOptions = {
1111
+ config: Config;
1112
+ debug: boolean;
1113
+ enableLegacyPiP: boolean;
1114
+ format: InputFormatType;
1115
+ formatted: boolean;
1116
+ keepCA: boolean;
1117
+ mode: ModeType;
1118
+ scale: number;
1119
+ showCollision: boolean;
1120
+ showCommentCount: boolean;
1121
+ showFPS: boolean;
1122
+ useLegacy: boolean;
1123
+ video: HTMLVideoElement | undefined;
1124
+ };
1125
+ export type Options = Partial<BaseOptions>;
1126
+ export type inputFormatType = InputFormatType;
1127
+ export type inputFormat = InputFormat;
1128
+ export type FormattedCommentWithFont = {
1129
+ id: number;
1130
+ vpos: number;
1131
+ date: number;
1132
+ date_usec: number;
1133
+ owner: boolean;
1134
+ premium: boolean;
1135
+ mail: string[];
1136
+ user_id: number;
1137
+ layer: number;
1138
+ loc: CommentLoc;
1139
+ size: CommentSize;
1140
+ fontSize: number;
1141
+ font: CommentFont;
1142
+ color: string;
1143
+ strokeColor?: string;
1144
+ wakuColor?: string;
1145
+ fillColor?: string;
1146
+ full: boolean;
1147
+ ender: boolean;
1148
+ _live: boolean;
1149
+ long: number;
1150
+ invisible: boolean;
1151
+ content: CommentContentItem[];
1152
+ rawContent: string;
1153
+ flash: boolean;
1154
+ lineCount: number;
1155
+ lineOffset: number;
1156
+ is_my_post: boolean;
1157
+ button?: ButtonParams;
1158
+ };
1159
+ export type FormattedCommentWithSize = FormattedCommentWithFont & {
1160
+ height: number;
1161
+ width: number;
1162
+ lineHeight: number;
1163
+ resized: boolean;
1164
+ resizedX: boolean;
1165
+ resizedY: boolean;
1166
+ content: CommentMeasuredContentItem[];
1167
+ charSize: number;
1168
+ scale: number;
1169
+ scaleX: number;
1170
+ buttonObjects?: ButtonList;
1171
+ };
1172
+ export type ParseContentResult = {
1173
+ content: CommentContentItem[];
1174
+ lineCount: number;
1175
+ lineOffset: number;
1176
+ };
1177
+ export type ParseCommandAndNicoScriptResult = {
1178
+ flash: boolean;
1179
+ loc: CommentLoc;
1180
+ size: CommentSize;
1181
+ fontSize: number;
1182
+ color: string;
1183
+ strokeColor?: string;
1184
+ wakuColor?: string;
1185
+ fillColor?: string;
1186
+ font: CommentFont;
1187
+ full: boolean;
1188
+ ender: boolean;
1189
+ _live: boolean;
1190
+ invisible: boolean;
1191
+ long: number;
1192
+ button?: ButtonParams;
1193
+ };
1194
+ export declare const ZCommentFont: UnionSchema<[
1195
+ LiteralSchema<"defont", "defont">,
1196
+ LiteralSchema<"mincho", "mincho">,
1197
+ LiteralSchema<"gothic", "gothic">,
1198
+ LiteralSchema<"gulim", "gulim">,
1199
+ LiteralSchema<"simsun", "simsun">
1200
+ ], "defont" | "mincho" | "gothic" | "gulim" | "simsun">;
1201
+ export type CommentFont = Output<typeof ZCommentFont>;
1202
+ export declare const ZCommentHTML5Font: UnionSchema<[
1203
+ LiteralSchema<"defont", "defont">,
1204
+ LiteralSchema<"mincho", "mincho">,
1205
+ LiteralSchema<"gothic", "gothic">
1206
+ ], "defont" | "mincho" | "gothic">;
1207
+ export type CommentHTML5Font = Output<typeof ZCommentHTML5Font>;
1208
+ export declare const ZCommentFlashFont: UnionSchema<[
1209
+ LiteralSchema<"defont", "defont">,
1210
+ LiteralSchema<"gulim", "gulim">,
1211
+ LiteralSchema<"simsun", "simsun">
1212
+ ], "defont" | "gulim" | "simsun">;
1213
+ export type CommentFlashFont = Output<typeof ZCommentFlashFont>;
1214
+ export declare const ZCommentContentItemSpacer: ObjectSchema<{
1215
+ type: LiteralSchema<"spacer", "spacer">;
1216
+ char: StringSchema<string>;
1217
+ charWidth: NumberSchema<number>;
1218
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1219
+ font: OptionalSchema<UnionSchema<[
1220
+ LiteralSchema<"defont", "defont">,
1221
+ LiteralSchema<"gulim", "gulim">,
1222
+ LiteralSchema<"simsun", "simsun">
1223
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1224
+ count: NumberSchema<number>;
802
1225
  }, undefined, {
803
- type: "spacer";
804
- char: string;
805
- charWidth: number;
806
- count: number;
807
- isButton?: boolean | undefined;
808
- font?: "defont" | "gulim" | "simsun" | undefined;
1226
+ type: "spacer";
1227
+ char: string;
1228
+ charWidth: number;
1229
+ count: number;
1230
+ isButton?: boolean | undefined;
1231
+ font?: "defont" | "gulim" | "simsun" | undefined;
809
1232
  }>;
810
- declare const ZCommentContentItemText: valibot.ObjectSchema<{
811
- type: valibot.LiteralSchema<"text", "text">;
812
- content: valibot.StringSchema<string>;
813
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
814
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
815
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
816
- width: valibot.OptionalSchema<valibot.ArraySchema<valibot.NumberSchema<number>, number[]>, undefined, number[] | undefined>;
1233
+ export declare const ZCommentContentItemText: ObjectSchema<{
1234
+ type: LiteralSchema<"text", "text">;
1235
+ content: StringSchema<string>;
1236
+ slicedContent: ArraySchema<StringSchema<string>, string[]>;
1237
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1238
+ font: OptionalSchema<UnionSchema<[
1239
+ LiteralSchema<"defont", "defont">,
1240
+ LiteralSchema<"gulim", "gulim">,
1241
+ LiteralSchema<"simsun", "simsun">
1242
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1243
+ width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
817
1244
  }, undefined, {
818
- type: "text";
819
- content: string;
820
- slicedContent: string[];
821
- isButton?: boolean | undefined;
822
- font?: "defont" | "gulim" | "simsun" | undefined;
823
- width?: number[] | undefined;
1245
+ type: "text";
1246
+ content: string;
1247
+ slicedContent: string[];
1248
+ isButton?: boolean | undefined;
1249
+ font?: "defont" | "gulim" | "simsun" | undefined;
1250
+ width?: number[] | undefined;
824
1251
  }>;
825
- type CommentContentItemText = Output<typeof ZCommentContentItemText>;
826
- declare const ZCommentContentItem: valibot.UnionSchema<[valibot.ObjectSchema<{
827
- type: valibot.LiteralSchema<"spacer", "spacer">;
828
- char: valibot.StringSchema<string>;
829
- charWidth: valibot.NumberSchema<number>;
830
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
831
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
832
- count: valibot.NumberSchema<number>;
833
- }, undefined, {
834
- type: "spacer";
835
- char: string;
836
- charWidth: number;
837
- count: number;
838
- isButton?: boolean | undefined;
839
- font?: "defont" | "gulim" | "simsun" | undefined;
840
- }>, valibot.ObjectSchema<{
841
- type: valibot.LiteralSchema<"text", "text">;
842
- content: valibot.StringSchema<string>;
843
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
844
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
845
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
846
- width: valibot.OptionalSchema<valibot.ArraySchema<valibot.NumberSchema<number>, number[]>, undefined, number[] | undefined>;
847
- }, undefined, {
848
- type: "text";
849
- content: string;
850
- slicedContent: string[];
851
- isButton?: boolean | undefined;
852
- font?: "defont" | "gulim" | "simsun" | undefined;
853
- width?: number[] | undefined;
854
- }>], {
855
- type: "spacer";
856
- char: string;
857
- charWidth: number;
858
- count: number;
859
- isButton?: boolean | undefined;
860
- font?: "defont" | "gulim" | "simsun" | undefined;
1252
+ export type CommentContentItemText = Output<typeof ZCommentContentItemText>;
1253
+ export declare const ZCommentContentItem: UnionSchema<[
1254
+ ObjectSchema<{
1255
+ type: LiteralSchema<"spacer", "spacer">;
1256
+ char: StringSchema<string>;
1257
+ charWidth: NumberSchema<number>;
1258
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1259
+ font: OptionalSchema<UnionSchema<[
1260
+ LiteralSchema<"defont", "defont">,
1261
+ LiteralSchema<"gulim", "gulim">,
1262
+ LiteralSchema<"simsun", "simsun">
1263
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1264
+ count: NumberSchema<number>;
1265
+ }, undefined, {
1266
+ type: "spacer";
1267
+ char: string;
1268
+ charWidth: number;
1269
+ count: number;
1270
+ isButton?: boolean | undefined;
1271
+ font?: "defont" | "gulim" | "simsun" | undefined;
1272
+ }>,
1273
+ ObjectSchema<{
1274
+ type: LiteralSchema<"text", "text">;
1275
+ content: StringSchema<string>;
1276
+ slicedContent: ArraySchema<StringSchema<string>, string[]>;
1277
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1278
+ font: OptionalSchema<UnionSchema<[
1279
+ LiteralSchema<"defont", "defont">,
1280
+ LiteralSchema<"gulim", "gulim">,
1281
+ LiteralSchema<"simsun", "simsun">
1282
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1283
+ width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
1284
+ }, undefined, {
1285
+ type: "text";
1286
+ content: string;
1287
+ slicedContent: string[];
1288
+ isButton?: boolean | undefined;
1289
+ font?: "defont" | "gulim" | "simsun" | undefined;
1290
+ width?: number[] | undefined;
1291
+ }>
1292
+ ], {
1293
+ type: "spacer";
1294
+ char: string;
1295
+ charWidth: number;
1296
+ count: number;
1297
+ isButton?: boolean | undefined;
1298
+ font?: "defont" | "gulim" | "simsun" | undefined;
861
1299
  } | {
862
- type: "text";
863
- content: string;
864
- slicedContent: string[];
865
- isButton?: boolean | undefined;
866
- font?: "defont" | "gulim" | "simsun" | undefined;
867
- width?: number[] | undefined;
1300
+ type: "text";
1301
+ content: string;
1302
+ slicedContent: string[];
1303
+ isButton?: boolean | undefined;
1304
+ font?: "defont" | "gulim" | "simsun" | undefined;
1305
+ width?: number[] | undefined;
868
1306
  }>;
869
- type CommentContentItem = Output<typeof ZCommentContentItem>;
870
- declare const ZCommentMeasuredContentItemText: valibot.IntersectSchema<[valibot.UnionSchema<[valibot.ObjectSchema<{
871
- type: valibot.LiteralSchema<"spacer", "spacer">;
872
- char: valibot.StringSchema<string>;
873
- charWidth: valibot.NumberSchema<number>;
874
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
875
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
876
- count: valibot.NumberSchema<number>;
877
- }, undefined, {
878
- type: "spacer";
879
- char: string;
880
- charWidth: number;
881
- count: number;
882
- isButton?: boolean | undefined;
883
- font?: "defont" | "gulim" | "simsun" | undefined;
884
- }>, valibot.ObjectSchema<{
885
- type: valibot.LiteralSchema<"text", "text">;
886
- content: valibot.StringSchema<string>;
887
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
888
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
889
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
890
- width: valibot.OptionalSchema<valibot.ArraySchema<valibot.NumberSchema<number>, number[]>, undefined, number[] | undefined>;
891
- }, undefined, {
892
- type: "text";
893
- content: string;
894
- slicedContent: string[];
895
- isButton?: boolean | undefined;
896
- font?: "defont" | "gulim" | "simsun" | undefined;
897
- width?: number[] | undefined;
898
- }>], {
899
- type: "spacer";
900
- char: string;
901
- charWidth: number;
902
- count: number;
903
- isButton?: boolean | undefined;
904
- font?: "defont" | "gulim" | "simsun" | undefined;
905
- } | {
906
- type: "text";
907
- content: string;
908
- slicedContent: string[];
909
- isButton?: boolean | undefined;
910
- font?: "defont" | "gulim" | "simsun" | undefined;
911
- width?: number[] | undefined;
912
- }>, valibot.ObjectSchema<{
913
- width: valibot.ArraySchema<valibot.NumberSchema<number>, number[]>;
914
- }, undefined, {
915
- width: number[];
916
- }>], ({
917
- type: "spacer";
918
- char: string;
919
- charWidth: number;
920
- count: number;
921
- isButton?: boolean | undefined;
922
- font?: "defont" | "gulim" | "simsun" | undefined;
1307
+ export type CommentContentItem = Output<typeof ZCommentContentItem>;
1308
+ export declare const ZCommentMeasuredContentItemText: IntersectSchema<[
1309
+ UnionSchema<[
1310
+ ObjectSchema<{
1311
+ type: LiteralSchema<"spacer", "spacer">;
1312
+ char: StringSchema<string>;
1313
+ charWidth: NumberSchema<number>;
1314
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1315
+ font: OptionalSchema<UnionSchema<[
1316
+ LiteralSchema<"defont", "defont">,
1317
+ LiteralSchema<"gulim", "gulim">,
1318
+ LiteralSchema<"simsun", "simsun">
1319
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1320
+ count: NumberSchema<number>;
1321
+ }, undefined, {
1322
+ type: "spacer";
1323
+ char: string;
1324
+ charWidth: number;
1325
+ count: number;
1326
+ isButton?: boolean | undefined;
1327
+ font?: "defont" | "gulim" | "simsun" | undefined;
1328
+ }>,
1329
+ ObjectSchema<{
1330
+ type: LiteralSchema<"text", "text">;
1331
+ content: StringSchema<string>;
1332
+ slicedContent: ArraySchema<StringSchema<string>, string[]>;
1333
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1334
+ font: OptionalSchema<UnionSchema<[
1335
+ LiteralSchema<"defont", "defont">,
1336
+ LiteralSchema<"gulim", "gulim">,
1337
+ LiteralSchema<"simsun", "simsun">
1338
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1339
+ width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
1340
+ }, undefined, {
1341
+ type: "text";
1342
+ content: string;
1343
+ slicedContent: string[];
1344
+ isButton?: boolean | undefined;
1345
+ font?: "defont" | "gulim" | "simsun" | undefined;
1346
+ width?: number[] | undefined;
1347
+ }>
1348
+ ], {
1349
+ type: "spacer";
1350
+ char: string;
1351
+ charWidth: number;
1352
+ count: number;
1353
+ isButton?: boolean | undefined;
1354
+ font?: "defont" | "gulim" | "simsun" | undefined;
1355
+ } | {
1356
+ type: "text";
1357
+ content: string;
1358
+ slicedContent: string[];
1359
+ isButton?: boolean | undefined;
1360
+ font?: "defont" | "gulim" | "simsun" | undefined;
1361
+ width?: number[] | undefined;
1362
+ }>,
1363
+ ObjectSchema<{
1364
+ width: ArraySchema<NumberSchema<number>, number[]>;
1365
+ }, undefined, {
1366
+ width: number[];
1367
+ }>
1368
+ ], ({
1369
+ type: "spacer";
1370
+ char: string;
1371
+ charWidth: number;
1372
+ count: number;
1373
+ isButton?: boolean | undefined;
1374
+ font?: "defont" | "gulim" | "simsun" | undefined;
923
1375
  } | {
924
- type: "text";
925
- content: string;
926
- slicedContent: string[];
927
- isButton?: boolean | undefined;
928
- font?: "defont" | "gulim" | "simsun" | undefined;
929
- width?: number[] | undefined;
1376
+ type: "text";
1377
+ content: string;
1378
+ slicedContent: string[];
1379
+ isButton?: boolean | undefined;
1380
+ font?: "defont" | "gulim" | "simsun" | undefined;
1381
+ width?: number[] | undefined;
930
1382
  }) & {
931
- width: number[];
1383
+ width: number[];
932
1384
  }>;
933
- declare const ZCommentMeasuredContentItem: valibot.UnionSchema<[valibot.IntersectSchema<[valibot.UnionSchema<[valibot.ObjectSchema<{
934
- type: valibot.LiteralSchema<"spacer", "spacer">;
935
- char: valibot.StringSchema<string>;
936
- charWidth: valibot.NumberSchema<number>;
937
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
938
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
939
- count: valibot.NumberSchema<number>;
940
- }, undefined, {
941
- type: "spacer";
942
- char: string;
943
- charWidth: number;
944
- count: number;
945
- isButton?: boolean | undefined;
946
- font?: "defont" | "gulim" | "simsun" | undefined;
947
- }>, valibot.ObjectSchema<{
948
- type: valibot.LiteralSchema<"text", "text">;
949
- content: valibot.StringSchema<string>;
950
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
951
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
952
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
953
- width: valibot.OptionalSchema<valibot.ArraySchema<valibot.NumberSchema<number>, number[]>, undefined, number[] | undefined>;
954
- }, undefined, {
955
- type: "text";
956
- content: string;
957
- slicedContent: string[];
958
- isButton?: boolean | undefined;
959
- font?: "defont" | "gulim" | "simsun" | undefined;
960
- width?: number[] | undefined;
961
- }>], {
962
- type: "spacer";
963
- char: string;
964
- charWidth: number;
965
- count: number;
966
- isButton?: boolean | undefined;
967
- font?: "defont" | "gulim" | "simsun" | undefined;
968
- } | {
969
- type: "text";
970
- content: string;
971
- slicedContent: string[];
972
- isButton?: boolean | undefined;
973
- font?: "defont" | "gulim" | "simsun" | undefined;
974
- width?: number[] | undefined;
975
- }>, valibot.ObjectSchema<{
976
- width: valibot.ArraySchema<valibot.NumberSchema<number>, number[]>;
977
- }, undefined, {
978
- width: number[];
979
- }>], ({
980
- type: "spacer";
981
- char: string;
982
- charWidth: number;
983
- count: number;
984
- isButton?: boolean | undefined;
985
- font?: "defont" | "gulim" | "simsun" | undefined;
986
- } | {
987
- type: "text";
988
- content: string;
989
- slicedContent: string[];
990
- isButton?: boolean | undefined;
991
- font?: "defont" | "gulim" | "simsun" | undefined;
992
- width?: number[] | undefined;
993
- }) & {
994
- width: number[];
995
- }>, valibot.ObjectSchema<{
996
- type: valibot.LiteralSchema<"spacer", "spacer">;
997
- char: valibot.StringSchema<string>;
998
- charWidth: valibot.NumberSchema<number>;
999
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
1000
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1001
- count: valibot.NumberSchema<number>;
1002
- }, undefined, {
1003
- type: "spacer";
1004
- char: string;
1005
- charWidth: number;
1006
- count: number;
1007
- isButton?: boolean | undefined;
1008
- font?: "defont" | "gulim" | "simsun" | undefined;
1009
- }>], {
1010
- type: "spacer";
1011
- char: string;
1012
- charWidth: number;
1013
- count: number;
1014
- isButton?: boolean | undefined;
1015
- font?: "defont" | "gulim" | "simsun" | undefined;
1385
+ export declare const ZCommentMeasuredContentItem: UnionSchema<[
1386
+ IntersectSchema<[
1387
+ UnionSchema<[
1388
+ ObjectSchema<{
1389
+ type: LiteralSchema<"spacer", "spacer">;
1390
+ char: StringSchema<string>;
1391
+ charWidth: NumberSchema<number>;
1392
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1393
+ font: OptionalSchema<UnionSchema<[
1394
+ LiteralSchema<"defont", "defont">,
1395
+ LiteralSchema<"gulim", "gulim">,
1396
+ LiteralSchema<"simsun", "simsun">
1397
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1398
+ count: NumberSchema<number>;
1399
+ }, undefined, {
1400
+ type: "spacer";
1401
+ char: string;
1402
+ charWidth: number;
1403
+ count: number;
1404
+ isButton?: boolean | undefined;
1405
+ font?: "defont" | "gulim" | "simsun" | undefined;
1406
+ }>,
1407
+ ObjectSchema<{
1408
+ type: LiteralSchema<"text", "text">;
1409
+ content: StringSchema<string>;
1410
+ slicedContent: ArraySchema<StringSchema<string>, string[]>;
1411
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1412
+ font: OptionalSchema<UnionSchema<[
1413
+ LiteralSchema<"defont", "defont">,
1414
+ LiteralSchema<"gulim", "gulim">,
1415
+ LiteralSchema<"simsun", "simsun">
1416
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1417
+ width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
1418
+ }, undefined, {
1419
+ type: "text";
1420
+ content: string;
1421
+ slicedContent: string[];
1422
+ isButton?: boolean | undefined;
1423
+ font?: "defont" | "gulim" | "simsun" | undefined;
1424
+ width?: number[] | undefined;
1425
+ }>
1426
+ ], {
1427
+ type: "spacer";
1428
+ char: string;
1429
+ charWidth: number;
1430
+ count: number;
1431
+ isButton?: boolean | undefined;
1432
+ font?: "defont" | "gulim" | "simsun" | undefined;
1433
+ } | {
1434
+ type: "text";
1435
+ content: string;
1436
+ slicedContent: string[];
1437
+ isButton?: boolean | undefined;
1438
+ font?: "defont" | "gulim" | "simsun" | undefined;
1439
+ width?: number[] | undefined;
1440
+ }>,
1441
+ ObjectSchema<{
1442
+ width: ArraySchema<NumberSchema<number>, number[]>;
1443
+ }, undefined, {
1444
+ width: number[];
1445
+ }>
1446
+ ], ({
1447
+ type: "spacer";
1448
+ char: string;
1449
+ charWidth: number;
1450
+ count: number;
1451
+ isButton?: boolean | undefined;
1452
+ font?: "defont" | "gulim" | "simsun" | undefined;
1453
+ } | {
1454
+ type: "text";
1455
+ content: string;
1456
+ slicedContent: string[];
1457
+ isButton?: boolean | undefined;
1458
+ font?: "defont" | "gulim" | "simsun" | undefined;
1459
+ width?: number[] | undefined;
1460
+ }) & {
1461
+ width: number[];
1462
+ }>,
1463
+ ObjectSchema<{
1464
+ type: LiteralSchema<"spacer", "spacer">;
1465
+ char: StringSchema<string>;
1466
+ charWidth: NumberSchema<number>;
1467
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1468
+ font: OptionalSchema<UnionSchema<[
1469
+ LiteralSchema<"defont", "defont">,
1470
+ LiteralSchema<"gulim", "gulim">,
1471
+ LiteralSchema<"simsun", "simsun">
1472
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1473
+ count: NumberSchema<number>;
1474
+ }, undefined, {
1475
+ type: "spacer";
1476
+ char: string;
1477
+ charWidth: number;
1478
+ count: number;
1479
+ isButton?: boolean | undefined;
1480
+ font?: "defont" | "gulim" | "simsun" | undefined;
1481
+ }>
1482
+ ], {
1483
+ type: "spacer";
1484
+ char: string;
1485
+ charWidth: number;
1486
+ count: number;
1487
+ isButton?: boolean | undefined;
1488
+ font?: "defont" | "gulim" | "simsun" | undefined;
1016
1489
  } | (({
1017
- type: "spacer";
1018
- char: string;
1019
- charWidth: number;
1020
- count: number;
1021
- isButton?: boolean | undefined;
1022
- font?: "defont" | "gulim" | "simsun" | undefined;
1490
+ type: "spacer";
1491
+ char: string;
1492
+ charWidth: number;
1493
+ count: number;
1494
+ isButton?: boolean | undefined;
1495
+ font?: "defont" | "gulim" | "simsun" | undefined;
1023
1496
  } | {
1024
- type: "text";
1025
- content: string;
1026
- slicedContent: string[];
1027
- isButton?: boolean | undefined;
1028
- font?: "defont" | "gulim" | "simsun" | undefined;
1029
- width?: number[] | undefined;
1497
+ type: "text";
1498
+ content: string;
1499
+ slicedContent: string[];
1500
+ isButton?: boolean | undefined;
1501
+ font?: "defont" | "gulim" | "simsun" | undefined;
1502
+ width?: number[] | undefined;
1030
1503
  }) & {
1031
- width: number[];
1504
+ width: number[];
1032
1505
  })>;
1033
- type CommentMeasuredContentItem = Output<typeof ZCommentMeasuredContentItem>;
1034
- type CommentFlashFontParsed = "gothic" | "gulim" | "simsunStrong" | "simsunWeak";
1035
- type CommentContentIndex = {
1036
- index: number;
1037
- font: CommentFlashFontParsed;
1038
- };
1039
- declare const ZCommentSize: valibot.UnionSchema<[valibot.LiteralSchema<"big", "big">, valibot.LiteralSchema<"medium", "medium">, valibot.LiteralSchema<"small", "small">], "big" | "medium" | "small">;
1040
- type CommentSize = Output<typeof ZCommentSize>;
1041
- declare const ZCommentLoc: valibot.UnionSchema<[valibot.LiteralSchema<"ue", "ue">, valibot.LiteralSchema<"naka", "naka">, valibot.LiteralSchema<"shita", "shita">], "ue" | "naka" | "shita">;
1042
- type CommentLoc = Output<typeof ZCommentLoc>;
1043
- type Collision = {
1044
- [key in CollisionPos]: CollisionItem;
1045
- };
1046
- type Timeline = {
1047
- [key: number]: IComment[];
1048
- };
1049
- type CollisionPos = "ue" | "shita" | "right" | "left";
1050
- type CollisionItem = {
1051
- [p: number]: IComment[];
1052
- };
1053
- type NicoScript = {
1054
- reverse: NicoScriptReverse[];
1055
- ban: NicoScriptBan[];
1056
- default: NicoScriptDefault[];
1057
- replace: NicoScriptReplace[];
1058
- seekDisable: NicoScriptSeekDisable[];
1059
- jump: NicoScriptJump[];
1060
- };
1061
- type NicoScriptSeekDisable = {
1062
- start: number;
1063
- end: number;
1064
- };
1065
- type NicoScriptJump = {
1066
- start: number;
1067
- end?: number;
1068
- to: string;
1069
- message?: string;
1070
- };
1071
- type NicoScriptReverse = {
1072
- target: NicoScriptReverseTarget;
1073
- start: number;
1074
- end: number;
1075
- };
1076
- type NicoScriptReverseTarget = "コメ" | "投コメ" | "全";
1077
- type NicoScriptReplace = {
1078
- start: number;
1079
- long: number | undefined;
1080
- keyword: string;
1081
- replace: string;
1082
- range: NicoScriptReplaceRange;
1083
- target: NicoScriptReplaceTarget;
1084
- condition: NicoScriptReplaceCondition;
1085
- color: string | undefined;
1086
- size: CommentSize | undefined;
1087
- font: CommentFont | undefined;
1088
- loc: CommentLoc | undefined;
1089
- no: number;
1090
- };
1091
- type NicoScriptReplaceRange = "単" | "全";
1092
- type NicoScriptReplaceTarget = "コメ" | "投コメ" | "全" | "含まない" | "含む";
1093
- type NicoScriptReplaceCondition = "完全一致" | "部分一致";
1094
- type NicoScriptBan = {
1095
- start: number;
1096
- end: number;
1097
- };
1098
- type NicoScriptDefault = {
1099
- start: number;
1100
- long: number | undefined;
1101
- color: string | undefined;
1102
- size: CommentSize | undefined;
1103
- font: CommentFont | undefined;
1104
- loc: CommentLoc | undefined;
1105
- };
1106
- type MeasureTextResult = {
1107
- width: number;
1108
- height: number;
1109
- resized: boolean;
1110
- resizedX: boolean;
1111
- resizedY: boolean;
1112
- fontSize: number;
1113
- lineHeight: number;
1114
- content: CommentMeasuredContentItem[];
1115
- charSize: number;
1116
- scaleX: number;
1117
- scale: number;
1118
- };
1119
- type ButtonParams = {
1120
- message: {
1121
- before: string;
1122
- body: string;
1123
- after: string;
1124
- };
1125
- commentMessage: string;
1126
- commentMail: string[];
1127
- commentVisible: boolean;
1128
- limit: number;
1129
- local: boolean;
1130
- hidden: boolean;
1131
- };
1132
- type ParsedCommand = {
1133
- loc: CommentLoc | undefined;
1134
- size: CommentSize | undefined;
1135
- fontSize: number | undefined;
1136
- color: string | undefined;
1137
- strokeColor?: string;
1138
- wakuColor?: string;
1139
- fillColor?: string;
1140
- font: CommentFont | undefined;
1141
- full: boolean;
1142
- ender: boolean;
1143
- _live: boolean;
1144
- invisible: boolean;
1145
- long: number | undefined;
1146
- button?: ButtonParams;
1147
- };
1148
- type MeasureTextInput = FormattedCommentWithFont & {
1149
- resized?: boolean;
1150
- resizedY?: boolean;
1151
- resizedX?: boolean;
1152
- lineHeight?: number;
1153
- charSize?: number;
1154
- scale: number;
1155
- };
1156
- declare const ZMeasureInput: valibot.ObjectSchema<{
1157
- font: valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"mincho", "mincho">, valibot.LiteralSchema<"gothic", "gothic">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "mincho" | "gothic" | "gulim" | "simsun">;
1158
- content: valibot.ArraySchema<valibot.UnionSchema<[valibot.ObjectSchema<{
1159
- type: valibot.LiteralSchema<"spacer", "spacer">;
1160
- char: valibot.StringSchema<string>;
1161
- charWidth: valibot.NumberSchema<number>;
1162
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
1163
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1164
- count: valibot.NumberSchema<number>;
1165
- }, undefined, {
1166
- type: "spacer";
1167
- char: string;
1168
- charWidth: number;
1169
- count: number;
1170
- isButton?: boolean | undefined;
1171
- font?: "defont" | "gulim" | "simsun" | undefined;
1172
- }>, valibot.ObjectSchema<{
1173
- type: valibot.LiteralSchema<"text", "text">;
1174
- content: valibot.StringSchema<string>;
1175
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
1176
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
1177
- font: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1178
- width: valibot.OptionalSchema<valibot.ArraySchema<valibot.NumberSchema<number>, number[]>, undefined, number[] | undefined>;
1179
- }, undefined, {
1180
- type: "text";
1181
- content: string;
1182
- slicedContent: string[];
1183
- isButton?: boolean | undefined;
1184
- font?: "defont" | "gulim" | "simsun" | undefined;
1185
- width?: number[] | undefined;
1186
- }>], {
1187
- type: "spacer";
1188
- char: string;
1189
- charWidth: number;
1190
- count: number;
1191
- isButton?: boolean | undefined;
1192
- font?: "defont" | "gulim" | "simsun" | undefined;
1193
- } | {
1194
- type: "text";
1195
- content: string;
1196
- slicedContent: string[];
1197
- isButton?: boolean | undefined;
1198
- font?: "defont" | "gulim" | "simsun" | undefined;
1199
- width?: number[] | undefined;
1200
- }>, ({
1201
- type: "spacer";
1202
- char: string;
1203
- charWidth: number;
1204
- count: number;
1205
- isButton?: boolean | undefined;
1206
- font?: "defont" | "gulim" | "simsun" | undefined;
1207
- } | {
1208
- type: "text";
1209
- content: string;
1210
- slicedContent: string[];
1211
- isButton?: boolean | undefined;
1212
- font?: "defont" | "gulim" | "simsun" | undefined;
1213
- width?: number[] | undefined;
1214
- })[]>;
1215
- lineHeight: valibot.NumberSchema<number>;
1216
- charSize: valibot.NumberSchema<number>;
1217
- lineCount: valibot.NumberSchema<number>;
1506
+ export type CommentMeasuredContentItem = Output<typeof ZCommentMeasuredContentItem>;
1507
+ export type CommentFlashFontParsed = "gothic" | "gulim" | "simsunStrong" | "simsunWeak";
1508
+ export type CommentContentIndex = {
1509
+ index: number;
1510
+ font: CommentFlashFontParsed;
1511
+ };
1512
+ export declare const ZCommentSize: UnionSchema<[
1513
+ LiteralSchema<"big", "big">,
1514
+ LiteralSchema<"medium", "medium">,
1515
+ LiteralSchema<"small", "small">
1516
+ ], "big" | "medium" | "small">;
1517
+ export type CommentSize = Output<typeof ZCommentSize>;
1518
+ export declare const ZCommentLoc: UnionSchema<[
1519
+ LiteralSchema<"ue", "ue">,
1520
+ LiteralSchema<"naka", "naka">,
1521
+ LiteralSchema<"shita", "shita">
1522
+ ], "ue" | "naka" | "shita">;
1523
+ export type CommentLoc = Output<typeof ZCommentLoc>;
1524
+ export type Collision = {
1525
+ [key in CollisionPos]: CollisionItem;
1526
+ };
1527
+ export type Timeline = {
1528
+ [key: number]: IComment[];
1529
+ };
1530
+ export type CollisionPos = "ue" | "shita" | "right" | "left";
1531
+ export type CollisionItem = {
1532
+ [p: number]: IComment[];
1533
+ };
1534
+ export type NicoScript = {
1535
+ reverse: NicoScriptReverse[];
1536
+ ban: NicoScriptBan[];
1537
+ default: NicoScriptDefault[];
1538
+ replace: NicoScriptReplace[];
1539
+ seekDisable: NicoScriptSeekDisable[];
1540
+ jump: NicoScriptJump[];
1541
+ };
1542
+ export type NicoScriptSeekDisable = {
1543
+ start: number;
1544
+ end: number;
1545
+ };
1546
+ export type NicoScriptJump = {
1547
+ start: number;
1548
+ end?: number;
1549
+ to: string;
1550
+ message?: string;
1551
+ };
1552
+ export type NicoScriptReverse = {
1553
+ target: NicoScriptReverseTarget;
1554
+ start: number;
1555
+ end: number;
1556
+ };
1557
+ export type NicoScriptReverseTarget = "\u30B3\u30E1" | "\u6295\u30B3\u30E1" | "\u5168";
1558
+ export type NicoScriptReplace = {
1559
+ start: number;
1560
+ long: number | undefined;
1561
+ keyword: string;
1562
+ replace: string;
1563
+ range: NicoScriptReplaceRange;
1564
+ target: NicoScriptReplaceTarget;
1565
+ condition: NicoScriptReplaceCondition;
1566
+ color: string | undefined;
1567
+ size: CommentSize | undefined;
1568
+ font: CommentFont | undefined;
1569
+ loc: CommentLoc | undefined;
1570
+ no: number;
1571
+ };
1572
+ export type NicoScriptReplaceRange = "\u5358" | "\u5168";
1573
+ export type NicoScriptReplaceTarget = "\u30B3\u30E1" | "\u6295\u30B3\u30E1" | "\u5168" | "\u542B\u307E\u306A\u3044" | "\u542B\u3080";
1574
+ export type NicoScriptReplaceCondition = "\u5B8C\u5168\u4E00\u81F4" | "\u90E8\u5206\u4E00\u81F4";
1575
+ export type NicoScriptBan = {
1576
+ start: number;
1577
+ end: number;
1578
+ };
1579
+ export type NicoScriptDefault = {
1580
+ start: number;
1581
+ long: number | undefined;
1582
+ color: string | undefined;
1583
+ size: CommentSize | undefined;
1584
+ font: CommentFont | undefined;
1585
+ loc: CommentLoc | undefined;
1586
+ };
1587
+ export type MeasureTextResult = {
1588
+ width: number;
1589
+ height: number;
1590
+ resized: boolean;
1591
+ resizedX: boolean;
1592
+ resizedY: boolean;
1593
+ fontSize: number;
1594
+ lineHeight: number;
1595
+ content: CommentMeasuredContentItem[];
1596
+ charSize: number;
1597
+ scaleX: number;
1598
+ scale: number;
1599
+ };
1600
+ export type ButtonParams = {
1601
+ message: {
1602
+ before: string;
1603
+ body: string;
1604
+ after: string;
1605
+ };
1606
+ commentMessage: string;
1607
+ commentMail: string[];
1608
+ commentVisible: boolean;
1609
+ limit: number;
1610
+ local: boolean;
1611
+ hidden: boolean;
1612
+ };
1613
+ export type ParsedCommand = {
1614
+ loc: CommentLoc | undefined;
1615
+ size: CommentSize | undefined;
1616
+ fontSize: number | undefined;
1617
+ color: string | undefined;
1618
+ strokeColor?: string;
1619
+ wakuColor?: string;
1620
+ fillColor?: string;
1621
+ font: CommentFont | undefined;
1622
+ full: boolean;
1623
+ ender: boolean;
1624
+ _live: boolean;
1625
+ invisible: boolean;
1626
+ long: number | undefined;
1627
+ button?: ButtonParams;
1628
+ };
1629
+ export type MeasureTextInput = FormattedCommentWithFont & {
1630
+ resized?: boolean;
1631
+ resizedY?: boolean;
1632
+ resizedX?: boolean;
1633
+ lineHeight?: number;
1634
+ charSize?: number;
1635
+ scale: number;
1636
+ };
1637
+ export declare const ZMeasureInput: ObjectSchema<{
1638
+ font: UnionSchema<[
1639
+ LiteralSchema<"defont", "defont">,
1640
+ LiteralSchema<"mincho", "mincho">,
1641
+ LiteralSchema<"gothic", "gothic">,
1642
+ LiteralSchema<"gulim", "gulim">,
1643
+ LiteralSchema<"simsun", "simsun">
1644
+ ], "defont" | "mincho" | "gothic" | "gulim" | "simsun">;
1645
+ content: ArraySchema<UnionSchema<[
1646
+ ObjectSchema<{
1647
+ type: LiteralSchema<"spacer", "spacer">;
1648
+ char: StringSchema<string>;
1649
+ charWidth: NumberSchema<number>;
1650
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1651
+ font: OptionalSchema<UnionSchema<[
1652
+ LiteralSchema<"defont", "defont">,
1653
+ LiteralSchema<"gulim", "gulim">,
1654
+ LiteralSchema<"simsun", "simsun">
1655
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1656
+ count: NumberSchema<number>;
1657
+ }, undefined, {
1658
+ type: "spacer";
1659
+ char: string;
1660
+ charWidth: number;
1661
+ count: number;
1662
+ isButton?: boolean | undefined;
1663
+ font?: "defont" | "gulim" | "simsun" | undefined;
1664
+ }>,
1665
+ ObjectSchema<{
1666
+ type: LiteralSchema<"text", "text">;
1667
+ content: StringSchema<string>;
1668
+ slicedContent: ArraySchema<StringSchema<string>, string[]>;
1669
+ isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
1670
+ font: OptionalSchema<UnionSchema<[
1671
+ LiteralSchema<"defont", "defont">,
1672
+ LiteralSchema<"gulim", "gulim">,
1673
+ LiteralSchema<"simsun", "simsun">
1674
+ ], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
1675
+ width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
1676
+ }, undefined, {
1677
+ type: "text";
1678
+ content: string;
1679
+ slicedContent: string[];
1680
+ isButton?: boolean | undefined;
1681
+ font?: "defont" | "gulim" | "simsun" | undefined;
1682
+ width?: number[] | undefined;
1683
+ }>
1684
+ ], {
1685
+ type: "spacer";
1686
+ char: string;
1687
+ charWidth: number;
1688
+ count: number;
1689
+ isButton?: boolean | undefined;
1690
+ font?: "defont" | "gulim" | "simsun" | undefined;
1691
+ } | {
1692
+ type: "text";
1693
+ content: string;
1694
+ slicedContent: string[];
1695
+ isButton?: boolean | undefined;
1696
+ font?: "defont" | "gulim" | "simsun" | undefined;
1697
+ width?: number[] | undefined;
1698
+ }>, ({
1699
+ type: "spacer";
1700
+ char: string;
1701
+ charWidth: number;
1702
+ count: number;
1703
+ isButton?: boolean | undefined;
1704
+ font?: "defont" | "gulim" | "simsun" | undefined;
1705
+ } | {
1706
+ type: "text";
1707
+ content: string;
1708
+ slicedContent: string[];
1709
+ isButton?: boolean | undefined;
1710
+ font?: "defont" | "gulim" | "simsun" | undefined;
1711
+ width?: number[] | undefined;
1712
+ })[]>;
1713
+ lineHeight: NumberSchema<number>;
1714
+ charSize: NumberSchema<number>;
1715
+ lineCount: NumberSchema<number>;
1218
1716
  }, undefined, {
1219
- lineHeight: number;
1220
- font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
1221
- content: ({
1222
- type: "spacer";
1223
- char: string;
1224
- charWidth: number;
1225
- count: number;
1226
- isButton?: boolean | undefined;
1227
- font?: "defont" | "gulim" | "simsun" | undefined;
1228
- } | {
1229
- type: "text";
1230
- content: string;
1231
- slicedContent: string[];
1232
- isButton?: boolean | undefined;
1233
- font?: "defont" | "gulim" | "simsun" | undefined;
1234
- width?: number[] | undefined;
1235
- })[];
1236
- charSize: number;
1237
- lineCount: number;
1717
+ lineHeight: number;
1718
+ font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
1719
+ content: ({
1720
+ type: "spacer";
1721
+ char: string;
1722
+ charWidth: number;
1723
+ count: number;
1724
+ isButton?: boolean | undefined;
1725
+ font?: "defont" | "gulim" | "simsun" | undefined;
1726
+ } | {
1727
+ type: "text";
1728
+ content: string;
1729
+ slicedContent: string[];
1730
+ isButton?: boolean | undefined;
1731
+ font?: "defont" | "gulim" | "simsun" | undefined;
1732
+ width?: number[] | undefined;
1733
+ })[];
1734
+ charSize: number;
1735
+ lineCount: number;
1238
1736
  }>;
1239
- type MeasureInput = Output<typeof ZMeasureInput>;
1240
- type ValueOf<T> = T[keyof T];
1241
-
1737
+ export type MeasureInput = Output<typeof ZMeasureInput>;
1738
+ export type ValueOf<T> = T[keyof T];
1242
1739
  declare let imageCache: {
1243
- [key: string]: {
1244
- image: IRenderer;
1245
- timeout: number | NodeJS.Timeout;
1246
- };
1740
+ [key: string]: {
1741
+ image: IRenderer;
1742
+ timeout: number;
1743
+ };
1247
1744
  };
1248
1745
  declare const resetImageCache: () => void;
1249
-
1250
1746
  declare let nicoScripts: NicoScript;
1251
1747
  declare const resetNicoScripts: () => void;
1252
-
1253
1748
  declare let plugins: IPluginList;
1254
1749
  declare const setPlugins: (input: IPluginList) => void;
1255
-
1256
1750
  declare const index_d$3_imageCache: typeof imageCache;
1257
1751
  declare const index_d$3_nicoScripts: typeof nicoScripts;
1258
1752
  declare const index_d$3_plugins: typeof plugins;
@@ -1260,44 +1754,41 @@ declare const index_d$3_resetImageCache: typeof resetImageCache;
1260
1754
  declare const index_d$3_resetNicoScripts: typeof resetNicoScripts;
1261
1755
  declare const index_d$3_setPlugins: typeof setPlugins;
1262
1756
  declare namespace index_d$3 {
1263
- export { index_d$3_imageCache as imageCache, index_d$3_nicoScripts as nicoScripts, index_d$3_plugins as plugins, index_d$3_resetImageCache as resetImageCache, index_d$3_resetNicoScripts as resetNicoScripts, index_d$3_setPlugins as setPlugins };
1757
+ export { index_d$3_imageCache as index_d$3_imageCache, index_d$3_nicoScripts as index_d$3_nicoScripts, index_d$3_plugins as index_d$3_plugins, index_d$3_resetImageCache as index_d$3_resetImageCache, index_d$3_resetNicoScripts as index_d$3_resetNicoScripts, index_d$3_setPlugins as index_d$3_setPlugins };
1264
1758
  }
1265
-
1266
1759
  declare const colors: {
1267
- white: string;
1268
- red: string;
1269
- pink: string;
1270
- orange: string;
1271
- yellow: string;
1272
- green: string;
1273
- cyan: string;
1274
- blue: string;
1275
- purple: string;
1276
- black: string;
1277
- white2: string;
1278
- niconicowhite: string;
1279
- red2: string;
1280
- truered: string;
1281
- pink2: string;
1282
- orange2: string;
1283
- passionorange: string;
1284
- yellow2: string;
1285
- madyellow: string;
1286
- green2: string;
1287
- elementalgreen: string;
1288
- cyan2: string;
1289
- blue2: string;
1290
- marinblue: string;
1291
- purple2: string;
1292
- nobleviolet: string;
1293
- black2: string;
1760
+ white: string;
1761
+ red: string;
1762
+ pink: string;
1763
+ orange: string;
1764
+ yellow: string;
1765
+ green: string;
1766
+ cyan: string;
1767
+ blue: string;
1768
+ purple: string;
1769
+ black: string;
1770
+ white2: string;
1771
+ niconicowhite: string;
1772
+ red2: string;
1773
+ truered: string;
1774
+ pink2: string;
1775
+ orange2: string;
1776
+ passionorange: string;
1777
+ yellow2: string;
1778
+ madyellow: string;
1779
+ green2: string;
1780
+ elementalgreen: string;
1781
+ cyan2: string;
1782
+ blue2: string;
1783
+ marinblue: string;
1784
+ purple2: string;
1785
+ nobleviolet: string;
1786
+ black2: string;
1294
1787
  };
1295
-
1296
1788
  declare const colors$1_colors: typeof colors;
1297
1789
  declare namespace colors$1 {
1298
- export { colors$1_colors as colors };
1790
+ export { colors$1_colors as colors$1_colors };
1299
1791
  }
1300
-
1301
1792
  declare let defaultConfig: BaseConfig;
1302
1793
  declare const updateConfig: (config: BaseConfig) => void;
1303
1794
  declare const defaultOptions: BaseOptions;
@@ -1305,7 +1796,6 @@ declare let config: BaseConfig;
1305
1796
  declare let options: BaseOptions;
1306
1797
  declare const setConfig: (value: BaseConfig) => void;
1307
1798
  declare const setOptions: (value: BaseOptions) => void;
1308
-
1309
1799
  declare const config$1_config: typeof config;
1310
1800
  declare const config$1_defaultConfig: typeof defaultConfig;
1311
1801
  declare const config$1_defaultOptions: typeof defaultOptions;
@@ -1314,527 +1804,507 @@ declare const config$1_setConfig: typeof setConfig;
1314
1804
  declare const config$1_setOptions: typeof setOptions;
1315
1805
  declare const config$1_updateConfig: typeof updateConfig;
1316
1806
  declare namespace config$1 {
1317
- export { config$1_config as config, config$1_defaultConfig as defaultConfig, config$1_defaultOptions as defaultOptions, config$1_options as options, config$1_setConfig as setConfig, config$1_setOptions as setOptions, config$1_updateConfig as updateConfig };
1807
+ export { config$1_config as config$1_config, config$1_defaultConfig as config$1_defaultConfig, config$1_defaultOptions as config$1_defaultOptions, config$1_options as config$1_options, config$1_setConfig as config$1_setConfig, config$1_setOptions as config$1_setOptions, config$1_updateConfig as config$1_updateConfig };
1318
1808
  }
1319
-
1320
1809
  declare const fontTemplates: {
1321
- arial: {
1322
- font: string;
1323
- offset: number;
1324
- weight: number;
1325
- };
1326
- gothic: {
1327
- font: string;
1328
- offset: number;
1329
- weight: number;
1330
- };
1331
- gulim: {
1332
- font: string;
1333
- offset: number;
1334
- weight: number;
1335
- };
1336
- mincho: {
1337
- font: string;
1338
- offset: number;
1339
- weight: number;
1340
- };
1341
- simsun: {
1342
- font: string;
1343
- offset: number;
1344
- weight: number;
1345
- };
1346
- macGothicPro6: {
1347
- font: string;
1348
- offset: number;
1349
- weight: number;
1350
- };
1351
- macGothicPro3: {
1352
- font: string;
1353
- offset: number;
1354
- weight: number;
1355
- };
1356
- macMincho: {
1357
- font: string;
1358
- offset: number;
1359
- weight: number;
1360
- };
1361
- macGothic1: {
1362
- font: string;
1363
- offset: number;
1364
- weight: number;
1365
- };
1366
- macGothic2: {
1367
- font: string;
1368
- offset: number;
1369
- weight: number;
1370
- };
1371
- sansSerif600: {
1372
- font: string;
1373
- offset: number;
1374
- weight: number;
1375
- };
1376
- sansSerif400: {
1377
- font: string;
1378
- offset: number;
1379
- weight: number;
1380
- };
1381
- serif: {
1382
- font: string;
1383
- offset: number;
1384
- weight: number;
1385
- };
1810
+ arial: {
1811
+ font: string;
1812
+ offset: number;
1813
+ weight: number;
1814
+ };
1815
+ gothic: {
1816
+ font: string;
1817
+ offset: number;
1818
+ weight: number;
1819
+ };
1820
+ gulim: {
1821
+ font: string;
1822
+ offset: number;
1823
+ weight: number;
1824
+ };
1825
+ mincho: {
1826
+ font: string;
1827
+ offset: number;
1828
+ weight: number;
1829
+ };
1830
+ simsun: {
1831
+ font: string;
1832
+ offset: number;
1833
+ weight: number;
1834
+ };
1835
+ macGothicPro6: {
1836
+ font: string;
1837
+ offset: number;
1838
+ weight: number;
1839
+ };
1840
+ macGothicPro3: {
1841
+ font: string;
1842
+ offset: number;
1843
+ weight: number;
1844
+ };
1845
+ macMincho: {
1846
+ font: string;
1847
+ offset: number;
1848
+ weight: number;
1849
+ };
1850
+ macGothic1: {
1851
+ font: string;
1852
+ offset: number;
1853
+ weight: number;
1854
+ };
1855
+ macGothic2: {
1856
+ font: string;
1857
+ offset: number;
1858
+ weight: number;
1859
+ };
1860
+ sansSerif600: {
1861
+ font: string;
1862
+ offset: number;
1863
+ weight: number;
1864
+ };
1865
+ sansSerif400: {
1866
+ font: string;
1867
+ offset: number;
1868
+ weight: number;
1869
+ };
1870
+ serif: {
1871
+ font: string;
1872
+ offset: number;
1873
+ weight: number;
1874
+ };
1386
1875
  };
1387
1876
  declare const fonts: {
1388
- win7: {
1389
- defont: FontItem;
1390
- gothic: FontItem;
1391
- mincho: FontItem;
1392
- };
1393
- win8_1: {
1394
- defont: FontItem;
1395
- gothic: FontItem;
1396
- mincho: FontItem;
1397
- };
1398
- win: {
1399
- defont: FontItem;
1400
- gothic: FontItem;
1401
- mincho: FontItem;
1402
- };
1403
- mac10_9: {
1404
- defont: FontItem;
1405
- gothic: FontItem;
1406
- mincho: FontItem;
1407
- };
1408
- mac10_11: {
1409
- defont: FontItem;
1410
- gothic: FontItem;
1411
- mincho: FontItem;
1412
- };
1413
- mac: {
1414
- defont: FontItem;
1415
- gothic: FontItem;
1416
- mincho: FontItem;
1417
- };
1418
- other: {
1419
- defont: FontItem;
1420
- gothic: FontItem;
1421
- mincho: FontItem;
1422
- };
1877
+ win7: {
1878
+ defont: FontItem;
1879
+ gothic: FontItem;
1880
+ mincho: FontItem;
1881
+ };
1882
+ win8_1: {
1883
+ defont: FontItem;
1884
+ gothic: FontItem;
1885
+ mincho: FontItem;
1886
+ };
1887
+ win: {
1888
+ defont: FontItem;
1889
+ gothic: FontItem;
1890
+ mincho: FontItem;
1891
+ };
1892
+ mac10_9: {
1893
+ defont: FontItem;
1894
+ gothic: FontItem;
1895
+ mincho: FontItem;
1896
+ };
1897
+ mac10_11: {
1898
+ defont: FontItem;
1899
+ gothic: FontItem;
1900
+ mincho: FontItem;
1901
+ };
1902
+ mac: {
1903
+ defont: FontItem;
1904
+ gothic: FontItem;
1905
+ mincho: FontItem;
1906
+ };
1907
+ other: {
1908
+ defont: FontItem;
1909
+ gothic: FontItem;
1910
+ mincho: FontItem;
1911
+ };
1423
1912
  };
1424
-
1425
1913
  declare const fonts$1_fontTemplates: typeof fontTemplates;
1426
1914
  declare const fonts$1_fonts: typeof fonts;
1427
1915
  declare namespace fonts$1 {
1428
- export { fonts$1_fontTemplates as fontTemplates, fonts$1_fonts as fonts };
1916
+ export { fonts$1_fontTemplates as fonts$1_fontTemplates, fonts$1_fonts as fonts$1_fonts };
1429
1917
  }
1430
-
1431
1918
  declare const initConfig: () => void;
1432
-
1433
1919
  declare const initConfig$1_initConfig: typeof initConfig;
1434
1920
  declare namespace initConfig$1 {
1435
- export { initConfig$1_initConfig as initConfig };
1921
+ export { initConfig$1_initConfig as initConfig$1_initConfig };
1436
1922
  }
1437
-
1438
1923
  declare class CanvasRenderingContext2DError extends Error {
1439
- constructor(options?: {
1440
- [key: string]: unknown;
1441
- });
1924
+ constructor(options?: {
1925
+ [key: string]: unknown;
1926
+ });
1442
1927
  }
1443
-
1444
1928
  declare class InvalidFormatError extends Error {
1445
- constructor(options?: {
1446
- [key: string]: unknown;
1447
- });
1929
+ constructor(options?: {
1930
+ [key: string]: unknown;
1931
+ });
1448
1932
  }
1449
-
1450
1933
  declare class InvalidOptionError extends Error {
1451
- constructor(options?: {
1452
- [key: string]: unknown;
1453
- });
1934
+ constructor(options?: {
1935
+ [key: string]: unknown;
1936
+ });
1454
1937
  }
1455
-
1456
1938
  declare class NotImplementedError extends Error {
1457
- pluginName: string;
1458
- methodName: string;
1459
- constructor(pluginName: string, methodName: string, options?: {
1460
- [key: string]: unknown;
1461
- });
1939
+ pluginName: string;
1940
+ methodName: string;
1941
+ constructor(pluginName: string, methodName: string, options?: {
1942
+ [key: string]: unknown;
1943
+ });
1462
1944
  }
1463
-
1464
- type index_d$2_CanvasRenderingContext2DError = CanvasRenderingContext2DError;
1945
+ export type index_d$2_CanvasRenderingContext2DError = CanvasRenderingContext2DError;
1465
1946
  declare const index_d$2_CanvasRenderingContext2DError: typeof CanvasRenderingContext2DError;
1466
- type index_d$2_InvalidFormatError = InvalidFormatError;
1947
+ export type index_d$2_InvalidFormatError = InvalidFormatError;
1467
1948
  declare const index_d$2_InvalidFormatError: typeof InvalidFormatError;
1468
- type index_d$2_InvalidOptionError = InvalidOptionError;
1949
+ export type index_d$2_InvalidOptionError = InvalidOptionError;
1469
1950
  declare const index_d$2_InvalidOptionError: typeof InvalidOptionError;
1470
- type index_d$2_NotImplementedError = NotImplementedError;
1951
+ export type index_d$2_NotImplementedError = NotImplementedError;
1471
1952
  declare const index_d$2_NotImplementedError: typeof NotImplementedError;
1472
1953
  declare namespace index_d$2 {
1473
- export { index_d$2_CanvasRenderingContext2DError as CanvasRenderingContext2DError, index_d$2_InvalidFormatError as InvalidFormatError, index_d$2_InvalidOptionError as InvalidOptionError, index_d$2_NotImplementedError as NotImplementedError };
1954
+ export { index_d$2_CanvasRenderingContext2DError as index_d$2_CanvasRenderingContext2DError, index_d$2_InvalidFormatError as index_d$2_InvalidFormatError, index_d$2_InvalidOptionError as index_d$2_InvalidOptionError, index_d$2_NotImplementedError as index_d$2_NotImplementedError };
1474
1955
  }
1475
-
1476
1956
  declare const registerHandler: <K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]) => void;
1477
1957
  declare const removeHandler: <K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]) => void;
1478
1958
  declare const triggerHandler: (vpos: number, lastVpos: number) => void;
1479
-
1480
1959
  declare const eventHandler_d_registerHandler: typeof registerHandler;
1481
1960
  declare const eventHandler_d_removeHandler: typeof removeHandler;
1482
1961
  declare const eventHandler_d_triggerHandler: typeof triggerHandler;
1483
1962
  declare namespace eventHandler_d {
1484
- export { eventHandler_d_registerHandler as registerHandler, eventHandler_d_removeHandler as removeHandler, eventHandler_d_triggerHandler as triggerHandler };
1963
+ export { eventHandler_d_registerHandler as eventHandler_d_registerHandler, eventHandler_d_removeHandler as eventHandler_d_removeHandler, eventHandler_d_triggerHandler as eventHandler_d_triggerHandler };
1485
1964
  }
1486
-
1487
1965
  declare const convert2formattedComment: (data: unknown, type: InputFormatType) => FormattedComment[];
1488
-
1489
1966
  declare namespace inputParser_d {
1490
- export { convert2formattedComment as default };
1967
+ export { convert2formattedComment as convert2formattedComment };
1491
1968
  }
1492
-
1493
1969
  declare class CanvasRenderer implements IRenderer {
1494
- readonly canvas: HTMLCanvasElement;
1495
- readonly video?: HTMLVideoElement;
1496
- private readonly context;
1497
- constructor(canvas?: HTMLCanvasElement, video?: HTMLVideoElement);
1498
- drawVideo(enableLegacyPip: boolean): void;
1499
- getFont(): string;
1500
- getFillStyle(): string | CanvasGradient | CanvasPattern;
1501
- setScale(scale: number, arg1?: number): void;
1502
- drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void;
1503
- fillRect(x: number, y: number, width: number, height: number): void;
1504
- strokeRect(x: number, y: number, width: number, height: number): void;
1505
- fillText(text: string, x: number, y: number): void;
1506
- strokeText(text: string, x: number, y: number): void;
1507
- quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
1508
- clearRect(x: number, y: number, width: number, height: number): void;
1509
- setFont(font: string): void;
1510
- setFillStyle(color: string): void;
1511
- setStrokeStyle(color: string): void;
1512
- setLineWidth(width: number): void;
1513
- setGlobalAlpha(alpha: number): void;
1514
- setSize(width: number, height: number): void;
1515
- getSize(): {
1516
- width: number;
1517
- height: number;
1518
- };
1519
- measureText(text: string): TextMetrics;
1520
- beginPath(): void;
1521
- closePath(): void;
1522
- moveTo(x: number, y: number): void;
1523
- lineTo(x: number, y: number): void;
1524
- stroke(): void;
1525
- save(): void;
1526
- restore(): void;
1527
- getCanvas(): IRenderer;
1528
- destroy(): void;
1970
+ readonly canvas: HTMLCanvasElement;
1971
+ readonly video?: HTMLVideoElement;
1972
+ private readonly context;
1973
+ constructor(canvas?: HTMLCanvasElement, video?: HTMLVideoElement);
1974
+ drawVideo(enableLegacyPip: boolean): void;
1975
+ getFont(): string;
1976
+ getFillStyle(): string | CanvasGradient | CanvasPattern;
1977
+ setScale(scale: number, arg1?: number): void;
1978
+ drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void;
1979
+ fillRect(x: number, y: number, width: number, height: number): void;
1980
+ strokeRect(x: number, y: number, width: number, height: number): void;
1981
+ fillText(text: string, x: number, y: number): void;
1982
+ strokeText(text: string, x: number, y: number): void;
1983
+ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
1984
+ clearRect(x: number, y: number, width: number, height: number): void;
1985
+ setFont(font: string): void;
1986
+ setFillStyle(color: string): void;
1987
+ setStrokeStyle(color: string): void;
1988
+ setLineWidth(width: number): void;
1989
+ setGlobalAlpha(alpha: number): void;
1990
+ setSize(width: number, height: number): void;
1991
+ getSize(): {
1992
+ width: number;
1993
+ height: number;
1994
+ };
1995
+ measureText(text: string): TextMetrics;
1996
+ beginPath(): void;
1997
+ closePath(): void;
1998
+ moveTo(x: number, y: number): void;
1999
+ lineTo(x: number, y: number): void;
2000
+ stroke(): void;
2001
+ save(): void;
2002
+ restore(): void;
2003
+ getCanvas(): IRenderer;
2004
+ destroy(): void;
1529
2005
  }
1530
-
1531
- type index_d$1_CanvasRenderer = CanvasRenderer;
2006
+ export type index_d$1_CanvasRenderer = CanvasRenderer;
1532
2007
  declare const index_d$1_CanvasRenderer: typeof CanvasRenderer;
1533
2008
  declare namespace index_d$1 {
1534
- export { index_d$1_CanvasRenderer as CanvasRenderer };
2009
+ export { index_d$1_CanvasRenderer as index_d$1_CanvasRenderer };
1535
2010
  }
1536
-
1537
2011
  declare const typeGuard: {
1538
- formatted: {
1539
- comment: (i: unknown) => i is {
1540
- owner: boolean;
1541
- content: string;
1542
- id: number;
1543
- vpos: number;
1544
- date: number;
1545
- date_usec: number;
1546
- premium: boolean;
1547
- mail: string[];
1548
- user_id: number;
1549
- layer: number;
1550
- is_my_post: boolean;
1551
- };
1552
- comments: (i: unknown) => i is {
1553
- owner: boolean;
1554
- content: string;
1555
- id: number;
1556
- vpos: number;
1557
- date: number;
1558
- date_usec: number;
1559
- premium: boolean;
1560
- mail: string[];
1561
- user_id: number;
1562
- layer: number;
1563
- is_my_post: boolean;
1564
- }[];
1565
- legacyComment: (i: unknown) => i is {
1566
- owner: boolean;
1567
- content: string;
1568
- id: number;
1569
- vpos: number;
1570
- date: number;
1571
- date_usec: number;
1572
- premium: boolean;
1573
- mail: string[];
1574
- };
1575
- legacyComments: (i: unknown) => i is {
1576
- owner: boolean;
1577
- content: string;
1578
- id: number;
1579
- vpos: number;
1580
- date: number;
1581
- date_usec: number;
1582
- premium: boolean;
1583
- mail: string[];
1584
- }[];
1585
- };
1586
- legacy: {
1587
- rawApiResponses: (i: unknown) => i is ({
1588
- chat: {
1589
- content: string;
1590
- vpos: number;
1591
- date: number;
1592
- date_usec: number;
1593
- premium: number;
1594
- mail: string;
1595
- user_id: string;
1596
- thread: string;
1597
- no: number;
1598
- nicoru: number;
1599
- anonymity: number;
1600
- deleted: number;
1601
- };
1602
- } | {
1603
- [x: string]: unknown;
1604
- })[];
1605
- apiChat: (i: unknown) => i is {
1606
- content: string;
1607
- vpos: number;
1608
- date: number;
1609
- date_usec: number;
1610
- premium: number;
1611
- mail: string;
1612
- user_id: string;
1613
- thread: string;
1614
- no: number;
1615
- nicoru: number;
1616
- anonymity: number;
1617
- deleted: number;
1618
- };
1619
- apiGlobalNumRes: (i: unknown) => i is {
1620
- thread: string;
1621
- num_res: number;
1622
- };
1623
- apiLeaf: (i: unknown) => i is {
1624
- count: number;
1625
- thread: string;
1626
- };
1627
- apiPing: (i: unknown) => i is {
1628
- content: string;
1629
- };
1630
- apiThread: (i: unknown) => i is {
1631
- thread: string;
1632
- resultcode: number;
1633
- server_time: number;
1634
- ticket: string;
1635
- revision: number;
1636
- };
1637
- };
1638
- xmlDocument: (i: unknown) => i is XMLDocument;
1639
- legacyOwner: {
1640
- comments: (i: unknown) => i is string;
1641
- };
1642
- owner: {
1643
- comment: (i: unknown) => i is {
1644
- time: string;
1645
- command: string;
1646
- comment: string;
1647
- };
1648
- comments: (i: unknown) => i is {
1649
- time: string;
1650
- command: string;
1651
- comment: string;
1652
- }[];
1653
- };
1654
- v1: {
1655
- comment: (i: unknown) => i is {
1656
- id: string;
1657
- no: number;
1658
- vposMs: number;
1659
- body: string;
1660
- commands: string[];
1661
- userId: string;
1662
- isPremium: boolean;
1663
- score: number;
1664
- postedAt: string;
1665
- nicoruCount: number;
1666
- nicoruId: string | null;
1667
- source: string;
1668
- isMyPost: boolean;
1669
- };
1670
- comments: (i: unknown) => i is {
1671
- id: string;
1672
- no: number;
1673
- vposMs: number;
1674
- body: string;
1675
- commands: string[];
1676
- userId: string;
1677
- isPremium: boolean;
1678
- score: number;
1679
- postedAt: string;
1680
- nicoruCount: number;
1681
- nicoruId: string | null;
1682
- source: string;
1683
- isMyPost: boolean;
1684
- }[];
1685
- thread: (i: unknown) => i is {
1686
- fork: string;
1687
- commentCount: number;
1688
- comments: {
1689
- id: string;
1690
- no: number;
1691
- vposMs: number;
1692
- body: string;
1693
- commands: string[];
1694
- userId: string;
1695
- isPremium: boolean;
1696
- score: number;
1697
- postedAt: string;
1698
- nicoruCount: number;
1699
- nicoruId: string | null;
1700
- source: string;
1701
- isMyPost: boolean;
1702
- }[];
1703
- id?: unknown;
1704
- };
1705
- threads: (i: unknown) => i is {
1706
- fork: string;
1707
- commentCount: number;
1708
- comments: {
1709
- id: string;
1710
- no: number;
1711
- vposMs: number;
1712
- body: string;
1713
- commands: string[];
1714
- userId: string;
1715
- isPremium: boolean;
1716
- score: number;
1717
- postedAt: string;
1718
- nicoruCount: number;
1719
- nicoruId: string | null;
1720
- source: string;
1721
- isMyPost: boolean;
1722
- }[];
1723
- id?: unknown;
1724
- }[];
1725
- };
1726
- nicoScript: {
1727
- range: {
1728
- target: (i: unknown) => i is NicoScriptReverseTarget;
1729
- };
1730
- replace: {
1731
- range: (i: unknown) => i is NicoScriptReplaceRange;
1732
- target: (i: unknown) => i is NicoScriptReplaceTarget;
1733
- condition: (i: unknown) => i is NicoScriptReplaceCondition;
1734
- };
1735
- };
1736
- comment: {
1737
- font: (i: unknown) => i is "defont" | "mincho" | "gothic" | "gulim" | "simsun";
1738
- loc: (i: unknown) => i is "ue" | "naka" | "shita";
1739
- size: (i: unknown) => i is "big" | "medium" | "small";
1740
- command: {
1741
- key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
1742
- };
1743
- 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";
1744
- colorCode: (i: unknown) => i is string;
1745
- colorCodeAllowAlpha: (i: unknown) => i is string;
1746
- };
1747
- config: {
1748
- initOptions: (item: unknown) => item is Partial<BaseOptions>;
1749
- };
1750
- internal: {
1751
- CommentMeasuredContentItem: (i: unknown) => i is {
1752
- type: "spacer";
1753
- char: string;
1754
- charWidth: number;
1755
- count: number;
1756
- isButton?: boolean | undefined;
1757
- font?: "defont" | "gulim" | "simsun" | undefined;
1758
- } | (({
1759
- type: "spacer";
1760
- char: string;
1761
- charWidth: number;
1762
- count: number;
1763
- isButton?: boolean | undefined;
1764
- font?: "defont" | "gulim" | "simsun" | undefined;
1765
- } | {
1766
- type: "text";
1767
- content: string;
1768
- slicedContent: string[];
1769
- isButton?: boolean | undefined;
1770
- font?: "defont" | "gulim" | "simsun" | undefined;
1771
- width?: number[] | undefined;
1772
- }) & {
1773
- width: number[];
1774
- });
1775
- CommentMeasuredContentItemArray: (i: unknown) => i is ({
1776
- type: "spacer";
1777
- char: string;
1778
- charWidth: number;
1779
- count: number;
1780
- isButton?: boolean | undefined;
1781
- font?: "defont" | "gulim" | "simsun" | undefined;
1782
- } | (({
1783
- type: "spacer";
1784
- char: string;
1785
- charWidth: number;
1786
- count: number;
1787
- isButton?: boolean | undefined;
1788
- font?: "defont" | "gulim" | "simsun" | undefined;
1789
- } | {
1790
- type: "text";
1791
- content: string;
1792
- slicedContent: string[];
1793
- isButton?: boolean | undefined;
1794
- font?: "defont" | "gulim" | "simsun" | undefined;
1795
- width?: number[] | undefined;
1796
- }) & {
1797
- width: number[];
1798
- }))[];
1799
- MultiConfigItem: <T>(i: unknown) => i is MultiConfigItem<T>;
1800
- HTML5Fonts: (i: unknown) => i is "defont" | "mincho" | "gothic";
1801
- MeasureInput: (i: unknown) => i is {
1802
- lineHeight: number;
1803
- font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
1804
- content: ({
1805
- type: "spacer";
1806
- char: string;
1807
- charWidth: number;
1808
- count: number;
1809
- isButton?: boolean | undefined;
1810
- font?: "defont" | "gulim" | "simsun" | undefined;
1811
- } | {
1812
- type: "text";
1813
- content: string;
1814
- slicedContent: string[];
1815
- isButton?: boolean | undefined;
1816
- font?: "defont" | "gulim" | "simsun" | undefined;
1817
- width?: number[] | undefined;
1818
- })[];
1819
- charSize: number;
1820
- lineCount: number;
1821
- };
1822
- };
2012
+ formatted: {
2013
+ comment: (i: unknown) => i is {
2014
+ owner: boolean;
2015
+ content: string;
2016
+ id: number;
2017
+ vpos: number;
2018
+ date: number;
2019
+ date_usec: number;
2020
+ premium: boolean;
2021
+ mail: string[];
2022
+ user_id: number;
2023
+ layer: number;
2024
+ is_my_post: boolean;
2025
+ };
2026
+ comments: (i: unknown) => i is {
2027
+ owner: boolean;
2028
+ content: string;
2029
+ id: number;
2030
+ vpos: number;
2031
+ date: number;
2032
+ date_usec: number;
2033
+ premium: boolean;
2034
+ mail: string[];
2035
+ user_id: number;
2036
+ layer: number;
2037
+ is_my_post: boolean;
2038
+ }[];
2039
+ legacyComment: (i: unknown) => i is {
2040
+ owner: boolean;
2041
+ content: string;
2042
+ id: number;
2043
+ vpos: number;
2044
+ date: number;
2045
+ date_usec: number;
2046
+ premium: boolean;
2047
+ mail: string[];
2048
+ };
2049
+ legacyComments: (i: unknown) => i is {
2050
+ owner: boolean;
2051
+ content: string;
2052
+ id: number;
2053
+ vpos: number;
2054
+ date: number;
2055
+ date_usec: number;
2056
+ premium: boolean;
2057
+ mail: string[];
2058
+ }[];
2059
+ };
2060
+ legacy: {
2061
+ rawApiResponses: (i: unknown) => i is ({
2062
+ chat: {
2063
+ content: string;
2064
+ vpos: number;
2065
+ date: number;
2066
+ date_usec: number;
2067
+ premium: number;
2068
+ mail: string;
2069
+ user_id: string;
2070
+ thread: string;
2071
+ no: number;
2072
+ nicoru: number;
2073
+ anonymity: number;
2074
+ deleted: number;
2075
+ };
2076
+ } | {
2077
+ [x: string]: unknown;
2078
+ })[];
2079
+ apiChat: (i: unknown) => i is {
2080
+ content: string;
2081
+ vpos: number;
2082
+ date: number;
2083
+ date_usec: number;
2084
+ premium: number;
2085
+ mail: string;
2086
+ user_id: string;
2087
+ thread: string;
2088
+ no: number;
2089
+ nicoru: number;
2090
+ anonymity: number;
2091
+ deleted: number;
2092
+ };
2093
+ apiGlobalNumRes: (i: unknown) => i is {
2094
+ thread: string;
2095
+ num_res: number;
2096
+ };
2097
+ apiLeaf: (i: unknown) => i is {
2098
+ count: number;
2099
+ thread: string;
2100
+ };
2101
+ apiPing: (i: unknown) => i is {
2102
+ content: string;
2103
+ };
2104
+ apiThread: (i: unknown) => i is {
2105
+ thread: string;
2106
+ resultcode: number;
2107
+ server_time: number;
2108
+ ticket: string;
2109
+ revision: number;
2110
+ };
2111
+ };
2112
+ xmlDocument: (i: unknown) => i is XMLDocument;
2113
+ legacyOwner: {
2114
+ comments: (i: unknown) => i is string;
2115
+ };
2116
+ owner: {
2117
+ comment: (i: unknown) => i is {
2118
+ time: string;
2119
+ command: string;
2120
+ comment: string;
2121
+ };
2122
+ comments: (i: unknown) => i is {
2123
+ time: string;
2124
+ command: string;
2125
+ comment: string;
2126
+ }[];
2127
+ };
2128
+ v1: {
2129
+ comment: (i: unknown) => i is {
2130
+ id: string;
2131
+ no: number;
2132
+ vposMs: number;
2133
+ body: string;
2134
+ commands: string[];
2135
+ userId: string;
2136
+ isPremium: boolean;
2137
+ score: number;
2138
+ postedAt: string;
2139
+ nicoruCount: number;
2140
+ nicoruId: string | null;
2141
+ source: string;
2142
+ isMyPost: boolean;
2143
+ };
2144
+ comments: (i: unknown) => i is {
2145
+ id: string;
2146
+ no: number;
2147
+ vposMs: number;
2148
+ body: string;
2149
+ commands: string[];
2150
+ userId: string;
2151
+ isPremium: boolean;
2152
+ score: number;
2153
+ postedAt: string;
2154
+ nicoruCount: number;
2155
+ nicoruId: string | null;
2156
+ source: string;
2157
+ isMyPost: boolean;
2158
+ }[];
2159
+ thread: (i: unknown) => i is {
2160
+ fork: string;
2161
+ commentCount: number;
2162
+ comments: {
2163
+ id: string;
2164
+ no: number;
2165
+ vposMs: number;
2166
+ body: string;
2167
+ commands: string[];
2168
+ userId: string;
2169
+ isPremium: boolean;
2170
+ score: number;
2171
+ postedAt: string;
2172
+ nicoruCount: number;
2173
+ nicoruId: string | null;
2174
+ source: string;
2175
+ isMyPost: boolean;
2176
+ }[];
2177
+ id?: unknown;
2178
+ };
2179
+ threads: (i: unknown) => i is {
2180
+ fork: string;
2181
+ commentCount: number;
2182
+ comments: {
2183
+ id: string;
2184
+ no: number;
2185
+ vposMs: number;
2186
+ body: string;
2187
+ commands: string[];
2188
+ userId: string;
2189
+ isPremium: boolean;
2190
+ score: number;
2191
+ postedAt: string;
2192
+ nicoruCount: number;
2193
+ nicoruId: string | null;
2194
+ source: string;
2195
+ isMyPost: boolean;
2196
+ }[];
2197
+ id?: unknown;
2198
+ }[];
2199
+ };
2200
+ nicoScript: {
2201
+ range: {
2202
+ target: (i: unknown) => i is NicoScriptReverseTarget;
2203
+ };
2204
+ replace: {
2205
+ range: (i: unknown) => i is NicoScriptReplaceRange;
2206
+ target: (i: unknown) => i is NicoScriptReplaceTarget;
2207
+ condition: (i: unknown) => i is NicoScriptReplaceCondition;
2208
+ };
2209
+ };
2210
+ comment: {
2211
+ font: (i: unknown) => i is "defont" | "mincho" | "gothic" | "gulim" | "simsun";
2212
+ loc: (i: unknown) => i is "ue" | "naka" | "shita";
2213
+ size: (i: unknown) => i is "big" | "medium" | "small";
2214
+ command: {
2215
+ key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
2216
+ };
2217
+ 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";
2218
+ colorCode: (i: unknown) => i is string;
2219
+ colorCodeAllowAlpha: (i: unknown) => i is string;
2220
+ };
2221
+ config: {
2222
+ initOptions: (item: unknown) => item is Partial<BaseOptions>;
2223
+ };
2224
+ internal: {
2225
+ CommentMeasuredContentItem: (i: unknown) => i is {
2226
+ type: "spacer";
2227
+ char: string;
2228
+ charWidth: number;
2229
+ count: number;
2230
+ isButton?: boolean | undefined;
2231
+ font?: "defont" | "gulim" | "simsun" | undefined;
2232
+ } | (({
2233
+ type: "spacer";
2234
+ char: string;
2235
+ charWidth: number;
2236
+ count: number;
2237
+ isButton?: boolean | undefined;
2238
+ font?: "defont" | "gulim" | "simsun" | undefined;
2239
+ } | {
2240
+ type: "text";
2241
+ content: string;
2242
+ slicedContent: string[];
2243
+ isButton?: boolean | undefined;
2244
+ font?: "defont" | "gulim" | "simsun" | undefined;
2245
+ width?: number[] | undefined;
2246
+ }) & {
2247
+ width: number[];
2248
+ });
2249
+ CommentMeasuredContentItemArray: (i: unknown) => i is ({
2250
+ type: "spacer";
2251
+ char: string;
2252
+ charWidth: number;
2253
+ count: number;
2254
+ isButton?: boolean | undefined;
2255
+ font?: "defont" | "gulim" | "simsun" | undefined;
2256
+ } | (({
2257
+ type: "spacer";
2258
+ char: string;
2259
+ charWidth: number;
2260
+ count: number;
2261
+ isButton?: boolean | undefined;
2262
+ font?: "defont" | "gulim" | "simsun" | undefined;
2263
+ } | {
2264
+ type: "text";
2265
+ content: string;
2266
+ slicedContent: string[];
2267
+ isButton?: boolean | undefined;
2268
+ font?: "defont" | "gulim" | "simsun" | undefined;
2269
+ width?: number[] | undefined;
2270
+ }) & {
2271
+ width: number[];
2272
+ }))[];
2273
+ MultiConfigItem: <T>(i: unknown) => i is MultiConfigItem<T>;
2274
+ HTML5Fonts: (i: unknown) => i is "defont" | "mincho" | "gothic";
2275
+ MeasureInput: (i: unknown) => i is {
2276
+ lineHeight: number;
2277
+ font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
2278
+ content: ({
2279
+ type: "spacer";
2280
+ char: string;
2281
+ charWidth: number;
2282
+ count: number;
2283
+ isButton?: boolean | undefined;
2284
+ font?: "defont" | "gulim" | "simsun" | undefined;
2285
+ } | {
2286
+ type: "text";
2287
+ content: string;
2288
+ slicedContent: string[];
2289
+ isButton?: boolean | undefined;
2290
+ font?: "defont" | "gulim" | "simsun" | undefined;
2291
+ width?: number[] | undefined;
2292
+ })[];
2293
+ charSize: number;
2294
+ lineCount: number;
2295
+ };
2296
+ };
1823
2297
  };
1824
-
1825
2298
  declare namespace typeGuard_d {
1826
- export { typeGuard as default };
2299
+ export { typeGuard as typeGuard };
1827
2300
  }
1828
-
1829
2301
  declare const arrayPush: (array: {
1830
- [key: number]: IComment[];
2302
+ [key: number]: IComment[];
1831
2303
  }, key: string | number, push: IComment) => void;
1832
2304
  declare const arrayEqual: (a: unknown[], b: unknown[]) => boolean;
1833
-
1834
2305
  declare const hex2rgb: (hex: string) => number[];
1835
2306
  declare const hex2rgba: (hex: string) => number[];
1836
2307
  declare const getStrokeColor: (comment: FormattedCommentWithSize) => string;
1837
-
1838
2308
  declare const isLineBreakResize: (comment: MeasureTextInput) => boolean;
1839
2309
  declare const getDefaultCommand: (vpos: number) => DefaultCommand;
1840
2310
  declare const parseCommandAndNicoScript: (comment: FormattedComment) => ParseCommandAndNicoScriptResult;
@@ -1844,53 +2314,47 @@ declare const isBanActive: (vpos: number) => boolean;
1844
2314
  declare const processFixedComment: (comment: IComment, collision: CollisionItem, timeline: Timeline) => void;
1845
2315
  declare const processMovableComment: (comment: IComment, collision: Collision, timeline: Timeline) => void;
1846
2316
  declare const getPosY: (currentPos: number, targetComment: IComment, collision: IComment[] | undefined, isChanged?: boolean) => {
1847
- currentPos: number;
1848
- isChanged: boolean;
1849
- isBreak: boolean;
2317
+ currentPos: number;
2318
+ isChanged: boolean;
2319
+ isBreak: boolean;
1850
2320
  };
1851
2321
  declare const getPosX: (comment: FormattedCommentWithSize, vpos: number, isReverse?: boolean) => number;
1852
2322
  declare const parseFont: (font: CommentFont, size: string | number) => string;
1853
-
1854
2323
  declare const changeCALayer: (rawData: FormattedComment[]) => FormattedComment[];
1855
-
1856
2324
  declare const getConfig: <T>(input: ConfigItem<T>, isFlash?: boolean) => T;
1857
-
1858
2325
  declare const getFlashFontIndex: (part: string) => CommentContentIndex[];
1859
2326
  declare const getFlashFontName: (font: CommentFlashFontParsed) => CommentFlashFont;
1860
2327
  declare const parseContent: (content: string) => ({
1861
- type: "spacer";
1862
- char: string;
1863
- charWidth: number;
1864
- count: number;
1865
- isButton?: boolean | undefined;
1866
- font?: "defont" | "gulim" | "simsun" | undefined;
2328
+ type: "spacer";
2329
+ char: string;
2330
+ charWidth: number;
2331
+ count: number;
2332
+ isButton?: boolean | undefined;
2333
+ font?: "defont" | "gulim" | "simsun" | undefined;
1867
2334
  } | {
1868
- type: "text";
1869
- content: string;
1870
- slicedContent: string[];
1871
- isButton?: boolean | undefined;
1872
- font?: "defont" | "gulim" | "simsun" | undefined;
1873
- width?: number[] | undefined;
2335
+ type: "text";
2336
+ content: string;
2337
+ slicedContent: string[];
2338
+ isButton?: boolean | undefined;
2339
+ font?: "defont" | "gulim" | "simsun" | undefined;
2340
+ width?: number[] | undefined;
1874
2341
  })[];
1875
2342
  declare const getButtonParts: (comment: FormattedCommentWithSize) => FormattedCommentWithSize;
1876
2343
  declare const buildAtButtonComment: (comment: FormattedCommentWithSize, vpos: number) => FormattedComment | undefined;
1877
-
1878
2344
  declare const getLineHeight: (fontSize: CommentSize, isFlash: boolean, resized?: boolean) => number;
1879
2345
  declare const getCharSize: (fontSize: CommentSize, isFlash: boolean) => number;
1880
2346
  declare const measure: (comment: MeasureInput, renderer: IRenderer) => {
1881
- height: number;
1882
- width: number;
1883
- lineWidth: number[];
1884
- itemWidth: number[][];
2347
+ height: number;
2348
+ width: number;
2349
+ lineWidth: number[];
2350
+ itemWidth: number[][];
1885
2351
  };
1886
2352
  declare const addHTML5PartToResult: (lineContent: CommentContentItem[], part: string, font?: CommentHTML5Font) => void;
1887
2353
  declare const getFontSizeAndScale: (charSize: number) => {
1888
- scale: number;
1889
- fontSize: number;
2354
+ scale: number;
2355
+ fontSize: number;
1890
2356
  };
1891
-
1892
2357
  declare const nativeSort: <T>(getter: (input: T) => number) => (a: T, b: T) => 1 | 0 | -1;
1893
-
1894
2358
  declare const index_d_addHTML5PartToResult: typeof addHTML5PartToResult;
1895
2359
  declare const index_d_arrayEqual: typeof arrayEqual;
1896
2360
  declare const index_d_arrayPush: typeof arrayPush;
@@ -1921,350 +2385,351 @@ declare const index_d_parseFont: typeof parseFont;
1921
2385
  declare const index_d_processFixedComment: typeof processFixedComment;
1922
2386
  declare const index_d_processMovableComment: typeof processMovableComment;
1923
2387
  declare namespace index_d {
1924
- export { index_d_addHTML5PartToResult as addHTML5PartToResult, index_d_arrayEqual as arrayEqual, index_d_arrayPush as arrayPush, index_d_buildAtButtonComment as buildAtButtonComment, index_d_changeCALayer as changeCALayer, index_d_getButtonParts as getButtonParts, index_d_getCharSize as getCharSize, index_d_getConfig as getConfig, index_d_getDefaultCommand as getDefaultCommand, index_d_getFlashFontIndex as getFlashFontIndex, index_d_getFlashFontName as getFlashFontName, index_d_getFontSizeAndScale as getFontSizeAndScale, index_d_getLineHeight as getLineHeight, index_d_getPosX as getPosX, index_d_getPosY as getPosY, index_d_getStrokeColor as getStrokeColor, index_d_hex2rgb as hex2rgb, index_d_hex2rgba as hex2rgba, index_d_isBanActive as isBanActive, index_d_isFlashComment as isFlashComment, index_d_isLineBreakResize as isLineBreakResize, index_d_isReverseActive as isReverseActive, index_d_measure as measure, index_d_nativeSort as nativeSort, index_d_parseCommandAndNicoScript as parseCommandAndNicoScript, index_d_parseContent as parseContent, index_d_parseFont as parseFont, index_d_processFixedComment as processFixedComment, index_d_processMovableComment as processMovableComment };
2388
+ export { index_d_addHTML5PartToResult as index_d_addHTML5PartToResult, index_d_arrayEqual as index_d_arrayEqual, index_d_arrayPush as index_d_arrayPush, index_d_buildAtButtonComment as index_d_buildAtButtonComment, index_d_changeCALayer as index_d_changeCALayer, index_d_getButtonParts as index_d_getButtonParts, index_d_getCharSize as index_d_getCharSize, index_d_getConfig as index_d_getConfig, index_d_getDefaultCommand as index_d_getDefaultCommand, index_d_getFlashFontIndex as index_d_getFlashFontIndex, index_d_getFlashFontName as index_d_getFlashFontName, index_d_getFontSizeAndScale as index_d_getFontSizeAndScale, index_d_getLineHeight as index_d_getLineHeight, index_d_getPosX as index_d_getPosX, index_d_getPosY as index_d_getPosY, index_d_getStrokeColor as index_d_getStrokeColor, index_d_hex2rgb as index_d_hex2rgb, index_d_hex2rgba as index_d_hex2rgba, index_d_isBanActive as index_d_isBanActive, index_d_isFlashComment as index_d_isFlashComment, index_d_isLineBreakResize as index_d_isLineBreakResize, index_d_isReverseActive as index_d_isReverseActive, index_d_measure as index_d_measure, index_d_nativeSort as index_d_nativeSort, index_d_parseCommandAndNicoScript as index_d_parseCommandAndNicoScript, index_d_parseContent as index_d_parseContent, index_d_parseFont as index_d_parseFont, index_d_processFixedComment as index_d_processFixedComment, index_d_processMovableComment as index_d_processMovableComment };
1925
2389
  }
1926
-
1927
2390
  declare const definition: {
1928
- colors: typeof colors$1;
1929
- config: typeof config$1;
1930
- fonts: typeof fonts$1;
1931
- initConfig: typeof initConfig$1;
2391
+ colors: typeof colors$1;
2392
+ config: typeof config$1;
2393
+ fonts: typeof fonts$1;
2394
+ initConfig: typeof initConfig$1;
1932
2395
  };
1933
-
1934
2396
  declare const internal_definition: typeof definition;
1935
2397
  declare namespace internal {
1936
- export { index_d$4 as comments, index_d$3 as contexts, internal_definition as definition, index_d$2 as errors, eventHandler_d as eventHandler, inputParser_d as inputParser, index_d$1 as renderer, typeGuard_d as typeGuard, index_d as utils };
2398
+ export { index_d$4 as index_d$4, index_d$3 as index_d$3, internal_definition as internal_definition, index_d$2 as index_d$2, eventHandler_d as eventHandler_d, inputParser_d as inputParser_d, index_d$1 as index_d$1, typeGuard_d as typeGuard_d, index_d as index_d };
1937
2399
  }
1938
-
1939
2400
  declare class NiconiComments {
1940
- enableLegacyPiP: boolean;
1941
- showCollision: boolean;
1942
- showFPS: boolean;
1943
- showCommentCount: boolean;
1944
- private lastVpos;
1945
- private readonly renderer;
1946
- private readonly collision;
1947
- private readonly timeline;
1948
- static typeGuard: {
1949
- formatted: {
1950
- comment: (i: unknown) => i is {
1951
- owner: boolean;
1952
- content: string;
1953
- id: number;
1954
- vpos: number;
1955
- date: number;
1956
- date_usec: number;
1957
- premium: boolean;
1958
- mail: string[];
1959
- user_id: number;
1960
- layer: number;
1961
- is_my_post: boolean;
1962
- };
1963
- comments: (i: unknown) => i is {
1964
- owner: boolean;
1965
- content: string;
1966
- id: number;
1967
- vpos: number;
1968
- date: number;
1969
- date_usec: number;
1970
- premium: boolean;
1971
- mail: string[];
1972
- user_id: number;
1973
- layer: number;
1974
- is_my_post: boolean;
1975
- }[];
1976
- legacyComment: (i: unknown) => i is {
1977
- owner: boolean;
1978
- content: string;
1979
- id: number;
1980
- vpos: number;
1981
- date: number;
1982
- date_usec: number;
1983
- premium: boolean;
1984
- mail: string[];
1985
- };
1986
- legacyComments: (i: unknown) => i is {
1987
- owner: boolean;
1988
- content: string;
1989
- id: number;
1990
- vpos: number;
1991
- date: number;
1992
- date_usec: number;
1993
- premium: boolean;
1994
- mail: string[];
1995
- }[];
1996
- };
1997
- legacy: {
1998
- rawApiResponses: (i: unknown) => i is ({
1999
- chat: {
2000
- content: string;
2001
- vpos: number;
2002
- date: number;
2003
- date_usec: number;
2004
- premium: number;
2005
- mail: string;
2006
- user_id: string;
2007
- thread: string;
2008
- no: number;
2009
- nicoru: number;
2010
- anonymity: number;
2011
- deleted: number;
2012
- };
2013
- } | {
2014
- [x: string]: unknown;
2015
- })[];
2016
- apiChat: (i: unknown) => i is {
2017
- content: string;
2018
- vpos: number;
2019
- date: number;
2020
- date_usec: number;
2021
- premium: number;
2022
- mail: string;
2023
- user_id: string;
2024
- thread: string;
2025
- no: number;
2026
- nicoru: number;
2027
- anonymity: number;
2028
- deleted: number;
2029
- };
2030
- apiGlobalNumRes: (i: unknown) => i is {
2031
- thread: string;
2032
- num_res: number;
2033
- };
2034
- apiLeaf: (i: unknown) => i is {
2035
- count: number;
2036
- thread: string;
2037
- };
2038
- apiPing: (i: unknown) => i is {
2039
- content: string;
2040
- };
2041
- apiThread: (i: unknown) => i is {
2042
- thread: string;
2043
- resultcode: number;
2044
- server_time: number;
2045
- ticket: string;
2046
- revision: number;
2047
- };
2048
- };
2049
- xmlDocument: (i: unknown) => i is XMLDocument;
2050
- legacyOwner: {
2051
- comments: (i: unknown) => i is string;
2052
- };
2053
- owner: {
2054
- comment: (i: unknown) => i is {
2055
- time: string;
2056
- command: string;
2057
- comment: string;
2058
- };
2059
- comments: (i: unknown) => i is {
2060
- time: string;
2061
- command: string;
2062
- comment: string;
2063
- }[];
2064
- };
2065
- v1: {
2066
- comment: (i: unknown) => i is {
2067
- id: string;
2068
- no: number;
2069
- vposMs: number;
2070
- body: string;
2071
- commands: string[];
2072
- userId: string;
2073
- isPremium: boolean;
2074
- score: number;
2075
- postedAt: string;
2076
- nicoruCount: number;
2077
- nicoruId: string | null;
2078
- source: string;
2079
- isMyPost: boolean;
2080
- };
2081
- comments: (i: unknown) => i is {
2082
- id: string;
2083
- no: number;
2084
- vposMs: number;
2085
- body: string;
2086
- commands: string[];
2087
- userId: string;
2088
- isPremium: boolean;
2089
- score: number;
2090
- postedAt: string;
2091
- nicoruCount: number;
2092
- nicoruId: string | null;
2093
- source: string;
2094
- isMyPost: boolean;
2095
- }[];
2096
- thread: (i: unknown) => i is {
2097
- fork: string;
2098
- commentCount: number;
2099
- comments: {
2100
- id: string;
2101
- no: number;
2102
- vposMs: number;
2103
- body: string;
2104
- commands: string[];
2105
- userId: string;
2106
- isPremium: boolean;
2107
- score: number;
2108
- postedAt: string;
2109
- nicoruCount: number;
2110
- nicoruId: string | null;
2111
- source: string;
2112
- isMyPost: boolean;
2113
- }[];
2114
- id?: unknown;
2115
- };
2116
- threads: (i: unknown) => i is {
2117
- fork: string;
2118
- commentCount: number;
2119
- comments: {
2120
- id: string;
2121
- no: number;
2122
- vposMs: number;
2123
- body: string;
2124
- commands: string[];
2125
- userId: string;
2126
- isPremium: boolean;
2127
- score: number;
2128
- postedAt: string;
2129
- nicoruCount: number;
2130
- nicoruId: string | null;
2131
- source: string;
2132
- isMyPost: boolean;
2133
- }[];
2134
- id?: unknown;
2135
- }[];
2136
- };
2137
- nicoScript: {
2138
- range: {
2139
- target: (i: unknown) => i is NicoScriptReverseTarget;
2140
- };
2141
- replace: {
2142
- range: (i: unknown) => i is NicoScriptReplaceRange;
2143
- target: (i: unknown) => i is NicoScriptReplaceTarget;
2144
- condition: (i: unknown) => i is NicoScriptReplaceCondition;
2145
- };
2146
- };
2147
- comment: {
2148
- font: (i: unknown) => i is "defont" | "mincho" | "gothic" | "gulim" | "simsun";
2149
- loc: (i: unknown) => i is "ue" | "naka" | "shita";
2150
- size: (i: unknown) => i is "big" | "medium" | "small";
2151
- command: {
2152
- key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
2153
- };
2154
- 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";
2155
- colorCode: (i: unknown) => i is string;
2156
- colorCodeAllowAlpha: (i: unknown) => i is string;
2157
- };
2158
- config: {
2159
- initOptions: (item: unknown) => item is Partial<BaseOptions>;
2160
- };
2161
- internal: {
2162
- CommentMeasuredContentItem: (i: unknown) => i is {
2163
- type: "spacer";
2164
- char: string;
2165
- charWidth: number;
2166
- count: number;
2167
- isButton?: boolean | undefined;
2168
- font?: "defont" | "gulim" | "simsun" | undefined;
2169
- } | (({
2170
- type: "spacer";
2171
- char: string;
2172
- charWidth: number;
2173
- count: number;
2174
- isButton?: boolean | undefined;
2175
- font?: "defont" | "gulim" | "simsun" | undefined;
2176
- } | {
2177
- type: "text";
2178
- content: string;
2179
- slicedContent: string[];
2180
- isButton?: boolean | undefined;
2181
- font?: "defont" | "gulim" | "simsun" | undefined;
2182
- width?: number[] | undefined;
2183
- }) & {
2184
- width: number[];
2185
- });
2186
- CommentMeasuredContentItemArray: (i: unknown) => i is ({
2187
- type: "spacer";
2188
- char: string;
2189
- charWidth: number;
2190
- count: number;
2191
- isButton?: boolean | undefined;
2192
- font?: "defont" | "gulim" | "simsun" | undefined;
2193
- } | (({
2194
- type: "spacer";
2195
- char: string;
2196
- charWidth: number;
2197
- count: number;
2198
- isButton?: boolean | undefined;
2199
- font?: "defont" | "gulim" | "simsun" | undefined;
2200
- } | {
2201
- type: "text";
2202
- content: string;
2203
- slicedContent: string[];
2204
- isButton?: boolean | undefined;
2205
- font?: "defont" | "gulim" | "simsun" | undefined;
2206
- width?: number[] | undefined;
2207
- }) & {
2208
- width: number[];
2209
- }))[];
2210
- MultiConfigItem: <T>(i: unknown) => i is MultiConfigItem<T>;
2211
- HTML5Fonts: (i: unknown) => i is "defont" | "mincho" | "gothic";
2212
- MeasureInput: (i: unknown) => i is {
2213
- lineHeight: number;
2214
- font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
2215
- content: ({
2216
- type: "spacer";
2217
- char: string;
2218
- charWidth: number;
2219
- count: number;
2220
- isButton?: boolean | undefined;
2221
- font?: "defont" | "gulim" | "simsun" | undefined;
2222
- } | {
2223
- type: "text";
2224
- content: string;
2225
- slicedContent: string[];
2226
- isButton?: boolean | undefined;
2227
- font?: "defont" | "gulim" | "simsun" | undefined;
2228
- width?: number[] | undefined;
2229
- })[];
2230
- charSize: number;
2231
- lineCount: number;
2232
- };
2233
- };
2234
- };
2235
- static default: typeof NiconiComments;
2236
- static FlashComment: {
2237
- condition: (comment: {
2238
- owner: boolean;
2239
- content: string;
2240
- id: number;
2241
- vpos: number;
2242
- date: number;
2243
- date_usec: number;
2244
- premium: boolean;
2245
- mail: string[];
2246
- user_id: number;
2247
- layer: number;
2248
- is_my_post: boolean;
2249
- }) => boolean;
2250
- class: typeof FlashComment;
2251
- };
2252
- static internal: typeof internal;
2253
- constructor(renderer: IRenderer | HTMLCanvasElement, data: InputFormat, initOptions?: Options);
2254
- private preRendering;
2255
- private getCommentPos;
2256
- private sortComment;
2257
- addComments(...rawComments: FormattedComment[]): void;
2258
- drawCanvas(vpos: number, forceRendering?: boolean, cursor?: Position): boolean;
2259
- private _drawVideo;
2260
- private _drawComments;
2261
- private _drawCollision;
2262
- private _drawFPS;
2263
- private _drawCommentCount;
2264
- addEventListener<K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]): void;
2265
- removeEventListener<K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]): void;
2266
- clear(): void;
2267
- click(vpos: number, pos: Position): void;
2401
+ enableLegacyPiP: boolean;
2402
+ showCollision: boolean;
2403
+ showFPS: boolean;
2404
+ showCommentCount: boolean;
2405
+ private lastVpos;
2406
+ private readonly renderer;
2407
+ private readonly collision;
2408
+ private readonly timeline;
2409
+ static typeGuard: {
2410
+ formatted: {
2411
+ comment: (i: unknown) => i is {
2412
+ owner: boolean;
2413
+ content: string;
2414
+ id: number;
2415
+ vpos: number;
2416
+ date: number;
2417
+ date_usec: number;
2418
+ premium: boolean;
2419
+ mail: string[];
2420
+ user_id: number;
2421
+ layer: number;
2422
+ is_my_post: boolean;
2423
+ };
2424
+ comments: (i: unknown) => i is {
2425
+ owner: boolean;
2426
+ content: string;
2427
+ id: number;
2428
+ vpos: number;
2429
+ date: number;
2430
+ date_usec: number;
2431
+ premium: boolean;
2432
+ mail: string[];
2433
+ user_id: number;
2434
+ layer: number;
2435
+ is_my_post: boolean;
2436
+ }[];
2437
+ legacyComment: (i: unknown) => i is {
2438
+ owner: boolean;
2439
+ content: string;
2440
+ id: number;
2441
+ vpos: number;
2442
+ date: number;
2443
+ date_usec: number;
2444
+ premium: boolean;
2445
+ mail: string[];
2446
+ };
2447
+ legacyComments: (i: unknown) => i is {
2448
+ owner: boolean;
2449
+ content: string;
2450
+ id: number;
2451
+ vpos: number;
2452
+ date: number;
2453
+ date_usec: number;
2454
+ premium: boolean;
2455
+ mail: string[];
2456
+ }[];
2457
+ };
2458
+ legacy: {
2459
+ rawApiResponses: (i: unknown) => i is ({
2460
+ chat: {
2461
+ content: string;
2462
+ vpos: number;
2463
+ date: number;
2464
+ date_usec: number;
2465
+ premium: number;
2466
+ mail: string;
2467
+ user_id: string;
2468
+ thread: string;
2469
+ no: number;
2470
+ nicoru: number;
2471
+ anonymity: number;
2472
+ deleted: number;
2473
+ };
2474
+ } | {
2475
+ [x: string]: unknown;
2476
+ })[];
2477
+ apiChat: (i: unknown) => i is {
2478
+ content: string;
2479
+ vpos: number;
2480
+ date: number;
2481
+ date_usec: number;
2482
+ premium: number;
2483
+ mail: string;
2484
+ user_id: string;
2485
+ thread: string;
2486
+ no: number;
2487
+ nicoru: number;
2488
+ anonymity: number;
2489
+ deleted: number;
2490
+ };
2491
+ apiGlobalNumRes: (i: unknown) => i is {
2492
+ thread: string;
2493
+ num_res: number;
2494
+ };
2495
+ apiLeaf: (i: unknown) => i is {
2496
+ count: number;
2497
+ thread: string;
2498
+ };
2499
+ apiPing: (i: unknown) => i is {
2500
+ content: string;
2501
+ };
2502
+ apiThread: (i: unknown) => i is {
2503
+ thread: string;
2504
+ resultcode: number;
2505
+ server_time: number;
2506
+ ticket: string;
2507
+ revision: number;
2508
+ };
2509
+ };
2510
+ xmlDocument: (i: unknown) => i is XMLDocument;
2511
+ legacyOwner: {
2512
+ comments: (i: unknown) => i is string;
2513
+ };
2514
+ owner: {
2515
+ comment: (i: unknown) => i is {
2516
+ time: string;
2517
+ command: string;
2518
+ comment: string;
2519
+ };
2520
+ comments: (i: unknown) => i is {
2521
+ time: string;
2522
+ command: string;
2523
+ comment: string;
2524
+ }[];
2525
+ };
2526
+ v1: {
2527
+ comment: (i: unknown) => i is {
2528
+ id: string;
2529
+ no: number;
2530
+ vposMs: number;
2531
+ body: string;
2532
+ commands: string[];
2533
+ userId: string;
2534
+ isPremium: boolean;
2535
+ score: number;
2536
+ postedAt: string;
2537
+ nicoruCount: number;
2538
+ nicoruId: string | null;
2539
+ source: string;
2540
+ isMyPost: boolean;
2541
+ };
2542
+ comments: (i: unknown) => i is {
2543
+ id: string;
2544
+ no: number;
2545
+ vposMs: number;
2546
+ body: string;
2547
+ commands: string[];
2548
+ userId: string;
2549
+ isPremium: boolean;
2550
+ score: number;
2551
+ postedAt: string;
2552
+ nicoruCount: number;
2553
+ nicoruId: string | null;
2554
+ source: string;
2555
+ isMyPost: boolean;
2556
+ }[];
2557
+ thread: (i: unknown) => i is {
2558
+ fork: string;
2559
+ commentCount: number;
2560
+ comments: {
2561
+ id: string;
2562
+ no: number;
2563
+ vposMs: number;
2564
+ body: string;
2565
+ commands: string[];
2566
+ userId: string;
2567
+ isPremium: boolean;
2568
+ score: number;
2569
+ postedAt: string;
2570
+ nicoruCount: number;
2571
+ nicoruId: string | null;
2572
+ source: string;
2573
+ isMyPost: boolean;
2574
+ }[];
2575
+ id?: unknown;
2576
+ };
2577
+ threads: (i: unknown) => i is {
2578
+ fork: string;
2579
+ commentCount: number;
2580
+ comments: {
2581
+ id: string;
2582
+ no: number;
2583
+ vposMs: number;
2584
+ body: string;
2585
+ commands: string[];
2586
+ userId: string;
2587
+ isPremium: boolean;
2588
+ score: number;
2589
+ postedAt: string;
2590
+ nicoruCount: number;
2591
+ nicoruId: string | null;
2592
+ source: string;
2593
+ isMyPost: boolean;
2594
+ }[];
2595
+ id?: unknown;
2596
+ }[];
2597
+ };
2598
+ nicoScript: {
2599
+ range: {
2600
+ target: (i: unknown) => i is NicoScriptReverseTarget;
2601
+ };
2602
+ replace: {
2603
+ range: (i: unknown) => i is NicoScriptReplaceRange;
2604
+ target: (i: unknown) => i is NicoScriptReplaceTarget;
2605
+ condition: (i: unknown) => i is NicoScriptReplaceCondition;
2606
+ };
2607
+ };
2608
+ comment: {
2609
+ font: (i: unknown) => i is "defont" | "mincho" | "gothic" | "gulim" | "simsun";
2610
+ loc: (i: unknown) => i is "ue" | "naka" | "shita";
2611
+ size: (i: unknown) => i is "big" | "medium" | "small";
2612
+ command: {
2613
+ key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
2614
+ };
2615
+ 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";
2616
+ colorCode: (i: unknown) => i is string;
2617
+ colorCodeAllowAlpha: (i: unknown) => i is string;
2618
+ };
2619
+ config: {
2620
+ initOptions: (item: unknown) => item is Partial<BaseOptions>;
2621
+ };
2622
+ internal: {
2623
+ CommentMeasuredContentItem: (i: unknown) => i is {
2624
+ type: "spacer";
2625
+ char: string;
2626
+ charWidth: number;
2627
+ count: number;
2628
+ isButton?: boolean | undefined;
2629
+ font?: "defont" | "gulim" | "simsun" | undefined;
2630
+ } | (({
2631
+ type: "spacer";
2632
+ char: string;
2633
+ charWidth: number;
2634
+ count: number;
2635
+ isButton?: boolean | undefined;
2636
+ font?: "defont" | "gulim" | "simsun" | undefined;
2637
+ } | {
2638
+ type: "text";
2639
+ content: string;
2640
+ slicedContent: string[];
2641
+ isButton?: boolean | undefined;
2642
+ font?: "defont" | "gulim" | "simsun" | undefined;
2643
+ width?: number[] | undefined;
2644
+ }) & {
2645
+ width: number[];
2646
+ });
2647
+ CommentMeasuredContentItemArray: (i: unknown) => i is ({
2648
+ type: "spacer";
2649
+ char: string;
2650
+ charWidth: number;
2651
+ count: number;
2652
+ isButton?: boolean | undefined;
2653
+ font?: "defont" | "gulim" | "simsun" | undefined;
2654
+ } | (({
2655
+ type: "spacer";
2656
+ char: string;
2657
+ charWidth: number;
2658
+ count: number;
2659
+ isButton?: boolean | undefined;
2660
+ font?: "defont" | "gulim" | "simsun" | undefined;
2661
+ } | {
2662
+ type: "text";
2663
+ content: string;
2664
+ slicedContent: string[];
2665
+ isButton?: boolean | undefined;
2666
+ font?: "defont" | "gulim" | "simsun" | undefined;
2667
+ width?: number[] | undefined;
2668
+ }) & {
2669
+ width: number[];
2670
+ }))[];
2671
+ MultiConfigItem: <T>(i: unknown) => i is MultiConfigItem<T>;
2672
+ HTML5Fonts: (i: unknown) => i is "defont" | "mincho" | "gothic";
2673
+ MeasureInput: (i: unknown) => i is {
2674
+ lineHeight: number;
2675
+ font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
2676
+ content: ({
2677
+ type: "spacer";
2678
+ char: string;
2679
+ charWidth: number;
2680
+ count: number;
2681
+ isButton?: boolean | undefined;
2682
+ font?: "defont" | "gulim" | "simsun" | undefined;
2683
+ } | {
2684
+ type: "text";
2685
+ content: string;
2686
+ slicedContent: string[];
2687
+ isButton?: boolean | undefined;
2688
+ font?: "defont" | "gulim" | "simsun" | undefined;
2689
+ width?: number[] | undefined;
2690
+ })[];
2691
+ charSize: number;
2692
+ lineCount: number;
2693
+ };
2694
+ };
2695
+ };
2696
+ static default: typeof NiconiComments;
2697
+ static FlashComment: {
2698
+ condition: (comment: {
2699
+ owner: boolean;
2700
+ content: string;
2701
+ id: number;
2702
+ vpos: number;
2703
+ date: number;
2704
+ date_usec: number;
2705
+ premium: boolean;
2706
+ mail: string[];
2707
+ user_id: number;
2708
+ layer: number;
2709
+ is_my_post: boolean;
2710
+ }) => boolean;
2711
+ class: typeof FlashComment;
2712
+ };
2713
+ static internal: typeof internal;
2714
+ constructor(renderer: IRenderer | HTMLCanvasElement, data: InputFormat, initOptions?: Options);
2715
+ private preRendering;
2716
+ private getCommentPos;
2717
+ private sortComment;
2718
+ addComments(...rawComments: FormattedComment[]): void;
2719
+ drawCanvas(vpos: number, forceRendering?: boolean, cursor?: Position): boolean;
2720
+ private _drawVideo;
2721
+ private _drawComments;
2722
+ private _drawCollision;
2723
+ private _drawFPS;
2724
+ private _drawCommentCount;
2725
+ addEventListener<K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]): void;
2726
+ removeEventListener<K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]): void;
2727
+ clear(): void;
2728
+ click(vpos: number, pos: Position): void;
2268
2729
  }
2269
2730
 
2270
- export { type ApiChat, type ApiGlobalNumRes, type ApiLeaf, type ApiPing, type ApiThread, type BaseConfig, type BaseOptions, type ButtonList, type ButtonParams, type ButtonPartLeft, type ButtonPartMiddle, type ButtonPartRight, type Canvas, type Collision, type CollisionItem, type CollisionPos, type CommentContentIndex, type CommentContentItem, type CommentContentItemText, type CommentDisableEvent, type CommentDisableEventHandler, type CommentEnableEvent, type CommentEnableEventHandler, type CommentEventBase, type CommentEventHandler, type CommentEventHandlerMap, type CommentEventMap, type CommentEventName, type CommentFlashFont, type CommentFlashFontParsed, type CommentFont, type CommentHTML5Font, type CommentLoc, type CommentMeasuredContentItem, type CommentSize, type CommentStageSize, type Config, type ConfigItem, type Context2D, type DefaultCommand, type FlashMode, type FlashScriptChar, type FontItem, type FormattedComment, type FormattedCommentWithFont, type FormattedCommentWithSize, type FormattedLegacyComment, type HTML5Fonts, type IComment, type IPlugin, type IPluginConstructor, type IPluginList, type IRenderer, type InputFormat, type InputFormatType, type JumpEvent, type JumpEventHandler, type MeasureInput, type MeasureTextInput, type MeasureTextResult, type MultiConfigItem, type NicoScript, type NicoScriptReplace, type NicoScriptReplaceCondition, type NicoScriptReplaceRange, type NicoScriptReplaceTarget, type NicoScriptReverseTarget, type Options, type OwnerComment, type ParseCommandAndNicoScriptResult, type ParseContentResult, type ParsedCommand, type Platform, type PlatformFont, type Position, type RawApiResponse, type SeekDisableEvent, type SeekDisableEventHandler, type SeekEnableEvent, type SeekEnableEventHandler, type Timeline, type V1Comment, type V1Thread, type ValueOf, ZApiChat, ZApiGlobalNumRes, ZApiLeaf, ZApiPing, ZApiThread, ZCommentContentItem, ZCommentContentItemSpacer, ZCommentContentItemText, ZCommentFlashFont, ZCommentFont, ZCommentHTML5Font, ZCommentLoc, ZCommentMeasuredContentItem, ZCommentMeasuredContentItemText, ZCommentSize, ZFormattedComment, ZFormattedLegacyComment, ZHTML5Fonts, ZMeasureInput, ZOwnerComment, ZRawApiResponse, ZV1Comment, ZV1Thread, NiconiComments as default, type formattedComment, type formattedLegacyComment, type inputFormat, type inputFormatType, type ownerComment, type rawApiResponse, type v1Thread };
2731
+ export {
2732
+ NiconiComments as default,
2733
+ };
2734
+
2735
+ export {};