@xpadev-net/niconicomments 0.2.62 → 0.2.64

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,1257 +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
- drawVideo(enableLegacyPip: boolean): void;
45
- getFont(): string;
46
- getFillStyle(): string | CanvasGradient | CanvasPattern;
47
- setScale(scale: number, arg1?: number): void;
48
- fillRect(x: number, y: number, width: number, height: number): void;
49
- strokeRect(x: number, y: number, width: number, height: number): void;
50
- fillText(text: string, x: number, y: number): void;
51
- strokeText(text: string, x: number, y: number): void;
52
- quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
53
- clearRect(x: number, y: number, width: number, height: number): void;
54
- setFont(font: string): void;
55
- setFillStyle(color: string): void;
56
- setStrokeStyle(color: string): void;
57
- setLineWidth(width: number): void;
58
- setGlobalAlpha(alpha: number): void;
59
- setSize(width: number, height: number): void;
60
- getSize(): {
61
- width: number;
62
- height: number;
63
- };
64
- measureText(text: string): TextMetrics;
65
- beginPath(): void;
66
- closePath(): void;
67
- moveTo(x: number, y: number): void;
68
- lineTo(x: number, y: number): void;
69
- stroke(): void;
70
- save(): void;
71
- restore(): void;
72
- getCanvas(): IRenderer;
73
- 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;
74
489
  }
75
-
76
490
  declare class BaseComment implements IComment {
77
- protected readonly renderer: IRenderer;
78
- protected cacheKey: string;
79
- comment: FormattedCommentWithSize;
80
- pos: {
81
- x: number;
82
- y: number;
83
- };
84
- posY: number;
85
- readonly pluginName: string;
86
- image?: IRenderer | null;
87
- buttonImage?: IRenderer | null;
88
- constructor(comment: FormattedComment, renderer: IRenderer);
89
- get invisible(): boolean;
90
- get loc(): "ue" | "naka" | "shita";
91
- get long(): number;
92
- get vpos(): number;
93
- get width(): number;
94
- get height(): number;
95
- get flash(): boolean;
96
- get layer(): number;
97
- get owner(): boolean;
98
- get mail(): string[];
99
- get content(): string;
100
- set content(_: string);
101
- protected getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
102
- protected parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
103
- protected parseContent(comment: string): ParseContentResult;
104
- protected measureText(comment: MeasureTextInput): MeasureTextResult;
105
- protected convertComment(comment: FormattedComment): FormattedCommentWithSize;
106
- draw(vpos: number, showCollision: boolean, cursor?: Position): void;
107
- protected _draw(posX: number, posY: number, cursor?: Position): void;
108
- protected _drawRectColor(posX: number, posY: number): void;
109
- protected _drawBackgroundColor(posX: number, posY: number): void;
110
- protected _drawDebugInfo(posX: number, posY: number): void;
111
- protected _drawCollision(posX: number, posY: number, showCollision: boolean): void;
112
- protected getTextImage(): IRenderer | null;
113
- protected _generateTextImage(): IRenderer;
114
- protected _cacheImage(image: IRenderer): void;
115
- protected getButtonImage(posX: number, posY: number, cursor?: Position): IRenderer | undefined;
116
- isHovered(cursor?: Position, posX?: number, posY?: number): boolean;
117
- 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;
118
532
  }
119
-
120
533
  declare class FlashComment extends BaseComment {
121
- private _globalScale;
122
- readonly pluginName: string;
123
- buttonImage: IRenderer;
124
- constructor(comment: FormattedComment, renderer: IRenderer);
125
- get content(): string;
126
- set content(input: string);
127
- convertComment(comment: FormattedComment): FormattedCommentWithSize;
128
- getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
129
- parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
130
- parseContent(input: string, button?: ButtonParams): {
131
- content: ({
132
- type: "spacer";
133
- char: string;
134
- charWidth: number;
135
- count: number;
136
- isButton?: boolean | undefined;
137
- font?: "defont" | "gulim" | "simsun" | undefined;
138
- } | {
139
- type: "text";
140
- content: string;
141
- slicedContent: string[];
142
- isButton?: boolean | undefined;
143
- font?: "defont" | "gulim" | "simsun" | undefined;
144
- width?: number[] | undefined;
145
- })[];
146
- lineCount: number;
147
- lineOffset: number;
148
- };
149
- measureText(comment: MeasureTextInput): MeasureTextResult;
150
- private _isDoubleResize;
151
- private _measureContent;
152
- _drawCollision(posX: number, posY: number, showCollision: boolean): void;
153
- _generateTextImage(): IRenderer;
154
- getButtonImage(posX: number, posY: number, cursor?: Position): IRenderer | undefined;
155
- isHovered(_cursor?: Position, _posX?: number, _posY?: number): boolean;
156
- protected _setupCanvas(renderer: IRenderer): {
157
- renderer: IRenderer;
158
- };
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
+ };
159
572
  }
160
-
161
573
  declare class HTML5Comment extends BaseComment {
162
- readonly pluginName: string;
163
- constructor(comment: FormattedComment, context: IRenderer);
164
- get content(): string;
165
- set content(input: string);
166
- convertComment(comment: FormattedComment): FormattedCommentWithSize;
167
- getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
168
- parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
169
- parseContent(input: string, font?: HTML5Fonts): {
170
- content: {
171
- type: "text";
172
- content: string;
173
- slicedContent: string[];
174
- isButton?: boolean | undefined;
175
- font?: "defont" | "gulim" | "simsun" | undefined;
176
- width?: number[] | undefined;
177
- }[];
178
- lineCount: number;
179
- lineOffset: number;
180
- };
181
- measureText(comment: MeasureTextInput): MeasureTextResult;
182
- private _measureComment;
183
- private _processResizeX;
184
- _drawCollision(posX: number, posY: number, showCollision: boolean): void;
185
- _generateTextImage(): IRenderer;
186
- getButtonImage(): undefined;
187
- 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;
188
600
  }
189
-
190
- type index_d$4_BaseComment = BaseComment;
601
+ export type index_d$4_BaseComment = BaseComment;
191
602
  declare const index_d$4_BaseComment: typeof BaseComment;
192
- type index_d$4_FlashComment = FlashComment;
603
+ export type index_d$4_FlashComment = FlashComment;
193
604
  declare const index_d$4_FlashComment: typeof FlashComment;
194
- type index_d$4_HTML5Comment = HTML5Comment;
605
+ export type index_d$4_HTML5Comment = HTML5Comment;
195
606
  declare const index_d$4_HTML5Comment: typeof HTML5Comment;
196
607
  declare namespace index_d$4 {
197
- 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 };
198
609
  }
