import { type Instrumentation } from "@synnaxlabs/alamos";
import { type Synnax, control, type channel } from "@synnaxlabs/client";
import { type Destructor } from "@synnaxlabs/x";
import { z } from "zod";
import { aether } from '../../../aether/aether';
import { color } from '../../../color/core';
export declare const stateProviderStateZ: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
interface InternalState {
    palette: color.Color[];
    instrumentation: Instrumentation;
    defaultColor: color.Color;
    client: Synnax | null;
}
/**
 * An extension of the Synnax client's control state that allows us to assign a unique
 * color to each control subject for user identification.
 */
export declare const sugaredStateZ: z.ZodObject<{
    resource: z.ZodNumber;
    subject: z.ZodObject<{
        name: z.ZodString;
        key: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        name: string;
        key: string;
    }, {
        name: string;
        key: string;
    }>;
    authority: z.ZodUnion<[z.ZodType<control.Authority, z.ZodTypeDef, control.Authority>, z.ZodEffects<z.ZodNumber, control.Authority, number>, z.ZodEffects<z.ZodType<Number, z.ZodTypeDef, Number>, control.Authority, Number>]>;
    subjectColor: 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]>;
}, "strip", z.ZodTypeAny, {
    resource: number;
    subjectColor: color.Color;
    subject: {
        name: string;
        key: string;
    };
    authority: control.Authority;
}, {
    resource: number;
    subjectColor: 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);
    subject: {
        name: string;
        key: string;
    };
    authority: (number | Number | control.Authority) & (number | Number | control.Authority | undefined);
}>;
/**
 * An extension of the Synnax client's control state that allows us to assign a unique
 * color to each control subject for user identification.
 */
export interface SugaredState extends control.State {
    subjectColor: color.Color;
}
/**
 * StateProvider tracks the control state for the channels in a Synnax cluster, listening
 * for updates and providing a way to get the current state for a channel.
 */
export declare class StateProvider extends aether.Composite<typeof stateProviderStateZ, InternalState> {
    static readonly TYPE = "StateProvider";
    schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
    /** Tracks the colors we assign to a particular control subject. */
    private readonly colors;
    /** Tracks the current control state for each channel and allows us to access it */
    private tracker?;
    /** Stop listening for changes to the tracker */
    private disconnectTrackerChange?;
    /** An observer that lets external subscribers know when the control state changes */
    private readonly obs;
    /**
     * Grabs the state provider from the current aether context.
     *
     * @param ctx - The component's current aether context.
     * @throws {Error} if the state provider is not in the context.
     */
    static use(ctx: aether.Context): StateProvider;
    afterUpdate(): Promise<void>;
    afterDelete(): Promise<void>;
    onChange(cb: (transfers: control.Transfer[]) => void): Destructor;
    get(key: channel.Key): SugaredState | undefined;
    get(keys: channel.Key[]): SugaredState[];
    private getOne;
    private startUpdating;
    private updateColors;
}
export {};
