import { type Instrumentation } from "@synnaxlabs/alamos";
import { bounds, type box, scale, xy, type Series } from "@synnaxlabs/x";
import { z } from "zod";
import { aether } from '../../../aether/aether';
import { color } from '../../../color/core';
import { telem } from '../../../telem/aether';
import { render } from '../../render';
export declare const stateZ: z.ZodObject<{
    x: z.ZodObject<{
        type: z.ZodString;
        props: z.ZodAny;
        variant: z.ZodLiteral<"source">;
        transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
        valueType: z.ZodLiteral<"series">;
    }, "strip", z.ZodTypeAny, {
        type: string;
        valueType: "series";
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    }, {
        type: string;
        valueType: "series";
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    }>;
    y: z.ZodObject<{
        type: z.ZodString;
        props: z.ZodAny;
        variant: z.ZodLiteral<"source">;
        transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
        valueType: z.ZodLiteral<"series">;
    }, "strip", z.ZodTypeAny, {
        type: string;
        valueType: "series";
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    }, {
        type: string;
        valueType: "series";
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    }>;
    label: z.ZodOptional<z.ZodString>;
    color: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodType<color.Color, z.ZodTypeDef, color.Color>, z.ZodObject<{
        rgba255: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
    }, "strip", z.ZodTypeAny, {
        rgba255: [number, number, number, number];
    }, {
        rgba255: [number, number, number, number];
    }>]>, color.Color, string | [number, number, number, number] | {
        rgba255: [number, number, number, number];
    } | color.Color | [number, number, number]>;
    strokeWidth: z.ZodDefault<z.ZodNumber>;
    downsample: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
}, "strip", z.ZodTypeAny, {
    color: color.Color;
    strokeWidth: number;
    x: {
        type: string;
        valueType: "series";
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    };
    y: {
        type: string;
        valueType: "series";
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    };
    downsample: number;
    label?: string | undefined;
}, {
    color: string | [number, number, number, number] | {
        rgba255: [number, number, number, number];
    } | color.Color | [number, number, number] | (string & [number, number, number, number]) | (string & {
        rgba255: [number, number, number, number];
    }) | (string & color.Color) | (string & [number, number, number]) | ([number, number, number, number] & string) | ([number, number, number, number] & {
        rgba255: [number, number, number, number];
    }) | ([number, number, number, number] & color.Color) | ({
        rgba255: [number, number, number, number];
    } & string) | ({
        rgba255: [number, number, number, number];
    } & [number, number, number, number]) | ({
        rgba255: [number, number, number, number];
    } & color.Color) | ({
        rgba255: [number, number, number, number];
    } & [number, number, number]) | (color.Color & string) | (color.Color & [number, number, number, number]) | (color.Color & {
        rgba255: [number, number, number, number];
    }) | (color.Color & [number, number, number]) | ([number, number, number] & string) | ([number, number, number] & {
        rgba255: [number, number, number, number];
    }) | ([number, number, number] & color.Color);
    x: {
        type: string;
        valueType: "series";
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    };
    y: {
        type: string;
        valueType: "series";
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    };
    label?: string | undefined;
    strokeWidth?: number | undefined;
    downsample?: number | undefined;
}>;
export type State = z.input<typeof stateZ>;
export type ParsedState = z.output<typeof stateZ>;
export interface FindResult {
    key: string;
    position: xy.XY;
    value: xy.XY;
    color: color.Color;
    label?: string;
    units?: string;
}
export declare const ZERO_FIND_RESULT: FindResult;
export interface LineProps {
    /**
     * A box in pixel space representing the region of the display that the line
     * should be rendered in. The root of the pixel coordinate system is the top
     * left of the canvas.
     */
    region: box.Box;
    /** An XY scale that maps from the data space to decimal space. */
    dataToDecimalScale: scale.XY;
}
export declare class Context extends render.GLProgram {
    translationBuffer: WebGLBuffer;
    private static readonly CONTEXT_KEY;
    private readonly aAttribLoc;
    private constructor();
    bindPropsAndState({ dataToDecimalScale: s, region }: LineProps, { strokeWidth, color }: ParsedState): number;
    bindScale(s: scale.XY): void;
    draw({ x, y, count, downsample, xOffset, yOffset }: DrawOperation, instances: number): void;
    static create(ctx: aether.Context): Context;
    static use(ctx: aether.Context): Context;
    private bindAttrBuffer;
    /**
     * We apply stroke width by drawing the line multiple times, each time with a slight
     * transformation. This is done as simply as possible. We draw the "centered" line
     * and then four more lines: one to the left, one to the right, one above, and one
     * below. We can repeat this process an arbitrary number of times to make the line
     * thicker. As we increase the stroke width, we also increase the cost of drawing the
     * line.
     */
    private attrStrokeWidth;
}
interface InternalState {
    instrumentation: Instrumentation;
    prog: Context;
    xTelem: telem.SeriesSource;
    yTelem: telem.SeriesSource;
    requestRender: render.RequestF;
}
export declare class Line extends aether.Leaf<typeof stateZ, InternalState> {
    static readonly TYPE = "line";
    schema: typeof stateZ;
    afterUpdate(): Promise<void>;
    afterDelete(): Promise<void>;
    xBounds(): Promise<bounds.Bounds>;
    yBounds(): Promise<bounds.Bounds>;
    findByXValue(props: LineProps, target: number): Promise<FindResult>;
    render(props: LineProps): Promise<void>;
}
export declare const REGISTRY: aether.ComponentRegistry;
interface DrawOperation {
    x: Series;
    y: Series;
    xOffset: number;
    yOffset: number;
    count: number;
    downsample: number;
}
export {};
