import { SugaredOffscreenCanvasRenderingContext2D } from './canvas';
import { theming } from '../../theming/aether';
import { text } from '../../text/core';
import { color } from '../../color/core';
import { box, direction, xy, dimensions, location } from '@synnaxlabs/x';

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;
    radius: number;
    position: xy.XY;
}
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 {
    text: string;
    position: xy.XY;
    level: text.Level;
    weight?: text.Weight;
    shade?: text.Shade;
    maxWidth?: number;
}
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;
}
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, ...props }: Draw2DRuleProps): void;
    line({ stroke, lineWidth, lineDash, start, end }: Draw2DLineProps): void;
    circle({ fill, radius, position }: Draw2DCircleProps): void;
    resolveColor(c: ColorSpec | undefined, fallback: ColorSpec): color.Color;
    resolveColor(c: ColorSpec): color.Color;
    border({ region, color, 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];
    drawTextInCenter({ box: b, text, level }: DrawTextInCenterProps): void;
    text({ text, position, level, weight, shade, maxWidth }: DrawTextProps): void;
}
export {};
//# sourceMappingURL=index.d.ts.map