pixi.js
Version:
<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">
25 lines (24 loc) • 1.03 kB
TypeScript
import { GraphicsPath } from '../path/GraphicsPath';
import type { FillGradient } from '../fill/FillGradient';
import type { GraphicsContext } from '../GraphicsContext';
/**
* Represents a session for SVG parsing. Contains the current state and resources needed during parsing.
* @internal
*/
export interface Session {
/** The graphics context to render to */
context: GraphicsContext;
/** The current path being constructed */
path: GraphicsPath;
/** Map of definitions by id */
defs: Record<string, FillGradient>;
}
/**
* Parses an SVG element or string and renders it to a graphics context.
* Handles both SVG strings and SVG DOM elements as input.
* @param svg - The SVG content to parse, either as a string or element
* @param graphicsContext - Optional graphics context to render to
* @returns The graphics context with the SVG rendered into it
* @internal
*/
export declare function SVGParser(svg: string | SVGElement | SVGSVGElement, graphicsContext?: GraphicsContext): GraphicsContext;