199
-
200
- type ConfigItem<T> = T | MultiConfigItem<T>;
201
- type MultiConfigItem<T> = {
202
- html5: T;
203
- flash: T;
204
- };
205
- type ConfigSizeItem<T> = {
206
- big: T;
207
- medium: T;
208
- small: T;
209
- };
210
- type ConfigResizedItem<T> = {
211
- default: T;
212
- resized: T;
213
- };
214
- type ConfigFlashFontItem<T> = {
215
- gulim: T;
216
- simsun: T;
217
- defont: T;
218
- };
219
- type ConfigHTML5FontItem<T> = {
220
- gothic: T;
221
- mincho: T;
222
- defont: T;
223
- };
224
- type CommentStageSize = {
225
- width: number;
226
- fullWidth: number;
227
- height: number;
228
- };
229
- type FlashCharList = {
230
- [key in "simsunStrong" | "simsunWeak" | "gulim" | "gothic"]: string;
231
- };
232
- type FlashMode = "xp" | "vista";
233
- type FlashScriptChar = {
234
- [key in "super" | "sub"]: string;
235
- };
236
- type FontList = {
237
- [key in "gulim" | "simsun"]: string;
238
- };
239
- type LineCounts = {
240
- [key in "default" | "resized" | "doubleResized"]: ConfigSizeItem<number>;
241
- };
242
- type BaseConfig = {
243
- cacheAge: number;
244
- canvasHeight: number;
245
- canvasWidth: number;
246
- collisionRange: {
247
- [key in "left" | "right"]: number;
248
- };
249
- collisionPadding: number;
250
- colors: {
251
- [key: string]: string;
252
- };
253
- commentDrawPadding: number;
254
- commentDrawRange: number;
255
- commentScale: ConfigItem<number>;
256
- commentStageSize: ConfigItem<CommentStageSize>;
257
- flashCommentYOffset: ConfigSizeItem<ConfigResizedItem<number>>;
258
- flashCommentYPaddingTop: ConfigResizedItem<number>;
259
- contextFillLiveOpacity: number;
260
- contextLineWidth: ConfigItem<number>;
261
- contextStrokeColor: string;
262
- contextStrokeInversionColor: string;
263
- contextStrokeOpacity: number;
264
- flashChar: FlashCharList;
265
- flashMode: FlashMode;
266
- flashScriptChar: FlashScriptChar;
267
- flashThreshold: number;
268
- fonts: {
269
- flash: FontList;
270
- html5: PlatformFont;
271
- };
272
- fontSize: ConfigItem<ConfigSizeItem<ConfigResizedItem<number>>>;
273
- fpsInterval: number;
274
- html5HiResCommentCorrection: number;
275
- html5LineCounts: ConfigItem<LineCounts>;
276
- lineHeight: ConfigItem<ConfigSizeItem<ConfigResizedItem<number>>>;
277
- html5MinFontSize: number;
278
- sameCAGap: number;
279
- sameCAMinScore: number;
280
- sameCARange: number;
281
- sameCATimestampRange: number;
282
- flashLetterSpacing: number;
283
- flashScriptCharOffset: number;
284
- plugins: IPluginConstructor[];
285
- commentPlugins: {
286
- class: typeof BaseComment;
287
- condition: (comment: FormattedComment) => boolean;
288
- }[];
289
- commentLimit: number | undefined;
290
- hideCommentOrder: "asc" | "desc";
291
- lineBreakCount: {
292
- [key in CommentSize]: number;
293
- };
294
- nakaCommentSpeedOffset: number;
295
- atButtonPadding: number;
296
- atButtonRadius: number;
297
- flashDoubleResizeHeights: Partial<ConfigSizeItem<{
298
- [key: number]: number;
299
- }>>;
300
- flashLineBreakScale: ConfigSizeItem<number>;
301
- compatSpacer: {
302
- flash: {
303
- [key: string]: Partial<ConfigFlashFontItem<number>>;
304
- };
305
- html5: {
306
- [key: string]: Partial<ConfigHTML5FontItem<number>>;
307
- };
308
- };
309
- };
310
- type Config = Partial<BaseConfig>;
311
-
312
- type Position = {
313
- x: number;
314
- y: number;
610
+ export type ConfigItem<T> = T | MultiConfigItem<T>;
611
+ export type MultiConfigItem<T> = {
612
+ html5: T;
613
+ flash: T;
315
614
  };
316
-
317
- interface CommentEventBase {
318
- type: CommentEventName;
319
- timeStamp: number;
320
- 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;
321
729
  }
322
- interface SeekDisableEvent extends CommentEventBase {
323
- type: "seekDisable";
730
+ export interface SeekDisableEvent extends CommentEventBase {
731
+ type: "seekDisable";
324
732
  }
325
- type SeekDisableEventHandler = (event: SeekDisableEvent) => unknown;
326
- interface SeekEnableEvent extends CommentEventBase {
327
- type: "seekEnable";
733
+ export type SeekDisableEventHandler = (event: SeekDisableEvent) => unknown;
734
+ export interface SeekEnableEvent extends CommentEventBase {
735
+ type: "seekEnable";
328
736
  }
329
- type SeekEnableEventHandler = (event: SeekEnableEvent) => unknown;
330
- interface CommentDisableEvent extends CommentEventBase {
331
- type: "commentDisable";
737
+ export type SeekEnableEventHandler = (event: SeekEnableEvent) => unknown;
738
+ export interface CommentDisableEvent extends CommentEventBase {
739
+ type: "commentDisable";
332
740
  }
333
- type CommentDisableEventHandler = (event: CommentDisableEvent) => unknown;
334
- interface CommentEnableEvent extends CommentEventBase {
335
- type: "commentEnable";
741
+ export type CommentDisableEventHandler = (event: CommentDisableEvent) => unknown;
742
+ export interface CommentEnableEvent extends CommentEventBase {
743
+ type: "commentEnable";
336
744
  }
337
- type CommentEnableEventHandler = (event: CommentEnableEvent) => unknown;
338
- interface JumpEvent extends CommentEventBase {
339
- type: "jump";
340
- to: string;
341
- message?: string;
745
+ export type CommentEnableEventHandler = (event: CommentEnableEvent) => unknown;
746
+ export interface JumpEvent extends CommentEventBase {
747
+ type: "jump";
748
+ to: string;
749
+ message?: string;
342
750
  }
343
- type JumpEventHandler = (event: JumpEvent) => unknown;
344
- type CommentEventName = "seekDisable" | "seekEnable" | "commentDisable" | "commentEnable" | "jump";
345
- type CommentEventHandler = SeekDisableEventHandler | SeekEnableEventHandler | CommentDisableEventHandler | CommentEnableEventHandler | JumpEventHandler;
346
- interface CommentEventHandlerMap {
347
- seekDisable: SeekDisableEventHandler;
348
- seekEnable: SeekEnableEventHandler;
349
- commentDisable: CommentDisableEventHandler;
350
- commentEnable: CommentEnableEventHandler;
351
- 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;
352
760
  }
353
- interface CommentEventMap {
354
- seekDisable: SeekDisableEvent;
355
- seekEnable: SeekEnableEvent;
356
- commentDisable: CommentDisableEvent;
357
- commentEnable: CommentEnableEvent;
358
- jump: JumpEvent;
761
+ export interface CommentEventMap {
762
+ seekDisable: SeekDisableEvent;
763
+ seekEnable: SeekEnableEvent;
764
+ commentDisable: CommentDisableEvent;
765
+ commentEnable: CommentEnableEvent;
766
+ jump: JumpEvent;
359
767
  }
360
-
361
- type Platform = "win7" | "win8_1" | "win" | "mac10_9" | "mac10_11" | "mac" | "other";
362
- declare const ZHTML5Fonts: valibot.UnionSchema<[valibot.LiteralSchema<"gothic", "gothic">, valibot.LiteralSchema<"mincho", "mincho">, valibot.LiteralSchema<"defont", "defont">], "defont" | "mincho" | "gothic">;
363
- type HTML5Fonts = Output<typeof ZHTML5Fonts>;
364
- type FontItem = {
365
- font: string;
366
- offset: number;
367
- 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;
368
779
  };
369
- type PlatformFont = {
370
- [key in HTML5Fonts]: FontItem;
780
+ export type PlatformFont = {
781
+ [key in HTML5Fonts]: FontItem;
371
782
  };
372
-
373
- declare const ZFormattedComment: valibot.ObjectSchema<{
374
- id: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
375
- vpos: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
376
- content: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
377
- date: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
378
- date_usec: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
379
- owner: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
380
- premium: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
381
- mail: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<string>, string[]>, never[], string[]>;
382
- user_id: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
383
- layer: valibot.OptionalSchema<valibot.NumberSchema<number>, -1, number>;
384
- 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>;
385
795
  }, undefined, {
386
- owner: boolean;
387
- content: string;
388
- vpos: number;
389
- date: number;
390
- id: number;
391
- date_usec: number;
392
- premium: boolean;
393
- mail: string[];
394
- user_id: number;
395
- layer: number;
396
- 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;
397
807
  }>;
398
- type FormattedComment = Output<typeof ZFormattedComment>;
399
- declare const ZFormattedLegacyComment: valibot.ObjectSchema<Omit<{
400
- id: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
401
- vpos: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
402
- content: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
403
- date: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
404
- date_usec: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
405
- owner: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
406
- premium: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, false, boolean>;
407
- mail: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<string>, string[]>, never[], string[]>;
408
- user_id: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
409
- layer: valibot.OptionalSchema<valibot.NumberSchema<number>, -1, number>;
410
- 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>;
411
821
  }, "user_id" | "layer" | "is_my_post">, undefined, {
412
- owner: boolean;
413
- content: string;
414
- vpos: number;
415
- date: number;
416
- id: number;
417
- date_usec: number;
418
- premium: boolean;
419
- 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[];
420
830
  }>;
421
- type FormattedLegacyComment = Output<typeof ZFormattedLegacyComment>;
422
- type formattedComment = FormattedComment;
423
- type formattedLegacyComment = FormattedLegacyComment;
424
-
425
- declare const ZApiChat: valibot.ObjectSchema<{
426
- thread: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
427
- no: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
428
- vpos: valibot.NumberSchema<number>;
429
- date: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
430
- date_usec: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
431
- nicoru: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
432
- premium: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
433
- anonymity: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
434
- user_id: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
435
- mail: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
436
- content: valibot.StringSchema<string>;
437
- 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>;
438
847
  }, undefined, {
439
- content: string;
440
- vpos: number;
441
- date: number;
442
- date_usec: number;
443
- premium: number;
444
- mail: string;
445
- user_id: string;
446
- thread: string;
447
- no: number;
448
- nicoru: number;
449
- anonymity: number;
450
- 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;
451
860
  }>;
452
- type ApiChat = Output<typeof ZApiChat>;
453
- declare const ZRawApiResponse: valibot.UnionSchema<[valibot.ObjectSchema<{
454
- chat: valibot.ObjectSchema<{
455
- thread: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
456
- no: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
457
- vpos: valibot.NumberSchema<number>;
458
- date: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
459
- date_usec: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
460
- nicoru: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
461
- premium: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
462
- anonymity: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
463
- user_id: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
464
- mail: valibot.OptionalSchema<valibot.StringSchema<string>, "", string>;
465
- content: valibot.StringSchema<string>;
466
- deleted: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
467
- }, undefined, {
468
- content: string;
469
- vpos: number;
470
- date: number;
471
- date_usec: number;
472
- premium: number;
473
- mail: string;
474
- user_id: string;
475
- thread: string;
476
- no: number;
477
- nicoru: number;
478
- anonymity: number;
479
- deleted: number;
480
- }>;
481
- }, undefined, {
482
- chat: {
483
- content: string;
484
- vpos: number;
485
- date: number;
486
- date_usec: number;
487
- premium: number;
488
- mail: string;
489
- user_id: string;
490
- thread: string;
491
- no: number;
492
- nicoru: number;
493
- anonymity: number;
494
- deleted: number;
495
- };
496
- }>, valibot.RecordSchema<valibot.StringSchema<string>, valibot.UnknownSchema<unknown>, {
497
- [x: string]: unknown;
498
- }>], {
499
- chat: {
500
- content: string;
501
- vpos: number;
502
- date: number;
503
- date_usec: number;
504
- premium: number;
505
- mail: string;
506
- user_id: string;
507
- thread: string;
508
- no: number;
509
- nicoru: number;
510
- anonymity: number;
511
- deleted: number;
512
- };
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
+ };
513
925
  } | {
514
- [x: string]: unknown;
926
+ [x: string]: unknown;
515
927
  }>;
516
- type RawApiResponse = Output<typeof ZRawApiResponse>;
517
- declare const ZApiPing: valibot.ObjectSchema<{
518
- content: valibot.StringSchema<string>;
928
+ export type RawApiResponse = Output<typeof ZRawApiResponse>;
929
+ export declare const ZApiPing: ObjectSchema<{
930
+ content: StringSchema<string>;
519
931
  }, undefined, {
520
- content: string;
932
+ content: string;
521
933
  }>;
522
- type ApiPing = Output<typeof ZApiPing>;
523
- declare const ZApiThread: valibot.ObjectSchema<{
524
- resultcode: valibot.NumberSchema<number>;
525
- thread: valibot.StringSchema<string>;
526
- server_time: valibot.NumberSchema<number>;
527
- ticket: valibot.StringSchema<string>;
528
- 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>;
529
941
  }, undefined, {
530
- thread: string;
531
- resultcode: number;
532
- server_time: number;
533
- ticket: string;
534
- revision: number;
942
+ thread: string;
943
+ resultcode: number;
944
+ server_time: number;
945
+ ticket: string;
946
+ revision: number;
535
947
  }>;
536
- type ApiThread = Output<typeof ZApiThread>;
537
- declare const ZApiLeaf: valibot.ObjectSchema<{
538
- thread: valibot.StringSchema<string>;
539
- 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>;
540
952
  }, undefined, {
541
- count: number;
542
- thread: string;
953
+ count: number;
954
+ thread: string;
543
955
  }>;
544
- type ApiLeaf = Output<typeof ZApiLeaf>;
545
- declare const ZApiGlobalNumRes: valibot.ObjectSchema<{
546
- thread: valibot.StringSchema<string>;
547
- 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>;
548
960
  }, undefined, {
549
- thread: string;
550
- num_res: number;
961
+ thread: string;
962
+ num_res: number;
551
963
  }>;
552
- type ApiGlobalNumRes = Output<typeof ZApiGlobalNumRes>;
553
- type rawApiResponse = RawApiResponse;
554
-
555
- declare const ZOwnerComment: valibot.ObjectSchema<{
556
- time: valibot.StringSchema<string>;
557
- command: valibot.StringSchema<string>;
558
- 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>;
559
970
  }, undefined, {
560
- time: string;
561
- command: string;
562
- comment: string;
971
+ time: string;
972
+ command: string;
973
+ comment: string;
563
974
  }>;
564
- type OwnerComment = Output<typeof ZOwnerComment>;
565
- type ownerComment = OwnerComment;
566
-
567
- declare const ZV1Comment: valibot.ObjectSchema<{
568
- id: valibot.StringSchema<string>;
569
- no: valibot.NumberSchema<number>;
570
- vposMs: valibot.NumberSchema<number>;
571
- body: valibot.StringSchema<string>;
572
- commands: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
573
- userId: valibot.StringSchema<string>;
574
- isPremium: valibot.BooleanSchema<boolean>;
575
- score: valibot.NumberSchema<number>;
576
- postedAt: valibot.StringSchema<string>;
577
- nicoruCount: valibot.NumberSchema<number>;
578
- nicoruId: valibot.NullableSchema<valibot.StringSchema<string>, undefined, string | null>;
579
- source: valibot.StringSchema<string>;
580
- 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>;
581
991
  }, undefined, {
582
- id: string;
583
- no: number;
584
- vposMs: number;
585
- body: string;
586
- commands: string[];
587
- userId: string;
588
- isPremium: boolean;
589
- score: number;
590
- postedAt: string;
591
- nicoruCount: number;
592
- nicoruId: string | null;
593
- source: string;
594
- 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;
595
1005
  }>;
596
- type V1Comment = Output<typeof ZV1Comment>;
597
- declare const ZV1Thread: valibot.ObjectSchema<{
598
- id: valibot.UnknownSchema<unknown>;
599
- fork: valibot.StringSchema<string>;
600
- commentCount: valibot.OptionalSchema<valibot.NumberSchema<number>, 0, number>;
601
- comments: valibot.ArraySchema<valibot.ObjectSchema<{
602
- id: valibot.StringSchema<string>;
603
- no: valibot.NumberSchema<number>;
604
- vposMs: valibot.NumberSchema<number>;
605
- body: valibot.StringSchema<string>;
606
- commands: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
607
- userId: valibot.StringSchema<string>;
608
- isPremium: valibot.BooleanSchema<boolean>;
609
- score: valibot.NumberSchema<number>;
610
- postedAt: valibot.StringSchema<string>;
611
- nicoruCount: valibot.NumberSchema<number>;
612
- nicoruId: valibot.NullableSchema<valibot.StringSchema<string>, undefined, string | null>;
613
- source: valibot.StringSchema<string>;
614
- isMyPost: valibot.BooleanSchema<boolean>;
615
- }, undefined, {
616
- id: string;
617
- no: number;
618
- vposMs: number;
619
- body: string;
620
- commands: string[];
621
- userId: string;
622
- isPremium: boolean;
623
- score: number;
624
- postedAt: string;
625
- nicoruCount: number;
626
- nicoruId: string | null;
627
- source: string;
628
- isMyPost: boolean;
629
- }>, {
630
- id: string;
631
- no: number;
632
- vposMs: number;
633
- body: string;
634
- commands: string[];
635
- userId: string;
636
- isPremium: boolean;
637
- score: number;
638
- postedAt: string;
639
- nicoruCount: number;
640
- nicoruId: string | null;
641
- source: string;
642
- isMyPost: boolean;
643
- }[]>;
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
+ }[]>;
644
1054
  }, undefined, {
645
- fork: string;
646
- commentCount: number;
647
- comments: {
648
- id: string;
649
- no: number;
650
- vposMs: number;
651
- body: string;
652
- commands: string[];
653
- userId: string;
654
- isPremium: boolean;
655
- score: number;
656
- postedAt: string;
657
- nicoruCount: number;
658
- nicoruId: string | null;
659
- source: string;
660
- isMyPost: boolean;
661
- }[];
662
- 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;
663
1073
  }>;
664
- type V1Thread = Output<typeof ZV1Thread>;
665
- type v1Thread = V1Thread;
666
-
667
- interface IComment {
668
- comment: FormattedCommentWithSize;
669
- invisible: boolean;
670
- loc: CommentLoc;
671
- width: number;
672
- long: number;
673
- height: number;
674
- vpos: number;
675
- flash: boolean;
676
- posY: number;
677
- owner: boolean;
678
- layer: number;
679
- mail: string[];
680
- content: string;
681
- image?: IRenderer | null;
682
- draw: (vpos: number, showCollision: boolean, cursor?: Position) => void;
683
- 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;
684
1093
  }
685
-
686
- interface IPluginConstructor {
687
- id: string;
688
- new (Canvas: IRenderer, comments: IComment[]): IPlugin;
1094
+ export interface IPluginConstructor {
1095
+ id: string;
1096
+ new (Canvas: IRenderer, comments: IComment[]): IPlugin;
689
1097
  }
690
- interface IPlugin {
691
- draw?: (vpos: number) => void;
692
- addComments?: (comments: IComment[]) => void;
693
- transformComments?: (comments: IComment[]) => IComment[];
1098
+ export interface IPlugin {
1099
+ draw?: (vpos: number) => void;
1100
+ addComments?: (comments: IComment[]) => void;
1101
+ transformComments?: (comments: IComment[]) => IComment[];
694
1102
  }
695
- type IPluginList = {
696
- instance: IPlugin;
697
- canvas: IRenderer;
1103
+ export type IPluginList = {
1104
+ instance: IPlugin;
1105
+ canvas: IRenderer;
698
1106
  }[];
699
-
700
- type InputFormatType = "XMLDocument" | "niconicome" | "formatted" | "legacy" | "legacyOwner" | "owner" | "v1" | "empty" | "default";
701
- type InputFormat = XMLDocument | FormattedComment[] | FormattedLegacyComment[] | RawApiResponse[] | OwnerComment[] | V1Thread[] | string | undefined;
702
- type ModeType = "default" | "html5" | "flash";
703
- type BaseOptions = {
704
- config: Config;
705
- debug: boolean;
706
- enableLegacyPiP: boolean;
707
- format: InputFormatType;
708
- formatted: boolean;
709
- keepCA: boolean;
710
- mode: ModeType;
711
- scale: number;
712
- showCollision: boolean;
713
- showCommentCount: boolean;
714
- showFPS: boolean;
715
- useLegacy: boolean;
716
- video: HTMLVideoElement | undefined;
717
- };
718
- type Options = Partial<BaseOptions>;
719
- type inputFormatType = InputFormatType;
720
- type inputFormat = InputFormat;
721
-
722
- type FormattedCommentWithFont = {
723
- id: number;
724
- vpos: number;
725
- date: number;
726
- date_usec: number;
727
- owner: boolean;
728
- premium: boolean;
729
- mail: string[];
730
- user_id: number;
731
- layer: number;
732
- loc: CommentLoc;
733
- size: CommentSize;
734
- fontSize: number;
735
- font: CommentFont;
736
- color: string;
737
- strokeColor?: string;
738
- wakuColor?: string;
739
- fillColor?: string;
740
- full: boolean;
741
- ender: boolean;
742
- _live: boolean;
743
- long: number;
744
- invisible: boolean;
745
- content: CommentContentItem[];
746
- rawContent: string;
747
- flash: boolean;
748
- lineCount: number;
749
- lineOffset: number;
750
- is_my_post: boolean;
751
- button?: ButtonParams;
752
- };
753
- type FormattedCommentWithSize = FormattedCommentWithFont & {
754
- height: number;
755
- width: number;
756
- lineHeight: number;
757
- resized: boolean;
758
- resizedX: boolean;
759
- resizedY: boolean;
760
- content: CommentMeasuredContentItem[];
761
- charSize: number;
762
- scale: number;
763
- scaleX: number;
764
- buttonObjects?: ButtonList;
765
- };
766
- type ParseContentResult = {
767
- content: CommentContentItem[];
768
- lineCount: number;
769
- lineOffset: number;
770
- };
771
- type ParseCommandAndNicoScriptResult = {
772
- flash: boolean;
773
- loc: CommentLoc;
774
- size: CommentSize;
775
- fontSize: number;
776
- color: string;
777
- strokeColor?: string;
778
- wakuColor?: string;
779
- fillColor?: string;
780
- font: CommentFont;
781
- full: boolean;
782
- ender: boolean;
783
- _live: boolean;
784
- invisible: boolean;
785
- long: number;
786
- button?: ButtonParams;
787
- };
788
- 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">;
789
- type CommentFont = Output<typeof ZCommentFont>;
790
- declare const ZCommentHTML5Font: valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"mincho", "mincho">, valibot.LiteralSchema<"gothic", "gothic">], "defont" | "mincho" | "gothic">;
791
- type CommentHTML5Font = Output<typeof ZCommentHTML5Font>;
792
- declare const ZCommentFlashFont: valibot.UnionSchema<[valibot.LiteralSchema<"defont", "defont">, valibot.LiteralSchema<"gulim", "gulim">, valibot.LiteralSchema<"simsun", "simsun">], "defont" | "gulim" | "simsun">;
793
- type CommentFlashFont = Output<typeof ZCommentFlashFont>;
794
- declare const ZCommentContentItemSpacer: valibot.ObjectSchema<{
795
- type: valibot.LiteralSchema<"spacer", "spacer">;
796
- char: valibot.StringSchema<string>;
797
- charWidth: valibot.NumberSchema<number>;
798
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
799
- 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>;
800
- 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>;
801
1225
  }, undefined, {
802
- type: "spacer";
803
- char: string;
804
- charWidth: number;
805
- count: number;
806
- isButton?: boolean | undefined;
807
- 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;
808
1232
  }>;
809
- declare const ZCommentContentItemText: valibot.ObjectSchema<{
810
- type: valibot.LiteralSchema<"text", "text">;
811
- content: valibot.StringSchema<string>;
812
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
813
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
814
- 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>;
815
- 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>;
816
1244
  }, undefined, {
817
- type: "text";
818
- content: string;
819
- slicedContent: string[];
820
- isButton?: boolean | undefined;
821
- font?: "defont" | "gulim" | "simsun" | undefined;
822
- 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;
823
1251
  }>;
824
- type CommentContentItemText = Output<typeof ZCommentContentItemText>;
825
- declare const ZCommentContentItem: valibot.UnionSchema<[valibot.ObjectSchema<{
826
- type: valibot.LiteralSchema<"spacer", "spacer">;
827
- char: valibot.StringSchema<string>;
828
- charWidth: valibot.NumberSchema<number>;
829
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
830
- 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>;
831
- count: valibot.NumberSchema<number>;
832
- }, undefined, {
833
- type: "spacer";
834
- char: string;
835
- charWidth: number;
836
- count: number;
837
- isButton?: boolean | undefined;
838
- font?: "defont" | "gulim" | "simsun" | undefined;
839
- }>, valibot.ObjectSchema<{
840
- type: valibot.LiteralSchema<"text", "text">;
841
- content: valibot.StringSchema<string>;
842
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
843
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
844
- 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>;
845
- width: valibot.OptionalSchema<valibot.ArraySchema<valibot.NumberSchema<number>, number[]>, undefined, number[] | undefined>;
846
- }, undefined, {
847
- type: "text";
848
- content: string;
849
- slicedContent: string[];
850
- isButton?: boolean | undefined;
851
- font?: "defont" | "gulim" | "simsun" | undefined;
852
- width?: number[] | undefined;
853
- }>], {
854
- type: "spacer";
855
- char: string;
856
- charWidth: number;
857
- count: number;
858
- isButton?: boolean | undefined;
859
- 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;
860
1299
  } | {
861
- type: "text";
862
- content: string;
863
- slicedContent: string[];
864
- isButton?: boolean | undefined;
865
- font?: "defont" | "gulim" | "simsun" | undefined;
866
- 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;
867
1306
  }>;
868
- type CommentContentItem = Output<typeof ZCommentContentItem>;
869
- declare const ZCommentMeasuredContentItemText: valibot.IntersectSchema<[valibot.UnionSchema<[valibot.ObjectSchema<{
870
- type: valibot.LiteralSchema<"spacer", "spacer">;
871
- char: valibot.StringSchema<string>;
872
- charWidth: valibot.NumberSchema<number>;
873
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
874
- 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>;
875
- count: valibot.NumberSchema<number>;
876
- }, undefined, {
877
- type: "spacer";
878
- char: string;
879
- charWidth: number;
880
- count: number;
881
- isButton?: boolean | undefined;
882
- font?: "defont" | "gulim" | "simsun" | undefined;
883
- }>, valibot.ObjectSchema<{
884
- type: valibot.LiteralSchema<"text", "text">;
885
- content: valibot.StringSchema<string>;
886
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
887
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
888
- 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>;
889
- width: valibot.OptionalSchema<valibot.ArraySchema<valibot.NumberSchema<number>, number[]>, undefined, number[] | undefined>;
890
- }, undefined, {
891
- type: "text";
892
- content: string;
893
- slicedContent: string[];
894
- isButton?: boolean | undefined;
895
- font?: "defont" | "gulim" | "simsun" | undefined;
896
- width?: number[] | undefined;
897
- }>], {
898
- type: "spacer";
899
- char: string;
900
- charWidth: number;
901
- count: number;
902
- isButton?: boolean | undefined;
903
- font?: "defont" | "gulim" | "simsun" | undefined;
904
- } | {
905
- type: "text";
906
- content: string;
907
- slicedContent: string[];
908
- isButton?: boolean | undefined;
909
- font?: "defont" | "gulim" | "simsun" | undefined;
910
- width?: number[] | undefined;
911
- }>, valibot.ObjectSchema<{
912
- width: valibot.ArraySchema<valibot.NumberSchema<number>, number[]>;
913
- }, undefined, {
914
- width: number[];
915
- }>], ({
916
- type: "spacer";
917
- char: string;
918
- charWidth: number;
919
- count: number;
920
- isButton?: boolean | undefined;
921
- 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;
922
1375
  } | {
923
- type: "text";
924
- content: string;
925
- slicedContent: string[];
926
- isButton?: boolean | undefined;
927
- font?: "defont" | "gulim" | "simsun" | undefined;
928
- 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;
929
1382
  }) & {
930
- width: number[];
1383
+ width: number[];
931
1384
  }>;
932
- declare const ZCommentMeasuredContentItem: valibot.UnionSchema<[valibot.IntersectSchema<[valibot.UnionSchema<[valibot.ObjectSchema<{
933
- type: valibot.LiteralSchema<"spacer", "spacer">;
934
- char: valibot.StringSchema<string>;
935
- charWidth: valibot.NumberSchema<number>;
936
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
937
- 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>;
938
- count: valibot.NumberSchema<number>;
939
- }, undefined, {
940
- type: "spacer";
941
- char: string;
942
- charWidth: number;
943
- count: number;
944
- isButton?: boolean | undefined;
945
- font?: "defont" | "gulim" | "simsun" | undefined;
946
- }>, valibot.ObjectSchema<{
947
- type: valibot.LiteralSchema<"text", "text">;
948
- content: valibot.StringSchema<string>;
949
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
950
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
951
- 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>;
952
- width: valibot.OptionalSchema<valibot.ArraySchema<valibot.NumberSchema<number>, number[]>, undefined, number[] | undefined>;
953
- }, undefined, {
954
- type: "text";
955
- content: string;
956
- slicedContent: string[];
957
- isButton?: boolean | undefined;
958
- font?: "defont" | "gulim" | "simsun" | undefined;
959
- width?: number[] | undefined;
960
- }>], {
961
- type: "spacer";
962
- char: string;
963
- charWidth: number;
964
- count: number;
965
- isButton?: boolean | undefined;
966
- font?: "defont" | "gulim" | "simsun" | undefined;
967
- } | {
968
- type: "text";
969
- content: string;
970
- slicedContent: string[];
971
- isButton?: boolean | undefined;
972
- font?: "defont" | "gulim" | "simsun" | undefined;
973
- width?: number[] | undefined;
974
- }>, valibot.ObjectSchema<{
975
- width: valibot.ArraySchema<valibot.NumberSchema<number>, number[]>;
976
- }, undefined, {
977
- width: number[];
978
- }>], ({
979
- type: "spacer";
980
- char: string;
981
- charWidth: number;
982
- count: number;
983
- isButton?: boolean | undefined;
984
- font?: "defont" | "gulim" | "simsun" | undefined;
985
- } | {
986
- type: "text";
987
- content: string;
988
- slicedContent: string[];
989
- isButton?: boolean | undefined;
990
- font?: "defont" | "gulim" | "simsun" | undefined;
991
- width?: number[] | undefined;
992
- }) & {
993
- width: number[];
994
- }>, valibot.ObjectSchema<{
995
- type: valibot.LiteralSchema<"spacer", "spacer">;
996
- char: valibot.StringSchema<string>;
997
- charWidth: valibot.NumberSchema<number>;
998
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
999
- 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>;
1000
- count: valibot.NumberSchema<number>;
1001
- }, undefined, {
1002
- type: "spacer";
1003
- char: string;
1004
- charWidth: number;
1005
- count: number;
1006
- isButton?: boolean | undefined;
1007
- font?: "defont" | "gulim" | "simsun" | undefined;
1008
- }>], {
1009
- type: "spacer";
1010
- char: string;
1011
- charWidth: number;
1012
- count: number;
1013
- isButton?: boolean | undefined;
1014
- 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;
1015
1489
  } | (({
1016
- type: "spacer";
1017
- char: string;
1018
- charWidth: number;
1019
- count: number;
1020
- isButton?: boolean | undefined;
1021
- 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;
1022
1496
  } | {
1023
- type: "text";
1024
- content: string;
1025
- slicedContent: string[];
1026
- isButton?: boolean | undefined;
1027
- font?: "defont" | "gulim" | "simsun" | undefined;
1028
- 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;
1029
1503
  }) & {
1030
- width: number[];
1504
+ width: number[];
1031
1505
  })>;
1032
- type CommentMeasuredContentItem = Output<typeof ZCommentMeasuredContentItem>;
1033
- type CommentFlashFontParsed = "gothic" | "gulim" | "simsunStrong" | "simsunWeak";
1034
- type CommentContentIndex = {
1035
- index: number;
1036
- font: CommentFlashFontParsed;
1037
- };
1038
- declare const ZCommentSize: valibot.UnionSchema<[valibot.LiteralSchema<"big", "big">, valibot.LiteralSchema<"medium", "medium">, valibot.LiteralSchema<"small", "small">], "big" | "medium" | "small">;
1039
- type CommentSize = Output<typeof ZCommentSize>;
1040
- declare const ZCommentLoc: valibot.UnionSchema<[valibot.LiteralSchema<"ue", "ue">, valibot.LiteralSchema<"naka", "naka">, valibot.LiteralSchema<"shita", "shita">], "ue" | "naka" | "shita">;
1041
- type CommentLoc = Output<typeof ZCommentLoc>;
1042
- type Collision = {
1043
- [key in CollisionPos]: CollisionItem;
1044
- };
1045
- type Timeline = {
1046
- [key: number]: IComment[];
1047
- };
1048
- type CollisionPos = "ue" | "shita" | "right" | "left";
1049
- type CollisionItem = {
1050
- [p: number]: IComment[];
1051
- };
1052
- type NicoScript = {
1053
- reverse: NicoScriptReverse[];
1054
- ban: NicoScriptBan[];
1055
- default: NicoScriptDefault[];
1056
- replace: NicoScriptReplace[];
1057
- seekDisable: NicoScriptSeekDisable[];
1058
- jump: NicoScriptJump[];
1059
- };
1060
- type NicoScriptSeekDisable = {
1061
- start: number;
1062
- end: number;
1063
- };
1064
- type NicoScriptJump = {
1065
- start: number;
1066
- end?: number;
1067
- to: string;
1068
- message?: string;
1069
- };
1070
- type NicoScriptReverse = {
1071
- target: NicoScriptReverseTarget;
1072
- start: number;
1073
- end: number;
1074
- };
1075
- type NicoScriptReverseTarget = "コメ" | "投コメ" | "全";
1076
- type NicoScriptReplace = {
1077
- start: number;
1078
- long: number | undefined;
1079
- keyword: string;
1080
- replace: string;
1081
- range: NicoScriptReplaceRange;
1082
- target: NicoScriptReplaceTarget;
1083
- condition: NicoScriptReplaceCondition;
1084
- color: string | undefined;
1085
- size: CommentSize | undefined;
1086
- font: CommentFont | undefined;
1087
- loc: CommentLoc | undefined;
1088
- no: number;
1089
- };
1090
- type NicoScriptReplaceRange = "単" | "全";
1091
- type NicoScriptReplaceTarget = "コメ" | "投コメ" | "全" | "含まない" | "含む";
1092
- type NicoScriptReplaceCondition = "完全一致" | "部分一致";
1093
- type NicoScriptBan = {
1094
- start: number;
1095
- end: number;
1096
- };
1097
- type NicoScriptDefault = {
1098
- start: number;
1099
- long: number | undefined;
1100
- color: string | undefined;
1101
- size: CommentSize | undefined;
1102
- font: CommentFont | undefined;
1103
- loc: CommentLoc | undefined;
1104
- };
1105
- type MeasureTextResult = {
1106
- width: number;
1107
- height: number;
1108
- resized: boolean;
1109
- resizedX: boolean;
1110
- resizedY: boolean;
1111
- fontSize: number;
1112
- lineHeight: number;
1113
- content: CommentMeasuredContentItem[];
1114
- charSize: number;
1115
- scaleX: number;
1116
- scale: number;
1117
- };
1118
- type ButtonParams = {
1119
- message: {
1120
- before: string;
1121
- body: string;
1122
- after: string;
1123
- };
1124
- commentMessage: string;
1125
- commentMail: string[];
1126
- commentVisible: boolean;
1127
- limit: number;
1128
- local: boolean;
1129
- hidden: boolean;
1130
- };
1131
- type ParsedCommand = {
1132
- loc: CommentLoc | undefined;
1133
- size: CommentSize | undefined;
1134
- fontSize: number | undefined;
1135
- color: string | undefined;
1136
- strokeColor?: string;
1137
- wakuColor?: string;
1138
- fillColor?: string;
1139
- font: CommentFont | undefined;
1140
- full: boolean;
1141
- ender: boolean;
1142
- _live: boolean;
1143
- invisible: boolean;
1144
- long: number | undefined;
1145
- button?: ButtonParams;
1146
- };
1147
- type MeasureTextInput = FormattedCommentWithFont & {
1148
- resized?: boolean;
1149
- resizedY?: boolean;
1150
- resizedX?: boolean;
1151
- lineHeight?: number;
1152
- charSize?: number;
1153
- scale: number;
1154
- };
1155
- declare const ZMeasureInput: valibot.ObjectSchema<{
1156
- 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">;
1157
- content: valibot.ArraySchema<valibot.UnionSchema<[valibot.ObjectSchema<{
1158
- type: valibot.LiteralSchema<"spacer", "spacer">;
1159
- char: valibot.StringSchema<string>;
1160
- charWidth: valibot.NumberSchema<number>;
1161
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
1162
- 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>;
1163
- count: valibot.NumberSchema<number>;
1164
- }, undefined, {
1165
- type: "spacer";
1166
- char: string;
1167
- charWidth: number;
1168
- count: number;
1169
- isButton?: boolean | undefined;
1170
- font?: "defont" | "gulim" | "simsun" | undefined;
1171
- }>, valibot.ObjectSchema<{
1172
- type: valibot.LiteralSchema<"text", "text">;
1173
- content: valibot.StringSchema<string>;
1174
- slicedContent: valibot.ArraySchema<valibot.StringSchema<string>, string[]>;
1175
- isButton: valibot.OptionalSchema<valibot.BooleanSchema<boolean>, undefined, boolean | undefined>;
1176
- 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>;
1177
- width: valibot.OptionalSchema<valibot.ArraySchema<valibot.NumberSchema<number>, number[]>, undefined, number[] | undefined>;
1178
- }, undefined, {
1179
- type: "text";
1180
- content: string;
1181
- slicedContent: string[];
1182
- isButton?: boolean | undefined;
1183
- font?: "defont" | "gulim" | "simsun" | undefined;
1184
- width?: number[] | undefined;
1185
- }>], {
1186
- type: "spacer";
1187
- char: string;
1188
- charWidth: number;
1189
- count: number;
1190
- isButton?: boolean | undefined;
1191
- font?: "defont" | "gulim" | "simsun" | undefined;
1192
- } | {
1193
- type: "text";
1194
- content: string;
1195
- slicedContent: string[];
1196
- isButton?: boolean | undefined;
1197
- font?: "defont" | "gulim" | "simsun" | undefined;
1198
- width?: number[] | undefined;
1199
- }>, ({
1200
- type: "spacer";
1201
- char: string;
1202
- charWidth: number;
1203
- count: number;
1204
- isButton?: boolean | undefined;
1205
- font?: "defont" | "gulim" | "simsun" | undefined;
1206
- } | {
1207
- type: "text";
1208
- content: string;
1209
- slicedContent: string[];
1210
- isButton?: boolean | undefined;
1211
- font?: "defont" | "gulim" | "simsun" | undefined;
1212
- width?: number[] | undefined;
1213
- })[]>;
1214
- lineHeight: valibot.NumberSchema<number>;
1215
- charSize: valibot.NumberSchema<number>;
1216
- 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>;
1217
1716
  }, undefined, {
1218
- lineHeight: number;
1219
- font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
1220
- content: ({
1221
- type: "spacer";
1222
- char: string;
1223
- charWidth: number;
1224
- count: number;
1225
- isButton?: boolean | undefined;
1226
- font?: "defont" | "gulim" | "simsun" | undefined;
1227
- } | {
1228
- type: "text";
1229
- content: string;
1230
- slicedContent: string[];
1231
- isButton?: boolean | undefined;
1232
- font?: "defont" | "gulim" | "simsun" | undefined;
1233
- width?: number[] | undefined;
1234
- })[];
1235
- charSize: number;
1236
- 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;
1237
1736
  }>;
1238
- type MeasureInput = Output<typeof ZMeasureInput>;
1239
- type ValueOf<T> = T[keyof T];
1240
-
1737
+ export type MeasureInput = Output<typeof ZMeasureInput>;
1738
+ export type ValueOf<T> = T[keyof T];
1241
1739
  declare let imageCache: {
1242
- [key: string]: {
1243
- image: IRenderer;
1244
- timeout: number | NodeJS.Timeout;
1245
- };
1740
+ [key: string]: {
1741
+ image: IRenderer;
1742
+ timeout: number | NodeJS.Timeout;
1743
+ };
1246
1744
  };
1247
1745
  declare const resetImageCache: () => void;
1248
-
1249
1746
  declare let nicoScripts: NicoScript;
1250
1747
  declare const resetNicoScripts: () => void;
1251
-
1252
1748
  declare let plugins: IPluginList;
1253
1749
  declare const setPlugins: (input: IPluginList) => void;
1254
-
1255
1750
  declare const index_d$3_imageCache: typeof imageCache;
1256
1751
  declare const index_d$3_nicoScripts: typeof nicoScripts;
1257
1752
  declare const index_d$3_plugins: typeof plugins;
@@ -1259,44 +1754,41 @@ declare const index_d$3_resetImageCache: typeof resetImageCache;
1259
1754
  declare const index_d$3_resetNicoScripts: typeof resetNicoScripts;
1260
1755
  declare const index_d$3_setPlugins: typeof setPlugins;
1261
1756
  declare namespace index_d$3 {
1262
- 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 };
1263
1758
  }
1264
-
1265
1759
  declare const colors: {
1266
- white: string;
1267
- red: string;
1268
- pink: string;
1269
- orange: string;
1270
- yellow: string;
1271
- green: string;
1272
- cyan: string;
1273
- blue: string;
1274
- purple: string;
1275
- black: string;
1276
- white2: string;
1277
- niconicowhite: string;
1278
- red2: string;
1279
- truered: string;
1280
- pink2: string;
1281
- orange2: string;
1282
- passionorange: string;
1283
- yellow2: string;
1284
- madyellow: string;
1285
- green2: string;
1286
- elementalgreen: string;
1287
- cyan2: string;
1288
- blue2: string;
1289
- marinblue: string;
1290
- purple2: string;
1291
- nobleviolet: string;
1292
- 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;
1293
1787
  };
1294
-
1295
1788
  declare const colors$1_colors: typeof colors;
1296
1789
  declare namespace colors$1 {
1297
- export { colors$1_colors as colors };
1790
+ export { colors$1_colors as colors$1_colors };
1298
1791
  }
1299
-
1300
1792
  declare let defaultConfig: BaseConfig;
1301
1793
  declare const updateConfig: (config: BaseConfig) => void;
1302
1794
  declare const defaultOptions: BaseOptions;
@@ -1304,7 +1796,6 @@ declare let config: BaseConfig;
1304
1796
  declare let options: BaseOptions;
1305
1797
  declare const setConfig: (value: BaseConfig) => void;
1306
1798
  declare const setOptions: (value: BaseOptions) => void;
1307
-
1308
1799
  declare const config$1_config: typeof config;
1309
1800
  declare const config$1_defaultConfig: typeof defaultConfig;
1310
1801
  declare const config$1_defaultOptions: typeof defaultOptions;
@@ -1313,314 +1804,507 @@ declare const config$1_setConfig: typeof setConfig;
1313
1804
  declare const config$1_setOptions: typeof setOptions;
1314
1805
  declare const config$1_updateConfig: typeof updateConfig;
1315
1806
  declare namespace config$1 {
1316
- 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 };
1317
1808
  }
1318
-
1319
1809
  declare const fontTemplates: {
1320
- arial: {
1321
- font: string;
1322
- offset: number;
1323
- weight: number;
1324
- };
1325
- gothic: {
1326
- font: string;
1327
- offset: number;
1328
- weight: number;
1329
- };
1330
- gulim: {
1331
- font: string;
1332
- offset: number;
1333
- weight: number;
1334
- };
1335
- mincho: {
1336
- font: string;
1337
- offset: number;
1338
- weight: number;
1339
- };
1340
- simsun: {
1341
- font: string;
1342
- offset: number;
1343
- weight: number;
1344
- };
1345
- macGothicPro6: {
1346
- font: string;
1347
- offset: number;
1348
- weight: number;
1349
- };
1350
- macGothicPro3: {
1351
- font: string;
1352
- offset: number;
1353
- weight: number;
1354
- };
1355
- macMincho: {
1356
- font: string;
1357
- offset: number;
1358
- weight: number;
1359
- };
1360
- macGothic1: {
1361
- font: string;
1362
- offset: number;
1363
- weight: number;
1364
- };
1365
- macGothic2: {
1366
- font: string;
1367
- offset: number;
1368
- weight: number;
1369
- };
1370
- sansSerif600: {
1371
- font: string;
1372
- offset: number;
1373
- weight: number;
1374
- };
1375
- sansSerif400: {
1376
- font: string;
1377
- offset: number;
1378
- weight: number;
1379
- };
1380
- serif: {
1381
- font: string;
1382
- offset: number;
1383
- weight: number;
1384
- };
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
+ };
1385
1875
  };
1386
1876
  declare const fonts: {
1387
- win7: {
1388
- defont: FontItem;
1389
- gothic: FontItem;
1390
- mincho: FontItem;
1391
- };
1392
- win8_1: {
1393
- defont: FontItem;
1394
- gothic: FontItem;
1395
- mincho: FontItem;
1396
- };
1397
- win: {
1398
- defont: FontItem;
1399
- gothic: FontItem;
1400
- mincho: FontItem;
1401
- };
1402
- mac10_9: {
1403
- defont: FontItem;
1404
- gothic: FontItem;
1405
- mincho: FontItem;
1406
- };
1407
- mac10_11: {
1408
- defont: FontItem;
1409
- gothic: FontItem;
1410
- mincho: FontItem;
1411
- };
1412
- mac: {
1413
- defont: FontItem;
1414
- gothic: FontItem;
1415
- mincho: FontItem;
1416
- };
1417
- other: {
1418
- defont: FontItem;
1419
- gothic: FontItem;
1420
- mincho: FontItem;
1421
- };
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
+ };
1422
1912
  };
1423
-
1424
1913
  declare const fonts$1_fontTemplates: typeof fontTemplates;
1425
1914
  declare const fonts$1_fonts: typeof fonts;
1426
1915
  declare namespace fonts$1 {
1427
- 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 };
1428
1917
  }
1429
-
1430
1918
  declare const initConfig: () => void;
1431
-
1432
1919
  declare const initConfig$1_initConfig: typeof initConfig;
1433
1920
  declare namespace initConfig$1 {
1434
- export { initConfig$1_initConfig as initConfig };
1921
+ export { initConfig$1_initConfig as initConfig$1_initConfig };
1435
1922
  }
1436
-
1437
1923
  declare class CanvasRenderingContext2DError extends Error {
1438
- constructor(options?: {
1439
- [key: string]: unknown;
1440
- });
1924
+ constructor(options?: {
1925
+ [key: string]: unknown;
1926
+ });
1441
1927
  }
1442
-
1443
1928
  declare class InvalidFormatError extends Error {
1444
- constructor(options?: {
1445
- [key: string]: unknown;
1446
- });
1929
+ constructor(options?: {
1930
+ [key: string]: unknown;
1931
+ });
1447
1932
  }
1448
-
1449
1933
  declare class InvalidOptionError extends Error {
1450
- constructor(options?: {
1451
- [key: string]: unknown;
1452
- });
1934
+ constructor(options?: {
1935
+ [key: string]: unknown;
1936
+ });
1453
1937
  }
1454
-
1455
1938
  declare class NotImplementedError extends Error {
1456
- pluginName: string;
1457
- methodName: string;
1458
- constructor(pluginName: string, methodName: string, options?: {
1459
- [key: string]: unknown;
1460
- });
1939
+ pluginName: string;
1940
+ methodName: string;
1941
+ constructor(pluginName: string, methodName: string, options?: {
1942
+ [key: string]: unknown;
1943
+ });
1461
1944
  }
1462
-
1463
- type index_d$2_CanvasRenderingContext2DError = CanvasRenderingContext2DError;
1945
+ export type index_d$2_CanvasRenderingContext2DError = CanvasRenderingContext2DError;
1464
1946
  declare const index_d$2_CanvasRenderingContext2DError: typeof CanvasRenderingContext2DError;
1465
- type index_d$2_InvalidFormatError = InvalidFormatError;
1947
+ export type index_d$2_InvalidFormatError = InvalidFormatError;
1466
1948
  declare const index_d$2_InvalidFormatError: typeof InvalidFormatError;
1467
- type index_d$2_InvalidOptionError = InvalidOptionError;
1949
+ export type index_d$2_InvalidOptionError = InvalidOptionError;
1468
1950
  declare const index_d$2_InvalidOptionError: typeof InvalidOptionError;
1469
- type index_d$2_NotImplementedError = NotImplementedError;
1951
+ export type index_d$2_NotImplementedError = NotImplementedError;
1470
1952
  declare const index_d$2_NotImplementedError: typeof NotImplementedError;
1471
1953
  declare namespace index_d$2 {
1472
- 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 };
1473
1955
  }
1474
-
1475
1956
  declare const registerHandler: <K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]) => void;
1476
1957
  declare const removeHandler: <K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]) => void;
