interface OffscreenCanvasRenderingContext2D {
    canvas: OffscreenCanvas;
    direction: CanvasDirection;
    fillStyle: string | CanvasGradient | CanvasPattern;
    filter: string;
    font: string;
    fontKerning: CanvasFontKerning;
    globalAlpha: number;
    globalCompositeOperation: GlobalCompositeOperation;
    imageSmoothingEnabled: boolean;
    imageSmoothingQuality: ImageSmoothingQuality;
    lineCap: CanvasLineCap;
    lineDashOffset: number;
    lineJoin: CanvasLineJoin;
    lineWidth: number;
    miterLimit: number;
    shadowBlur: number;
    shadowColor: string;
    shadowOffsetX: number;
    shadowOffsetY: number;
    strokeStyle: string | CanvasGradient | CanvasPattern;
    textAlign: CanvasTextAlign;
    textBaseline: CanvasTextBaseline;
    arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
    arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
    beginPath(): void;
    bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
    clearRect(x: number, y: number, w: number, h: number): void;
    clip(fillRule?: CanvasFillRule): void;
    clip(path: Path2D, fillRule?: CanvasFillRule): void;
    closePath(): void;
    commit(): void;
    createConicGradient(startAngle: number, x: number, y: number): CanvasGradient;
    createImageData(sw: number, sh: number, settings?: ImageDataSettings): ImageData;
    createImageData(imagedata: ImageData): ImageData;
    createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
    createPattern(image: CanvasImageSource, repetition: null | string): null | CanvasPattern;
    createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
    drawImage(image: CanvasImageSource, dx: number, dy: number): void;
    drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void;
    drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;
    ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
    fill(fillRule?: CanvasFillRule): void;
    fill(path: Path2D, fillRule?: CanvasFillRule): void;
    fillRect(x: number, y: number, w: number, h: number): void;
    fillText(text: string, x: number, y: number, maxWidth?: number): void;
    getImageData(sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings): ImageData;
    getLineDash(): number[];
    getTransform(): DOMMatrix;
    isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;
    isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;
    isPointInStroke(x: number, y: number): boolean;
    isPointInStroke(path: Path2D, x: number, y: number): boolean;
    lineTo(x: number, y: number): void;
    measureText(text: string): TextMetrics;
    moveTo(x: number, y: number): void;
    putImageData(imagedata: ImageData, dx: number, dy: number): void;
    putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void;
    quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
    rect(x: number, y: number, w: number, h: number): void;
    resetTransform(): void;
    restore(): void;
    rotate(angle: number): void;
    roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void;
    roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Iterable<number | DOMPointInit>): void;
    save(): void;
    scale(x: number, y: number): void;
    setLineDash(segments: number[]): void;
    setLineDash(segments: Iterable<number>): void;
    setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
    setTransform(transform?: DOMMatrix2DInit): void;
    stroke(): void;
    stroke(path: Path2D): void;
    strokeRect(x: number, y: number, w: number, h: number): void;
    strokeText(text: string, x: number, y: number, maxWidth?: number): void;
    transform(a: number, b: number, c: number, d: number, e: number, f: number): void;
    translate(x: number, y: number): void;
}

Hierarchy (view full)

Properties

direction: CanvasDirection
fillStyle: string | CanvasGradient | CanvasPattern
filter: string
font: string
fontKerning: CanvasFontKerning
globalAlpha: number
globalCompositeOperation: GlobalCompositeOperation
imageSmoothingEnabled: boolean
imageSmoothingQuality: ImageSmoothingQuality
lineCap: CanvasLineCap
lineDashOffset: number
lineJoin: CanvasLineJoin
lineWidth: number
miterLimit: number
shadowBlur: number
shadowColor: string
shadowOffsetX: number
shadowOffsetY: number
strokeStyle: string | CanvasGradient | CanvasPattern
textAlign: CanvasTextAlign
textBaseline: CanvasTextBaseline

Methods

  • Parameters

    • x: number
    • y: number
    • radius: number
    • startAngle: number
    • endAngle: number
    • Optionalcounterclockwise: boolean

    Returns void

  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number
    • radius: number

    Returns void

  • Returns void

  • Parameters

    • cp1x: number
    • cp1y: number
    • cp2x: number
    • cp2y: number
    • x: number
    • y: number

    Returns void

  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

  • Returns void

  • Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    • image: CanvasImageSource
    • sx: number
    • sy: number
    • sw: number
    • sh: number
    • dx: number
    • dy: number
    • dw: number
    • dh: number

    Returns void

  • Parameters

    • x: number
    • y: number
    • radiusX: number
    • radiusY: number
    • rotation: number
    • startAngle: number
    • endAngle: number
    • Optionalcounterclockwise: boolean

    Returns void

  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

  • Parameters

    • text: string
    • x: number
    • y: number
    • OptionalmaxWidth: number

    Returns void

  • Returns number[]

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • x: number
    • y: number

    Returns boolean

  • Parameters

    • path: Path2D
    • x: number
    • y: number

    Returns boolean

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    Returns void

  • Parameters

    • imagedata: ImageData
    • dx: number
    • dy: number
    • dirtyX: number
    • dirtyY: number
    • dirtyWidth: number
    • dirtyHeight: number

    Returns void

  • Parameters

    • cpx: number
    • cpy: number
    • x: number
    • y: number

    Returns void

  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

  • Returns void

  • Parameters

    • angle: number

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    • segments: number[]

    Returns void

  • Parameters

    Returns void

  • Parameters

    • a: number
    • b: number
    • c: number
    • d: number
    • e: number
    • f: number

    Returns void

  • Parameters

    Returns void

  • Returns void

  • Parameters

    Returns void

  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

  • Parameters

    • text: string
    • x: number
    • y: number
    • OptionalmaxWidth: number

    Returns void

  • Parameters

    • a: number
    • b: number
    • c: number
    • d: number
    • e: number
    • f: number

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void