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;
};

type Canvas = HTMLCanvasElement;
type Context2D = CanvasRenderingContext2D;

type DefaultCommand = {
    color?: string;
    size?: CommentSize;
    font?: CommentFont;
    loc?: CommentLoc;
};

declare class BaseComment implements IComment {
    protected readonly renderer: IRenderer;
    protected cacheKey: string;
    comment: FormattedCommentWithSize;
    pos: {
        x: number;
        y: number;
    };
    posY: number;
    readonly pluginName: string;
    image?: IRenderer | null;
    buttonImage?: IRenderer | null;
    index: number;
    constructor(comment: FormattedComment, renderer: IRenderer, index: number);
    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 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): 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 getButtonImage(posX: number, posY: number, cursor?: Position): IRenderer | undefined;
    isHovered(cursor?: Position, posX?: number, posY?: number): boolean;
    protected getCacheKey(): string;
}

declare class FlashComment extends BaseComment {
    private _globalScale;
    readonly pluginName: string;
    buttonImage: IRenderer;
    constructor(comment: FormattedComment, renderer: IRenderer, index: number);
    get content(): string;
    set content(input: string);
    convertComment(comment: FormattedComment): FormattedCommentWithSize;
    getCommentSize(parsedData: FormattedCommentWithFont): FormattedCommentWithSize;
    parseCommandAndNicoscript(comment: FormattedComment): FormattedCommentWithFont;
    parseContent(input: string, button?: ButtonParams): {
        content: ({
            type: "spacer";
            char: string;
            charWidth: number;
            count: number;
            isButton?: boolean | undefined;
            font?: "defont" | "gulim" | "simsun" | undefined;
        } | {
            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;
    getButtonImage(posX: number, posY: number, cursor?: Position): IRenderer | undefined;
    isHovered(_cursor?: Position, _posX?: number, _posY?: number): boolean;
    protected _setupCanvas(renderer: IRenderer): {
        renderer: IRenderer;
    };
}

declare class HTML5Comment extends BaseComment {
    readonly pluginName: string;
    constructor(comment: FormattedComment, context: IRenderer, index: number);
    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;
    _generateTextImage(): IRenderer;
    getButtonImage(): undefined;
    isHovered(): boolean;
}

type index_d$4_BaseComment = BaseComment;
declare const index_d$4_BaseComment: typeof BaseComment;
type index_d$4_FlashComment = FlashComment;
declare const index_d$4_FlashComment: typeof FlashComment;
type index_d$4_HTML5Comment = HTML5Comment;
declare const index_d$4_HTML5Comment: typeof HTML5Comment;
declare namespace index_d$4 {
  export { index_d$4_BaseComment as BaseComment, index_d$4_FlashComment as FlashComment, index_d$4_HTML5Comment as HTML5Comment };
}

type ConfigItem<T> = T | MultiConfigItem<T>;
type MultiConfigItem<T> = {
    html5: T;
    flash: T;
};
type ConfigSizeItem<T> = {
    big: T;
    medium: T;
    small: T;
};
type ConfigResizedItem<T> = {
    default: T;
    resized: T;
};
type ConfigFlashFontItem<T> = {
    gulim: T;
    simsun: T;
    defont: T;
};
type ConfigHTML5FontItem<T> = {
    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<number>;
};
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<number>;
    commentStageSize: ConfigItem<CommentStageSize>;
    flashCommentYOffset: ConfigSizeItem<ConfigResizedItem<number>>;
    flashCommentYPaddingTop: ConfigResizedItem<number>;
    contextFillLiveOpacity: number;
    contextLineWidth: ConfigItem<number>;
    contextStrokeColor: string;
    contextStrokeInversionColor: string;
    contextStrokeOpacity: number;
    flashChar: FlashCharList;
    flashMode: FlashMode;
    flashScriptChar: FlashScriptChar;
    flashThreshold: number;
    fonts: {
        flash: FontList;
        html5: PlatformFont;
    };
    fontSize: ConfigItem<ConfigSizeItem<ConfigResizedItem<number>>>;
    fpsInterval: number;
    html5HiResCommentCorrection: number;
    html5LineCounts: ConfigItem<LineCounts>;
    lineHeight: ConfigItem<ConfigSizeItem<ConfigResizedItem<number>>>;
    html5MinFontSize: number;
    sameCAGap: number;
    sameCAMinScore: number;
    sameCARange: number;
    sameCATimestampRange: number;
    flashLetterSpacing: number;
    flashScriptCharOffset: number;
    plugins: IPluginConstructor[];
    commentPlugins: {
        class: typeof BaseComment;
        condition: (comment: FormattedComment) => boolean;
    }[];
    commentLimit: number | undefined;
    hideCommentOrder: "asc" | "desc";
    lineBreakCount: {
        [key in CommentSize]: number;
    };
    nakaCommentSpeedOffset: number;
    atButtonPadding: number;
    atButtonRadius: number;
    flashDoubleResizeHeights: Partial<ConfigSizeItem<{
        [key: number]: number;
    }>>;
    flashLineBreakScale: ConfigSizeItem<number>;
    compatSpacer: {
        flash: {
            [key: string]: Partial<ConfigFlashFontItem<number>>;
        };
        html5: {
            [key: string]: Partial<ConfigHTML5FontItem<number>>;
        };
    };
};
type Config = Partial<BaseConfig>;

type Position = {
    x: number;
    y: number;
};

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;
}

/**
 * Pipe action context type.
 */
interface PipeActionContext {
    type: string;
    expects: string | null;
    message: ErrorMessage | undefined;
    requirement: unknown;
}
/**
 * Valid action result type.
 */
interface ValidActionResult<TOutput> {
    /**
     * The pipe output.
     */
    output: TOutput;
    /**
     * The pipe issues.
     */
    issues?: undefined;
}
/**
 * Invalid action result type.
 */
interface InvalidActionResult {
    /**
     * The pipe output.
     */
    output?: undefined;
    /**
     * The pipe issues.
     */
    issues: PipeActionIssues;
}
/**
 * Pipe action result type.
 */
type PipeActionResult<TOutput> = ValidActionResult<TOutput> | InvalidActionResult;
/**
 * Base validation type.
 */
interface BaseValidation<TInput = any> {
    /**
     * The validation type.
     */
    type: string;
    /**
     * The expected property.
     */
    expects: string | null;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * Whether it's async.
     */
    async: false;
    /**
     * The validation requirement.
     */
    requirement: unknown;
    /**
     * Parses unknown input based on its requirement.
     *
     * @param input The input to be parsed.
     *
     * @returns The pipe action result.
     *
     * @internal
     */
    _parse(input: TInput): PipeActionResult<TInput>;
}
/**
 * Base validation async type.
 */
interface BaseValidationAsync<TInput = any> {
    /**
     * The validation type.
     */
    type: string;
    /**
     * The expected property.
     */
    expects: string | null;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * Whether it's async.
     */
    async: true;
    /**
     * The validation requirement.
     */
    requirement: unknown;
    /**
     * Parses unknown input based on its requirement.
     *
     * @param input The input to be parsed.
     *
     * @returns The pipe action result.
     *
     * @internal
     */
    _parse(input: TInput): Promise<PipeActionResult<TInput>>;
}
/**
 * Base transformation type.
 */
interface BaseTransformation<TInput = any> {
    /**
     * The transformation type.
     */
    type: string;
    /**
     * Whether it's async.
     */
    async: false;
    /**
     * Parses unknown input based on its requirement.
     *
     * @param input The input to be parsed.
     *
     * @returns The pipe action result.
     *
     * @internal
     */
    _parse(input: TInput): PipeActionResult<TInput>;
}
/**
 * Base transformation async type.
 */
interface BaseTransformationAsync<TInput = any> {
    /**
     * The transformation type.
     */
    type: string;
    /**
     * Whether it's async.
     */
    async: true;
    /**
     * Parses unknown input based on its requirement.
     *
     * @param input The input to be parsed.
     *
     * @returns The pipe action result.
     *
     * @internal
     */
    _parse(input: TInput): Promise<PipeActionResult<TInput>>;
}
/**
 * Pipe type.
 */
type Pipe<TInput> = (BaseValidation<TInput> | BaseTransformation<TInput>)[];
/**
 * Pipe async type.
 */
type PipeAsync<TInput> = (BaseValidation<TInput> | BaseValidationAsync<TInput> | BaseTransformation<TInput> | BaseTransformationAsync<TInput>)[];

/**
 * Issue reason type.
 */
type IssueReason = 'any' | 'array' | 'bigint' | 'blob' | 'boolean' | 'date' | 'intersect' | 'function' | 'instance' | 'map' | 'number' | 'object' | 'record' | 'set' | 'special' | 'string' | 'symbol' | 'tuple' | 'undefined' | 'union' | 'unknown' | 'variant' | 'type';
/**
 * Unknown path item type.
 */
interface UnknownPathItem {
    type: 'unknown';
    origin: 'key' | 'value';
    input: unknown;
    key: unknown;
    value: unknown;
}
/**
 * Path item type.
 */
type PathItem = ArrayPathItem | MapPathItem | ObjectPathItem | RecordPathItem | SetPathItem | TuplePathItem | UnknownPathItem;
/**
 * Issue path type.
 */
type IssuePath = [PathItem, ...PathItem[]];
/**
 * Schema issue type.
 */
interface SchemaIssue extends Omit<SchemaConfig, 'message'> {
    /**
     * The issue reason.
     */
    reason: IssueReason;
    /**
     * The context name.
     */
    context: string;
    /**
     * The raw input data.
     */
    input: unknown;
    /**
     * The expected input.
     */
    expected: string | null;
    /**
     * The received input.
     */
    received: string;
    /**
     * The error message.
     */
    message: string;
    /**
     * The validation requirement
     */
    requirement?: unknown;
    /**
     * The issue path.
     */
    path?: IssuePath;
    /**
     * The sub issues.
     */
    issues?: SchemaIssues;
}
/**
 * Schema issues type.
 */
type SchemaIssues = [SchemaIssue, ...SchemaIssue[]];
/**
 * Pipe action issue type.
 */
interface PipeActionIssue {
    context: PipeActionContext;
    reference: Function;
    input: unknown;
    label: string;
    received?: string;
    path?: IssuePath;
}
/**
 * Pipe action issues type.
 */
type PipeActionIssues = [PipeActionIssue, ...PipeActionIssue[]];

/**
 * Error message type.
 */
type ErrorMessage = string | ((issue: SchemaIssue) => string);
/**
 * The schema config type.
 */
interface SchemaConfig {
    /**
     * The selected language.
     */
    lang?: string;
    /**
     * The error message.
     */
    message?: ErrorMessage;
    /**
     * Whether it was abort early.
     */
    abortEarly?: boolean;
    /**
     * Whether the pipe was abort early.
     */
    abortPipeEarly?: boolean;
    /**
     * Whether the pipe was skipped.
     */
    skipPipe?: boolean;
}

/**
 * Typed schema result type.
 */
interface TypedSchemaResult<TOutput> {
    /**
     * Whether is's typed.
     */
    typed: true;
    /**
     * The parse output.
     */
    output: TOutput;
    /**
     * The parse issues.
     */
    issues?: SchemaIssues;
}
/**
 * Untyped schema result type.
 */
interface UntypedSchemaResult {
    /**
     * Whether is's typed.
     */
    typed: false;
    /**
     * The parse output.
     */
    output: unknown;
    /**
     * The parse issues.
     */
    issues: SchemaIssues;
}
/**
 * Schema result type.
 */
type SchemaResult<TOutput> = TypedSchemaResult<TOutput> | UntypedSchemaResult;
/**
 * Base schema type.
 */
interface BaseSchema<TInput = any, TOutput = TInput> {
    /**
     * The schema type.
     */
    type: string;
    /**
     * The expected property.
     */
    expects: string;
    /**
     * Whether it's async.
     */
    async: false;
    /**
     * Parses unknown input based on its schema.
     *
     * @param input The input to be parsed.
     * @param config The parse configuration.
     *
     * @returns The schema result.
     *
     * @internal
     */
    _parse(input: unknown, config?: SchemaConfig): SchemaResult<TOutput>;
    /**
     * Input and output type.
     *
     * @internal
     */
    _types?: {
        input: TInput;
        output: TOutput;
    };
}
/**
 * Base schema async type.
 */
interface BaseSchemaAsync<TInput = any, TOutput = TInput> {
    /**
     * The schema type.
     */
    type: string;
    /**
     * The expected property.
     */
    expects: string;
    /**
     * Whether it's async.
     */
    async: true;
    /**
     * Parses unknown input based on its schema.
     *
     * @param input The input to be parsed.
     * @param config The parse configuration.
     *
     * @returns The schema result.
     *
     * @internal
     */
    _parse(input: unknown, config?: SchemaConfig): Promise<SchemaResult<TOutput>>;
    /**
     * Input and output type.
     *
     * @internal
     */
    _types?: {
        input: TInput;
        output: TOutput;
    };
}
/**
 * Input inference type.
 */
type Input<TSchema extends BaseSchema | BaseSchemaAsync> = NonNullable<TSchema['_types']>['input'];
/**
 * Output inference type.
 */
type Output<TSchema extends BaseSchema | BaseSchemaAsync> = NonNullable<TSchema['_types']>['output'];

/**
 * Default type.
 */
type Default<TSchema extends BaseSchema> = Input<TSchema> | (() => Input<TSchema> | undefined) | undefined;
/**
 * Default async type.
 */
type DefaultAsync<TSchema extends BaseSchema | BaseSchemaAsync> = Input<TSchema> | (() => Input<TSchema> | Promise<Input<TSchema> | undefined> | undefined) | undefined;
/**
 * Maybe readonly type.
 */
type MaybeReadonly<T> = T | Readonly<T>;
/**
 * Resolve type.
 *
 * 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 Resolve<T> = T;
/**
 * Resolve object type.
 *
 * 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 ResolveObject<T> = Resolve<{
    [k in keyof T]: T[k];
}>;

/**
 * Array schema type.
 */
interface ArraySchema<TItem extends BaseSchema, TOutput = Output<TItem>[]> extends BaseSchema<Input<TItem>[], TOutput> {
    /**
     * The schema type.
     */
    type: 'array';
    /**
     * The array item schema.
     */
    item: TItem;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<Output<TItem>[]> | undefined;
}

/**
 * Array path item type.
 */
interface ArrayPathItem {
    type: 'array';
    origin: 'value';
    input: unknown[];
    key: number;
    value: unknown;
}

/**
 * Boolean schema type.
 */
interface BooleanSchema<TOutput = boolean> extends BaseSchema<boolean, TOutput> {
    /**
     * The schema type.
     */
    type: 'boolean';
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<boolean> | undefined;
}

/**
 * Enum type.
 */
interface Enum {
    [key: string]: string | number;
    [key: number]: string;
}
/**
 * Native enum schema type.
 */
interface EnumSchema<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> extends BaseSchema<TEnum[keyof TEnum], TOutput> {
    /**
     * The schema type.
     */
    type: 'enum';
    /**
     * The enum value.
     */
    enum: TEnum;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
}

/**
 * Native enum schema async type.
 */
interface EnumSchemaAsync<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> extends BaseSchemaAsync<TEnum[keyof TEnum], TOutput> {
    /**
     * The schema type.
     */
    type: 'enum';
    /**
     * The enum value.
     */
    enum: TEnum;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
}

/**
 * Intersect options async type.
 */
type IntersectOptionsAsync = MaybeReadonly<[
    BaseSchema | BaseSchemaAsync,
    BaseSchema | BaseSchemaAsync,
    ...(BaseSchema[] | BaseSchemaAsync[])
]>;

/**
 * Intersect input inference type.
 */
type IntersectInput<TIntersectOptions extends IntersectOptions | IntersectOptionsAsync> = TIntersectOptions extends [
    BaseSchema<infer TInput1, any> | BaseSchemaAsync<infer TInput1, any>,
    ...infer TRest
] ? TRest extends IntersectOptions ? TInput1 & IntersectOutput<TRest> : TRest extends [
    BaseSchema<infer TInput2, any> | BaseSchemaAsync<infer TInput2, any>
] ? TInput1 & TInput2 : never : never;
/**
 * Intersect output inference type.
 */
type IntersectOutput<TIntersectOptions extends IntersectOptions | IntersectOptionsAsync> = TIntersectOptions extends [
    BaseSchema<any, infer TOutput1> | BaseSchemaAsync<any, infer TOutput1>,
    ...infer TRest
] ? TRest extends IntersectOptions ? TOutput1 & IntersectOutput<TRest> : TRest extends [
    BaseSchema<any, infer TOutput2> | BaseSchemaAsync<any, infer TOutput2>
] ? TOutput1 & TOutput2 : never : never;

/**
 * Intersect options type.
 */
type IntersectOptions = MaybeReadonly<[
    BaseSchema,
    BaseSchema,
    ...BaseSchema[]
]>;
/**
 * Intersect schema type.
 */
interface IntersectSchema<TOptions extends IntersectOptions, TOutput = IntersectOutput<TOptions>> extends BaseSchema<IntersectInput<TOptions>, TOutput> {
    /**
     * The schema type.
     */
    type: 'intersect';
    /**
     * The intersect options.
     */
    options: TOptions;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<IntersectOutput<TOptions>> | undefined;
}

/**
 * Literal type.
 */
type Literal = number | string | boolean | symbol | bigint;

/**
 * Literal schema type.
 */
interface LiteralSchema<TLiteral extends Literal, TOutput = TLiteral> extends BaseSchema<TLiteral, TOutput> {
    /**
     * The schema type.
     */
    type: 'literal';
    /**
     * The literal value.
     */
    literal: TLiteral;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
}

/**
 * Map path item type.
 */
interface MapPathItem {
    type: 'map';
    origin: 'key' | 'value';
    input: Map<unknown, unknown>;
    key: unknown;
    value: unknown;
}

/**
 * Never schema type.
 */
interface NeverSchema extends BaseSchema<never> {
    /**
     * The schema type.
     */
    type: 'never';
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
}

/**
 * Never schema async type.
 */
interface NeverSchemaAsync extends BaseSchemaAsync<never> {
    /**
     * The schema type.
     */
    type: 'never';
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
}

/**
 * Nullable schema type.
 */
interface NullableSchema<TWrapped extends BaseSchema, TDefault extends Default<TWrapped> = undefined, TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped>) ? Output<TWrapped> : Output<TWrapped> | null> extends BaseSchema<Input<TWrapped> | null, TOutput> {
    /**
     * The schema type.
     */
    type: 'nullable';
    /**
     * The wrapped schema.
     */
    wrapped: TWrapped;
    /**
     * The default value.
     */
    default: TDefault;
}

