//#endregion //#region src/@types/button.d.ts type ButtonList = { left: ButtonPartLeft; middle: ButtonPartMiddle[]; right: ButtonPartRight; }; type ButtonPartLeft = { type: "left"; left: number; top: number; width: number; height: number; }; type ButtonPartMiddle = { type: "middle"; left: number; top: number; width: number; height: number; }; type ButtonPartRight = { type: "right"; right: number; top: number; height: number; }; //#endregion //#region src/@types/canvas.d.ts type Canvas = HTMLCanvasElement; type Context2D = CanvasRenderingContext2D; //#endregion //#region src/@types/comment.d.ts type DefaultCommand = { color?: string; size?: CommentSize; font?: CommentFont; loc?: CommentLoc; }; //#endregion //#region src/contexts/cache.d.ts declare class ImageCacheContext { private _cache; get(key: string): { image: IRenderer; timeout: number; } | undefined; set(key: string, value: { image: IRenderer; timeout: number; }): void; delete(key: string): void; reset(): void; } //#endregion //#region src/utils/rangeCache.d.ts declare class RangeCacheContext { readonly reverseActiveOwner: Map; readonly reverseActiveViewer: Map; readonly banActive: Map; reset(): void; setCachedActiveState(cache: Map, vpos: number, result: boolean): void; } //#endregion //#region src/contexts/instanceContext.d.ts type CommentInstanceContext = { config: BaseConfig; options: BaseOptions; nicoScripts: NicoScript; imageCache: ImageCacheContext; rangeCache: RangeCacheContext; }; //#endregion //#region src/contexts/nicoscript.d.ts declare const createNicoScripts: () => NicoScript; declare namespace index_d_exports$4 { export { CommentInstanceContext, ImageCacheContext, createNicoScripts }; } //#endregion //#region src/comments/BaseComment.d.ts declare class BaseComment implements IComment { protected readonly renderer: IRenderer; protected readonly config: BaseConfig; protected readonly ctx: CommentInstanceContext; protected cacheKey: string; comment: FormattedCommentWithSize; pos: { x: number; y: number; }; posY: number; readonly pluginName: string; image?: IRenderer | null; buttonImage?: IRenderer | null; index: number; private readonly _timeoutIds; private _destroyed; constructor(comment: FormattedComment, renderer: IRenderer, index: number, ctx: CommentInstanceContext); get invisible(): boolean; get loc(): "ue" | "naka" | "shita"; get long(): number; get vpos(): number; get width(): number; get height(): number; get flash(): boolean; get layer(): number; get ignoreScale(): boolean; protected getLayerScale(parsedData: FormattedCommentWithFont): number; get owner(): boolean; get mail(): string[]; get content(): string; set content(_: string); protected getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize; protected parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont; protected parseContent(comment: string): ParseContentResult; protected measureText(comment: MeasureTextInput): MeasureTextResult; protected convertComment(comment: FormattedComment): FormattedCommentWithSize; draw(vpos: number, showCollision: boolean, cursor?: Position, frameActiveState?: FrameActiveState): void; protected _draw(posX: number, posY: number, cursor?: Position): void; protected _drawRectColor(posX: number, posY: number): void; protected _drawBackgroundColor(posX: number, posY: number): void; protected _drawDebugInfo(posX: number, posY: number): void; protected _drawCollision(posX: number, posY: number, showCollision: boolean): void; protected getTextImage(): IRenderer | null; protected _generateTextImage(): IRenderer; protected _cacheImage(image: IRenderer): void; protected canGenerateTextImage(): boolean; protected getButtonImage(_posX: number, _posY: number, _cursor?: Position): IRenderer | undefined; isHovered(_cursor?: Position, _posX?: number, _posY?: number): boolean; protected getCacheKey(): string; private _setCommentImageClearTimeout; private _setCacheImageExpiryTimeout; destroy(): void; } //#endregion //#region src/comments/FlashComment.d.ts declare class FlashComment extends BaseComment { private _globalScale; private _buttonImageState?; readonly pluginName: string; constructor(comment: FormattedComment, renderer: IRenderer, index: number, ctx: CommentInstanceContext); private get _flashScriptCharRegex(); get content(): string; get flash(): boolean; set content(input: string); destroy(): void; convertComment(comment: FormattedComment): FormattedCommentWithSize; getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize; parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont; parseContent(input: string, button?: ButtonParams): { content: ({ type: "spacer"; char: string; charWidth: number; isButton?: boolean | undefined; font?: "defont" | "gulim" | "simsun" | undefined; count: number; } | { type: "text"; content: string; slicedContent: string[]; isButton?: boolean | undefined; font?: "defont" | "gulim" | "simsun" | undefined; width?: number[] | undefined; })[]; lineCount: number; lineOffset: number; }; measureText(comment: MeasureTextInput): MeasureTextResult; private _isDoubleResize; private _measureContent; _drawCollision(posX: number, posY: number, showCollision: boolean): void; _generateTextImage(): IRenderer; protected canGenerateTextImage(): boolean; getButtonImage(posX: number, posY: number, cursor?: Position): IRenderer | undefined; isHovered(_cursor?: Position, _posX?: number, _posY?: number): boolean; protected _setupCanvas(renderer: IRenderer): { renderer: IRenderer; }; } //#endregion //#region src/comments/HTML5Comment.d.ts declare class HTML5Comment extends BaseComment { readonly pluginName: string; private readonly textImageBoundsCache; constructor(comment: FormattedComment, context: IRenderer, index: number, ctx: CommentInstanceContext); get content(): string; set content(input: string); convertComment(comment: FormattedComment): FormattedCommentWithSize; getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize; parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont; parseContent(input: string, font?: HTML5Fonts): { content: { type: "text"; content: string; slicedContent: string[]; isButton?: boolean | undefined; font?: "defont" | "gulim" | "simsun" | undefined; width?: number[] | undefined; }[]; lineCount: number; lineOffset: number; }; measureText(comment: MeasureTextInput): MeasureTextResult; private _measureComment; private _processResizeX; _drawCollision(posX: number, posY: number, showCollision: boolean): void; protected canGenerateTextImage(): boolean; private getTextImageBounds; protected _draw(posX: number, posY: number, cursor?: Position): void; _generateTextImage(): IRenderer; getButtonImage(): undefined; isHovered(): boolean; } declare namespace index_d_exports$3 { export { BaseComment, FlashComment, HTML5Comment }; } //#endregion //#region node_modules/.pnpm/valibot@1.4.1_typescript@6.0.3/node_modules/valibot/dist/index.d.mts //#endregion //#region src/methods/fallback/fallback.d.ts /** * Fallback type. */ type Fallback>> = MaybeDeepReadonly> | ((dataset?: OutputDataset, InferIssue>, config?: Config$1>) => MaybeDeepReadonly>); /** * Schema with fallback type. */ type SchemaWithFallback>, TFallback$1 extends Fallback> = TSchema & { /** * The fallback value. */ readonly fallback: TFallback$1; }; //#endregion //#region src/methods/fallback/fallbackAsync.d.ts /** * Fallback async type. */ type FallbackAsync> | BaseSchemaAsync>> = MaybeDeepReadonly> | ((dataset?: OutputDataset, InferIssue>, config?: Config$1>) => MaybePromise>>); /** * Schema with fallback async type. */ type SchemaWithFallbackAsync> | BaseSchemaAsync>, TFallback$1 extends FallbackAsync> = Omit & { /** * The fallback value. */ readonly fallback: TFallback$1; /** * Whether it's async. */ readonly async: true; /** * The Standard Schema properties. * * @internal */ readonly "~standard": StandardProps, InferOutput>; /** * Parses unknown input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: UnknownDataset, config: Config$1>) => Promise, InferIssue>>; }; //#endregion //#region src/methods/pipe/pipe.d.ts /** * Schema with pipe type. */ type SchemaWithPipe>, ...PipeItem>[]]> = Omit, "pipe" | "~standard" | "~run" | "~types"> & { /** * The pipe items. */ readonly pipe: TPipe$1; /** * The Standard Schema properties. * * @internal */ readonly "~standard": StandardProps>, InferOutput>>; /** * Parses unknown input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: UnknownDataset, config: Config$1>) => OutputDataset>, InferIssue>; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: InferInput>; readonly output: InferOutput>; readonly issue: InferIssue; } | undefined; }; //#endregion //#region src/types/metadata.d.ts /** * Base metadata interface. */ interface BaseMetadata { /** * The object kind. */ readonly kind: "metadata"; /** * The metadata type. */ readonly type: string; /** * The metadata reference. */ readonly reference: (...args: any[]) => BaseMetadata; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: TInput$1; readonly output: TInput$1; readonly issue: never; } | undefined; } //#endregion //#region src/types/dataset.d.ts /** * Unknown dataset interface. */ interface UnknownDataset { /** * Whether is's typed. */ typed?: false; /** * The dataset value. */ value: unknown; /** * The dataset issues. */ issues?: undefined; } /** * Success dataset interface. */ interface SuccessDataset { /** * Whether is's typed. */ typed: true; /** * The dataset value. */ value: TValue$1; /** * The dataset issues. */ issues?: undefined; } /** * Partial dataset interface. */ interface PartialDataset> { /** * Whether is's typed. */ typed: true; /** * The dataset value. */ value: TValue$1; /** * The dataset issues. */ issues: [TIssue, ...TIssue[]]; } /** * Failure dataset interface. */ interface FailureDataset> { /** * Whether is's typed. */ typed: false; /** * The dataset value. */ value: unknown; /** * The dataset issues. */ issues: [TIssue, ...TIssue[]]; } /** * Output dataset type. */ type OutputDataset> = SuccessDataset | PartialDataset | FailureDataset; //#endregion //#region src/types/standard.d.ts /** * The Standard Schema properties interface. */ interface StandardProps { /** * The version number of the standard. */ readonly version: 1; /** * The vendor name of the schema library. */ readonly vendor: "valibot"; /** * Validates unknown input values. */ readonly validate: (value: unknown) => StandardResult | Promise>; /** * Inferred types associated with the schema. */ readonly types?: StandardTypes | undefined; } /** * The result interface of the validate function. */ type StandardResult = StandardSuccessResult | StandardFailureResult; /** * The result interface if validation succeeds. */ interface StandardSuccessResult { /** * The typed output value. */ readonly value: TOutput$1; /** * The non-existent issues. */ readonly issues?: undefined; } /** * The result interface if validation fails. */ interface StandardFailureResult { /** * The issues of failed validation. */ readonly issues: readonly StandardIssue[]; } /** * The issue interface of the failure output. */ interface StandardIssue { /** * The error message of the issue. */ readonly message: string; /** * The path of the issue, if any. */ readonly path?: readonly (PropertyKey | StandardPathItem)[] | undefined; } /** * The path item interface of the issue. */ interface StandardPathItem { /** * The key of the path item. */ readonly key: PropertyKey; } /** * The Standard Schema types interface. */ interface StandardTypes { /** * The input type of the schema. */ readonly input: TInput$1; /** * The output type of the schema. */ readonly output: TOutput$1; } //#endregion //#region src/types/schema.d.ts /** * Base schema interface. */ interface BaseSchema> { /** * The object kind. */ readonly kind: "schema"; /** * The schema type. */ readonly type: string; /** * The schema reference. */ readonly reference: (...args: any[]) => BaseSchema>; /** * The expected property. */ readonly expects: string; /** * Whether it's async. */ readonly async: false; /** * The Standard Schema properties. * * @internal */ readonly "~standard": StandardProps; /** * Parses unknown input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: UnknownDataset, config: Config$1>) => OutputDataset; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: TInput$1; readonly output: TOutput$1; readonly issue: TIssue; } | undefined; } /** * Base schema async interface. */ interface BaseSchemaAsync> extends Omit, "reference" | "async" | "~run"> { /** * The schema reference. */ readonly reference: (...args: any[]) => BaseSchema> | BaseSchemaAsync>; /** * Whether it's async. */ readonly async: true; /** * Parses unknown input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: UnknownDataset, config: Config$1>) => Promise>; } //#endregion //#region src/types/transformation.d.ts /** * Base transformation interface. */ interface BaseTransformation> { /** * The object kind. */ readonly kind: "transformation"; /** * The transformation type. */ readonly type: string; /** * The transformation reference. */ readonly reference: (...args: any[]) => BaseTransformation>; /** * Whether it's async. */ readonly async: false; /** * Transforms known input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: SuccessDataset, config: Config$1>) => OutputDataset | TIssue>; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: TInput$1; readonly output: TOutput$1; readonly issue: TIssue; } | undefined; } /** * Base transformation async interface. */ interface BaseTransformationAsync> extends Omit, "reference" | "async" | "~run"> { /** * The transformation reference. */ readonly reference: (...args: any[]) => BaseTransformation> | BaseTransformationAsync>; /** * Whether it's async. */ readonly async: true; /** * Transforms known input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: SuccessDataset, config: Config$1>) => Promise | TIssue>>; } //#endregion //#region src/types/validation.d.ts /** * Base validation interface. */ interface BaseValidation> { /** * The object kind. */ readonly kind: "validation"; /** * The validation type. */ readonly type: string; /** * The validation reference. */ readonly reference: (...args: any[]) => BaseValidation>; /** * The expected property. */ readonly expects: string | null; /** * Whether it's async. */ readonly async: false; /** * Validates known input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: OutputDataset>, config: Config$1>) => OutputDataset | TIssue>; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: TInput$1; readonly output: TOutput$1; readonly issue: TIssue; } | undefined; } /** * Base validation async interface. */ interface BaseValidationAsync> extends Omit, "reference" | "async" | "~run"> { /** * The validation reference. */ readonly reference: (...args: any[]) => BaseValidation> | BaseValidationAsync>; /** * Whether it's async. */ readonly async: true; /** * Validates known input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: OutputDataset>, config: Config$1>) => Promise | TIssue>>; } //#endregion //#region src/types/infer.d.ts /** * Infer input type. */ type InferInput> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["input"]; /** * Infer output type. */ type InferOutput> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["output"]; /** * Infer issue type. */ type InferIssue> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["issue"]; /** * Checks if a type is `never`. */ type IsNever = [Type] extends [never] ? true : false; /** * Constructs a type that is maybe readonly. */ type MaybeReadonly = TValue$1 | Readonly; /** * Constructs a type that is deeply readonly. */ type DeepReadonly = TValue$1 extends Record | readonly unknown[] ? { readonly [TKey in keyof TValue$1]: DeepReadonly; } : TValue$1; /** * Constructs a type that is maybe deeply readonly. */ type MaybeDeepReadonly = TValue$1 | DeepReadonly; /** * Constructs a type that is maybe a promise. */ type MaybePromise = TValue$1 | Promise; /** * Prettifies a type for better readability. * * Hint: This type has no effect and is only used so that TypeScript displays * the final type in the preview instead of the utility types used. */ type Prettify = { [TKey in keyof TObject]: TObject[TKey]; } & {}; /** * Marks specific keys as optional. */ type MarkOptional = { [TKey in keyof TObject]?: unknown; } & Omit & Partial>; /** * Extracts first tuple item. */ type FirstTupleItem = TTuple[0]; /** * Extracts last tuple item. */ type LastTupleItem = TTuple[TTuple extends readonly [unknown, ...infer TRest] ? TRest["length"] : never]; /** * Converts union to intersection type. */ type UnionToIntersect = (TUnion extends any ? (arg: TUnion) => void : never) extends ((arg: infer Intersect) => void) ? Intersect : never; //#endregion //#region src/types/other.d.ts /** * Error message type. */ type ErrorMessage> = ((issue: TIssue) => string) | string; /** * Default type. */ type Default>, TInput$1 extends null | undefined> = MaybeDeepReadonly | TInput$1> | ((dataset?: UnknownDataset, config?: Config$1>) => MaybeDeepReadonly | TInput$1>) | undefined; /** * Default async type. */ type DefaultAsync> | BaseSchemaAsync>, TInput$1 extends null | undefined> = MaybeDeepReadonly | TInput$1> | ((dataset?: UnknownDataset, config?: Config$1>) => MaybePromise | TInput$1>>) | undefined; /** * Default value type. */ type DefaultValue>, null | undefined> | DefaultAsync> | BaseSchemaAsync>, null | undefined>> = TDefault extends DefaultAsync> | BaseSchemaAsync>, infer TInput> ? TDefault extends ((dataset?: UnknownDataset, config?: Config$1>) => MaybePromise | TInput>>) ? Awaited> : TDefault : never; //#endregion //#region src/types/object.d.ts /** * Optional entry schema type. */ type OptionalEntrySchema = ExactOptionalSchema>, unknown> | NullishSchema>, unknown> | OptionalSchema>, unknown>; /** * Optional entry schema async type. */ type OptionalEntrySchemaAsync = ExactOptionalSchemaAsync> | BaseSchemaAsync>, unknown> | NullishSchemaAsync> | BaseSchemaAsync>, unknown> | OptionalSchemaAsync> | BaseSchemaAsync>, unknown>; /** * Object entries interface. */ interface ObjectEntries { [key: string]: BaseSchema> | SchemaWithFallback>, unknown> | OptionalEntrySchema; } /** * Object entries async interface. */ interface ObjectEntriesAsync { [key: string]: BaseSchema> | BaseSchemaAsync> | SchemaWithFallback>, unknown> | SchemaWithFallbackAsync> | BaseSchemaAsync>, unknown> | OptionalEntrySchema | OptionalEntrySchemaAsync; } /** * Infer entries input type. */ type InferEntriesInput = { -readonly [TKey in keyof TEntries$1]: InferInput; }; /** * Infer entries output type. */ type InferEntriesOutput = { -readonly [TKey in keyof TEntries$1]: InferOutput; }; /** * Optional input keys type. */ type OptionalInputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? TKey : never; }[keyof TEntries$1]; /** * Optional output keys type. */ type OptionalOutputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? undefined extends TEntries$1[TKey]["default"] ? TKey : never : never; }[keyof TEntries$1]; /** * Input with question marks type. */ type InputWithQuestionMarks> = MarkOptional>; /** * Output with question marks type. */ type OutputWithQuestionMarks> = MarkOptional>; /** * Readonly output keys type. */ type ReadonlyOutputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends { readonly pipe: readonly unknown[]; } ? ReadonlyAction extends TEntries$1[TKey]["pipe"][number] ? TKey : never : never; }[keyof TEntries$1]; /** * Output with readonly type. */ type OutputWithReadonly>> = ReadonlyOutputKeys extends never ? TObject : Readonly & Pick>>; /** * Infer object input type. */ type InferObjectInput = Prettify>>; /** * Infer object output type. */ type InferObjectOutput = Prettify>>>; /** * Infer object issue type. */ type InferObjectIssue = InferIssue; //#endregion //#region src/types/issue.d.ts /** * Array path item interface. */ interface ArrayPathItem { /** * The path item type. */ readonly type: "array"; /** * The path item origin. */ readonly origin: "value"; /** * The path item input. */ readonly input: MaybeReadonly; /** * The path item key. */ readonly key: number; /** * The path item value. */ readonly value: unknown; } /** * Map path item interface. */ interface MapPathItem { /** * The path item type. */ readonly type: "map"; /** * The path item origin. */ readonly origin: "key" | "value"; /** * The path item input. */ readonly input: Map; /** * The path item key. */ readonly key: unknown; /** * The path item value. */ readonly value: unknown; } /** * Object path item interface. */ interface ObjectPathItem { /** * The path item type. */ readonly type: "object"; /** * The path item origin. */ readonly origin: "key" | "value"; /** * The path item input. */ readonly input: Record; /** * The path item key. */ readonly key: string; /** * The path item value. */ readonly value: unknown; } /** * Set path item interface. */ interface SetPathItem { /** * The path item type. */ readonly type: "set"; /** * The path item origin. */ readonly origin: "value"; /** * The path item input. */ readonly input: Set; /** * The path item key. */ readonly key: null; /** * The path item key. */ readonly value: unknown; } /** * Unknown path item interface. */ interface UnknownPathItem { /** * The path item type. */ readonly type: "unknown"; /** * The path item origin. */ readonly origin: "key" | "value"; /** * The path item input. */ readonly input: unknown; /** * The path item key. */ readonly key: unknown; /** * The path item value. */ readonly value: unknown; } /** * Issue path item type. */ type IssuePathItem = ArrayPathItem | MapPathItem | ObjectPathItem | SetPathItem | UnknownPathItem; /** * Base issue interface. */ interface BaseIssue extends Config$1> { /** * The issue kind. */ readonly kind: "schema" | "validation" | "transformation"; /** * The issue type. */ readonly type: string; /** * The raw input data. */ readonly input: TInput$1; /** * The expected property. */ readonly expected: string | null; /** * The received property. */ readonly received: string; /** * The error message. */ readonly message: string; /** * The input requirement. */ readonly requirement?: unknown | undefined; /** * The issue path. */ readonly path?: [IssuePathItem, ...IssuePathItem[]] | undefined; /** * The sub issues. */ readonly issues?: [BaseIssue, ...BaseIssue[]] | undefined; } //#endregion //#region src/types/config.d.ts /** * Config interface. */ interface Config$1> { /** * The selected language. */ readonly lang?: string | undefined; /** * The error message. */ readonly message?: ErrorMessage | undefined; /** * Whether it should be aborted early. */ readonly abortEarly?: boolean | undefined; /** * Whether a pipe should be aborted early. */ readonly abortPipeEarly?: boolean | undefined; } //#endregion //#region src/types/pipe.d.ts /** * Pipe action type. */ type PipeAction> = BaseValidation | BaseTransformation | BaseMetadata; /** * Pipe item type. */ type PipeItem> = BaseSchema | PipeAction; //#endregion //#region src/schemas/array/types.d.ts /** * Array issue interface. */ interface ArrayIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "array"; /** * The expected property. */ readonly expected: "Array"; } //#endregion //#region src/schemas/array/array.d.ts /** * Array schema interface. */ interface ArraySchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema[], InferOutput[], ArrayIssue | InferIssue> { /** * The schema type. */ readonly type: "array"; /** * The schema reference. */ readonly reference: typeof array; /** * The expected property. */ readonly expects: "Array"; /** * The array item schema. */ readonly item: TItem$1; /** * The error message. */ readonly message: TMessage; } /** * Creates an array schema. * * @param item The item schema. * * @returns An array schema. */ declare function array>>(item: TItem$1): ArraySchema; /** * Creates an array schema. * * @param item The item schema. * @param message The error message. * * @returns An array schema. */ declare function array>, const TMessage extends ErrorMessage | undefined>(item: TItem$1, message: TMessage): ArraySchema; //#endregion //#region src/schemas/boolean/boolean.d.ts /** * Boolean issue interface. */ interface BooleanIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "boolean"; /** * The expected property. */ readonly expected: "boolean"; } /** * Boolean schema interface. */ interface BooleanSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "boolean"; /** * The schema reference. */ readonly reference: typeof boolean; /** * The expected property. */ readonly expects: "boolean"; /** * The error message. */ readonly message: TMessage; } /** * Creates a boolean schema. * * @returns A boolean schema. */ declare function boolean(): BooleanSchema; /** * Creates a boolean schema. * * @param message The error message. * * @returns A boolean schema. */ declare function boolean | undefined>(message: TMessage): BooleanSchema; //#endregion //#region src/schemas/exactOptional/exactOptional.d.ts /** * Exact optional schema interface. */ interface ExactOptionalSchema>, TDefault extends Default> extends BaseSchema, InferOutput, InferIssue> { /** * The schema type. */ readonly type: "exact_optional"; /** * The schema reference. */ readonly reference: typeof exactOptional; /** * The expected property. */ readonly expects: TWrapped$1["expects"]; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates an exact optional schema. * * @param wrapped The wrapped schema. * * @returns An exact optional schema. */ declare function exactOptional>>(wrapped: TWrapped$1): ExactOptionalSchema; /** * Creates an exact optional schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns An exact optional schema. */ declare function exactOptional>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchema; //#endregion //#region src/schemas/exactOptional/exactOptionalAsync.d.ts /** * Exact optional schema async interface. */ interface ExactOptionalSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync, InferOutput, InferIssue> { /** * The schema type. */ readonly type: "exact_optional"; /** * The schema reference. */ readonly reference: typeof exactOptional | typeof exactOptionalAsync; /** * The expected property. */ readonly expects: TWrapped$1["expects"]; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates an exact optional schema. * * @param wrapped The wrapped schema. * * @returns An exact optional schema. */ declare function exactOptionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): ExactOptionalSchemaAsync; /** * Creates an exact optional schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns An exact optional schema. */ declare function exactOptionalAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchemaAsync; //#endregion //#region src/schemas/intersect/types.d.ts /** * Intersect issue interface. */ interface IntersectIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "intersect"; /** * The expected property. */ readonly expected: string; } /** * Intersect options type. */ type IntersectOptions = MaybeReadonly>[]>; /** * Intersect options async type. */ type IntersectOptionsAsync = MaybeReadonly<(BaseSchema> | BaseSchemaAsync>)[]>; /** * Infer option type. */ type InferOption = BaseSchema> | BaseSchemaAsync>; /** * Infer intersect input type. */ type InferIntersectInput = TOptions$1 extends readonly [InferOption, ...infer TRest] ? TRest extends readonly [InferOption, ...InferOption[]] ? TInput & InferIntersectInput : TInput : IsNever extends true ? never : UnionToIntersect>; /** * Infer intersect output type. */ type InferIntersectOutput = TOptions$1 extends readonly [InferOption, ...infer TRest] ? TRest extends readonly [InferOption, ...InferOption[]] ? TOutput & InferIntersectOutput : TOutput : IsNever extends true ? never : UnionToIntersect>; //#endregion //#region src/schemas/intersect/intersect.d.ts /** * Intersect schema interface. */ interface IntersectSchema | undefined> extends BaseSchema, InferIntersectOutput, IntersectIssue | InferIssue> { /** * The schema type. */ readonly type: "intersect"; /** * The schema reference. */ readonly reference: typeof intersect; /** * The intersect options. */ readonly options: TOptions$1; /** * The error message. */ readonly message: TMessage; } /** * Creates an intersect schema. * * @param options The intersect options. * * @returns An intersect schema. */ declare function intersect(options: TOptions$1): IntersectSchema; /** * Creates an intersect schema. * * @param options The intersect options. * @param message The error message. * * @returns An intersect schema. */ declare function intersect | undefined>(options: TOptions$1, message: TMessage): IntersectSchema; //#endregion //#region src/schemas/literal/literal.d.ts /** * Literal type. */ type Literal = bigint | boolean | number | string | symbol; /** * Literal issue interface. */ interface LiteralIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "literal"; /** * The expected property. */ readonly expected: string; } /** * Literal schema interface. */ interface LiteralSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "literal"; /** * The schema reference. */ readonly reference: typeof literal; /** * The literal value. */ readonly literal: TLiteral; /** * The error message. */ readonly message: TMessage; } /** * Creates a literal schema. * * @param literal_ The literal value. * * @returns A literal schema. */ declare function literal(literal_: TLiteral): LiteralSchema; /** * Creates a literal schema. * * @param literal_ The literal value. * @param message The error message. * * @returns A literal schema. */ declare function literal | undefined>(literal_: TLiteral, message: TMessage): LiteralSchema; //#endregion //#region src/schemas/union/types.d.ts /** * Union issue interface. */ interface UnionIssue> extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "union"; /** * The expected property. */ readonly expected: string; /** * The sub issues. */ readonly issues?: [TSubIssue, ...TSubIssue[]]; } //#endregion //#region src/schemas/union/union.d.ts /** * Union options type. */ type UnionOptions = MaybeReadonly>[]>; /** * Union schema interface. */ interface UnionSchema>> | undefined> extends BaseSchema, InferOutput, UnionIssue> | InferIssue> { /** * The schema type. */ readonly type: "union"; /** * The schema reference. */ readonly reference: typeof union; /** * The union options. */ readonly options: TOptions$1; /** * The error message. */ readonly message: TMessage; } /** * Creates an union schema. * * @param options The union options. * * @returns An union schema. */ declare function union(options: TOptions$1): UnionSchema; /** * Creates an union schema. * * @param options The union options. * @param message The error message. * * @returns An union schema. */ declare function union>> | undefined>(options: TOptions$1, message: TMessage): UnionSchema; //#endregion //#region src/schemas/nullable/types.d.ts /** * Infer nullable output type. */ type InferNullableOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | null : InferOutput | Extract, null>; //#endregion //#region src/schemas/nullable/nullable.d.ts /** * Nullable schema interface. */ interface NullableSchema>, TDefault extends Default> extends BaseSchema | null, InferNullableOutput, InferIssue> { /** * The schema type. */ readonly type: "nullable"; /** * The schema reference. */ readonly reference: typeof nullable; /** * The expected property. */ readonly expects: `(${TWrapped$1["expects"]} | null)`; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates a nullable schema. * * @param wrapped The wrapped schema. * * @returns A nullable schema. */ declare function nullable>>(wrapped: TWrapped$1): NullableSchema; /** * Creates a nullable schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns A nullable schema. */ declare function nullable>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): NullableSchema; //#endregion //#region src/schemas/nullish/types.d.ts /** * Infer nullish output type. */ type InferNullishOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | null | undefined : InferOutput | Extract, null | undefined>; //#endregion //#region src/schemas/nullish/nullish.d.ts /** * Nullish schema interface. */ interface NullishSchema>, TDefault extends Default> extends BaseSchema | null | undefined, InferNullishOutput, InferIssue> { /** * The schema type. */ readonly type: "nullish"; /** * The schema reference. */ readonly reference: typeof nullish; /** * The expected property. */ readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates a nullish schema. * * @param wrapped The wrapped schema. * * @returns A nullish schema. */ declare function nullish>>(wrapped: TWrapped$1): NullishSchema; /** * Creates a nullish schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns A nullish schema. */ declare function nullish>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): NullishSchema; //#endregion //#region src/schemas/nullish/nullishAsync.d.ts /** * Nullish schema async interface. */ interface NullishSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | null | undefined, InferNullishOutput, InferIssue> { /** * The schema type. */ readonly type: "nullish"; /** * The schema reference. */ readonly reference: typeof nullish | typeof nullishAsync; /** * The expected property. */ readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates a nullish schema. * * @param wrapped The wrapped schema. * * @returns A nullish schema. */ declare function nullishAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NullishSchemaAsync; /** * Creates a nullish schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns A nullish schema. */ declare function nullishAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): NullishSchemaAsync; //#endregion //#region src/schemas/number/number.d.ts /** * Number issue interface. */ interface NumberIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "number"; /** * The expected property. */ readonly expected: "number"; } /** * Number schema interface. */ interface NumberSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "number"; /** * The schema reference. */ readonly reference: typeof number; /** * The expected property. */ readonly expects: "number"; /** * The error message. */ readonly message: TMessage; } /** * Creates a number schema. * * @returns A number schema. */ declare function number(): NumberSchema; /** * Creates a number schema. * * @param message The error message. * * @returns A number schema. */ declare function number | undefined>(message: TMessage): NumberSchema; //#endregion //#region src/schemas/object/types.d.ts /** * Object issue interface. */ interface ObjectIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "object"; /** * The expected property. */ readonly expected: "Object" | `"${string}"`; } //#endregion //#region src/schemas/object/object.d.ts /** * Object schema interface. */ interface ObjectSchema | undefined> extends BaseSchema, InferObjectOutput, ObjectIssue | InferObjectIssue> { /** * The schema type. */ readonly type: "object"; /** * The schema reference. */ readonly reference: typeof object; /** * The expected property. */ readonly expects: "Object"; /** * The entries schema. */ readonly entries: TEntries$1; /** * The error message. */ readonly message: TMessage; } /** * Creates an object schema. * * Hint: This schema removes unknown entries. The output will only include the * entries you specify. To include unknown entries, use `looseObject`. To * return an issue for unknown entries, use `strictObject`. To include and * validate unknown entries, use `objectWithRest`. * * @param entries The entries schema. * * @returns An object schema. */ declare function object(entries: TEntries$1): ObjectSchema; /** * Creates an object schema. * * Hint: This schema removes unknown entries. The output will only include the * entries you specify. To include unknown entries, use `looseObject`. To * return an issue for unknown entries, use `strictObject`. To include and * validate unknown entries, use `objectWithRest`. * * @param entries The entries schema. * @param message The error message. * * @returns An object schema. */ declare function object | undefined>(entries: TEntries$1, message: TMessage): ObjectSchema; //#endregion //#region src/schemas/optional/types.d.ts /** * Infer optional output type. */ type InferOptionalOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | undefined : InferOutput | Extract, undefined>; //#endregion //#region src/schemas/optional/optional.d.ts /** * Optional schema interface. */ interface OptionalSchema>, TDefault extends Default> extends BaseSchema | undefined, InferOptionalOutput, InferIssue> { /** * The schema type. */ readonly type: "optional"; /** * The schema reference. */ readonly reference: typeof optional; /** * The expected property. */ readonly expects: `(${TWrapped$1["expects"]} | undefined)`; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates an optional schema. * * @param wrapped The wrapped schema. * * @returns An optional schema. */ declare function optional>>(wrapped: TWrapped$1): OptionalSchema; /** * Creates an optional schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns An optional schema. */ declare function optional>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): OptionalSchema; //#endregion //#region src/schemas/optional/optionalAsync.d.ts /** * Optional schema async interface. */ interface OptionalSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | undefined, InferOptionalOutput, InferIssue> { /** * The schema type. */ readonly type: "optional"; /** * The schema reference. */ readonly reference: typeof optional | typeof optionalAsync; /** * The expected property. */ readonly expects: `(${TWrapped$1["expects"]} | undefined)`; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates an optional schema. * * @param wrapped The wrapped schema. * * @returns An optional schema. */ declare function optionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): OptionalSchemaAsync; /** * Creates an optional schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns An optional schema. */ declare function optionalAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): OptionalSchemaAsync; //#endregion //#region src/schemas/record/types.d.ts /** * Record issue interface. */ interface RecordIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "record"; /** * The expected property. */ readonly expected: "Object"; } /** * Is literal type. */ type IsLiteral = string extends TKey$1 ? false : number extends TKey$1 ? false : symbol extends TKey$1 ? false : TKey$1 extends Brand ? false : true; /** * Optional keys type. */ type OptionalKeys> = { [TKey in keyof TObject]: IsLiteral extends true ? TKey : never; }[keyof TObject]; /** * With question marks type. * * Hint: We mark an entry as optional if we detect that its key is a literal * type. The reason for this is that it is not technically possible to detect * missing literal keys without restricting the key schema to `string`, `enum` * and `picklist`. However, if `enum` and `picklist` are used, it is better to * use `object` with `entriesFromList` because it already covers the needed * functionality. This decision also reduces the bundle size of `record`, * because it only needs to check the entries of the input and not any missing * keys. */ type WithQuestionMarks> = MarkOptional>; /** * With readonly type. */ type WithReadonly> | BaseSchemaAsync>, TObject extends WithQuestionMarks>> = TValue$1 extends { readonly pipe: readonly unknown[]; } ? ReadonlyAction extends TValue$1["pipe"][number] ? Readonly : TObject : TObject; /** * Infer record input type. */ type InferRecordInput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Prettify, InferInput>>>; /** * Infer record output type. */ type InferRecordOutput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Prettify, InferOutput>>>>; //#endregion //#region src/schemas/record/record.d.ts /** * Record schema interface. */ interface RecordSchema>, TValue$1 extends BaseSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferRecordOutput, RecordIssue | InferIssue | InferIssue> { /** * The schema type. */ readonly type: "record"; /** * The schema reference. */ readonly reference: typeof record; /** * The expected property. */ readonly expects: "Object"; /** * The record key schema. */ readonly key: TKey$1; /** * The record value schema. */ readonly value: TValue$1; /** * The error message. */ readonly message: TMessage; } /** * Creates a record schema. * * @param key The key schema. * @param value The value schema. * * @returns A record schema. */ declare function record>, const TValue$1 extends BaseSchema>>(key: TKey$1, value: TValue$1): RecordSchema; /** * Creates a record schema. * * @param key The key schema. * @param value The value schema. * @param message The error message. * * @returns A record schema. */ declare function record>, const TValue$1 extends BaseSchema>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): RecordSchema; //#endregion //#region src/schemas/string/string.d.ts /** * String issue interface. */ interface StringIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "string"; /** * The expected property. */ readonly expected: "string"; } /** * String schema interface. */ interface StringSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "string"; /** * The schema reference. */ readonly reference: typeof string; /** * The expected property. */ readonly expects: "string"; /** * The error message. */ readonly message: TMessage; } /** * Creates a string schema. * * @returns A string schema. */ declare function string(): StringSchema; /** * Creates a string schema. * * @param message The error message. * * @returns A string schema. */ declare function string | undefined>(message: TMessage): StringSchema; //#endregion //#region src/schemas/unknown/unknown.d.ts /** * Unknown schema interface. */ interface UnknownSchema extends BaseSchema { /** * The schema type. */ readonly type: "unknown"; /** * The schema reference. */ readonly reference: typeof unknown; /** * The expected property. */ readonly expects: "unknown"; } /** * Creates a unknown schema. * * @returns A unknown schema. */ declare function unknown(): UnknownSchema; //#endregion //#region src/actions/brand/brand.d.ts /** * Brand symbol. */ declare const BrandSymbol: unique symbol; /** * Brand name type. */ type BrandName = string | number | symbol; /** * Brand interface. */ interface Brand { [BrandSymbol]: { [TValue in TName]: TValue; }; } //#endregion //#region src/actions/check/types.d.ts /** * Check issue interface. */ interface CheckIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "validation"; /** * The issue type. */ readonly type: "check"; /** * The expected property. */ readonly expected: null; /** * The validation function. */ readonly requirement: (input: TInput$1) => MaybePromise; } //#endregion //#region src/actions/check/check.d.ts /** * Check action interface. */ interface CheckAction> | undefined> extends BaseValidation> { /** * The action type. */ readonly type: "check"; /** * The action reference. */ readonly reference: typeof check; /** * The expected property. */ readonly expects: null; /** * The validation function. */ readonly requirement: (input: TInput$1) => boolean; /** * The error message. */ readonly message: TMessage; } /** * Creates a check validation action. * * @param requirement The validation function. * * @returns A check action. */ declare function check(requirement: (input: TInput$1) => boolean): CheckAction; /** * Creates a check validation action. * * @param requirement The validation function. * @param message The error message. * * @returns A check action. */ declare function check> | undefined>(requirement: (input: TInput$1) => boolean, message: TMessage): CheckAction; //#endregion //#region src/actions/readonly/readonly.d.ts /** * Readonly output type. */ type ReadonlyOutput = TInput$1 extends Map ? ReadonlyMap : TInput$1 extends Set ? ReadonlySet : Readonly; /** * Readonly action interface. */ interface ReadonlyAction extends BaseTransformation, never> { /** * The action type. */ readonly type: "readonly"; /** * The action reference. */ readonly reference: typeof readonly; } /** * Creates a readonly transformation action. * * @returns A readonly action. */ declare function readonly(): ReadonlyAction; //#endregion //#region src/actions/transform/transform.d.ts /** * Transform action interface. */ interface TransformAction extends BaseTransformation { /** * The action type. */ readonly type: "transform"; /** * The action reference. */ readonly reference: typeof transform; /** * The transformation operation. */ readonly operation: (input: TInput$1) => TOutput$1; } /** * Creates a custom transformation action. * * @param operation The transformation operation. * * @returns A transform action. */ declare function transform(operation: (input: TInput$1) => TOutput$1): TransformAction; //#endregion //#region src/@types/options.d.ts declare const ZInputFormatType: UnionSchema<[LiteralSchema<"XMLDocument", undefined>, LiteralSchema<"niconicome", undefined>, LiteralSchema<"xml2js", undefined>, LiteralSchema<"formatted", undefined>, LiteralSchema<"legacy", undefined>, LiteralSchema<"legacyOwner", undefined>, LiteralSchema<"owner", undefined>, LiteralSchema<"v1", undefined>, LiteralSchema<"empty", undefined>, LiteralSchema<"default", undefined>], undefined>; type InputFormatType = InferOutput; type InputFormat = XMLDocument | Xml2jsPacket | FormattedCommentInput[] | FormattedLegacyCommentInput[] | RawApiResponse[] | OwnerComment[] | V1Thread[] | string | undefined; type ModeType = "default" | "html5" | "flash"; type BaseOptions = { config: Config; debug: boolean; enableLegacyPiP: boolean; format: InputFormatType; formatted: boolean; keepCA: boolean; mode: ModeType; scale: number; showCollision: boolean; showCommentCount: boolean; showFPS: boolean; useLegacy: boolean; video: HTMLVideoElement | undefined; lazy: boolean; }; type Options = Partial; type inputFormatType = InputFormatType; type inputFormat = InputFormat; //#endregion //#region src/@types/config.d.ts type ConfigItem = T | MultiConfigItem; type MultiConfigItem = { html5: T; flash: T; }; type ConfigSizeItem = { big: T; medium: T; small: T; }; type ConfigResizedItem = { default: T; resized: T; }; type ConfigFlashFontItem = { gulim: T; simsun: T; defont: T; }; type ConfigHTML5FontItem = { gothic: T; mincho: T; defont: T; }; type CommentStageSize = { width: number; fullWidth: number; height: number; }; type FlashCharList = { [key in "simsunStrong" | "simsunWeak" | "gulim" | "gothic"]: string; }; type FlashMode = "xp" | "vista"; type FlashScriptChar = { [key in "super" | "sub"]: string; }; type FontList = { [key in "gulim" | "simsun"]: string; }; type LineCounts = { [key in "default" | "resized" | "doubleResized"]: ConfigSizeItem; }; type BaseConfig = { cacheAge: number; canvasHeight: number; canvasWidth: number; collisionRange: { [key in "left" | "right"]: number; }; collisionPadding: number; colors: { [key: string]: string; }; commentDrawPadding: number; commentDrawRange: number; commentScale: ConfigItem; commentStageSize: ConfigItem; flashCommentYOffset: ConfigSizeItem>; flashCommentYPaddingTop: ConfigResizedItem; contextFillLiveOpacity: number; contextLineWidth: ConfigItem; contextStrokeColor: string; contextStrokeInversionColor: string; contextStrokeOpacity: number; flashChar: FlashCharList; flashMode: FlashMode; flashScriptChar: FlashScriptChar; flashThreshold: number; fonts: { flash: FontList; html5: PlatformFont; }; fontSize: ConfigItem>>; fpsInterval: number; html5HiResCommentCorrection: number; html5LineCounts: ConfigItem; lineHeight: ConfigItem>>; html5MinFontSize: number; sameCAGap: number; sameCAMinScore: number; sameCARange: number; sameCATimestampRange: number; flashLetterSpacing: number; flashScriptCharOffset: number; plugins: IPluginConstructor[]; commentPlugins: { class: typeof BaseComment; condition: (comment: FormattedComment, config: BaseConfig, options: BaseOptions) => boolean; }[]; commentLimit: number | undefined; hideCommentOrder: "asc" | "desc"; lineBreakCount: { [key in CommentSize]: number; }; nakaCommentSpeedOffset: number; atButtonPadding: number; atButtonRadius: number; flashDoubleResizeHeights: Partial>; flashLineBreakScale: ConfigSizeItem; compatSpacer: { flash: { [key: string]: Partial>; }; html5: { [key: string]: Partial>; }; }; }; type Config = Partial; //#endregion //#region src/@types/cursor.d.ts type Position = { x: number; y: number; }; //#endregion //#region src/@types/event.d.ts interface CommentEventBase { type: CommentEventName; timeStamp: number; vpos: number; } interface SeekDisableEvent extends CommentEventBase { type: "seekDisable"; } type SeekDisableEventHandler = (event: SeekDisableEvent) => unknown; interface SeekEnableEvent extends CommentEventBase { type: "seekEnable"; } type SeekEnableEventHandler = (event: SeekEnableEvent) => unknown; interface CommentDisableEvent extends CommentEventBase { type: "commentDisable"; } type CommentDisableEventHandler = (event: CommentDisableEvent) => unknown; interface CommentEnableEvent extends CommentEventBase { type: "commentEnable"; } type CommentEnableEventHandler = (event: CommentEnableEvent) => unknown; interface JumpEvent extends CommentEventBase { type: "jump"; to: string; message?: string; } type JumpEventHandler = (event: JumpEvent) => unknown; type CommentEventName = "seekDisable" | "seekEnable" | "commentDisable" | "commentEnable" | "jump"; type CommentEventHandler = SeekDisableEventHandler | SeekEnableEventHandler | CommentDisableEventHandler | CommentEnableEventHandler | JumpEventHandler; interface CommentEventHandlerMap { seekDisable: SeekDisableEventHandler; seekEnable: SeekEnableEventHandler; commentDisable: CommentDisableEventHandler; commentEnable: CommentEnableEventHandler; jump: JumpEventHandler; } interface CommentEventMap { seekDisable: SeekDisableEvent; seekEnable: SeekEnableEvent; commentDisable: CommentDisableEvent; commentEnable: CommentEnableEvent; jump: JumpEvent; } //#endregion //#region src/@types/fonts.d.ts type Platform = "win7" | "win8_1" | "win" | "mac10_9" | "mac10_11" | "mac" | "other"; declare const ZHTML5Fonts: UnionSchema<[LiteralSchema<"gothic", undefined>, LiteralSchema<"mincho", undefined>, LiteralSchema<"defont", undefined>], undefined>; type HTML5Fonts = InferOutput; type FontItem = { font: string; offset: number; weight: number; }; type PlatformFont = { [key in HTML5Fonts]: FontItem; }; //#endregion //#region src/@types/format.formatted.d.ts declare const ZFormattedComment: SchemaWithPipe, CheckAction]>, 0>; readonly vpos: OptionalSchema, CheckAction]>, 0>; readonly content: OptionalSchema, "">; readonly date: OptionalSchema, CheckAction]>, 0>; readonly date_usec: OptionalSchema, CheckAction]>, 0>; readonly owner: OptionalSchema, false>; readonly premium: OptionalSchema, false>; readonly mail: OptionalSchema, undefined>, readonly []>; readonly user_id: OptionalSchema, CheckAction]>, 0>; readonly layer: OptionalSchema, LiteralSchema<-2, undefined>, SchemaWithPipe, CheckAction]>], undefined>, undefined>; readonly ignoreScale: OptionalSchema, false>; readonly is_my_post: OptionalSchema, false>; }, undefined>, TransformAction<{ id: number; vpos: number; content: string; date: number; date_usec: number; owner: boolean; premium: boolean; mail: string[]; user_id: number; layer?: number | undefined; ignoreScale: boolean; is_my_post: boolean; }, { layer: number; id: number; vpos: number; content: string; date: number; date_usec: number; owner: boolean; premium: boolean; mail: string[]; user_id: number; ignoreScale: boolean; is_my_post: boolean; }>]>; type FormattedComment = InferOutput; type FormattedCommentInput = InferInput; declare const ZFormattedLegacyComment: Omit, CheckAction]>, 0>; readonly vpos: OptionalSchema, CheckAction]>, 0>; readonly content: OptionalSchema, "">; readonly date: OptionalSchema, CheckAction]>, 0>; readonly date_usec: OptionalSchema, CheckAction]>, 0>; readonly owner: OptionalSchema, false>; readonly premium: OptionalSchema, false>; readonly mail: OptionalSchema, undefined>, readonly []>; readonly user_id: OptionalSchema, CheckAction]>, 0>; readonly layer: OptionalSchema, LiteralSchema<-2, undefined>, SchemaWithPipe, CheckAction]>], undefined>, undefined>; readonly ignoreScale: OptionalSchema, false>; readonly is_my_post: OptionalSchema, false>; }, undefined>, "~types" | "~run" | "~standard" | "entries"> & { readonly entries: Omit<{ readonly id: OptionalSchema, CheckAction]>, 0>; readonly vpos: OptionalSchema, CheckAction]>, 0>; readonly content: OptionalSchema, "">; readonly date: OptionalSchema, CheckAction]>, 0>; readonly date_usec: OptionalSchema, CheckAction]>, 0>; readonly owner: OptionalSchema, false>; readonly premium: OptionalSchema, false>; readonly mail: OptionalSchema, undefined>, readonly []>; readonly user_id: OptionalSchema, CheckAction]>, 0>; readonly layer: OptionalSchema, LiteralSchema<-2, undefined>, SchemaWithPipe, CheckAction]>], undefined>, undefined>; readonly ignoreScale: OptionalSchema, false>; readonly is_my_post: OptionalSchema, false>; }, "user_id" | "layer" | "ignoreScale" | "is_my_post">; readonly "~standard": StandardProps<{ id?: number | undefined; vpos?: number | undefined; content?: string | undefined; date?: number | undefined; date_usec?: number | undefined; owner?: boolean | undefined; premium?: boolean | undefined; mail?: string[] | undefined; }, { id: number; vpos: number; content: string; date: number; date_usec: number; owner: boolean; premium: boolean; mail: string[]; }>; readonly "~run": (dataset: UnknownDataset, config: Config$1>) => OutputDataset<{ id: number; vpos: number; content: string; date: number; date_usec: number; owner: boolean; premium: boolean; mail: string[]; }, NumberIssue | CheckIssue | StringIssue | BooleanIssue | ArrayIssue | ObjectIssue>; readonly "~types"?: { readonly input: { id?: number | undefined; vpos?: number | undefined; content?: string | undefined; date?: number | undefined; date_usec?: number | undefined; owner?: boolean | undefined; premium?: boolean | undefined; mail?: string[] | undefined; }; readonly output: { id: number; vpos: number; content: string; date: number; date_usec: number; owner: boolean; premium: boolean; mail: string[]; }; readonly issue: NumberIssue | CheckIssue | StringIssue | BooleanIssue | ArrayIssue | ObjectIssue; } | undefined; }; type FormattedLegacyComment = InferOutput; type FormattedLegacyCommentInput = InferInput; type formattedComment = FormattedComment; type formattedLegacyComment = FormattedLegacyComment; //#endregion //#region src/@types/format.legacy.d.ts declare const ZApiChat: ObjectSchema<{ readonly thread: OptionalSchema, "">; readonly no: OptionalSchema, CheckAction]>, 0>; readonly vpos: SchemaWithPipe, CheckAction]>; readonly date: OptionalSchema, CheckAction]>, 0>; readonly date_usec: OptionalSchema, CheckAction]>, 0>; readonly nicoru: OptionalSchema, CheckAction]>, 0>; readonly premium: OptionalSchema, CheckAction]>, 0>; readonly anonymity: OptionalSchema, CheckAction]>, 0>; readonly user_id: OptionalSchema, "">; readonly mail: OptionalSchema, "">; readonly content: StringSchema; readonly deleted: OptionalSchema, CheckAction]>, 0>; }, undefined>; type ApiChat = InferOutput; declare const ZRawApiResponse: RecordSchema, UnknownSchema, undefined>; type RawApiResponse = InferOutput; declare const ZApiPing: ObjectSchema<{ readonly content: StringSchema; }, undefined>; type ApiPing = InferOutput; declare const ZApiThread: ObjectSchema<{ readonly resultcode: SchemaWithPipe, CheckAction]>; readonly thread: StringSchema; readonly server_time: SchemaWithPipe, CheckAction]>; readonly ticket: StringSchema; readonly revision: SchemaWithPipe, CheckAction]>; }, undefined>; type ApiThread = InferOutput; declare const ZApiLeaf: ObjectSchema<{ readonly thread: StringSchema; readonly count: SchemaWithPipe, CheckAction]>; }, undefined>; type ApiLeaf = InferOutput; declare const ZApiGlobalNumRes: ObjectSchema<{ readonly thread: StringSchema; readonly num_res: SchemaWithPipe, CheckAction]>; }, undefined>; type ApiGlobalNumRes = InferOutput; type rawApiResponse = RawApiResponse; //#endregion //#region src/@types/format.numeric.d.ts type NumberRangeOptions = { min?: number; max?: number; integer?: boolean; }; declare const isFiniteNumberInRange: (value: unknown, { min, max, integer }?: NumberRangeOptions) => value is number; declare const ZCommentId: SchemaWithPipe, CheckAction]>; declare const ZCommentVpos: SchemaWithPipe, CheckAction]>; declare const ZCommentDate: SchemaWithPipe, CheckAction]>; declare const ZCommentDateUsec: SchemaWithPipe, CheckAction]>; declare const ZCommentUserId: SchemaWithPipe, CheckAction]>; declare const VIEWER_DEFAULT_COLLISION_LAYER = -1; declare const OWNER_DEFAULT_COLLISION_LAYER = -2; declare const getDefaultCollisionLayer: (owner: boolean) => -1 | -2; declare const ZCommentLayer: UnionSchema<[LiteralSchema<-1, undefined>, LiteralSchema<-2, undefined>, SchemaWithPipe, CheckAction]>], undefined>; declare const ZCommentScore: SchemaWithPipe, CheckAction]>; declare const toFiniteNumberInRange: (value: unknown, options?: NumberRangeOptions) => number | undefined; //#endregion //#region src/@types/format.owner.d.ts declare const ZOwnerComment: ObjectSchema<{ readonly time: StringSchema; readonly command: OptionalSchema, "">; readonly comment: StringSchema; }, undefined>; type OwnerComment = InferOutput; type ownerComment = OwnerComment; //#endregion //#region src/@types/format.v1.d.ts declare const ZV1Comment: ObjectSchema<{ readonly id: StringSchema; readonly no: SchemaWithPipe, CheckAction]>; readonly vposMs: SchemaWithPipe, CheckAction]>; readonly body: StringSchema; readonly commands: ArraySchema, undefined>; readonly userId: StringSchema; readonly isPremium: BooleanSchema; readonly score: SchemaWithPipe, CheckAction]>; readonly postedAt: StringSchema; readonly nicoruCount: SchemaWithPipe, CheckAction]>; readonly nicoruId: NullableSchema, undefined>; readonly source: StringSchema; readonly isMyPost: BooleanSchema; }, undefined>; type V1Comment = InferOutput; declare const ZV1Thread: ObjectSchema<{ readonly id: UnknownSchema; readonly fork: StringSchema; readonly commentCount: OptionalSchema, CheckAction]>, 0>; readonly comments: ArraySchema; readonly no: SchemaWithPipe, CheckAction]>; readonly vposMs: SchemaWithPipe, CheckAction]>; readonly body: StringSchema; readonly commands: ArraySchema, undefined>; readonly userId: StringSchema; readonly isPremium: BooleanSchema; readonly score: SchemaWithPipe, CheckAction]>; readonly postedAt: StringSchema; readonly nicoruCount: SchemaWithPipe, CheckAction]>; readonly nicoruId: NullableSchema, undefined>; readonly source: StringSchema; readonly isMyPost: BooleanSchema; }, undefined>, undefined>; }, undefined>; type V1Thread = InferOutput; type v1Thread = V1Thread; //#endregion //#region src/@types/format.xml2js.d.ts declare const ZXml2jsChatItem: ObjectSchema<{ readonly _: OptionalSchema, "">; readonly $: ObjectSchema<{ readonly no: OptionalSchema, undefined>; readonly vpos: StringSchema; readonly date: OptionalSchema, "0">; readonly date_usec: OptionalSchema, "0">; readonly user_id: OptionalSchema, undefined>; readonly owner: OptionalSchema, "">; readonly premium: OptionalSchema, "">; readonly mail: OptionalSchema, "">; }, undefined>; }, undefined>; type Xml2jsChatItem = InferOutput; declare const ZXml2jsChat: ObjectSchema<{ readonly chat: ArraySchema, "">; readonly $: ObjectSchema<{ readonly no: OptionalSchema, undefined>; readonly vpos: StringSchema; readonly date: OptionalSchema, "0">; readonly date_usec: OptionalSchema, "0">; readonly user_id: OptionalSchema, undefined>; readonly owner: OptionalSchema, "">; readonly premium: OptionalSchema, "">; readonly mail: OptionalSchema, "">; }, undefined>; }, undefined>, undefined>; }, undefined>; type Xml2jsChat = InferOutput; declare const ZXml2jsPacket: ObjectSchema<{ readonly packet: ObjectSchema<{ readonly chat: ArraySchema, "">; readonly $: ObjectSchema<{ readonly no: OptionalSchema, undefined>; readonly vpos: StringSchema; readonly date: OptionalSchema, "0">; readonly date_usec: OptionalSchema, "0">; readonly user_id: OptionalSchema, undefined>; readonly owner: OptionalSchema, "">; readonly premium: OptionalSchema, "">; readonly mail: OptionalSchema, "">; }, undefined>; }, undefined>, undefined>; }, undefined>; }, undefined>; type Xml2jsPacket = InferOutput; //#endregion //#region src/@types/IComment.d.ts type FrameActiveState = { banActive: boolean; reverseActiveOwner: boolean; reverseActiveViewer: boolean; }; interface IComment { comment: FormattedCommentWithSize; invisible: boolean; index: number; loc: CommentLoc; width: number; long: number; height: number; vpos: number; flash: boolean; posY: number; owner: boolean; layer: number; ignoreScale: boolean; mail: string[]; content: string; image?: IRenderer | null; draw: (vpos: number, showCollision: boolean, cursor?: Position, frameActiveState?: FrameActiveState) => void; destroy?: () => void; isHovered: (cursor?: Position, posX?: number, posY?: number) => boolean; } //#endregion //#region src/@types/IPlugins.d.ts interface IPluginConstructor { id?: string; new (Canvas: IRenderer, comments: IComment[]): IPlugin; } interface IPlugin { draw?: (vpos: number) => boolean | undefined; addComments?: (comments: IComment[]) => void; transformComments?: (comments: IComment[]) => IComment[]; destroy?: () => void; } type IPluginList = { instance: IPlugin; canvas: IRenderer; }[]; //#endregion //#region src/@types/input-parser.d.ts interface InputParser { key: string[]; parse: (input: unknown) => FormattedComment[]; } //#endregion //#region src/@types/renderer.d.ts interface IRenderer { readonly rendererName: string; readonly canvas: HTMLCanvasElement; destroy(): void; drawVideo(enableLegacyPip: boolean): void; getFont(): string; getFillStyle(): string | CanvasGradient | CanvasPattern; setScale(scale: number, arg1?: number): void; fillRect(x: number, y: number, width: number, height: number): void; strokeRect(x: number, y: number, width: number, height: number): void; fillText(text: string, x: number, y: number): void; strokeText(text: string, x: number, y: number): void; quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; clearRect(x: number, y: number, width: number, height: number): void; setFont(font: string): void; setFillStyle(color: string): void; setStrokeStyle(color: string): void; setLineWidth(width: number): void; setGlobalAlpha(alpha: number): void; setSize(width: number, height: number): void; getSize(): { width: number; height: number; }; measureText(text: string): TextMetrics; measureTextAtDrawScale?(text: string, drawScale: number): TextMetrics; beginPath(): void; closePath(): void; moveTo(x: number, y: number): void; lineTo(x: number, y: number): void; stroke(): void; save(): void; restore(): void; getCanvas(padding?: number): IRenderer; drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void; flush(): void; needsRedraw?(): boolean; invalidateImage(image: IRenderer): void; } //#endregion //#region src/@types/types.d.ts type FormattedCommentWithFont = { id: number; vpos: number; date: number; date_usec: number; owner: boolean; premium: boolean; mail: string[]; user_id: number; layer: number; ignoreScale: boolean; loc: CommentLoc; size: CommentSize; fontSize: number; font: CommentFont; color: string; strokeColor?: string; wakuColor?: string; fillColor?: string; opacity?: number; commandScale?: number; full: boolean; ender: boolean; _live: boolean; long: number; invisible: boolean; content: CommentContentItem[]; rawContent: string; flash: boolean; lineCount: number; lineOffset: number; is_my_post: boolean; button?: ButtonParams; }; type FormattedCommentWithSize = FormattedCommentWithFont & { height: number; width: number; lineHeight: number; resized: boolean; resizedX: boolean; resizedY: boolean; content: CommentMeasuredContentItem[]; charSize: number; scale: number; scaleX: number; layerScale: number; buttonObjects?: ButtonList; }; type ParseContentResult = { content: CommentContentItem[]; lineCount: number; lineOffset: number; }; type ParseCommandAndNicoScriptResult = { flash: boolean; loc: CommentLoc; size: CommentSize; fontSize: number; color: string; strokeColor?: string; wakuColor?: string; fillColor?: string; opacity?: number; commandScale?: number; ignoreScale: boolean; font: CommentFont; full: boolean; ender: boolean; _live: boolean; invisible: boolean; long: number; button?: ButtonParams; }; declare const ZCommentFont: UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"mincho", undefined>, LiteralSchema<"gothic", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>; type CommentFont = InferOutput; declare const ZCommentHTML5Font: UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"mincho", undefined>, LiteralSchema<"gothic", undefined>], undefined>; type CommentHTML5Font = InferOutput; declare const ZCommentFlashFont: UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>; type CommentFlashFont = InferOutput; declare const ZCommentContentItemSpacer: ObjectSchema<{ readonly type: LiteralSchema<"spacer", undefined>; readonly char: StringSchema; readonly charWidth: NumberSchema; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly count: NumberSchema; }, undefined>; declare const ZCommentContentItemText: ObjectSchema<{ readonly type: LiteralSchema<"text", undefined>; readonly content: StringSchema; readonly slicedContent: ArraySchema, undefined>; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly width: OptionalSchema, undefined>, undefined>; }, undefined>; type CommentContentItemText = InferOutput; declare const ZCommentContentItem: UnionSchema<[ObjectSchema<{ readonly type: LiteralSchema<"spacer", undefined>; readonly char: StringSchema; readonly charWidth: NumberSchema; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly count: NumberSchema; }, undefined>, ObjectSchema<{ readonly type: LiteralSchema<"text", undefined>; readonly content: StringSchema; readonly slicedContent: ArraySchema, undefined>; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly width: OptionalSchema, undefined>, undefined>; }, undefined>], undefined>; type CommentContentItem = InferOutput; declare const ZCommentMeasuredContentItemText: IntersectSchema<[UnionSchema<[ObjectSchema<{ readonly type: LiteralSchema<"spacer", undefined>; readonly char: StringSchema; readonly charWidth: NumberSchema; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly count: NumberSchema; }, undefined>, ObjectSchema<{ readonly type: LiteralSchema<"text", undefined>; readonly content: StringSchema; readonly slicedContent: ArraySchema, undefined>; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly width: OptionalSchema, undefined>, undefined>; }, undefined>], undefined>, ObjectSchema<{ readonly width: ArraySchema, undefined>; }, undefined>], undefined>; declare const ZCommentMeasuredContentItem: UnionSchema<[IntersectSchema<[UnionSchema<[ObjectSchema<{ readonly type: LiteralSchema<"spacer", undefined>; readonly char: StringSchema; readonly charWidth: NumberSchema; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly count: NumberSchema; }, undefined>, ObjectSchema<{ readonly type: LiteralSchema<"text", undefined>; readonly content: StringSchema; readonly slicedContent: ArraySchema, undefined>; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly width: OptionalSchema, undefined>, undefined>; }, undefined>], undefined>, ObjectSchema<{ readonly width: ArraySchema, undefined>; }, undefined>], undefined>, ObjectSchema<{ readonly type: LiteralSchema<"spacer", undefined>; readonly char: StringSchema; readonly charWidth: NumberSchema; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly count: NumberSchema; }, undefined>], undefined>; type CommentMeasuredContentItem = InferOutput; type CommentFlashFontParsed = "gothic" | "gulim" | "simsunStrong" | "simsunWeak"; type CommentContentIndex = { index: number; font: CommentFlashFontParsed; }; declare const ZCommentSize: UnionSchema<[LiteralSchema<"big", undefined>, LiteralSchema<"medium", undefined>, LiteralSchema<"small", undefined>], undefined>; type CommentSize = InferOutput; declare const ZCommentLoc: UnionSchema<[LiteralSchema<"ue", undefined>, LiteralSchema<"naka", undefined>, LiteralSchema<"shita", undefined>], undefined>; type CommentLoc = InferOutput; type Collision = { [key in CollisionPos]: CollisionItem; }; type Timeline = { [key: number]: IComment[]; }; type CollisionPos = "ue" | "shita" | "right" | "left"; type CollisionItem = { [p: number]: IComment[]; }; type NicoScript = { reverse: NicoScriptReverse[]; ban: NicoScriptBan[]; default: NicoScriptDefault[]; replace: NicoScriptReplace[]; seekDisable: NicoScriptSeekDisable[]; jump: NicoScriptJump[]; }; type NicoScriptSeekDisable = { start: number; end: number; }; type NicoScriptJump = { start: number; end?: number; to: string; message?: string; }; type NicoScriptReverse = { target: NicoScriptReverseTarget; start: number; end: number; }; declare const ZNicoScriptReverseTarget: UnionSchema<[LiteralSchema<"コメ", undefined>, LiteralSchema<"投コメ", undefined>, LiteralSchema<"全", undefined>], undefined>; type NicoScriptReverseTarget = InferOutput; type NicoScriptReplace = { start: number; long: number | undefined; keyword: string; replace: string; range: NicoScriptReplaceRange; target: NicoScriptReplaceTarget; condition: NicoScriptReplaceCondition; color: string | undefined; size: CommentSize | undefined; font: CommentFont | undefined; loc: CommentLoc | undefined; no: number; }; declare const ZNicoScriptReplaceRange: UnionSchema<[LiteralSchema<"単", undefined>, LiteralSchema<"全", undefined>], undefined>; type NicoScriptReplaceRange = InferOutput; declare const ZNicoScriptReplaceTarget: UnionSchema<[LiteralSchema<"コメ", undefined>, LiteralSchema<"投コメ", undefined>, LiteralSchema<"全", undefined>, LiteralSchema<"含まない", undefined>, LiteralSchema<"含む", undefined>], undefined>; type NicoScriptReplaceTarget = InferOutput; declare const ZNicoScriptReplaceCondition: UnionSchema<[LiteralSchema<"部分一致", undefined>, LiteralSchema<"完全一致", undefined>], undefined>; type NicoScriptReplaceCondition = InferOutput; type NicoScriptBan = { start: number; end: number; }; type NicoScriptDefault = { start: number; long: number | undefined; color: string | undefined; size: CommentSize | undefined; font: CommentFont | undefined; loc: CommentLoc | undefined; }; type MeasureTextResult = { width: number; height: number; resized: boolean; resizedX: boolean; resizedY: boolean; fontSize: number; lineHeight: number; content: CommentMeasuredContentItem[]; charSize: number; scaleX: number; scale: number; }; type ButtonParams = { message: { before: string; body: string; after: string; }; commentMessage: string; commentMail: string[]; commentVisible: boolean; limit: number; local: boolean; hidden: boolean; }; type ParsedCommand = { loc: CommentLoc | undefined; size: CommentSize | undefined; fontSize: number | undefined; color: string | undefined; strokeColor?: string; wakuColor?: string; fillColor?: string; opacity?: number; commandScale?: number; ignoreScale?: boolean; font: CommentFont | undefined; full: boolean; ender: boolean; _live: boolean; invisible: boolean; long: number | undefined; button?: ButtonParams; }; type MeasureTextInput = FormattedCommentWithFont & { resized?: boolean; resizedY?: boolean; resizedX?: boolean; lineHeight?: number; charSize?: number; scale: number; layerScale: number; }; declare const ZMeasureInput: ObjectSchema<{ readonly font: UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"mincho", undefined>, LiteralSchema<"gothic", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>; readonly content: ArraySchema; readonly char: StringSchema; readonly charWidth: NumberSchema; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly count: NumberSchema; }, undefined>, ObjectSchema<{ readonly type: LiteralSchema<"text", undefined>; readonly content: StringSchema; readonly slicedContent: ArraySchema, undefined>; readonly isButton: OptionalSchema, undefined>; readonly font: OptionalSchema, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>; readonly width: OptionalSchema, undefined>, undefined>; }, undefined>], undefined>, undefined>; readonly lineHeight: NumberSchema; readonly charSize: NumberSchema; readonly lineCount: NumberSchema; }, undefined>; type MeasureInput = InferOutput; type ValueOf = T[keyof T]; declare namespace colors_d_exports { export { colors }; } declare const colors: { white: string; red: string; pink: string; orange: string; yellow: string; green: string; cyan: string; blue: string; purple: string; black: string; white2: string; niconicowhite: string; red2: string; truered: string; pink2: string; orange2: string; passionorange: string; yellow2: string; madyellow: string; green2: string; elementalgreen: string; cyan2: string; blue2: string; marinblue: string; purple2: string; nobleviolet: string; black2: string; }; declare namespace config_d_exports { export { defaultConfig, defaultOptions, resetOptions, setConfig, setOptions, updateConfig }; } declare let defaultConfig: BaseConfig; declare const updateConfig: (config: BaseConfig) => void; declare const setConfig: (config: BaseConfig) => void; declare const defaultOptions: BaseOptions; declare const setOptions: (options: BaseOptions) => void; declare const resetOptions: () => void; declare namespace fonts_d_exports { export { fontTemplates, fonts }; } declare const fontTemplates: { arial: { font: string; offset: number; weight: number; }; gothic: { font: string; offset: number; weight: number; }; gulim: { font: string; offset: number; weight: number; }; mincho: { font: string; offset: number; weight: number; }; simsun: { font: string; offset: number; weight: number; }; macGothicPro6: { font: string; offset: number; weight: number; }; macGothicPro3: { font: string; offset: number; weight: number; }; macMincho: { font: string; offset: number; weight: number; }; macGothic1: { font: string; offset: number; weight: number; }; macGothic2: { font: string; offset: number; weight: number; }; sansSerif600: { font: string; offset: number; weight: number; }; sansSerif400: { font: string; offset: number; weight: number; }; serif: { font: string; offset: number; weight: number; }; }; declare const fonts: { win7: { defont: FontItem; gothic: FontItem; mincho: FontItem; }; win8_1: { defont: FontItem; gothic: FontItem; mincho: FontItem; }; win: { defont: FontItem; gothic: FontItem; mincho: FontItem; }; mac10_9: { defont: FontItem; gothic: FontItem; mincho: FontItem; }; mac10_11: { defont: FontItem; gothic: FontItem; mincho: FontItem; }; mac: { defont: FontItem; gothic: FontItem; mincho: FontItem; }; other: { defont: FontItem; gothic: FontItem; mincho: FontItem; }; }; declare namespace initConfig_d_exports { export { initConfig }; } declare const initConfig: () => void; //#endregion //#region src/errors/CanvasRenderingContext2DError.d.ts declare class CanvasRenderingContext2DError extends Error { constructor(options?: { [key: string]: unknown; }); } //#endregion //#region src/errors/InvalidFormatError.d.ts declare class InvalidFormatError extends Error { constructor(options?: { [key: string]: unknown; }); } //#endregion //#region src/errors/InvalidOptionError.d.ts declare class InvalidOptionError extends Error { constructor(options?: { [key: string]: unknown; }); } //#endregion //#region src/errors/NotImplementedError.d.ts declare class NotImplementedError extends Error { pluginName: string; methodName: string; constructor(pluginName: string, methodName: string, options?: { [key: string]: unknown; }); } declare namespace index_d_exports$2 { export { CanvasRenderingContext2DError, InvalidFormatError, InvalidOptionError, NotImplementedError }; } declare namespace eventHandler_d_exports { export { EventHandler }; } declare class EventHandler { private handlerList; private handlerCounts; private readonly banActiveRangeScans; private readonly seekDisableActiveRangeScans; private readonly jumpActiveRangeScans; register(eventName: K, handler: CommentEventHandlerMap[K]): void; remove(eventName: K, handler: CommentEventHandlerMap[K]): void; trigger(vpos: number, lastVpos: number, nicoScripts: NicoScript): void; private _updateCounts; private _processCommentDisable; private _processSeekDisable; private _processJump; private _execute; } declare namespace inputParser_d_exports { export { convert2formattedComment as default }; } declare const convert2formattedComment: (data: unknown, type: InputFormatType) => FormattedComment[]; //#endregion //#region src/renderer/canvas.d.ts declare class CanvasRenderer implements IRenderer { readonly rendererName = "CanvasRenderer"; readonly canvas: HTMLCanvasElement; readonly video?: HTMLVideoElement; private readonly context; private padding; private width; private height; private static readonly _MT_CACHE_MAX_SIZE; private static _mtCache; private static _dsCanvas; private static _dsCtx; private static _dsScale; private static _dsFont; private readonly pooled; private readonly _onDestroy?; private _destroyed; constructor(canvas?: HTMLCanvasElement, video?: HTMLVideoElement, padding?: number, onDestroy?: () => void); private resetContextState; drawVideo(enableLegacyPip: boolean): void; getFont(): string; getFillStyle(): string | CanvasGradient | CanvasPattern; setScale(scale: number, arg1?: number): void; drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void; fillRect(x: number, y: number, width: number, height: number): void; strokeRect(x: number, y: number, width: number, height: number): void; fillText(text: string, x: number, y: number): void; strokeText(text: string, x: number, y: number): void; quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; clearRect(x: number, y: number, width: number, height: number): void; clear(): void; setFont(font: string): void; setFillStyle(color: string): void; setStrokeStyle(color: string): void; setLineWidth(width: number): void; setGlobalAlpha(alpha: number): void; setSize(width: number, height: number): void; getSize(): { width: number; height: number; }; getImagePadding(): number; measureText(text: string): TextMetrics; measureTextAtDrawScale(text: string, drawScale: number): TextMetrics; private _measureAtScale; beginPath(): void; closePath(): void; moveTo(x: number, y: number): void; lineTo(x: number, y: number): void; stroke(): void; save(): void; restore(): void; getCanvas(padding?: number): IRenderer; flush(): void; invalidateImage(_image: IRenderer): void; destroy(): void; } //#endregion //#region src/renderer/html5css.d.ts declare class HTML5CSSRenderer implements IRenderer { readonly rendererName = "HTML5CSSRenderer"; readonly canvas: HTMLCanvasElement; readonly root: HTMLElement; readonly layer: HTMLDivElement; readonly video?: HTMLVideoElement; private helper; private helperDirty; private helperCursor; private pathActive; private textDrawnBeforeDom; private readonly helperSurfaces; private videoSurface?; private width; private height; private state; private readonly stateStack; private readonly nodes; private prevNodeCursor; private activeCanvasSet; private prevCanvasSet; private readonly setupCanvases; private destroyed; private readonly cloneMap; private readonly cloneSourceMap; private duplicateCloneBudgetMap; private externalCanvasCopyFrameBudget; private readonly ownedCanvases; private readonly resizeObserver?; private readonly originalRootStyle; private nodeCursor; constructor(root: HTMLElement, video?: HTMLVideoElement); destroy(): void; drawVideo(enableLegacyPip: boolean): void; getFont(): string; getFillStyle(): string; setScale(scale: number, arg1?: number): void; fillRect(x: number, y: number, width: number, height: number): void; strokeRect(x: number, y: number, width: number, height: number): void; fillText(text: string, x: number, y: number): void; strokeText(text: string, x: number, y: number): void; quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; clearRect(_x: number, _y: number, _width: number, _height: number): void; setFont(font: string): void; setFillStyle(color: string): void; setStrokeStyle(color: string): void; setLineWidth(width: number): void; setGlobalAlpha(alpha: number): void; setSize(width: number, height: number): void; getSize(): { width: number; height: number; }; measureText(text: string): TextMetrics; beginPath(): void; closePath(): void; moveTo(x: number, y: number): void; lineTo(x: number, y: number): void; stroke(): void; save(): void; restore(): void; getCanvas(padding?: number): IRenderer; drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void; flush(): void; invalidateImage(image: IRenderer): void; private getNode; private positionNode; private updateObjectFitContain; private updateObjectFitContainWithSize; private getHelperSurface; private prepareHelperSurface; private commitHelperSurface; private keepVideoSurfaceFirst; private setupVideoCanvas; private setupSurfaceCanvas; private applyHelperScale; private recreateCurrentHelperSurface; private teardownSurfaceCanvas; private resetHelperContextDefaults; private shouldDrawOnOverflowHelper; private getCanvasByteSize; private canReserveCanvasCopyBudget; private incrementCanvasCopyBudget; private decrementCanvasCopyBudget; private reserveDuplicateClone; private reserveExternalCanvasCopy; private releaseDuplicateClone; private releaseExternalCanvasCopy; private resetDuplicateCloneAccounting; private trimHelperSurfaces; private resetState; private restoreFrameStartState; private toRenderState; private normalizeSize; private hideNode; private getInitialSize; private getPositiveNumber; private getNumber; } //#endregion //#region src/renderer/webgl2.d.ts declare class WebGL2Renderer implements IRenderer { readonly rendererName = "WebGL2Renderer"; readonly canvas: HTMLCanvasElement; readonly video?: HTMLVideoElement; private readonly gl; private spriteProg; private spriteLocRect; private spriteLocProj; private spriteLocAlpha; private rectProg; private rectLocRect; private rectLocProj; private rectLocColor; private quadVAO; private quadBuf; private readonly maxTextureSize; private tileCanvas; private tileCtx; private readonly proj; private scaleX; private scaleY; private state; private readonly stateStack; private readonly cmds; private readonly texMap; private frameCount; private helper; private helperDirty; private redrawNeeded; private readonly colorCtx; private readonly colorCache; private width; private height; private readonly _onContextLost; private readonly _onContextRestored; constructor(canvas: HTMLCanvasElement, video?: HTMLVideoElement); private _getUniformLocation; private _createHelper; private _createShader; private _createProgram; private _initGLResources; private _updateProjection; private _parseColor; private _createTexture; private _extractTile; private _buildTiles; private _uploadTexture; private _deleteTiles; private _gcTextures; private _rebuildGLResources; save(): void; restore(): void; setScale(scale: number, arg1?: number): void; getFont(): string; setFont(font: string): void; getFillStyle(): string; setFillStyle(color: string): void; setStrokeStyle(color: string): void; setLineWidth(width: number): void; setGlobalAlpha(alpha: number): void; setSize(width: number, height: number): void; getSize(): { width: number; height: number; }; getCanvas(padding?: number): IRenderer; clearRect(x: number, y: number, w: number, h: number): void; drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void; fillRect(x: number, y: number, w: number, h: number): void; strokeRect(x: number, y: number, w: number, h: number): void; drawVideo(enableLegacyPip: boolean): void; fillText(text: string, x: number, y: number): void; strokeText(text: string, x: number, y: number): void; measureText(text: string): TextMetrics; beginPath(): void; closePath(): void; moveTo(x: number, y: number): void; lineTo(x: number, y: number): void; quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; stroke(): void; flush(): void; invalidateImage(image: IRenderer): void; needsRedraw(): boolean; destroy(): void; } declare namespace index_d_exports$1 { export { CanvasRenderer, HTML5CSSRenderer, WebGL2Renderer, createRenderer }; } declare function createRenderer(canvas: HTMLCanvasElement, video?: HTMLVideoElement): IRenderer; declare namespace typeGuard_d_exports { export { MAX_OPTION_SCALE, typeGuard as default }; } declare const MAX_OPTION_SCALE = 8; declare const typeGuard: { formatted: { comment: (i: unknown) => i is FormattedComment; comments: (i: unknown) => i is FormattedComment[]; legacyComment: (i: unknown) => i is FormattedLegacyComment; legacyComments: (i: unknown) => i is FormattedLegacyComment[]; }; legacy: { rawApiResponses: (i: unknown) => i is RawApiResponse[]; apiChat: (i: unknown) => i is ApiChat; apiGlobalNumRes: (i: unknown) => i is ApiGlobalNumRes; apiLeaf: (i: unknown) => i is ApiLeaf; apiPing: (i: unknown) => i is ApiPing; apiThread: (i: unknown) => i is ApiThread; }; xmlDocument: (i: unknown) => i is XMLDocument; xml2js: { packet: (i: unknown) => i is Xml2jsPacket; chat: (i: unknown) => i is Xml2jsChat; chatItem: (i: unknown) => i is Xml2jsChatItem; }; legacyOwner: { comments: (i: unknown) => i is string; }; owner: { comment: (i: unknown) => i is OwnerComment; comments: (i: unknown) => i is OwnerComment[]; }; v1: { comment: (i: unknown) => i is V1Comment; comments: (i: unknown) => i is V1Comment[]; thread: (i: unknown) => i is V1Thread; threads: (i: unknown) => i is V1Thread[]; }; nicoScript: { range: { target: (i: unknown) => i is NicoScriptReverseTarget; }; replace: { range: (i: unknown) => i is NicoScriptReplaceRange; target: (i: unknown) => i is NicoScriptReplaceTarget; condition: (i: unknown) => i is NicoScriptReplaceCondition; }; }; comment: { font: (i: unknown) => i is CommentFont; loc: (i: unknown) => i is CommentLoc; size: (i: unknown) => i is CommentSize; command: { key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible"; }; color: (i: unknown) => i is keyof typeof colors; colorCode: (i: unknown) => i is string; colorCodeAllowAlpha: (i: unknown) => i is string; }; config: { initOptions: (item: unknown) => item is Options; }; internal: { CommentMeasuredContentItem: (i: unknown) => i is CommentMeasuredContentItem; CommentMeasuredContentItemArray: (i: unknown) => i is CommentMeasuredContentItem[]; MultiConfigItem: (i: unknown) => i is MultiConfigItem; HTML5Fonts: (i: unknown) => i is HTML5Fonts; MeasureInput: (i: unknown) => i is MeasureInput; }; }; //#endregion //#region src/utils/array.d.ts declare const arrayPush: (_array: { [key: number]: IComment[]; }, key: number, push: IComment) => void; declare const arrayEqual: (a: readonly unknown[], b: readonly unknown[]) => boolean; //#endregion //#region src/utils/color.d.ts declare const hex2rgb: (_hex: string) => number[]; declare const hex2rgba: (_hex: string) => number[]; declare const getStrokeColor: (comment: FormattedCommentWithSize, config: BaseConfig) => string; //#endregion //#region src/utils/comment.d.ts declare const DEFAULT_COMMENT_LONG = 300; declare const DEFAULT_NICOSCRIPT_LONG: number; declare const MAX_COMMENT_LONG: number; declare const MAX_NICOSCRIPT_LONG: number; declare const MAX_AT_BUTTON_COMMAND_CHARS = 16384; declare const MAX_AT_BUTTON_TEXT_CHARS = 4096; declare const MAX_AT_BUTTON_MAIL_ENTRIES = 16; declare const MAX_AT_BUTTON_MAIL_CHARS = 64; declare const MAX_AT_BUTTON_LIMIT = 100; declare const MAX_PARSED_COMMAND_MAIL_ENTRIES = 64; declare const MAX_PARSED_COMMAND_MAIL_CHARS = 128; declare const MAX_NICOSCRIPT_COMMAND_CHARS = 16384; declare const MAX_NICOSCRIPT_TEXT_CHARS = 4096; declare const MAX_LAZY_COMMENT_LOOKAHEAD: number; declare const getLazyCommentLookahead: (canvasWidth: number) => number; declare const isLineBreakResize: (comment: MeasureTextInput, config: BaseConfig) => boolean; declare const getDefaultCommand: (vpos: number, nicoScripts: NicoScript) => DefaultCommand; declare const parseCommandAndNicoScript: (comment: FormattedComment, ctx: CommentInstanceContext) => ParseCommandAndNicoScriptResult; declare const isFlashComment: (comment: FormattedComment, config: BaseConfig, options: BaseOptions) => boolean; declare const isReverseActive: (vpos: number, isOwner: boolean, nicoScripts: NicoScript, rangeCache: RangeCacheContext) => boolean; declare const isBanActive: (vpos: number, nicoScripts: NicoScript, rangeCache: RangeCacheContext) => boolean; declare const processFixedComment: (comment: IComment, collision: CollisionItem, timeline: Timeline, lazy: boolean | undefined, config: BaseConfig, touchedTimeline?: Set) => void; declare const processMovableComment: (comment: IComment, collision: Collision, timeline: Timeline, lazy: boolean | undefined, config: BaseConfig, touchedTimeline?: Set) => void; declare const getFixedPosY: (comment: IComment, collision: CollisionItem, config: BaseConfig) => number; declare const getMovablePosY: (comment: IComment, collision: Collision, beforeVpos: number, config: BaseConfig, speed?: number) => number; declare const getPosY: (_currentPos: number, targetComment: IComment, collision: IComment[] | undefined, config: BaseConfig) => { currentPos: number; isChanged: boolean; isBreak: boolean; }; declare const getPosX: (comment: FormattedCommentWithSize, vpos: number, config: BaseConfig, isReverse?: boolean) => number; declare const parseFont: (font: CommentFont, size: string | number, config: BaseConfig) => string; //#endregion //#region src/utils/commentArt.d.ts declare const changeCALayer: (rawData: FormattedComment[], config: BaseConfig) => FormattedComment[]; //#endregion //#region src/utils/config.d.ts declare const getConfig: (input: ConfigItem, isFlash?: boolean) => T; //#endregion //#region src/utils/flash.d.ts declare const MAX_FLASH_COMMENT_CHARS = 16384; declare const MAX_FLASH_COMMENT_LINES = 256; declare const MAX_FLASH_CONTENT_ITEMS = 2048; declare const clampFlashContent: (input: string) => { content: string; lineCount: number; }; declare const getFlashFontIndex: (part: string, config: BaseConfig) => CommentContentIndex[]; declare const getFlashFontName: (font: CommentFlashFontParsed) => CommentFlashFont; declare const parseContent: (content: string, config: BaseConfig) => ({ type: "spacer"; char: string; charWidth: number; isButton?: boolean | undefined; font?: "defont" | "gulim" | "simsun" | undefined; count: number; } | { type: "text"; content: string; slicedContent: string[]; isButton?: boolean | undefined; font?: "defont" | "gulim" | "simsun" | undefined; width?: number[] | undefined; })[]; declare const getButtonParts: (comment: FormattedCommentWithSize, config: BaseConfig) => FormattedCommentWithSize; declare const buildAtButtonComment: (comment: FormattedCommentWithSize, vpos: number) => FormattedComment | undefined; //#endregion //#region src/utils/niconico.d.ts declare const getLineHeight: (fontSize: CommentSize, isFlash: boolean, config: BaseConfig, resized?: boolean) => number; declare const getCharSize: (fontSize: CommentSize, isFlash: boolean, config: BaseConfig) => number; declare const measure: (comment: MeasureInput, renderer: IRenderer, config: BaseConfig, layerScale?: number) => { height: number; width: number; lineWidth: number[]; itemWidth: number[][]; }; declare const addHTML5PartToResult: (lineContent: CommentContentItem[], part: string, config: BaseConfig, _font?: CommentHTML5Font) => void; declare const getFontSizeAndScale: (_charSize: number, config: BaseConfig) => { scale: number; fontSize: number; }; //#endregion //#region src/utils/sort.d.ts declare const nativeSort: (getter: (input: T) => number) => (a: T, b: T) => 1 | 0 | -1; declare namespace index_d_exports { export { DEFAULT_COMMENT_LONG, DEFAULT_NICOSCRIPT_LONG, MAX_AT_BUTTON_COMMAND_CHARS, MAX_AT_BUTTON_LIMIT, MAX_AT_BUTTON_MAIL_CHARS, MAX_AT_BUTTON_MAIL_ENTRIES, MAX_AT_BUTTON_TEXT_CHARS, MAX_COMMENT_LONG, MAX_FLASH_COMMENT_CHARS, MAX_FLASH_COMMENT_LINES, MAX_FLASH_CONTENT_ITEMS, MAX_LAZY_COMMENT_LOOKAHEAD, MAX_NICOSCRIPT_COMMAND_CHARS, MAX_NICOSCRIPT_LONG, MAX_NICOSCRIPT_TEXT_CHARS, MAX_PARSED_COMMAND_MAIL_CHARS, MAX_PARSED_COMMAND_MAIL_ENTRIES, RangeCacheContext, addHTML5PartToResult, arrayEqual, arrayPush, buildAtButtonComment, changeCALayer, clampFlashContent, getButtonParts, getCharSize, getConfig, getDefaultCommand, getFixedPosY, getFlashFontIndex, getFlashFontName, getFontSizeAndScale, getLazyCommentLookahead, getLineHeight, getMovablePosY, getPosX, getPosY, getStrokeColor, hex2rgb, hex2rgba, isBanActive, isFlashComment, isLineBreakResize, isReverseActive, measure, nativeSort, parseCommandAndNicoScript, parseContent, parseFont, processFixedComment, processMovableComment }; } declare namespace internal_d_exports { export { index_d_exports$3 as comments, index_d_exports$4 as contexts, definition, index_d_exports$2 as errors, eventHandler_d_exports as eventHandler, inputParser_d_exports as inputParser, index_d_exports$1 as renderer, typeGuard_d_exports as typeGuard, index_d_exports as utils }; } declare const definition: { colors: typeof colors_d_exports; config: typeof config_d_exports; fonts: typeof fonts_d_exports; initConfig: typeof initConfig_d_exports; }; //#endregion //#region src/main.d.ts declare class NiconiComments { enableLegacyPiP: boolean; showCollision: boolean; showFPS: boolean; showCommentCount: boolean; private lastVpos; private lastEventVpos; private lastCursor?; private lastFrameBanActive; private frameDirty; private get lastVposInt(); private _cachedSplit; private lazyCommentOrderSortedByVpos; private nextUnprocessedCommentIndex; private commentArrayIndexMap; private processedCommentIndex; private comments; private destroyed; private readonly renderer; private readonly collision; private readonly timeline; private readonly ctx; private readonly eventHandler; private plugins; static typeGuard: { formatted: { comment: (i: unknown) => i is FormattedComment; comments: (i: unknown) => i is FormattedComment[]; legacyComment: (i: unknown) => i is FormattedLegacyComment; legacyComments: (i: unknown) => i is FormattedLegacyComment[]; }; legacy: { rawApiResponses: (i: unknown) => i is RawApiResponse[]; apiChat: (i: unknown) => i is ApiChat; apiGlobalNumRes: (i: unknown) => i is ApiGlobalNumRes; apiLeaf: (i: unknown) => i is ApiLeaf; apiPing: (i: unknown) => i is ApiPing; apiThread: (i: unknown) => i is ApiThread; }; xmlDocument: (i: unknown) => i is XMLDocument; xml2js: { packet: (i: unknown) => i is Xml2jsPacket; chat: (i: unknown) => i is Xml2jsChat; chatItem: (i: unknown) => i is Xml2jsChatItem; }; legacyOwner: { comments: (i: unknown) => i is string; }; owner: { comment: (i: unknown) => i is OwnerComment; comments: (i: unknown) => i is OwnerComment[]; }; v1: { comment: (i: unknown) => i is V1Comment; comments: (i: unknown) => i is V1Comment[]; thread: (i: unknown) => i is V1Thread; threads: (i: unknown) => i is V1Thread[]; }; nicoScript: { range: { target: (i: unknown) => i is NicoScriptReverseTarget; }; replace: { range: (i: unknown) => i is NicoScriptReplaceRange; target: (i: unknown) => i is NicoScriptReplaceTarget; condition: (i: unknown) => i is NicoScriptReplaceCondition; }; }; comment: { font: (i: unknown) => i is CommentFont; loc: (i: unknown) => i is CommentLoc; size: (i: unknown) => i is CommentSize; command: { key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible"; }; 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"; colorCode: (i: unknown) => i is string; colorCodeAllowAlpha: (i: unknown) => i is string; }; config: { initOptions: (item: unknown) => item is Options; }; internal: { CommentMeasuredContentItem: (i: unknown) => i is CommentMeasuredContentItem; CommentMeasuredContentItemArray: (i: unknown) => i is CommentMeasuredContentItem[]; MultiConfigItem: (i: unknown) => i is MultiConfigItem; HTML5Fonts: (i: unknown) => i is HTML5Fonts; MeasureInput: (i: unknown) => i is MeasureInput; }; }; static default: typeof NiconiComments; static readonly BAN_FRAME_POSITION_RESOLUTION_BUDGET = 256; static FlashComment: { condition: (comment: FormattedComment, config: BaseConfig, options: BaseOptions) => boolean; class: typeof FlashComment; }; static internal: typeof internal_d_exports; constructor(_renderer: IRenderer | HTMLCanvasElement, data: InputFormat, initOptions?: Options); destroy(): void; private _clearTimeline; private _clearCollision; private _rebuildCommentArrayIndex; private _advanceNextUnprocessedCommentIndex; private preRendering; private getCommentPos; private resolveLazyCommentWindow; private sortTimelineComment; addComments(...rawComments: FormattedCommentInput[]): void; drawCanvas(vpos: number, forceRendering?: boolean, cursor?: Position): boolean; private _drawVideo; private _drawComments; private _drawCollision; private _drawFPS; private _drawCommentCount; addEventListener(eventName: K, handler: CommentEventHandlerMap[K]): void; removeEventListener(eventName: K, handler: CommentEventHandlerMap[K]): void; clear(): void; click(vpos: number, pos: Position): void; private _log; } //#endregion 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 FormattedCommentInput, type FormattedCommentWithFont, type FormattedCommentWithSize, type FormattedLegacyComment, type FormattedLegacyCommentInput, type FrameActiveState, type HTML5Fonts, type IComment, type IPlugin, type IPluginConstructor, type IPluginList, type IRenderer, type InputFormat, type InputFormatType, type InputParser, 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 OWNER_DEFAULT_COLLISION_LAYER, 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 VIEWER_DEFAULT_COLLISION_LAYER, type ValueOf, type Xml2jsChat, type Xml2jsChatItem, type Xml2jsPacket, type ZApiChat, type ZApiGlobalNumRes, type ZApiLeaf, type ZApiPing, type ZApiThread, type ZCommentContentItem, type ZCommentContentItemSpacer, type ZCommentContentItemText, type ZCommentDate, type ZCommentDateUsec, type ZCommentFlashFont, type ZCommentFont, type ZCommentHTML5Font, type ZCommentId, type ZCommentLayer, type ZCommentLoc, type ZCommentMeasuredContentItem, type ZCommentMeasuredContentItemText, type ZCommentScore, type ZCommentSize, type ZCommentUserId, type ZCommentVpos, type ZFormattedComment, type ZFormattedLegacyComment, type ZHTML5Fonts, type ZInputFormatType, type ZMeasureInput, type ZNicoScriptReplaceCondition, type ZNicoScriptReplaceRange, type ZNicoScriptReplaceTarget, type ZNicoScriptReverseTarget, type ZOwnerComment, type ZRawApiResponse, type ZV1Comment, type ZV1Thread, type ZXml2jsChat, type ZXml2jsChatItem, type ZXml2jsPacket, NiconiComments as default, type formattedComment, type formattedLegacyComment, type getDefaultCollisionLayer, type inputFormat, type inputFormatType, type isFiniteNumberInRange, type ownerComment, type rawApiResponse, type toFiniteNumberInRange, type v1Thread }; //# sourceMappingURL=bundle.d.ts.map