1477
1958
  declare const triggerHandler: (vpos: number, lastVpos: number) => void;
1478
-
1479
1959
  declare const eventHandler_d_registerHandler: typeof registerHandler;
1480
1960
  declare const eventHandler_d_removeHandler: typeof removeHandler;
1481
1961
  declare const eventHandler_d_triggerHandler: typeof triggerHandler;
1482
1962
  declare namespace eventHandler_d {
1483
- 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 };
1484
1964
  }
1485
-
1486
1965
  declare const convert2formattedComment: (data: unknown, type: InputFormatType) => FormattedComment[];
1487
-
1488
1966
  declare namespace inputParser_d {
1489
- export { convert2formattedComment as default };
1967
+ export { convert2formattedComment as convert2formattedComment };
1490
1968
  }
1491
-
1492
1969
  declare class CanvasRenderer implements IRenderer {
1493
- readonly canvas: HTMLCanvasElement;
1494
- readonly video?: HTMLVideoElement;
1495
- private readonly context;
1496
- constructor(canvas?: HTMLCanvasElement, video?: HTMLVideoElement);
1497
- drawVideo(enableLegacyPip: boolean): void;
1498
- getFont(): string;
1499
- getFillStyle(): string | CanvasGradient | CanvasPattern;
1500
- setScale(scale: number, arg1?: number): void;
1501
- drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void;
1502
- fillRect(x: number, y: number, width: number, height: number): void;
1503
- strokeRect(x: number, y: number, width: number, height: number): void;
1504
- fillText(text: string, x: number, y: number): void;
1505
- strokeText(text: string, x: number, y: number): void;
1506
- quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
1507
- clearRect(x: number, y: number, width: number, height: number): void;
1508
- setFont(font: string): void;
1509
- setFillStyle(color: string): void;
1510
- setStrokeStyle(color: string): void;
1511
- setLineWidth(width: number): void;
1512
- setGlobalAlpha(alpha: number): void;
1513
- setSize(width: number, height: number): void;
1514
- getSize(): {
1515
- width: number;
1516
- height: number;
1517
- };
1518
- measureText(text: string): TextMetrics;
1519
- beginPath(): void;
1520
- closePath(): void;
1521
- moveTo(x: number, y: number): void;
1522
- lineTo(x: number, y: number): void;
1523
- stroke(): void;
1524
- save(): void;
1525
- restore(): void;
1526
- getCanvas(): IRenderer;
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;
1527
2005
  }
