import { Path2D } from './Path2D';
interface CanvasStyle {
    strokeStyle: string | SvgGradient | SvgPattern;
    fillStyle: string | SvgGradient | SvgPattern;
    fillRule: CanvasFillRule;
    filter: string;
    lineCap: CanvasLineCap;
    lineJoin: CanvasLineJoin;
    miterLimit: number;
    lineWidth: number;
    globalAlpha: number;
    globalCompositeOperation: GlobalCompositeOperation;
    font: string;
    shadowColor: string;
    shadowOffsetX: number;
    shadowOffsetY: number;
    shadowBlur: number;
    textAlign: CanvasTextAlign;
    textBaseline: CanvasTextBaseline;
    lineDash: number[];
    lineDashOffset: number;
}
declare class SvgPattern {
    readonly src: string;
    readonly width: number;
    readonly height: number;
    transform?: DOMMatrix;
    constructor(src: string, width: number, height: number);
    setTransform(matrix: DOMMatrix): void;
}
declare class SvgGradient {
    readonly x1: number;
    readonly y1: number;
    readonly x2: number;
    readonly y2: number;
    readonly stops: {
        offset: number;
        color: string;
    }[];
    constructor(x1: number, y1: number, x2: number, y2: number);
    addColorStop(offset: number, color: string): void;
}
export interface SvgNode {
    tag: string;
    attrs: Record<string, string | undefined>;
}
export interface SvgElement extends SvgNode {
    children: SvgNode[];
}
export interface SvgRoot extends SvgElement {
    tag: 'svg';
}
export interface SvgText extends SvgNode {
    tag: 'text';
    text: string;
}
export declare function isSvgElement(node: SvgNode): node is SvgElement;
export declare function isSvgText(node: SvgNode): node is SvgText;
export declare class SvgCanvasContext {
    private _width;
    private _height;
    private _canvas;
    private _ctx;
    private _currentStyle;
    private _styleStack;
    private _groupStack;
    private _transformMatrixStack;
    private _root;
    private _defs;
    private _currentGroup;
    private _currentElement;
    private _transformMatrix;
    private _currentPosition;
    get canvas(): HTMLCanvasElement;
    get fillStyle(): string;
    set fillStyle(value: string);
    get strokeStyle(): string;
    set strokeStyle(value: string);
    get fillRule(): string;
    set fillRule(value: CanvasFillRule);
    get filter(): string;
    set filter(value: string);
    get font(): string;
    set font(value: string);
    get globalAlpha(): number;
    set globalAlpha(value: number);
    get globalCompositeOperation(): GlobalCompositeOperation;
    set globalCompositeOperation(value: GlobalCompositeOperation);
    get imageSmoothingEnabled(): boolean;
    set imageSmoothingEnabled(value: boolean);
    get lineWidth(): number;
    set lineWidth(value: number);
    get lineCap(): CanvasLineCap;
    set lineCap(value: CanvasLineCap);
    get lineDashOffset(): number;
    set lineDashOffset(value: number);
    get lineJoin(): CanvasLineJoin;
    set lineJoin(value: CanvasLineJoin);
    get miterLimit(): number;
    set miterLimit(value: number);
    constructor(width: number, height: number, canvas: HTMLCanvasElement);
    getNode(): SvgRoot;
    resize(width: number, height: number): void;
    save(): void;
    restore(): void;
    beginPath(): void;
    closePath(): void;
    moveTo(x: number, y: number): void;
    lineTo(x: number, y: number): void;
    bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
    quadraticCurveTo(qx1: number, qy1: number, qx: number, qy: number): void;
    arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
    arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
    rect(x: number, y: number, width: number, height: number): void;
    ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise: boolean): void;
    stroke(): void;
    transform(...values: number[]): void;
    translate(x: number, y: number): void;
    scale(x: number, y: number): void;
    fill(path?: Path2D, fillRule?: CanvasFillRule): void;
    fillText(text: string, x: number, y: number): void;
    fillRect(x: number, y: number, width: number, height: number): void;
    getLineDash(): number[];
    setLineDash(dashArray: number[]): void;
    drawImage(image: CanvasImageSource, ...args: number[]): void;
    createPattern(image: CanvasImageSource, repetition: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat' | null): SvgPattern;
    createLinearGradient(x1: number, x2: number, y1: number, y2: number): SvgGradient;
    clip(path: Path2D, fillRule: CanvasFillRule): void;
    measureText(text: string): TextMetrics;
    resetTransform(): void;
    getTransform(): DOMMatrix;
    setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
    protected _isTransformationGroup(node: SvgNode): boolean;
    protected _ensureTransformationGroup(): SvgElement;
    protected _applyStyleState(styleState: CanvasStyle): void;
    protected _getStyleState(): CanvasStyle;
    protected _getTransformScale(): {
        x: number;
        y: number;
    };
    protected _getTransformRotation(): number;
    protected _matrixTransform(x: number, y: number): {
        x: number;
        y: number;
    };
    protected _applyTransformation(node: SvgNode, matrix?: DOMMatrix): void;
    protected _createPatternNode(pattern: SvgPattern, transform?: DOMMatrix): SvgElement;
    protected _createGradientNode(gradient: SvgGradient): SvgElement;
    protected _applyStyle(currentElement: SvgNode, type: 'fill' | 'stroke'): void;
    protected _addPathCommand(command: string): void;
    protected _applyText(text: string, x: number, y: number, action: 'fill'): void;
    protected _clearCanvas(): void;
}
export declare function createSvgContext(width: number, height: number): Promise<CanvasRenderingContext2D>;
export declare function toSvgNode(ctx: CanvasRenderingContext2D): Promise<SvgRoot>;
export {};