/**
 * Number schema type.
 */
interface NumberSchema<TOutput = number> extends BaseSchema<number, TOutput> {
    /**
     * The schema type.
     */
    type: 'number';
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<number> | undefined;
}

/**
 * Optional schema type.
 */
interface OptionalSchema<TWrapped extends BaseSchema, TDefault extends Default<TWrapped> = undefined, TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped>) ? Output<TWrapped> : Output<TWrapped> | undefined> extends BaseSchema<Input<TWrapped> | undefined, TOutput> {
    /**
     * The schema type.
     */
    type: 'optional';
    /**
     * The wrapped schema.
     */
    wrapped: TWrapped;
    /**
     * Returns the default value.
     */
    default: TDefault;
}

/**
 * Optional schema async type.
 */
interface OptionalSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TDefault extends DefaultAsync<TWrapped> = undefined, TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped> | Promise<Input<TWrapped>>) ? Output<TWrapped> : Output<TWrapped> | undefined> extends BaseSchemaAsync<Input<TWrapped> | undefined, TOutput> {
    /**
     * The schema type.
     */
    type: 'optional';
    /**
     * The wrapped schema.
     */
    wrapped: TWrapped;
    /**
     * Returns the default value.
     */
    default: TDefault;
}

/**
 * Object entries async type.
 */