1528
-
1529
- type index_d$1_CanvasRenderer = CanvasRenderer;
2006
+ export type index_d$1_CanvasRenderer = CanvasRenderer;
1530
2007
  declare const index_d$1_CanvasRenderer: typeof CanvasRenderer;
1531
2008
  declare namespace index_d$1 {
1532
- export { index_d$1_CanvasRenderer as CanvasRenderer };
2009
+ export { index_d$1_CanvasRenderer as index_d$1_CanvasRenderer };
1533
2010
  }
1534
-
1535
2011
  declare const typeGuard: {
1536
- xmlDocument: (i: unknown) => i is XMLDocument;
1537
- legacyOwner: {
1538
- comments: (i: unknown) => i is string;
1539
- };
1540
- nicoScript: {
1541
- range: {
1542
- target: (i: unknown) => i is NicoScriptReverseTarget;
1543
- };
1544
- replace: {
1545
- range: (i: unknown) => i is NicoScriptReplaceRange;
1546
- target: (i: unknown) => i is NicoScriptReplaceTarget;
1547
- condition: (i: unknown) => i is NicoScriptReplaceCondition;
1548
- };
1549
- };
1550
- comment: {
1551
- command: {
1552
- key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
1553
- };
1554
- 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";
1555
- colorCodeAllowAlpha: (i: unknown) => i is string;
1556
- };
1557
- config: {
1558
- initOptions: (item: unknown) => item is Partial<BaseOptions>;
1559
- };
1560
- internal: {
1561
- CommentMeasuredContentItemArray: (i: unknown) => i is ({
1562
- type: "spacer";
1563
- char: string;
1564
- charWidth: number;
1565
- count: number;
1566
- isButton?: boolean | undefined;
1567
- font?: "defont" | "gulim" | "simsun" | undefined;
1568
- } | (({
1569
- type: "spacer";
1570
- char: string;
1571
- charWidth: number;
1572
- count: number;
1573
- isButton?: boolean | undefined;
1574
- font?: "defont" | "gulim" | "simsun" | undefined;
1575
- } | {
1576
- type: "text";
1577
- content: string;
1578
- slicedContent: string[];
1579
- isButton?: boolean | undefined;
1580
- font?: "defont" | "gulim" | "simsun" | undefined;
1581
- width?: number[] | undefined;
1582
- }) & {
1583
- width: number[];
1584
- }))[];
1585
- MultiConfigItem: <T>(i: unknown) => i is MultiConfigItem<T>;
1586
- HTML5Fonts: (i: unknown) => i is "defont" | "mincho" | "gothic";
1587
- MeasureInput: (i: unknown) => i is {
1588
- lineHeight: number;
1589
- font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
1590
- content: ({
1591
- type: "spacer";
1592
- char: string;
1593
- charWidth: number;
1594
- count: number;
1595
- isButton?: boolean | undefined;
1596
- font?: "defont" | "gulim" | "simsun" | undefined;
1597
- } | {
1598
- type: "text";
1599
- content: string;
1600
- slicedContent: string[];
1601
- isButton?: boolean | undefined;
1602
- font?: "defont" | "gulim" | "simsun" | undefined;
1603
- width?: number[] | undefined;
1604
- })[];
1605
- charSize: number;
1606
- lineCount: number;
1607
- };
1608
- };
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
+ };
1609
2297
  };
