UNPKG

@nmmty/lazycanvas

Version:

A simple way to interact with @napi-rs/canvas in an advanced way!

24 lines (23 loc) 718 B
import { IPattern, AnyPatternType } from "../../types"; import { LazyCanvas } from "../LazyCanvas"; import { SKRSContext2D } from "@napi-rs/canvas"; export declare class Pattern implements IPattern { type: AnyPatternType; src: string | LazyCanvas; constructor(); /** * Set the type of the pattern * @param type {AnyPatternType} - The `type` of the pattern */ setType(type: AnyPatternType): this; /** * Set the source of the pattern * @param src {string | LazyCanvas} - The `src` of the pattern */ setSrc(src: string | LazyCanvas): this; draw(ctx: SKRSContext2D): Promise<CanvasPattern>; /** * @returns {IPattern} */ toJSON(): IPattern; }