interface ObjectEntriesAsync {
    [key: string]: BaseSchema | BaseSchemaAsync;
}

/**
 * Object path item type.
 */
interface ObjectPathItem {
    type: 'object';
    origin: 'value';
    input: Record<string, unknown>;
    key: string;
    value: unknown;
}
/**
 * Required object keys type.
 */
type RequiredKeys<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends EntriesInput<TEntries> | EntriesOutput<TEntries>> = {
    [TKey in keyof TEntries]: TEntries[TKey] extends OptionalSchema<any, any> | OptionalSchemaAsync<any, any> ? undefined extends TObject[TKey] ? never : TKey : TKey;
}[keyof TEntries];
/**
 * Optional object keys type.
 */
type OptionalKeys<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends EntriesInput<TEntries> | EntriesOutput<TEntries>> = {
    [TKey in keyof TEntries]: TEntries[TKey] extends OptionalSchema<any, any> | OptionalSchemaAsync<any, any> ? undefined extends TObject[TKey] ? TKey : never : never;
}[keyof TEntries];
/**
 * Entries input inference type.
 */
type EntriesInput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
    [TKey in keyof TEntries]: Input<TEntries[TKey]>;
};
/**
 * Entries output inference type.
 */
type EntriesOutput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
    [TKey in keyof TEntries]: Output<TEntries[TKey]>;
};
/**
 * Object with question marks type.
 */
type WithQuestionMarks<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends EntriesInput<TEntries> | EntriesOutput<TEntries>> = Pick<TObject, RequiredKeys<TEntries, TObject>> & Partial<Pick<TObject, OptionalKeys<TEntries, TObject>>>;
/**
 * Object input inference type.
 */
type ObjectInput<TEntries extends ObjectEntries | ObjectEntriesAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined> = TRest extends undefined | NeverSchema | NeverSchemaAsync ? ResolveObject<WithQuestionMarks<TEntries, EntriesInput<TEntries>>> : TRest extends BaseSchema | BaseSchemaAsync ? ResolveObject<WithQuestionMarks<TEntries, EntriesInput<TEntries>>> & Record<string, Input<TRest>> : never;
/**
 * Object output inference type.
 */
type ObjectOutput<TEntries extends ObjectEntries | ObjectEntriesAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined> = TRest extends undefined | NeverSchema | NeverSchemaAsync ? ResolveObject<WithQuestionMarks<TEntries, EntriesOutput<TEntries>>> : TRest extends BaseSchema | BaseSchemaAsync ? ResolveObject<WithQuestionMarks<TEntries, EntriesOutput<TEntries>>> & Record<string, Output<TRest>> : never;

/**
 * Object entries type.
 */
interface ObjectEntries {
    [key: string]: BaseSchema;
}
/**
 * Object schema type.
 */
interface ObjectSchema<TEntries extends ObjectEntries, TRest extends BaseSchema | undefined = undefined, TOutput = ObjectOutput<TEntries, TRest>> extends BaseSchema<ObjectInput<TEntries, TRest>, TOutput> {
    /**
     * The schema type.
     */
    type: 'object';
    /**
     * The object entries schema.
     */
    entries: TEntries;
    /**
     * The object rest schema.
     */
    rest: TRest;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<ObjectOutput<TEntries, TRest>> | undefined;
}

/**
 * Picklist options type.
 */
type PicklistOptions = MaybeReadonly<(string | number | bigint)[]>;

/**
 * Picklist schema type.
 */
interface PicklistSchema<TOptions extends PicklistOptions, TOutput = TOptions[number]> extends BaseSchema<TOptions[number], TOutput> {
    /**
     * The schema type.
     */
    type: 'picklist';
    /**
     * The picklist options.
     */
    options: TOptions;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
}

/**
 * Picklist schema async type.
 */
interface PicklistSchemaAsync<TOptions extends PicklistOptions, TOutput = TOptions[number]> extends BaseSchemaAsync<TOptions[number], TOutput> {
    /**
     * The schema type.
     */
    type: 'picklist';
    /**
     * The picklist value.
     */
    options: TOptions;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
}

/**
 * Special schema type.
 */
interface SpecialSchema<TInput, TOutput = TInput> extends BaseSchema<TInput, TOutput> {
    /**
     * The schema type.
     */
    type: 'special';
    /**
     * The type check function.
     */
    check: (input: unknown) => boolean;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<TInput> | undefined;
}

/**
 * Special schema async type.
 */
interface SpecialSchemaAsync<TInput, TOutput = TInput> extends BaseSchemaAsync<TInput, TOutput> {
    /**
     * The schema type.
     */
    type: 'special';
    /**
     * The type check function.
     */
    check: (input: unknown) => boolean | Promise<boolean>;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: PipeAsync<TInput> | undefined;
}

/**
 * String schema type.
 */
interface StringSchema<TOutput = string> extends BaseSchema<string, TOutput> {
    /**
     * The schema type.
     */
    type: 'string';
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<string> | undefined;
}

/**
 * String schema async type.
 */
interface StringSchemaAsync<TOutput = string> extends BaseSchemaAsync<string, TOutput> {
    /**
     * The schema type.
     */
    type: 'string';
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: PipeAsync<string> | undefined;
}

/**
 * Union options type.
 */
type UnionOptions = MaybeReadonly<BaseSchema[]>;
/**
 * Union schema type.
 */
interface UnionSchema<TOptions extends UnionOptions, TOutput = Output<TOptions[number]>> extends BaseSchema<Input<TOptions[number]>, TOutput> {
    /**
     * The schema type.
     */
    type: 'union';
    /**
     * The union options.
     */
    options: TOptions;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<Output<TOptions[number]>> | undefined;
}

/**
 * Union options async type.
 */
type UnionOptionsAsync = MaybeReadonly<(BaseSchema | BaseSchemaAsync)[]>;
/**
 * Union schema async type.
 */
interface UnionSchemaAsync<TOptions extends UnionOptionsAsync, TOutput = Output<TOptions[number]>> extends BaseSchemaAsync<Input<TOptions[number]>, TOutput> {
    /**
     * The schema type.
     */
    type: 'union';
    /**
     * The union options.
     */
    options: TOptions;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: PipeAsync<Input<TOptions[number]>> | undefined;
}

/**
 * Record key async type.
 */
type RecordKeyAsync = EnumSchema<any, string | number | symbol> | EnumSchemaAsync<any, string | number | symbol> | PicklistSchema<any, string | number | symbol> | PicklistSchemaAsync<any, string | number | symbol> | SpecialSchema<any, string | number | symbol> | SpecialSchemaAsync<any, string | number | symbol> | StringSchema<string | number | symbol> | StringSchemaAsync<string | number | symbol> | UnionSchema<any, string | number | symbol> | UnionSchemaAsync<any, string | number | symbol>;

/**
 * Record path item type.
 */
