import { status } from '../../status/aether';
import { color } from '../../color/core';
import { z } from 'zod';
import { observe, bounds, Series, Destructor } from '@synnaxlabs/x';

/**
 * Metadata about a telemetry source. This metadata can be thought of as a pointer
 * to the underlying telemetry source, and is intended for use as a main thread proxy
 * to the telemetry source on the worker thread.
 */
export declare const specZ: z.ZodObject<{
    type: z.ZodString;
    variant: z.ZodEnum<["source", "sink", "source-transformer", "sink-transformer"]>;
    valueType: z.ZodString;
    props: z.ZodAny;
    transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: string;
    variant: "source" | "sink" | "source-transformer" | "sink-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: string;
    variant: "source" | "sink" | "source-transformer" | "sink-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export declare const sourceSpecZ: z.ZodObject<{
    type: z.ZodString;
    props: z.ZodAny;
    valueType: z.ZodString;
    transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
    variant: z.ZodLiteral<"source">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: string;
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: string;
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export declare const sinkSpecZ: z.ZodObject<{
    type: z.ZodString;
    props: z.ZodAny;
    valueType: z.ZodString;
    transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
    variant: z.ZodLiteral<"sink">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: string;
    variant: "sink";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: string;
    variant: "sink";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export declare const sourceTransformerSpecZ: z.ZodObject<{
    type: z.ZodString;
    props: z.ZodAny;
    valueType: z.ZodString;
    transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
    variant: z.ZodLiteral<"source-transformer">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: string;
    variant: "source-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: string;
    variant: "source-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export declare const sinkTransformerSpecZ: z.ZodObject<{
    type: z.ZodString;
    props: z.ZodAny;
    valueType: z.ZodString;
    transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
    variant: z.ZodLiteral<"sink-transformer">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: string;
    variant: "sink-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: string;
    variant: "sink-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
/**
 * Metadata about a telemetry source. This metadata can be thought of as a pointer
 * to the underlying telemetry source, and is intended for use as a main thread proxy
 * to the telemetry source on the worker thread.
 */
export type Spec = z.infer<typeof specZ>;
export type SourceSpec<V extends string> = z.infer<typeof sourceSpecZ> & {
    valueType: V;
};
export type SinkSpec<V extends string> = z.infer<typeof sinkSpecZ> & {
    valueType: V;
};
export interface Telem {
    cleanup?: () => Promise<void>;
}
export interface Source<V> extends Telem, observe.Observable<void> {
    value: () => Promise<V>;
}
export interface Sink<V> extends Telem {
    set: (value: V) => Promise<void>;
}
export interface SourceTransformer<I, O> extends Telem, Source<O> {
    setSources: (sources: Record<string, Source<I>>) => void;
}
export interface SinkTransformer<I, O> extends Telem, Sink<I> {
    setSinks: (sinks: Record<string, Sink<O>>) => void;
}
export type SeriesSource = Source<[bounds.Bounds, Series[]]>;
export declare const seriesSourceSpecZ: 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;
}>;
export type SeriesSourceSpec = z.infer<typeof seriesSourceSpecZ>;
export type BooleanSource = Source<boolean>;
export declare const booleanSourceSpecZ: 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<"boolean">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: "boolean";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: "boolean";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export type BooleanSourceSpec = z.infer<typeof booleanSourceSpecZ>;
export type BooleanSink = Sink<boolean>;
export declare const booleanSinkSpecZ: z.ZodObject<{
    type: z.ZodString;
    props: z.ZodAny;
    variant: z.ZodLiteral<"sink">;
    transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
    valueType: z.ZodLiteral<"boolean">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: "boolean";
    variant: "sink";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: "boolean";
    variant: "sink";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export type BooleanSinkSpec = z.infer<typeof booleanSinkSpecZ>;
export type BooleanSinkTransformer = SinkTransformer<boolean, number>;
export declare const booleanSinkTransformerSpecZ: z.ZodObject<{
    type: z.ZodString;
    props: z.ZodAny;
    variant: z.ZodLiteral<"sink-transformer">;
    transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
    valueType: z.ZodLiteral<"boolean">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: "boolean";
    variant: "sink-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: "boolean";
    variant: "sink-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export type BooleanSinkTransformerSpec = z.infer<typeof booleanSinkTransformerSpecZ>;
export type BooleanSourceTransformer = SourceTransformer<number, boolean>;
export declare const booleanSourceTransformerSpecZ: z.ZodObject<{
    type: z.ZodString;
    props: z.ZodAny;
    variant: z.ZodLiteral<"source-transformer">;
    transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
    valueType: z.ZodLiteral<"boolean">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: "boolean";
    variant: "source-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: "boolean";
    variant: "source-transformer";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export type BooleanSourceTransformerSpec = z.infer<typeof booleanSourceTransformerSpecZ>;
export type NumberSource = Source<number>;
export declare const numberSourceSpecZ: 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<"number">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: "number";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: "number";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export type NumberSourceSpec = z.infer<typeof numberSourceSpecZ>;
export type NumberSink = Sink<number>;
export declare const numberSinkSpecZ: z.ZodObject<{
    type: z.ZodString;
    props: z.ZodAny;
    variant: z.ZodLiteral<"sink">;
    transfer: z.ZodOptional<z.ZodArray<z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, "many">>;
    valueType: z.ZodLiteral<"number">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: "number";
    variant: "sink";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: "number";
    variant: "sink";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export type NumberSinkSpec = z.infer<typeof numberSinkSpecZ>;
export type ColorSource = Source<color.Color>;
export declare const colorSourceSpecZ: 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<"color">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: "color";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: "color";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export type ColorSourceSpec = z.infer<typeof colorSourceSpecZ>;
export type StatusSource = Source<status.Spec>;
export declare const statusSourceSpecZ: 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<"status">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: "status";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: "status";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export type StatusSourceSpec = z.infer<typeof statusSourceSpecZ>;
export type StringSource = Source<string>;
export declare const stringSourceSpecZ: 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<"string">;
}, "strip", z.ZodTypeAny, {
    type: string;
    valueType: "string";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}, {
    type: string;
    valueType: "string";
    variant: "source";
    props?: any;
    transfer?: ArrayBuffer[] | undefined;
}>;
export type StringSourceSpec = z.infer<typeof stringSourceSpecZ>;
export declare class Base<P extends z.ZodTypeAny> extends observe.BaseObserver<void> {
    private props_;
    private readonly uProps_;
    schema: P | undefined;
    constructor(props: unknown);
    get props(): z.output<P>;
    private get _schema();
    cleanup(): Promise<void>;
}
export declare class AbstractSource<P extends z.ZodTypeAny> extends Base<P> {
}
export declare class AbstractSink<P extends z.ZodTypeAny> extends Base<P> {
}
export declare class UnarySourceTransformer<I, O, P extends z.ZodTypeAny> extends AbstractSource<P> implements SourceTransformer<I, O> {
    sources: Record<string, Source<I>>;
    private get source();
    value(): Promise<O>;
    onChange(handler: () => void): Destructor;
    setSources(sources: Record<string, Source<I>>): void;
    protected shouldNotify(value: I): boolean;
    protected transform(value: I): O;
}
export declare class MultiSourceTransformer<I, O, P extends z.ZodTypeAny> extends AbstractSource<P> implements SourceTransformer<I, O> {
    sources: Record<string, Source<I>>;
    value(): Promise<O>;
    setSources(sources: Record<string, Source<I>>): void;
    protected transform(values: Record<string, I>): O;
}
export declare class UnarySinkTransformer<I, O, P extends z.ZodTypeAny> extends Base<P> implements SinkTransformer<I, O> {
    sinks: Record<string, Sink<O>>;
    private get sink();
    set(value: I): Promise<void>;
    setSinks(sinks: Record<string, Sink<O>>): void;
    protected transform(value: I): O;
}
//# sourceMappingURL=telem.d.ts.map