1610
-
1611
2298
  declare namespace typeGuard_d {
1612
- export { typeGuard as default };
2299
+ export { typeGuard as typeGuard };
1613
2300
  }
1614
-
1615
2301
  declare const arrayPush: (array: {
1616
- [key: number]: IComment[];
2302
+ [key: number]: IComment[];
1617
2303
  }, key: string | number, push: IComment) => void;
1618
2304
  declare const arrayEqual: (a: unknown[], b: unknown[]) => boolean;
1619
-
1620
2305
  declare const hex2rgb: (hex: string) => number[];
1621
2306
  declare const hex2rgba: (hex: string) => number[];
1622
2307
  declare const getStrokeColor: (comment: FormattedCommentWithSize) => string;
1623
-
1624
2308
  declare const isLineBreakResize: (comment: MeasureTextInput) => boolean;
1625
2309
  declare const getDefaultCommand: (vpos: number) => DefaultCommand;
1626
2310
  declare const parseCommandAndNicoScript: (comment: FormattedComment) => ParseCommandAndNicoScriptResult;
@@ -1630,53 +2314,47 @@ declare const isBanActive: (vpos: number) => boolean;
1630
2314
  declare const processFixedComment: (comment: IComment, collision: CollisionItem, timeline: Timeline) => void;