interface RecordPathItem {
    type: 'record';
    origin: 'key' | 'value';
    input: Record<string | number | symbol, unknown>;
    key: string | number | symbol;
    value: unknown;
}
/**
 * Partial key schema type.
 */
type PartialKeySchema = PicklistSchema<any> | PicklistSchemaAsync<any> | EnumSchema<any> | EnumSchemaAsync<any> | UnionSchema<any> | UnionSchemaAsync<any>;
/**
 * Record input inference type.
 */
type RecordInput<TKey extends RecordKey | RecordKeyAsync, TValue extends BaseSchema | BaseSchemaAsync> = ResolveObject<TKey extends PartialKeySchema ? Partial<Record<Input<TKey>, Input<TValue>>> : Record<Input<TKey>, Input<TValue>>>;
/**
 * Record output inference type.
 */
type RecordOutput<TKey extends RecordKey | RecordKeyAsync, TValue extends BaseSchema | BaseSchemaAsync> = ResolveObject<TKey extends PartialKeySchema ? Partial<Record<Output<TKey>, Output<TValue>>> : Record<Output<TKey>, Output<TValue>>>;

/**
 * Record key type.
 */
type RecordKey = EnumSchema<any, string | number | symbol> | PicklistSchema<any, string | number | symbol> | SpecialSchema<any, string | number | symbol> | StringSchema<string | number | symbol> | UnionSchema<any, string | number | symbol>;
/**
 * Record schema type.
 */
interface RecordSchema<TKey extends RecordKey, TValue extends BaseSchema, TOutput = RecordOutput<TKey, TValue>> extends BaseSchema<RecordInput<TKey, TValue>, TOutput> {
    /**
     * The schema type.
     */
    type: 'record';
    /**
     * The record key schema.
     */
    key: TKey;
    /**
     * The record value schema.
     */
    value: TValue;
    /**
     * The error message.
     */
    message: ErrorMessage | undefined;
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<RecordOutput<TKey, TValue>> | undefined;
}

/**
 * Set path item type.
 */
interface SetPathItem {
    type: 'set';
    origin: 'value';
    input: Set<unknown>;
    key: number;
    value: unknown;
}

/**
 * Tuple path item type.
 */
interface TuplePathItem {
    type: 'tuple';
    origin: 'value';
    input: [unknown, ...unknown[]];
    key: number;
    value: unknown;
}

/**
 * Unknown schema type.
 */
interface UnknownSchema<TOutput = unknown> extends BaseSchema<unknown, TOutput> {
    /**
     * The schema type.
     */
    type: 'unknown';
    /**
     * The validation and transformation pipeline.
     */
    pipe: Pipe<unknown> | undefined;
}

type Platform = "win7" | "win8_1" | "win" | "mac10_9" | "mac10_11" | "mac" | "other";
declare const ZHTML5Fonts: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"mincho", "mincho"> | LiteralSchema<"gothic", "gothic">)[], "defont" | "mincho" | "gothic">;
type HTML5Fonts = Output<typeof ZHTML5Fonts>;
type FontItem = {
    font: string;
    offset: number;
    weight: number;
};
type PlatformFont = {
    [key in HTML5Fonts]: FontItem;
};

declare const ZFormattedComment: ObjectSchema<{
    id: OptionalSchema<NumberSchema<number>, 0, number>;
    vpos: OptionalSchema<NumberSchema<number>, 0, number>;
    content: OptionalSchema<StringSchema<string>, "", string>;
    date: OptionalSchema<NumberSchema<number>, 0, number>;
    date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
    owner: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
    premium: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
    mail: OptionalSchema<ArraySchema<StringSchema<string>, string[]>, never[], string[]>;
    user_id: OptionalSchema<NumberSchema<number>, 0, number>;
    layer: OptionalSchema<NumberSchema<number>, -1, number>;
    is_my_post: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
}, undefined, {
    owner: boolean;
    content: string;
    id: number;
    vpos: number;
    date: number;
    date_usec: number;
    premium: boolean;
    mail: string[];
    user_id: number;
    layer: number;
    is_my_post: boolean;
}>;
type FormattedComment = Output<typeof ZFormattedComment>;
declare const ZFormattedLegacyComment: ObjectSchema<Omit<{
    id: OptionalSchema<NumberSchema<number>, 0, number>;
    vpos: OptionalSchema<NumberSchema<number>, 0, number>;
    content: OptionalSchema<StringSchema<string>, "", string>;
    date: OptionalSchema<NumberSchema<number>, 0, number>;
    date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
    owner: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
    premium: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
    mail: OptionalSchema<ArraySchema<StringSchema<string>, string[]>, never[], string[]>;
    user_id: OptionalSchema<NumberSchema<number>, 0, number>;
    layer: OptionalSchema<NumberSchema<number>, -1, number>;
    is_my_post: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
}, "user_id" | "layer" | "is_my_post">, undefined, {
    owner: boolean;
    content: string;
    id: number;
    vpos: number;
    date: number;
    date_usec: number;
    premium: boolean;
    mail: string[];
}>;
type FormattedLegacyComment = Output<typeof ZFormattedLegacyComment>;
type formattedComment = FormattedComment;
type formattedLegacyComment = FormattedLegacyComment;

declare const ZApiChat: ObjectSchema<{
    thread: OptionalSchema<StringSchema<string>, "", string>;
    no: OptionalSchema<NumberSchema<number>, 0, number>;
    vpos: NumberSchema<number>;
    date: OptionalSchema<NumberSchema<number>, 0, number>;
    date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
    nicoru: OptionalSchema<NumberSchema<number>, 0, number>;
    premium: OptionalSchema<NumberSchema<number>, 0, number>;
    anonymity: OptionalSchema<NumberSchema<number>, 0, number>;
    user_id: OptionalSchema<StringSchema<string>, "", string>;
    mail: OptionalSchema<StringSchema<string>, "", string>;
    content: StringSchema<string>;
    deleted: OptionalSchema<NumberSchema<number>, 0, number>;
}, undefined, {
    content: string;
    vpos: number;
    date: number;
    date_usec: number;
    premium: number;
    mail: string;
    user_id: string;
    thread: string;
    no: number;
    nicoru: number;
    anonymity: number;
    deleted: number;
}>;
type ApiChat = Output<typeof ZApiChat>;
declare const ZRawApiResponse: UnionSchema<(ObjectSchema<{
    chat: ObjectSchema<{
        thread: OptionalSchema<StringSchema<string>, "", string>;
        no: OptionalSchema<NumberSchema<number>, 0, number>;
        vpos: NumberSchema<number>;
        date: OptionalSchema<NumberSchema<number>, 0, number>;
        date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
        nicoru: OptionalSchema<NumberSchema<number>, 0, number>;
        premium: OptionalSchema<NumberSchema<number>, 0, number>;
        anonymity: OptionalSchema<NumberSchema<number>, 0, number>;
        user_id: OptionalSchema<StringSchema<string>, "", string>;
        mail: OptionalSchema<StringSchema<string>, "", string>;
        content: StringSchema<string>;
        deleted: OptionalSchema<NumberSchema<number>, 0, number>;
    }, undefined, {
        content: string;
        vpos: number;
        date: number;
        date_usec: number;
        premium: number;
        mail: string;
        user_id: string;
        thread: string;
        no: number;
        nicoru: number;
        anonymity: number;
        deleted: number;
    }>;
}, undefined, {
    chat: {
        content: string;
        vpos: number;
        date: number;
        date_usec: number;
        premium: number;
        mail: string;
        user_id: string;
        thread: string;
        no: number;
        nicoru: number;
        anonymity: number;
        deleted: number;
    };
}> | RecordSchema<StringSchema<string>, UnknownSchema<unknown>, {
    [x: string]: unknown;
}>)[], {
    chat: {
        content: string;
        vpos: number;
        date: number;
        date_usec: number;
        premium: number;
        mail: string;
        user_id: string;
        thread: string;
        no: number;
        nicoru: number;
        anonymity: number;
        deleted: number;
    };
} | {
    [x: string]: unknown;
}>;
type RawApiResponse = Output<typeof ZRawApiResponse>;
declare const ZApiPing: ObjectSchema<{
    content: StringSchema<string>;
}, undefined, {
    content: string;
}>;
type ApiPing = Output<typeof ZApiPing>;
declare const ZApiThread: ObjectSchema<{
    resultcode: NumberSchema<number>;
    thread: StringSchema<string>;
    server_time: NumberSchema<number>;
    ticket: StringSchema<string>;
    revision: NumberSchema<number>;
}, undefined, {
    thread: string;
    resultcode: number;
    server_time: number;
    ticket: string;
    revision: number;
}>;
type ApiThread = Output<typeof ZApiThread>;
declare const ZApiLeaf: ObjectSchema<{
    thread: StringSchema<string>;
    count: NumberSchema<number>;
}, undefined, {
    count: number;
    thread: string;
}>;
type ApiLeaf = Output<typeof ZApiLeaf>;
declare const ZApiGlobalNumRes: ObjectSchema<{
    thread: StringSchema<string>;
    num_res: NumberSchema<number>;
}, undefined, {
    thread: string;
    num_res: number;
}>;
type ApiGlobalNumRes = Output<typeof ZApiGlobalNumRes>;
type rawApiResponse = RawApiResponse;

