import { box, color, dimensions, direction, location, xy } from '@synnaxlabs/x';
import { text } from '../../text/core';
import { theming } from '../../theming/aether';
import { FillTextOptions, SugaredOffscreenCanvasRenderingContext2D } from './canvas';
export interface Draw2DLineProps {
    stroke: color.Color;
    lineWidth: number;
    lineDash: number;
    start: xy.XY;
    end: xy.XY;
}
export interface Draw2DRuleProps extends Omit<Draw2DLineProps, "start" | "end"> {
    direction: direction.Direction;
    region: box.Box;
    position: number;
}
export interface Draw2DCircleProps {
    fill?: color.Color;
    stroke?: color.Color;
    strokeWidth?: number;
    radius: number | {
        inner: number;
        outer: number;
    };
    position: xy.XY;
    angle?: {
        lower: number;
        upper: number;
    };
    lineCap?: CanvasLineCap;
}
export interface Draw2DContainerProps {
    region: box.Box;
    bordered?: boolean | location.Location | location.Location[];
    rounded?: boolean;
    borderColor?: ColorSpec;
    borderRadius?: number;
    borderWidth?: number;
    backgroundColor?: ColorSpec;
}
export interface DrawTextProps extends FillTextOptions {
    text: string;
    position: xy.XY;
    level: text.Level;
    justify?: CanvasTextAlign;
    align?: CanvasTextBaseline;
    weight?: text.Weight;
    shade?: text.Shade;
    maxWidth?: number;
    code?: boolean;
    color?: ColorSpec;
}
export interface DrawTextInCenterProps extends Omit<DrawTextProps, "position" | "direction"> {
    box: box.Box;
}
export interface Draw2DMeasureTextContainerProps {
    text: string[];
    direction: direction.Direction;
    level: text.Level;
    spacing?: number;
}
export interface Draw2DBorderProps {
    region: box.Box;
    color?: ColorSpec;
    width?: number;
    radius?: number;
    location?: true | location.Location | location.Location[];
}
export interface Draw2DTextContainerProps extends Omit<Draw2DContainerProps, "region">, Draw2DMeasureTextContainerProps {
    position: xy.XY;
    offset?: xy.XY;
    root?: location.CornerXY;
}
export interface DrawList {
    length: number;
    position: xy.XY;
    itemHeight: number;
    spacing?: number;
    width: number;
    draw: (index: number, box: box.Box) => void;
    root?: location.CornerXY;
    offset?: xy.XY;
    padding?: xy.XY;
}
type ColorSpec = color.Crude | ((t: theming.Theme) => color.Color);
export declare class Draw2D {
    readonly canvas: SugaredOffscreenCanvasRenderingContext2D;
    readonly theme: theming.Theme;
    constructor(canvas: SugaredOffscreenCanvasRenderingContext2D, theme: theming.Theme);
    rule({ direction, region, position, ...rest }: Draw2DRuleProps): void;
    line({ stroke, lineWidth, lineDash, start, end }: Draw2DLineProps): void;
    circle({ fill, stroke, strokeWidth, radius, position, angle, lineCap, }: Draw2DCircleProps): void;
    resolveColor(c: ColorSpec | undefined, fallback: ColorSpec): color.Color;
    resolveColor(c: ColorSpec): color.Color;
    border({ region, color: colorVal, width, radius, location, }: Draw2DBorderProps): void;
    container({ region, bordered, rounded, borderColor, borderRadius, borderWidth, backgroundColor, }: Draw2DContainerProps): void;
    textContainer(props: Draw2DTextContainerProps): void;
    spacedTextDrawF({ text, direction: d, spacing, level, }: Draw2DMeasureTextContainerProps): [dimensions.Dimensions, (base: xy.XY) => void];
    list({ length, itemHeight, width, spacing, position, draw, root, offset, padding, }: DrawList): void;
    drawTextInCenter({ box: b, text, level }: DrawTextInCenterProps): void;
    text({ text, position, level, weight, shade, maxWidth, code, justify, align, useAtlas, color: colorVal, }: DrawTextProps): void;
}
export {};
//# sourceMappingURL=index.d.ts.map