import * as em from "./Enums"; import * as ds from "./Types"; import { ObjectManager } from "./ObjectManager"; import { ObjectBase } from "./ObjectBase"; /** * Represents a brush for filling contours and figures. **/ export declare abstract class Brush extends ObjectBase { /** * Gets the type of the brush. **/ abstract get type(): em.BrushType; } /** * Represents a solid brush. **/ export declare class SolidBrush extends Brush { /** * Creates a solid brush with specified color. * @param color The color of the brush. **/ constructor(color: ds.Color); /** * Creates a solid brush with specified color. * @param om An object manager that controls the lifetime of the {@link SolidBrush} object. * @param color The color of the brush. **/ constructor(om: ObjectManager, color: ds.Color); /** * Gets the type of the brush. **/ get type(): em.BrushType; /** * Gets the color of the brush. **/ get color(): ds.Color; } /** * Represents a linear gradient brush. **/ export declare class LinearGradientBrush extends Brush { /** * Creates a linear gradient brush with specified properties. * @param linearGradientBrushProperties The settings for creating a linear gradient brush. * * @example * const brush = new LinearGradientBrush({ * startColor: "ForestGreen", * startPoint: { x: 0, y: 0 }, * endColor: "Yellow", * endPoint: { x: 1, y: 0 } * }); **/ constructor(linearGradientBrushProperties: ds.LinearGradientBrushProperties); /** * Creates a linear gradient brush with specified properties. * @param om An object manager that controls the lifetime of the {@link LinearGradientBrush} object. * @param linearGradientBrushProperties The settings for creating a linear gradient brush. **/ constructor(om: ObjectManager, linearGradientBrushProperties: ds.LinearGradientBrushProperties); /** * Gets the type of the brush. **/ get type(): em.BrushType; /** * Gets the starting gradient color. **/ get startColor(): ds.Color; /** * Gets the start point of the linear gradient brush. (0, 0) is the top-left corner, (1, 1) is the bottom-right corner. **/ get startPoint(): ds.Point; /** * Gets the ending gradient color. **/ get endColor(): ds.Color; /** * Gets the end point of the linear gradient brush. (0, 0) is the top-left corner, (1, 1) is the bottom-right corner. **/ get endPoint(): ds.Point; /** * Gets the array of gradient stops. **/ get gradientStops(): ds.GradientStop[] | null; } /** * Represents a radial gradient brush. **/ export declare class RadialGradientBrush extends Brush { /** * Creates a radial gradient brush with specified properties. * @param radialGradientBrushProperties The settings for creating a radial gradient brush. **/ constructor(radialGradientBrushProperties: ds.RadialGradientBrushProperties); /** * Creates a radial gradient brush with specified properties. * @param om An object manager that controls the lifetime of the {@link RadialGradientBrush} object. * @param radialGradientBrushProperties The settings for creating a radial gradient brush. **/ constructor(om: ObjectManager, radialGradientBrushProperties: ds.RadialGradientBrushProperties); /** * Gets the type of the brush. **/ get type(): em.BrushType; /** * Gets the starting gradient color. **/ get startColor(): ds.Color; /** * Gets the ending gradient color. **/ get endColor(): ds.Color; /** * Gets the array of gradient stops. **/ get gradientStops(): ds.GradientStop[] | null; /** * Gets the radius of the end circle that defines the end of the gradient, as a fraction of the normalized diagonal. * The normalized diagonal length is calculated as sqrt(width * width + height * height) / 2. * If not specified, the end radius is equal to max(width, height) / 2. **/ get radiusOfEndCircle(): number | null; /** * Gets the radius of the start circle that defines the beginning of the gradient, as a fraction of the normalized diagonal. * The normalized diagonal length is calculated as sqrt(width * width + height * height) / 2. **/ get radiusOfStartCircle(): number; /** * Gets the center of the end circle that defines the end of the gradient. * (0, 0) is the top-left corner, (1, 1) is the bottom-right corner. **/ get centerOfEndCircle(): ds.Point; /** * Gets the center of the start circle that defines the beginning of the gradient. * (0, 0) is the top-left corner, (1, 1) is the bottom-right corner. * If not specified, the center of the start circle coincides with {@link RadialGradientBrush.centerOfEndCircle}. **/ get centerOfStartCircle(): ds.Point | null; /** * Gets a value indicating whether to extend the gradient beyond the start circle. **/ get extendStartCircle(): boolean; /** * Gets a value indicating whether to extend gradient beyond the end circle. **/ get extendEndCircle(): boolean; /** * Gets a value indicating whether to normalize the brush ensuring that it renders the same way on all supported * target contexts (such as {@link PdfContext}, {@link BmpContext}, and {@link SvgContext}). * If true, and the focal point is outside the end circle, it is moved to be on the end circle. * If false, the focal point position is not adjusted if it is outside the end circle, * and the result will depend on the implementation of the target {@link DrawingContext}. **/ get normalize(): boolean; } /** * Represents a hatch brush. **/ export declare class HatchBrush extends Brush { /** * Creates a hatch brush with specified properties. * @param hatchBrushProperties The settings for creating a brush with hatch style. * * @example * const brush = new HatchBrush({ * style: HatchStyle.LargeConfetti, * backColor: "Navy", * foreColor: "White" * }); **/ constructor(hatchBrushProperties: ds.HatchBrushProperties); /** * Creates a hatch brush with specified properties. * @param om An object manager that controls the lifetime of the {@link HatchBrush} object. * @param hatchBrushProperties The settings for creating a brush with hatch style. **/ constructor(om: ObjectManager, hatchBrushProperties: ds.HatchBrushProperties); /** * Gets the type of the brush. **/ get type(): em.BrushType; /** * Gets the hatch style of the {@link HatchBrush}. **/ get style(): em.HatchStyle; /** * Gets the color of spaces between the hatch lines. **/ get backColor(): ds.Color; /** * Gets the color of hatch lines. **/ get foreColor(): ds.Color; } /** * Represents an image brush. **/ export declare class ImageBrush extends Brush { /** * Creates an image brush based on the {@link Image} object. * @param image The {@link Image} object for the brush. **/ constructor(image: ds.ImageOrBitmap); /** * Creates an image brush based on the {@link Image} object. * @param om An object manager that controls the lifetime of the {@link ImageBrush} object. * @param image The {@link Image} object for the brush. **/ constructor(om: ObjectManager, image: ds.ImageOrBitmap); /** * Gets the type of the brush. **/ get type(): em.BrushType; /** * Gets the image object of the brush. **/ get image(): ds.ImageOrBitmap; }