declare const ZOwnerComment: ObjectSchema<{
    time: StringSchema<string>;
    command: StringSchema<string>;
    comment: StringSchema<string>;
}, undefined, {
    time: string;
    command: string;
    comment: string;
}>;
type OwnerComment = Output<typeof ZOwnerComment>;
type ownerComment = OwnerComment;

declare const ZV1Comment: ObjectSchema<{
    id: StringSchema<string>;
    no: NumberSchema<number>;
    vposMs: NumberSchema<number>;
    body: StringSchema<string>;
    commands: ArraySchema<StringSchema<string>, string[]>;
    userId: StringSchema<string>;
    isPremium: BooleanSchema<boolean>;
    score: NumberSchema<number>;
    postedAt: StringSchema<string>;
    nicoruCount: NumberSchema<number>;
    nicoruId: NullableSchema<StringSchema<string>, undefined, string | null>;
    source: StringSchema<string>;
    isMyPost: BooleanSchema<boolean>;
}, undefined, {
    id: string;
    no: number;
    vposMs: number;
    body: string;
    commands: string[];
    userId: string;
    isPremium: boolean;
    score: number;
    postedAt: string;
    nicoruCount: number;
    nicoruId: string | null;
    source: string;
    isMyPost: boolean;
}>;
type V1Comment = Output<typeof ZV1Comment>;
declare const ZV1Thread: ObjectSchema<{
    id: UnknownSchema<unknown>;
    fork: StringSchema<string>;
    commentCount: OptionalSchema<NumberSchema<number>, 0, number>;
    comments: ArraySchema<ObjectSchema<{
        id: StringSchema<string>;
        no: NumberSchema<number>;
        vposMs: NumberSchema<number>;
        body: StringSchema<string>;
        commands: ArraySchema<StringSchema<string>, string[]>;
        userId: StringSchema<string>;
        isPremium: BooleanSchema<boolean>;
        score: NumberSchema<number>;
        postedAt: StringSchema<string>;
        nicoruCount: NumberSchema<number>;
        nicoruId: NullableSchema<StringSchema<string>, undefined, string | null>;
        source: StringSchema<string>;
        isMyPost: BooleanSchema<boolean>;
    }, undefined, {
        id: string;
        no: number;
        vposMs: number;
        body: string;
        commands: string[];
        userId: string;
        isPremium: boolean;
        score: number;
        postedAt: string;
        nicoruCount: number;
        nicoruId: string | null;
        source: string;
        isMyPost: boolean;
    }>, {
        id: string;
        no: number;
        vposMs: number;
        body: string;
        commands: string[];
        userId: string;
        isPremium: boolean;
        score: number;
        postedAt: string;
        nicoruCount: number;
        nicoruId: string | null;
        source: string;
        isMyPost: boolean;
    }[]>;
}, undefined, {
    id: unknown;
    fork: string;
    commentCount: number;
    comments: {
        id: string;
        no: number;
        vposMs: number;
        body: string;
        commands: string[];
        userId: string;
        isPremium: boolean;
        score: number;
        postedAt: string;
        nicoruCount: number;
        nicoruId: string | null;
        source: string;
        isMyPost: boolean;
    }[];
}>;
type V1Thread = Output<typeof ZV1Thread>;
type v1Thread = V1Thread;

declare const ZXml2jsChatItem: ObjectSchema<{
    _: StringSchema<string>;
    $: ObjectSchema<{
        no: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
        vpos: StringSchema<string>;
        date: OptionalSchema<StringSchema<string>, "0", string>;
        date_usec: OptionalSchema<StringSchema<string>, "0", string>;
        user_id: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
        owner: OptionalSchema<StringSchema<string>, "", string>;
        premium: OptionalSchema<StringSchema<string>, "", string>;
        mail: OptionalSchema<StringSchema<string>, "", string>;
    }, undefined, {
        owner: string;
        vpos: string;
        date: string;
        date_usec: string;
        premium: string;
        mail: string;
        user_id?: string | undefined;
        no?: string | undefined;
    }>;
}, undefined, {
    _: string;
    $: {
        owner: string;
        vpos: string;
        date: string;
        date_usec: string;
        premium: string;
        mail: string;
        user_id?: string | undefined;
        no?: string | undefined;
    };
}>;
type Xml2jsChatItem = Output<typeof ZXml2jsChatItem>;
declare const ZXml2jsChat: ObjectSchema<{
    chat: ArraySchema<ObjectSchema<{
        _: StringSchema<string>;
        $: ObjectSchema<{
            no: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
            vpos: StringSchema<string>;
            date: OptionalSchema<StringSchema<string>, "0", string>;
            date_usec: OptionalSchema<StringSchema<string>, "0", string>;
            user_id: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
            owner: OptionalSchema<StringSchema<string>, "", string>;
            premium: OptionalSchema<StringSchema<string>, "", string>;
            mail: OptionalSchema<StringSchema<string>, "", string>;
        }, undefined, {
            owner: string;
            vpos: string;
            date: string;
            date_usec: string;
            premium: string;
            mail: string;
            user_id?: string | undefined;
            no?: string | undefined;
        }>;
    }, undefined, {
        _: string;
        $: {
            owner: string;
            vpos: string;
            date: string;
            date_usec: string;
            premium: string;
            mail: string;
            user_id?: string | undefined;
            no?: string | undefined;
        };
    }>, {
        _: string;
        $: {
            owner: string;
            vpos: string;
            date: string;
            date_usec: string;
            premium: string;
            mail: string;
            user_id?: string | undefined;
            no?: string | undefined;
        };
    }[]>;
}, undefined, {
    chat: {
        _: string;
        $: {
            owner: string;
            vpos: string;
            date: string;
            date_usec: string;
            premium: string;
            mail: string;
            user_id?: string | undefined;
            no?: string | undefined;
        };
    }[];
}>;
type Xml2jsChat = Output<typeof ZXml2jsChat>;
declare const ZXml2jsPacket: ObjectSchema<{
    packet: ObjectSchema<{
        chat: ArraySchema<ObjectSchema<{
            _: StringSchema<string>;
            $: ObjectSchema<{
                no: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
                vpos: StringSchema<string>;
                date: OptionalSchema<StringSchema<string>, "0", string>;
                date_usec: OptionalSchema<StringSchema<string>, "0", string>;
                user_id: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
                owner: OptionalSchema<StringSchema<string>, "", string>;
                premium: OptionalSchema<StringSchema<string>, "", string>;
                mail: OptionalSchema<StringSchema<string>, "", string>;
            }, undefined, {
                owner: string;
                vpos: string;
                date: string;
                date_usec: string;
                premium: string;
                mail: string;
                user_id?: string | undefined;
                no?: string | undefined;
            }>;
        }, undefined, {
            _: string;
            $: {
                owner: string;
                vpos: string;
                date: string;
                date_usec: string;
                premium: string;
                mail: string;
                user_id?: string | undefined;
                no?: string | undefined;
            };
        }>, {
            _: string;
            $: {
                owner: string;
                vpos: string;
                date: string;
                date_usec: string;
                premium: string;
                mail: string;
                user_id?: string | undefined;
                no?: string | undefined;
            };
        }[]>;
    }, undefined, {
        chat: {
            _: string;
            $: {
                owner: string;
                vpos: string;
                date: string;
                date_usec: string;
                premium: string;
                mail: string;
                user_id?: string | undefined;
                no?: string | undefined;
            };
        }[];
    }>;
}, undefined, {
    packet: {
        chat: {
            _: string;
            $: {
                owner: string;
                vpos: string;
                date: string;
                date_usec: string;
                premium: string;
                mail: string;
                user_id?: string | undefined;
                no?: string | undefined;
            };
        }[];
    };
}>;
type Xml2jsPacket = Output<typeof ZXml2jsPacket>;

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;
    mail: string[];
    content: string;
    image?: IRenderer | null;
    draw: (vpos: number, showCollision: boolean, cursor?: Position) => void;
    isHovered: (cursor?: Position, posX?: number, posY?: number) => boolean;
}

interface InputParser {
    key: string[];
    parse: (input: unknown) => FormattedComment[];
}

interface IPluginConstructor {
    id: string;
    new (Canvas: IRenderer, comments: IComment[]): IPlugin;
}
interface IPlugin {
    draw?: (vpos: number) => void;
    addComments?: (comments: IComment[]) => void;
    transformComments?: (comments: IComment[]) => IComment[];
}
type IPluginList = {
    instance: IPlugin;
    canvas: IRenderer;
}[];

