import { AbstractSource, Source, SourceTransformer, Telem, Spec, SourceSpec, Sink, SinkTransformer, AbstractSink, SinkSpec } from './telem';
import { Factory } from './factory';
import { z } from 'zod';
import { Destructor } from '@synnaxlabs/x';

export declare const sourcePipelinePropsZ: z.ZodObject<{
    connections: z.ZodArray<z.ZodObject<{
        from: z.ZodString;
        to: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        from: string;
        to: string;
    }, {
        from: string;
        to: string;
    }>, "many">;
    outlet: z.ZodString;
    segments: z.ZodRecord<z.ZodString, 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;
    }>>;
}, "strip", z.ZodTypeAny, {
    connections: {
        from: string;
        to: string;
    }[];
    outlet: string;
    segments: Record<string, {
        type: string;
        valueType: string;
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    }>;
}, {
    connections: {
        from: string;
        to: string;
    }[];
    outlet: string;
    segments: Record<string, {
        type: string;
        valueType: string;
        variant: "source";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    }>;
}>;
export type SourcePipelineProps = z.infer<typeof sourcePipelinePropsZ>;
export declare class PipelineFactory implements Factory {
    type: string;
    factory: Factory;
    constructor(factory: Factory);
    create(spec: Spec): Telem | null;
}
export declare class SourcePipeline<V> extends AbstractSource<typeof sourcePipelinePropsZ> implements Source<V> {
    static readonly TYPE = "source-pipeline";
    schema: z.ZodObject<{
        connections: z.ZodArray<z.ZodObject<{
            from: z.ZodString;
            to: z.ZodString;
        }, "strip", z.ZodTypeAny, {
            from: string;
            to: string;
        }, {
            from: string;
            to: string;
        }>, "many">;
        outlet: z.ZodString;
        segments: z.ZodRecord<z.ZodString, 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;
        }>>;
    }, "strip", z.ZodTypeAny, {
        connections: {
            from: string;
            to: string;
        }[];
        outlet: string;
        segments: Record<string, {
            type: string;
            valueType: string;
            variant: "source";
            props?: any;
            transfer?: ArrayBuffer[] | undefined;
        }>;
    }, {
        connections: {
            from: string;
            to: string;
        }[];
        outlet: string;
        segments: Record<string, {
            type: string;
            valueType: string;
            variant: "source";
            props?: any;
            transfer?: ArrayBuffer[] | undefined;
        }>;
    }>;
    sources: Record<string, Source<any> | SourceTransformer<any, any>>;
    private get outlet();
    constructor(props: unknown, factory: Factory);
    value(): Promise<V>;
    onChange(handler: () => void): Destructor;
    cleanup(): Promise<void>;
}
export declare const sourcePipeline: <V extends string>(valueType: V, props: SourcePipelineProps) => SourceSpec<V>;
export declare const sinkPipelinePropsZ: z.ZodObject<{
    connections: z.ZodArray<z.ZodObject<{
        from: z.ZodString;
        to: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        from: string;
        to: string;
    }, {
        from: string;
        to: string;
    }>, "many">;
    inlet: z.ZodString;
    segments: z.ZodRecord<z.ZodString, 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;
    }>>;
}, "strip", z.ZodTypeAny, {
    connections: {
        from: string;
        to: string;
    }[];
    segments: Record<string, {
        type: string;
        valueType: string;
        variant: "sink";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    }>;
    inlet: string;
}, {
    connections: {
        from: string;
        to: string;
    }[];
    segments: Record<string, {
        type: string;
        valueType: string;
        variant: "sink";
        props?: any;
        transfer?: ArrayBuffer[] | undefined;
    }>;
    inlet: string;
}>;
export type SinkPipelineProps = z.infer<typeof sinkPipelinePropsZ>;
export declare class SinkPipeline<V> extends AbstractSink<typeof sinkPipelinePropsZ> implements Sink<V> {
    static readonly TYPE = "sink-pipeline";
    schema: z.ZodObject<{
        connections: z.ZodArray<z.ZodObject<{
            from: z.ZodString;
            to: z.ZodString;
        }, "strip", z.ZodTypeAny, {
            from: string;
            to: string;
        }, {
            from: string;
            to: string;
        }>, "many">;
        inlet: z.ZodString;
        segments: z.ZodRecord<z.ZodString, 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;
        }>>;
    }, "strip", z.ZodTypeAny, {
        connections: {
            from: string;
            to: string;
        }[];
        segments: Record<string, {
            type: string;
            valueType: string;
            variant: "sink";
            props?: any;
            transfer?: ArrayBuffer[] | undefined;
        }>;
        inlet: string;
    }, {
        connections: {
            from: string;
            to: string;
        }[];
        segments: Record<string, {
            type: string;
            valueType: string;
            variant: "sink";
            props?: any;
            transfer?: ArrayBuffer[] | undefined;
        }>;
        inlet: string;
    }>;
    sinks: Record<string, Sink<any> | SinkTransformer<any, any>>;
    private get inlet();
    constructor(props: unknown, factory: Factory);
    set(value: V): Promise<void>;
    cleanup(): Promise<void>;
}
export declare const sinkPipeline: <V extends string>(valueType: V, props: SinkPipelineProps) => SinkSpec<V>;
//# sourceMappingURL=pipeline.d.ts.map