1631
2315
  declare const processMovableComment: (comment: IComment, collision: Collision, timeline: Timeline) => void;
1632
2316
  declare const getPosY: (currentPos: number, targetComment: IComment, collision: IComment[] | undefined, isChanged?: boolean) => {
1633
- currentPos: number;
1634
- isChanged: boolean;
1635
- isBreak: boolean;
2317
+ currentPos: number;
2318
+ isChanged: boolean;
2319
+ isBreak: boolean;
1636
2320
  };
1637
2321
  declare const getPosX: (comment: FormattedCommentWithSize, vpos: number, isReverse?: boolean) => number;
1638
2322
  declare const parseFont: (font: CommentFont, size: string | number) => string;
1639
-
1640
2323
  declare const changeCALayer: (rawData: FormattedComment[]) => FormattedComment[];
1641
-
1642
2324
  declare const getConfig: <T>(input: ConfigItem<T>, isFlash?: boolean) => T;
1643
-
1644
2325
  declare const getFlashFontIndex: (part: string) => CommentContentIndex[];
1645
2326
  declare const getFlashFontName: (font: CommentFlashFontParsed) => CommentFlashFont;
1646
2327
  declare const parseContent: (content: string) => ({
1647
- type: "spacer";
1648
- char: string;
1649
- charWidth: number;
1650
- count: number;
1651
- isButton?: boolean | undefined;
1652
- 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;
1653
2334
  } | {
1654
- type: "text";
1655
- content: string;
1656
- slicedContent: string[];
1657
- isButton?: boolean | undefined;
1658
- font?: "defont" | "gulim" | "simsun" | undefined;
1659
- 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;
1660
2341
  })[];