declare const ZInputFormatType: UnionSchema<(LiteralSchema<"XMLDocument", "XMLDocument"> | LiteralSchema<"niconicome", "niconicome"> | LiteralSchema<"xml2js", "xml2js"> | LiteralSchema<"formatted", "formatted"> | LiteralSchema<"legacy", "legacy"> | LiteralSchema<"legacyOwner", "legacyOwner"> | LiteralSchema<"owner", "owner"> | LiteralSchema<"v1", "v1"> | LiteralSchema<"empty", "empty"> | LiteralSchema<"default", "default">)[], "default" | "XMLDocument" | "niconicome" | "xml2js" | "formatted" | "legacy" | "legacyOwner" | "owner" | "v1" | "empty">;
type InputFormatType = Output<typeof ZInputFormatType>;
type InputFormat = XMLDocument | Xml2jsPacket | FormattedComment[] | FormattedLegacyComment[] | 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<BaseOptions>;
type inputFormatType = InputFormatType;
type inputFormat = InputFormat;

interface IRenderer {
    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;
    beginPath(): void;
    closePath(): void;
    moveTo(x: number, y: number): void;
    lineTo(x: number, y: number): void;
    stroke(): void;
    save(): void;
    restore(): void;
    getCanvas(): IRenderer;
    drawImage(image: IRenderer, x: number, y: number, width?: number, height?: number): void;
}

type FormattedCommentWithFont = {
    id: number;
    vpos: number;
    date: number;
    date_usec: number;
    owner: boolean;
    premium: boolean;
    mail: string[];
    user_id: number;
    layer: number;
    loc: CommentLoc;
    size: CommentSize;
    fontSize: number;
    font: CommentFont;
    color: string;
    strokeColor?: string;
    wakuColor?: string;
    fillColor?: string;
    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;
    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;
    font: CommentFont;
    full: boolean;
    ender: boolean;
    _live: boolean;
    invisible: boolean;
    long: number;
    button?: ButtonParams;
};
declare const ZCommentFont: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"mincho", "mincho"> | LiteralSchema<"gothic", "gothic"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "mincho" | "gothic" | "gulim" | "simsun">;
type CommentFont = Output<typeof ZCommentFont>;
declare const ZCommentHTML5Font: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"mincho", "mincho"> | LiteralSchema<"gothic", "gothic">)[], "defont" | "mincho" | "gothic">;
type CommentHTML5Font = Output<typeof ZCommentHTML5Font>;
declare const ZCommentFlashFont: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">;
type CommentFlashFont = Output<typeof ZCommentFlashFont>;
declare const ZCommentContentItemSpacer: ObjectSchema<{
    type: LiteralSchema<"spacer", "spacer">;
    char: StringSchema<string>;
    charWidth: NumberSchema<number>;
    isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
    font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
    count: NumberSchema<number>;
}, undefined, {
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
}>;
declare const ZCommentContentItemText: ObjectSchema<{
    type: LiteralSchema<"text", "text">;
    content: StringSchema<string>;
    slicedContent: ArraySchema<StringSchema<string>, string[]>;
    isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
    font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
    width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
}, undefined, {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}>;
type CommentContentItemText = Output<typeof ZCommentContentItemText>;
declare const ZCommentContentItem: UnionSchema<(ObjectSchema<{
    type: LiteralSchema<"spacer", "spacer">;
    char: StringSchema<string>;
    charWidth: NumberSchema<number>;
    isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
    font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
    count: NumberSchema<number>;
}, undefined, {
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
}> | ObjectSchema<{
    type: LiteralSchema<"text", "text">;
    content: StringSchema<string>;
    slicedContent: ArraySchema<StringSchema<string>, string[]>;
    isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
    font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
    width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
}, undefined, {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}>)[], {
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
} | {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}>;
type CommentContentItem = Output<typeof ZCommentContentItem>;
declare const ZCommentMeasuredContentItemText: IntersectSchema<[UnionSchema<(ObjectSchema<{
    type: LiteralSchema<"spacer", "spacer">;
    char: StringSchema<string>;
    charWidth: NumberSchema<number>;
    isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
    font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
    count: NumberSchema<number>;
}, undefined, {
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
}> | ObjectSchema<{
    type: LiteralSchema<"text", "text">;
    content: StringSchema<string>;
    slicedContent: ArraySchema<StringSchema<string>, string[]>;
    isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
    font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
    width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
}, undefined, {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}>)[], {
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
} | {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}>, ObjectSchema<{
    width: ArraySchema<NumberSchema<number>, number[]>;
}, undefined, {
    width: number[];
}>], ({
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
} | {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}) & {
    width: number[];
}>;
declare const ZCommentMeasuredContentItem: UnionSchema<(ObjectSchema<{
    type: LiteralSchema<"spacer", "spacer">;
    char: StringSchema<string>;
    charWidth: NumberSchema<number>;
    isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
    font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
    count: NumberSchema<number>;
}, undefined, {
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
}> | IntersectSchema<[UnionSchema<(ObjectSchema<{
    type: LiteralSchema<"spacer", "spacer">;
    char: StringSchema<string>;
    charWidth: NumberSchema<number>;
    isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
    font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
    count: NumberSchema<number>;
}, undefined, {
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
}> | ObjectSchema<{
    type: LiteralSchema<"text", "text">;
    content: StringSchema<string>;
    slicedContent: ArraySchema<StringSchema<string>, string[]>;
    isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
    font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
    width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
}, undefined, {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}>)[], {
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
} | {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}>, ObjectSchema<{
    width: ArraySchema<NumberSchema<number>, number[]>;
}, undefined, {
    width: number[];
}>], ({
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
} | {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}) & {
    width: number[];
}>)[], {
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
} | (({
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
} | {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
}) & {
    width: number[];
})>;
type CommentMeasuredContentItem = Output<typeof ZCommentMeasuredContentItem>;
type CommentFlashFontParsed = "gothic" | "gulim" | "simsunStrong" | "simsunWeak";
type CommentContentIndex = {
    index: number;
    font: CommentFlashFontParsed;
};
declare const ZCommentSize: UnionSchema<(LiteralSchema<"big", "big"> | LiteralSchema<"medium", "medium"> | LiteralSchema<"small", "small">)[], "big" | "medium" | "small">;
type CommentSize = Output<typeof ZCommentSize>;
declare const ZCommentLoc: UnionSchema<(LiteralSchema<"ue", "ue"> | LiteralSchema<"naka", "naka"> | LiteralSchema<"shita", "shita">)[], "ue" | "naka" | "shita">;
type CommentLoc = Output<typeof ZCommentLoc>;
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<"コメ", "コメ"> | LiteralSchema<"投コメ", "投コメ"> | LiteralSchema<"全", "全">)[], "コメ" | "投コメ" | "全">;
type NicoScriptReverseTarget = Output<typeof ZNicoScriptReverseTarget>;
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<"全", "全"> | LiteralSchema<"単", "単">)[], "全" | "単">;
type NicoScriptReplaceRange = Output<typeof ZNicoScriptReplaceRange>;
declare const ZNicoScriptReplaceTarget: UnionSchema<(LiteralSchema<"コメ", "コメ"> | LiteralSchema<"投コメ", "投コメ"> | LiteralSchema<"全", "全"> | LiteralSchema<"含まない", "含まない"> | LiteralSchema<"含む", "含む">)[], "コメ" | "投コメ" | "全" | "含まない" | "含む">;
type NicoScriptReplaceTarget = Output<typeof ZNicoScriptReplaceTarget>;
declare const ZNicoScriptReplaceCondition: UnionSchema<(LiteralSchema<"部分一致", "部分一致"> | LiteralSchema<"完全一致", "完全一致">)[], "部分一致" | "完全一致">;
type NicoScriptReplaceCondition = Output<typeof ZNicoScriptReplaceCondition>;
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;
    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;
};
declare const ZMeasureInput: ObjectSchema<{
    font: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"mincho", "mincho"> | LiteralSchema<"gothic", "gothic"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "mincho" | "gothic" | "gulim" | "simsun">;
    content: ArraySchema<UnionSchema<(ObjectSchema<{
        type: LiteralSchema<"spacer", "spacer">;
        char: StringSchema<string>;
        charWidth: NumberSchema<number>;
        isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
        font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
        count: NumberSchema<number>;
    }, undefined, {
        type: "spacer";
        char: string;
        charWidth: number;
        count: number;
        isButton?: boolean | undefined;
        font?: "defont" | "gulim" | "simsun" | undefined;
    }> | ObjectSchema<{
        type: LiteralSchema<"text", "text">;
        content: StringSchema<string>;
        slicedContent: ArraySchema<StringSchema<string>, string[]>;
        isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
        font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
        width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
    }, undefined, {
        type: "text";
        content: string;
        slicedContent: string[];
        isButton?: boolean | undefined;
        font?: "defont" | "gulim" | "simsun" | undefined;
        width?: number[] | undefined;
    }>)[], {
        type: "spacer";
        char: string;
        charWidth: number;
        count: number;
        isButton?: boolean | undefined;
        font?: "defont" | "gulim" | "simsun" | undefined;
    } | {
        type: "text";
        content: string;
        slicedContent: string[];
        isButton?: boolean | undefined;
        font?: "defont" | "gulim" | "simsun" | undefined;
        width?: number[] | undefined;
    }>, ({
        type: "spacer";
        char: string;
        charWidth: number;
        count: number;
        isButton?: boolean | undefined;
        font?: "defont" | "gulim" | "simsun" | undefined;
    } | {
        type: "text";
        content: string;
        slicedContent: string[];
        isButton?: boolean | undefined;
        font?: "defont" | "gulim" | "simsun" | undefined;
        width?: number[] | undefined;
    })[]>;
    lineHeight: NumberSchema<number>;
    charSize: NumberSchema<number>;
    lineCount: NumberSchema<number>;
}, undefined, {
    lineHeight: number;
    font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
    content: ({
        type: "spacer";
        char: string;
        charWidth: number;
        count: number;
        isButton?: boolean | undefined;
        font?: "defont" | "gulim" | "simsun" | undefined;
    } | {
        type: "text";
        content: string;
        slicedContent: string[];
        isButton?: boolean | undefined;
        font?: "defont" | "gulim" | "simsun" | undefined;
        width?: number[] | undefined;
    })[];
    charSize: number;
    lineCount: number;
}>;
type MeasureInput = Output<typeof ZMeasureInput>;
type ValueOf<T> = T[keyof T];

