@9am/fire-flame
Version:
A fire flame library.
38 lines (37 loc) • 1.07 kB
TypeScript
import { FireFlameOption } from './fireflame';
import Vector from './vector';
export interface Painter {
dom: Element;
updateSize({ w, h }: {
w: number;
h: number;
}): void;
draw(path: Array<[Vector, Vector]>, option: FireFlameOption): void;
}
declare class CanvasPainter implements Painter {
dom: HTMLCanvasElement;
ctx: CanvasRenderingContext2D;
protected static getTemplate(): HTMLTemplateElement;
constructor();
updateSize({ w, h }: {
w: number;
h: number;
}): void;
draw(path: Array<[Vector, Vector]>, option: FireFlameOption): void;
}
declare class SVGPainter implements Painter {
dom: Element;
pathStroke: Element;
pathFill: Element;
gradient: Element;
stopInner: Element;
stopOuter: Element;
protected static getTemplate(): HTMLTemplateElement;
constructor();
updateSize({ w, h }: {
w: number;
h: number;
}): void;
draw(path: Array<[Vector, Vector]>, option: FireFlameOption): void;
}
export { CanvasPainter, SVGPainter };