1661
2342
  declare const getButtonParts: (comment: FormattedCommentWithSize) => FormattedCommentWithSize;
1662
2343
  declare const buildAtButtonComment: (comment: FormattedCommentWithSize, vpos: number) => FormattedComment | undefined;
1663
-
1664
2344
  declare const getLineHeight: (fontSize: CommentSize, isFlash: boolean, resized?: boolean) => number;
1665
2345
  declare const getCharSize: (fontSize: CommentSize, isFlash: boolean) => number;
1666
2346
  declare const measure: (comment: MeasureInput, renderer: IRenderer) => {
1667
- height: number;
1668
- width: number;
1669
- lineWidth: number[];
1670
- itemWidth: number[][];
2347
+ height: number;
2348
+ width: number;
2349
+ lineWidth: number[];
2350
+ itemWidth: number[][];
1671
2351
  };
1672
2352
  declare const addHTML5PartToResult: (lineContent: CommentContentItem[], part: string, font?: CommentHTML5Font) => void;
1673
2353
  declare const getFontSizeAndScale: (charSize: number) => {
1674
- scale: number;
1675
- fontSize: number;
2354
+ scale: number;
2355
+ fontSize: number;
1676
2356
  };
1677
-
1678
2357
  declare const nativeSort: <T>(getter: (input: T) => number) => (a: T, b: T) => 1 | 0 | -1;
