UNPKG

dropflow

Version:

A small CSS2 document renderer built from specifications

35 lines (34 loc) 1.18 kB
import { ShapedItem } from './layout-text.js'; import type { Color } from './style.js'; import type { PaintBackend } from './paint.js'; import type { LoadedFontFace } from './text-font.js'; import type { Image } from './layout-image.js'; interface Rect { id: string; x: number; y: number; width: number; height: number; } export default class SvgPaintBackend implements PaintBackend { main: string; defs: string; clips: Rect[]; fillColor: Color; strokeColor: Color; lineWidth: number; direction: 'ltr' | 'rtl'; font: LoadedFontFace | undefined; fontSize: number; usedFonts: Map<string, LoadedFontFace>; constructor(); style(style: Record<string, string>): string; edge(x: number, y: number, length: number, side: 'top' | 'right' | 'bottom' | 'left'): void; text(x: number, y: number, item: ShapedItem, textStart: number, textEnd: number): void; rect(x: number, y: number, w: number, h: number): void; pushClip(x: number, y: number, width: number, height: number): void; popClip(): void; image(x: number, y: number, w: number, h: number, image: Image): void; body(): string; } export {};