declare let imageCache: {
    [key: string]: {
        image: IRenderer;
        timeout: number;
    };
};
declare const resetImageCache: () => void;

declare let nicoScripts: NicoScript;
declare const resetNicoScripts: () => void;

declare let plugins: IPluginList;
declare const setPlugins: (input: IPluginList) => void;

declare const index_d$3_imageCache: typeof imageCache;
declare const index_d$3_nicoScripts: typeof nicoScripts;
declare const index_d$3_plugins: typeof plugins;
declare const index_d$3_resetImageCache: typeof resetImageCache;
declare const index_d$3_resetNicoScripts: typeof resetNicoScripts;
declare const index_d$3_setPlugins: typeof setPlugins;
declare namespace index_d$3 {
  export { index_d$3_imageCache as imageCache, index_d$3_nicoScripts as nicoScripts, index_d$3_plugins as plugins, index_d$3_resetImageCache as resetImageCache, index_d$3_resetNicoScripts as resetNicoScripts, index_d$3_setPlugins as setPlugins };
}

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 const colors$1_colors: typeof colors;
declare namespace colors$1 {
  export { colors$1_colors as colors };
}

declare let defaultConfig: BaseConfig;
declare const updateConfig: (config: BaseConfig) => void;
declare const defaultOptions: BaseOptions;
declare let config: BaseConfig;
declare let options: BaseOptions;
declare const setConfig: (value: BaseConfig) => void;
declare const setOptions: (value: BaseOptions) => void;

declare const config$1_config: typeof config;
declare const config$1_defaultConfig: typeof defaultConfig;
declare const config$1_defaultOptions: typeof defaultOptions;
declare const config$1_options: typeof options;
declare const config$1_setConfig: typeof setConfig;
declare const config$1_setOptions: typeof setOptions;
declare const config$1_updateConfig: typeof updateConfig;
declare namespace config$1 {
  export { config$1_config as config, config$1_defaultConfig as defaultConfig, config$1_defaultOptions as defaultOptions, config$1_options as options, config$1_setConfig as setConfig, config$1_setOptions as setOptions, config$1_updateConfig as updateConfig };
}

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 const fonts$1_fontTemplates: typeof fontTemplates;
declare const fonts$1_fonts: typeof fonts;
declare namespace fonts$1 {
  export { fonts$1_fontTemplates as fontTemplates, fonts$1_fonts as fonts };
}

declare const initConfig: () => void;

declare const initConfig$1_initConfig: typeof initConfig;
declare namespace initConfig$1 {
  export { initConfig$1_initConfig as initConfig };
}

declare class CanvasRenderingContext2DError extends Error {
    constructor(options?: {
        [key: string]: unknown;
    });
}

declare class InvalidFormatError extends Error {
    constructor(options?: {
        [key: string]: unknown;
    });
}

declare class InvalidOptionError extends Error {
    constructor(options?: {
        [key: string]: unknown;
    });
}

declare class NotImplementedError extends Error {
    pluginName: string;
    methodName: string;
    constructor(pluginName: string, methodName: string, options?: {
        [key: string]: unknown;
    });
}

type index_d$2_CanvasRenderingContext2DError = CanvasRenderingContext2DError;
declare const index_d$2_CanvasRenderingContext2DError: typeof CanvasRenderingContext2DError;
type index_d$2_InvalidFormatError = InvalidFormatError;
declare const index_d$2_InvalidFormatError: typeof InvalidFormatError;
type index_d$2_InvalidOptionError = InvalidOptionError;
declare const index_d$2_InvalidOptionError: typeof InvalidOptionError;
type index_d$2_NotImplementedError = NotImplementedError;
declare const index_d$2_NotImplementedError: typeof NotImplementedError;
declare namespace index_d$2 {
  export { index_d$2_CanvasRenderingContext2DError as CanvasRenderingContext2DError, index_d$2_InvalidFormatError as InvalidFormatError, index_d$2_InvalidOptionError as InvalidOptionError, index_d$2_NotImplementedError as NotImplementedError };
}

declare const registerHandler: <K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]) => void;
declare const removeHandler: <K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]) => void;
declare const triggerHandler: (vpos: number, lastVpos: number) => void;

declare const eventHandler_d_registerHandler: typeof registerHandler;
declare const eventHandler_d_removeHandler: typeof removeHandler;
declare const eventHandler_d_triggerHandler: typeof triggerHandler;
declare namespace eventHandler_d {
  export { eventHandler_d_registerHandler as registerHandler, eventHandler_d_removeHandler as removeHandler, eventHandler_d_triggerHandler as triggerHandler };
}

declare const convert2formattedComment: (data: unknown, type: InputFormatType) => FormattedComment[];

declare namespace inputParser_d {
  export { convert2formattedComment as default };
}

declare class CanvasRenderer implements IRenderer {
    readonly canvas: HTMLCanvasElement;
    readonly video?: HTMLVideoElement;
    private readonly context;
    constructor(canvas?: HTMLCanvasElement, video?: HTMLVideoElement);
    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;
    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(): IRenderer;
    destroy(): void;
}

type index_d$1_CanvasRenderer = CanvasRenderer;
declare const index_d$1_CanvasRenderer: typeof CanvasRenderer;
declare namespace index_d$1 {
  export { index_d$1_CanvasRenderer as CanvasRenderer };
}

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: <T>(i: unknown) => i is MultiConfigItem<T>;
        HTML5Fonts: (i: unknown) => i is HTML5Fonts;
        MeasureInput: (i: unknown) => i is MeasureInput;
    };
};

declare namespace typeGuard_d {
  export { typeGuard as default };
}

declare const arrayPush: (_array: {
    [key: number]: IComment[];
}, key: string | number, push: IComment) => void;
declare const arrayEqual: (a: unknown[], b: unknown[]) => boolean;

declare const hex2rgb: (_hex: string) => number[];
declare const hex2rgba: (_hex: string) => number[];
declare const getStrokeColor: (comment: FormattedCommentWithSize) => string;

declare const isLineBreakResize: (comment: MeasureTextInput) => boolean;
declare const getDefaultCommand: (vpos: number) => DefaultCommand;
declare const parseCommandAndNicoScript: (comment: FormattedComment) => ParseCommandAndNicoScriptResult;
declare const isFlashComment: (comment: FormattedComment) => boolean;
declare const isReverseActive: (vpos: number, isOwner: boolean) => boolean;
declare const isBanActive: (vpos: number) => boolean;
declare const processFixedComment: (comment: IComment, collision: CollisionItem, timeline: Timeline, lazy?: boolean) => void;
declare const processMovableComment: (comment: IComment, collision: Collision, timeline: Timeline, lazy?: boolean) => void;
declare const getFixedPosY: (comment: IComment, collision: CollisionItem) => number;
declare const getMovablePosY: (comment: IComment, collision: Collision, beforeVpos: number) => number;
declare const getPosY: (_currentPos: number, targetComment: IComment, collision: IComment[] | undefined, _isChanged?: boolean) => {
    currentPos: number;
    isChanged: boolean;
    isBreak: boolean;
};
declare const getPosX: (comment: FormattedCommentWithSize, vpos: number, isReverse?: boolean) => number;
declare const parseFont: (font: CommentFont, size: string | number) => string;

declare const changeCALayer: (rawData: FormattedComment[]) => FormattedComment[];

declare const getConfig: <T>(input: ConfigItem<T>, isFlash?: boolean) => T;

declare const getFlashFontIndex: (part: string) => CommentContentIndex[];
declare const getFlashFontName: (font: CommentFlashFontParsed) => CommentFlashFont;
declare const parseContent: (content: string) => ({
    type: "spacer";
    char: string;
    charWidth: number;
    count: number;
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
} | {
    type: "text";
    content: string;
    slicedContent: string[];
    isButton?: boolean | undefined;
    font?: "defont" | "gulim" | "simsun" | undefined;
    width?: number[] | undefined;
})[];
declare const getButtonParts: (comment: FormattedCommentWithSize) => FormattedCommentWithSize;
declare const buildAtButtonComment: (comment: FormattedCommentWithSize, vpos: number) => FormattedComment | undefined;