1679
-
1680
2358
  declare const index_d_addHTML5PartToResult: typeof addHTML5PartToResult;
1681
2359
  declare const index_d_arrayEqual: typeof arrayEqual;
1682
2360
  declare const index_d_arrayPush: typeof arrayPush;
@@ -1707,138 +2385,351 @@ declare const index_d_parseFont: typeof parseFont;
1707
2385
  declare const index_d_processFixedComment: typeof processFixedComment;
1708
2386
  declare const index_d_processMovableComment: typeof processMovableComment;
1709
2387
  declare namespace index_d {
1710
- 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 };
1711
2389
  }
1712
-
1713
2390
  declare const definition: {
1714
- colors: typeof colors$1;
1715
- config: typeof config$1;
1716
- fonts: typeof fonts$1;
1717
- initConfig: typeof initConfig$1;
2391
+ colors: typeof colors$1;
2392
+ config: typeof config$1;
2393
+ fonts: typeof fonts$1;
2394
+ initConfig: typeof initConfig$1;
1718
2395
  };
1719
-
1720
2396
  declare const internal_definition: typeof definition;
1721
2397
  declare namespace internal {
1722
- 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 };
1723
2399
  }
1724
-
1725
2400
  declare class NiconiComments {
1726
- enableLegacyPiP: boolean;
1727
- showCollision: boolean;
1728
- showFPS: boolean;
1729
- showCommentCount: boolean;
1730
- private lastVpos;
1731
- private readonly renderer;
1732
- private readonly collision;
1733
- private readonly timeline;
1734
- static typeGuard: {
1735
- xmlDocument: (i: unknown) => i is XMLDocument;
1736
- legacyOwner: {
1737
- comments: (i: unknown) => i is string;
1738
- };
1739
- nicoScript: {
1740
- range: {
1741
- target: (i: unknown) => i is NicoScriptReverseTarget;
1742
- };
1743
- replace: {
1744
- range: (i: unknown) => i is NicoScriptReplaceRange;
1745
- target: (i: unknown) => i is NicoScriptReplaceTarget;
1746
- condition: (i: unknown) => i is NicoScriptReplaceCondition;
1747
- };
1748
- };
1749
- comment: {
1750
- command: {
1751
- key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
1752
- };
1753
- 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";
1754
- colorCodeAllowAlpha: (i: unknown) => i is string;
1755
- };
1756
- config: {
1757
- initOptions: (item: unknown) => item is Partial<BaseOptions>;
1758
- };
1759
- internal: {
1760
- CommentMeasuredContentItemArray: (i: unknown) => i is ({
1761
- type: "spacer";
1762
- char: string;
1763
- charWidth: number;
1764
- count: number;
1765
- isButton?: boolean | undefined;
1766
- font?: "defont" | "gulim" | "simsun" | undefined;
1767
- } | (({
1768
- type: "spacer";
1769
- char: string;
1770
- charWidth: number;
1771
- count: number;
1772
- isButton?: boolean | undefined;
1773
- font?: "defont" | "gulim" | "simsun" | undefined;
1774
- } | {
1775
- type: "text";
1776
- content: string;
1777
- slicedContent: string[];
1778
- isButton?: boolean | undefined;
1779
- font?: "defont" | "gulim" | "simsun" | undefined;
1780
- width?: number[] | undefined;
1781
- }) & {
1782
- width: number[];
1783
- }))[];
1784
- MultiConfigItem: <T>(i: unknown) => i is MultiConfigItem<T>;
1785
- HTML5Fonts: (i: unknown) => i is "defont" | "mincho" | "gothic";
1786
- MeasureInput: (i: unknown) => i is {
1787
- lineHeight: number;
1788
- font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
1789
- content: ({
1790
- type: "spacer";
1791
- char: string;
1792
- charWidth: number;
1793
- count: number;
1794
- isButton?: boolean | undefined;
1795
- font?: "defont" | "gulim" | "simsun" | undefined;
1796
- } | {
1797
- type: "text";
1798
- content: string;
1799
- slicedContent: string[];
1800
- isButton?: boolean | undefined;
1801
- font?: "defont" | "gulim" | "simsun" | undefined;
1802
- width?: number[] | undefined;
1803
- })[];
1804
- charSize: number;
1805
- lineCount: number;
1806
- };
1807
- };
1808
- };
1809
- static default: typeof NiconiComments;
1810
- static FlashComment: {
1811
- condition: (comment: {
1812
- owner: boolean;
1813
- content: string;
1814
- vpos: number;
1815
- date: number;
1816
- id: number;
1817
- date_usec: number;
1818
- premium: boolean;
1819
- mail: string[];
1820
- user_id: number;
1821
- layer: number;
1822
- is_my_post: boolean;
1823
- }) => boolean;
1824
- class: typeof FlashComment;
1825
- };
1826
- static internal: typeof internal;
1827
- constructor(renderer: IRenderer | HTMLCanvasElement, data: InputFormat, initOptions?: Options);
1828
- private preRendering;
1829
- private getCommentPos;
1830
- private sortComment;
1831
- addComments(...rawComments: FormattedComment[]): void;
1832
- drawCanvas(vpos: number, forceRendering?: boolean, cursor?: Position): boolean;
1833
- private _drawVideo;
1834
- private _drawComments;
1835
- private _drawCollision;
1836
- private _drawFPS;
1837
- private _drawCommentCount;
1838
- addEventListener<K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]): void;
1839
- removeEventListener<K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]): void;
1840
- clear(): void;
1841
- 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;
1842
2729
  }
1843
2730
 
1844
- 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 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 {};