UNPKG

@daign/2d-graphics

Version:

Two dimensional graphics library that implements the daign-2d-pipeline.

87 lines (86 loc) 3.5 kB
import { IStyleDeclaration } from '@daign/style-sheets'; /** * Implementation of IStyleDeclaration. */ export declare class GraphicStyle implements IStyleDeclaration { fill: string | null; fillOpacity: number | null; fillRule: string | null; stroke: string | null; strokeWidth: number | null; strokeOpacity: number | null; strokeLinecap: string | null; strokeLinejoin: string | null; strokeMiterlimit: number | null; strokeDasharray: string | null; strokeDashoffset: number | null; vectorEffect: string | null; display: string | null; visibility: string | null; opacity: number | null; paintOrder: string | null; mask: string | null; fontFamily: string | null; fontSize: string | null; fontStyle: string | null; fontVariant: string | null; fontWeight: string | null; fontStretch: string | null; letterSpacing: string | null; wordSpacing: string | null; textDecoration: string | null; pointerEvents: string | null; cursor: string | null; /** * Returns whether the declaration is empty (all attributes are equal null). */ get isEmpty(): boolean; /** * Constructor. * @param fill - Optional. * @param fillOpacity - Optional. * @param fillRule - Optional. * @param stroke - Optional. * @param strokeWidth - Optional. * @param strokeOpacity - Optional. * @param strokeLinecap - Optional. * @param strokeLinejoin - Optional. * @param strokeMiterlimit - Optional. * @param strokeDasharray - Optional. * @param strokeDashoffset - Optional. * @param vectorEffect - Optional. * @param display - Optional. * @param visibility - Optional. * @param opacity - Optional. * @param paintOrder - Optional. * @param mask - Optional. * @param fontFamily - Optional. * @param fontSize - Optional. * @param fontStyle - Optional. * @param fontVariant - Optional. * @param fontWeight - Optional. * @param fontStretch - Optional. * @param letterSpacing - Optional. * @param wordSpacing - Optional. * @param textDecoration - Optional. * @param pointerEvents - Optional. * @param cursor - Optional. */ constructor(fill?: string, fillOpacity?: number, fillRule?: string, stroke?: string, strokeWidth?: number, strokeOpacity?: number, strokeLinecap?: string, strokeLinejoin?: string, strokeMiterlimit?: number, strokeDasharray?: string, strokeDashoffset?: number, vectorEffect?: string, display?: string, visibility?: string, opacity?: number, paintOrder?: string, mask?: string, fontFamily?: string, fontSize?: string, fontStyle?: string, fontVariant?: string, fontWeight?: string, fontStretch?: string, letterSpacing?: string, wordSpacing?: string, textDecoration?: string, pointerEvents?: string, cursor?: string); /** * Parse the value of an attribute from string. * @param name - The name of the attribute. * @param value - The value as a string. */ parseAttribute(name: string, value: string): void; /** * Copy style attributes from given style declaration but don't override already existing values. * @param declaration - The style declaration whose values to use. */ complementWith(declaration: GraphicStyle): void; /** * Return the concatenated style declaration as string. * @returns The concatenated style declaration as string. */ printStyle(): string; }