declare const getLineHeight: (fontSize: CommentSize, isFlash: boolean, resized?: boolean) => number;
declare const getCharSize: (fontSize: CommentSize, isFlash: boolean) => number;
declare const measure: (comment: MeasureInput, renderer: IRenderer) => {
    height: number;
    width: number;
    lineWidth: number[];
    itemWidth: number[][];
};
declare const addHTML5PartToResult: (lineContent: CommentContentItem[], part: string, _font?: CommentHTML5Font) => void;
declare const getFontSizeAndScale: (_charSize: number) => {
    scale: number;
    fontSize: number;
};

declare const nativeSort: <T>(getter: (input: T) => number) => (a: T, b: T) => 1 | 0 | -1;

declare const index_d_addHTML5PartToResult: typeof addHTML5PartToResult;
declare const index_d_arrayEqual: typeof arrayEqual;
declare const index_d_arrayPush: typeof arrayPush;
declare const index_d_buildAtButtonComment: typeof buildAtButtonComment;
declare const index_d_changeCALayer: typeof changeCALayer;
declare const index_d_getButtonParts: typeof getButtonParts;
declare const index_d_getCharSize: typeof getCharSize;
declare const index_d_getConfig: typeof getConfig;
declare const index_d_getDefaultCommand: typeof getDefaultCommand;
declare const index_d_getFixedPosY: typeof getFixedPosY;
declare const index_d_getFlashFontIndex: typeof getFlashFontIndex;
declare const index_d_getFlashFontName: typeof getFlashFontName;
declare const index_d_getFontSizeAndScale: typeof getFontSizeAndScale;
declare const index_d_getLineHeight: typeof getLineHeight;
declare const index_d_getMovablePosY: typeof getMovablePosY;
declare const index_d_getPosX: typeof getPosX;
declare const index_d_getPosY: typeof getPosY;
declare const index_d_getStrokeColor: typeof getStrokeColor;
declare const index_d_hex2rgb: typeof hex2rgb;
declare const index_d_hex2rgba: typeof hex2rgba;
declare const index_d_isBanActive: typeof isBanActive;
declare const index_d_isFlashComment: typeof isFlashComment;
declare const index_d_isLineBreakResize: typeof isLineBreakResize;
declare const index_d_isReverseActive: typeof isReverseActive;
declare const index_d_measure: typeof measure;
declare const index_d_nativeSort: typeof nativeSort;
declare const index_d_parseCommandAndNicoScript: typeof parseCommandAndNicoScript;
declare const index_d_parseContent: typeof parseContent;
declare const index_d_parseFont: typeof parseFont;
declare const index_d_processFixedComment: typeof processFixedComment;
declare const index_d_processMovableComment: typeof processMovableComment;
declare namespace index_d {
  export { index_d_addHTML5PartToResult as addHTML5PartToResult, index_d_arrayEqual as arrayEqual, index_d_arrayPush as arrayPush, index_d_buildAtButtonComment as buildAtButtonComment, index_d_changeCALayer as changeCALayer, index_d_getButtonParts as getButtonParts, index_d_getCharSize as getCharSize, index_d_getConfig as getConfig, index_d_getDefaultCommand as getDefaultCommand, index_d_getFixedPosY as getFixedPosY, index_d_getFlashFontIndex as getFlashFontIndex, index_d_getFlashFontName as getFlashFontName, index_d_getFontSizeAndScale as getFontSizeAndScale, index_d_getLineHeight as getLineHeight, index_d_getMovablePosY as getMovablePosY, index_d_getPosX as getPosX, index_d_getPosY as getPosY, index_d_getStrokeColor as getStrokeColor, index_d_hex2rgb as hex2rgb, index_d_hex2rgba as hex2rgba, index_d_isBanActive as isBanActive, index_d_isFlashComment as isFlashComment, index_d_isLineBreakResize as isLineBreakResize, index_d_isReverseActive as isReverseActive, index_d_measure as measure, index_d_nativeSort as nativeSort, index_d_parseCommandAndNicoScript as parseCommandAndNicoScript, index_d_parseContent as parseContent, index_d_parseFont as parseFont, index_d_processFixedComment as processFixedComment, index_d_processMovableComment as processMovableComment };
}

declare const definition: {
    colors: typeof colors$1;
    config: typeof config$1;
    fonts: typeof fonts$1;
    initConfig: typeof initConfig$1;
};

declare const internal_definition: typeof definition;
declare namespace internal {
  export { index_d$4 as comments, index_d$3 as contexts, internal_definition as definition, index_d$2 as errors, eventHandler_d as eventHandler, inputParser_d as inputParser, index_d$1 as renderer, typeGuard_d as typeGuard, index_d as utils };
}

declare class NiconiComments {
    enableLegacyPiP: boolean;
    showCollision: boolean;
    showFPS: boolean;
    showCommentCount: boolean;
    private lastVpos;
    private get lastVposInt();
    private processedCommentIndex;
    private comments;
    private readonly renderer;
    private readonly collision;
    private readonly timeline;
    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: <T>(i: unknown) => i is MultiConfigItem<T>;
            HTML5Fonts: (i: unknown) => i is HTML5Fonts;
            MeasureInput: (i: unknown) => i is MeasureInput;
        };
    };
    static default: typeof NiconiComments;
    static FlashComment: {
        condition: (comment: FormattedComment) => boolean;
        class: typeof FlashComment;
    };
    static internal: typeof internal;
    constructor(_renderer: IRenderer | HTMLCanvasElement, data: InputFormat, initOptions?: Options);
    private preRendering;
    private getCommentPos;
    private sortTimelineComment;
    addComments(...rawComments: FormattedComment[]): void;
    drawCanvas(vpos: number, forceRendering?: boolean, cursor?: Position): boolean;
    private _drawVideo;
    private _drawComments;
    private _drawCollision;
    private _drawFPS;
    private _drawCommentCount;
    addEventListener<K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]): void;
    removeEventListener<K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]): void;
    clear(): void;
    click(vpos: number, pos: Position): void;
}

export { type ApiChat, type ApiGlobalNumRes, type ApiLeaf, type ApiPing, type ApiThread, type BaseConfig, type BaseOptions, type ButtonList, type ButtonParams, type ButtonPartLeft, type ButtonPartMiddle, type ButtonPartRight, type Canvas, type Collision, type CollisionItem, type CollisionPos, type CommentContentIndex, type CommentContentItem, type CommentContentItemText, type CommentDisableEvent, type CommentDisableEventHandler, type CommentEnableEvent, type CommentEnableEventHandler, type CommentEventBase, type CommentEventHandler, type CommentEventHandlerMap, type CommentEventMap, type CommentEventName, type CommentFlashFont, type CommentFlashFontParsed, type CommentFont, type CommentHTML5Font, type CommentLoc, type CommentMeasuredContentItem, type CommentSize, type CommentStageSize, type Config, type ConfigItem, type Context2D, type DefaultCommand, type FlashMode, type FlashScriptChar, type FontItem, type FormattedComment, type FormattedCommentWithFont, type FormattedCommentWithSize, type FormattedLegacyComment, type HTML5Fonts, type IComment, type IPlugin, type IPluginConstructor, type IPluginList, type IRenderer, type InputFormat, type InputFormatType, type 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 Options, type OwnerComment, type ParseCommandAndNicoScriptResult, type ParseContentResult, type ParsedCommand, type Platform, type PlatformFont, type Position, type RawApiResponse, type SeekDisableEvent, type SeekDisableEventHandler, type SeekEnableEvent, type SeekEnableEventHandler, type Timeline, type V1Comment, type V1Thread, type ValueOf, type Xml2jsChat, type Xml2jsChatItem, type Xml2jsPacket, ZApiChat, ZApiGlobalNumRes, ZApiLeaf, ZApiPing, ZApiThread, ZCommentContentItem, ZCommentContentItemSpacer, ZCommentContentItemText, ZCommentFlashFont, ZCommentFont, ZCommentHTML5Font, ZCommentLoc, ZCommentMeasuredContentItem, ZCommentMeasuredContentItemText, ZCommentSize, ZFormattedComment, ZFormattedLegacyComment, ZHTML5Fonts, ZInputFormatType, ZMeasureInput, ZNicoScriptReplaceCondition, ZNicoScriptReplaceRange, ZNicoScriptReplaceTarget, ZNicoScriptReverseTarget, ZOwnerComment, ZRawApiResponse, ZV1Comment, ZV1Thread, ZXml2jsChat, ZXml2jsChatItem, ZXml2jsPacket, NiconiComments as default, type formattedComment, type formattedLegacyComment, type inputFormat, type inputFormatType, type ownerComment, type rawApiResponse, type v1Thread };
