Universal Layer Manager
    Preparing search index...

    Interface ManagedLayer<TLayer, TGroup>

    interface ManagedLayer<TLayer, TGroup = TLayer> {
        type: "layer";
        layerActor: ActorRef<
            MachineSnapshot<
                LayerContext<TLayer, TGroup>,

                    | { type: "LAYER.ENABLED" }
                    | { type: "LAYER.DISABLED" }
                    | { type: "PARENT.VISIBLE" }
                    | { type: "PARENT.HIDDEN" }
                    | { type: "PARENT.OPACITY_CHANGED"; opacity: number }
                    | { type: "LAYER.SET_OPACITY"; opacity: number }
                    | { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo }
                    | { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer },
                {},
                { disabled: "hidden" } | { enabled: "hidden" | "visible" },
                string,
                NonReducibleUnknown,
                MetaObject,
                ToStateSchema<
                    {
                        id: "layer";
                        description: "A machine that represents a layer on the map.";
                        context: (
                            __namedParameters: {
                                spawn: {
                                    <TSrc extends never>(
                                        logic: TSrc,
                                        ...__namedParameters: never,
                                    ): ActorRefFromLogic<never>;
                                    <TLogic extends AnyActorLogic>(
                                        src: TLogic,
                                        ...__namedParameters: ConditionalRequired<
                                            [options?: (...) & (...)],
                                            IsNotNever<RequiredLogicInput<TLogic>>,
                                        >,
                                    ): ActorRefFromLogic<TLogic>;
                                };
                                input: {
                                    layerManagerRef: LayerManager<TLayer, TGroup>;
                                    layerId: string;
                                    parentRef: ParentLayerActor | null;
                                    layerName: string;
                                    listMode?: "hide" | "show";
                                    opacity?: number;
                                    timeInfo?: LayerTimeInfo;
                                    layerData: TLayer;
                                };
                                self: ActorRef<
                                    MachineSnapshot<
                                        LayerContext<TLayer, TGroup>,

                                            | { type: "LAYER.ENABLED" }
                                            | { type: "LAYER.DISABLED" }
                                            | { type: "PARENT.VISIBLE" }
                                            | { type: "PARENT.HIDDEN" }
                                            | { type: "PARENT.OPACITY_CHANGED"; opacity: number }
                                            | { type: "LAYER.SET_OPACITY"; opacity: number }
                                            | { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo }
                                            | { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer },
                                        Record<string, AnyActorRef | undefined>,
                                        StateValue,
                                        string,
                                        unknown,
                                        any,
                                        any,
                                    >,

                                        | { type: "LAYER.ENABLED" }
                                        | { type: "LAYER.DISABLED" }
                                        | { type: "PARENT.VISIBLE" }
                                        | { type: "PARENT.HIDDEN" }
                                        | { type: "PARENT.OPACITY_CHANGED"; opacity: number }
                                        | { type: "LAYER.SET_OPACITY"; opacity: number }
                                        | { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo }
                                        | { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer },
                                    AnyEventObject,
                                >;
                            },
                        ) => {
                            layerManagerRef: LayerManager<TLayer, TGroup>;
                            parentRef: ParentLayerActor | null;
                            layerId: string;
                            layerName: string;
                            listMode: "hide" | "show";
                            opacity: number;
                            computedOpacity: number;
                            layerType: "layer";
                            timeInfo: LayerTimeInfo | undefined;
                            layerData: TLayer;
                        };
                        initial: "disabled"
                        | "enabled";
                        states: {
                            enabled: {
                                initial: "hidden" | "visible";
                                description: "The layer is enabled";
                                states: {
                                    visible: {
                                        description: "The layer should appear visible on the map";
                                        entry: readonly [
                                            { type: "Notify Parent that layer is visible" },
                                            {
                                                type: "Notify Manager of visibility change";
                                                params: { visible: ... };
                                            },
                                        ];
                                        exit: readonly [
                                            {
                                                type: "Notify Manager of visibility change";
                                                params: { visible: ... };
                                            },
                                        ];
                                        on: { "PARENT.HIDDEN": { target: "hidden" } };
                                    };
                                    hidden: {
                                        description: "The layer should appear hidden on the map as its parent is hidden";
                                        on: { "PARENT.VISIBLE": { target: "visible" } };
                                    };
                                };
                                on: { "LAYER.DISABLED": { target: "disabled" } };
                            };
                            disabled: {
                                description: "The layer is disabled";
                                initial: "hidden";
                                states: {
                                    hidden: {
                                        description: "The layer should always appear hidden on the map";
                                    };
                                };
                                on: { "LAYER.ENABLED": { target: "enabled.visible" } };
                            };
                        };
                        on: {
                            "PARENT.OPACITY_CHANGED": {
                                actions: readonly [
                                    {
                                        type: "Update Computed Opacity";
                                        params: (
                                            __namedParameters: {
                                                context: LayerContext;
                                                event: { type: ...; opacity: ... };
                                            },
                                        ) => { type: "PARENT.OPACITY_CHANGED"; opacity: number };
                                    },
                                ];
                            };
                            "LAYER.SET_OPACITY": {
                                actions: readonly [
                                    {
                                        type: "Change Layer Opacity";
                                        params: (
                                            __namedParameters: {
                                                context: LayerContext;
                                                event: { type: ...; opacity: ... };
                                            },
                                        ) => { type: "LAYER.SET_OPACITY"; opacity: number };
                                    },
                                ];
                            };
                            "LAYER.SET_TIME_INFO": {
                                actions: readonly [
                                    {
                                        type: "Change Layer Time Info";
                                        params: (
                                            __namedParameters: {
                                                context: LayerContext;
                                                event: { type: ...; timeInfo: ... };
                                            },
                                        ) => { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo };
                                    },
                                ];
                            };
                            "LAYER.SET_LAYER_DATA": {
                                actions: readonly [
                                    {
                                        type: "Change Layer Data";
                                        params: (
                                            __namedParameters: {
                                                context: LayerContext;
                                                event: { type: ...; layerData: ... };
                                            },
                                        ) => { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer };
                                    },
                                ];
                            };
                        };
                    },
                >,
            >,
            | { type: "LAYER.ENABLED" }
            | { type: "LAYER.DISABLED" }
            | { type: "PARENT.VISIBLE" }
            | { type: "PARENT.HIDDEN" }
            | { type: "PARENT.OPACITY_CHANGED"; opacity: number }
            | { type: "LAYER.SET_OPACITY"; opacity: number }
            | { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo }
            | { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer },
        >;
    }

    Type Parameters

    Index

    Properties

    Properties

    type: "layer"
    layerActor: ActorRef<
        MachineSnapshot<
            LayerContext<TLayer, TGroup>,

                | { type: "LAYER.ENABLED" }
                | { type: "LAYER.DISABLED" }
                | { type: "PARENT.VISIBLE" }
                | { type: "PARENT.HIDDEN" }
                | { type: "PARENT.OPACITY_CHANGED"; opacity: number }
                | { type: "LAYER.SET_OPACITY"; opacity: number }
                | { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo }
                | { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer },
            {},
            { disabled: "hidden" } | { enabled: "hidden" | "visible" },
            string,
            NonReducibleUnknown,
            MetaObject,
            ToStateSchema<
                {
                    id: "layer";
                    description: "A machine that represents a layer on the map.";
                    context: (
                        __namedParameters: {
                            spawn: {
                                <TSrc extends never>(
                                    logic: TSrc,
                                    ...__namedParameters: never,
                                ): ActorRefFromLogic<never>;
                                <TLogic extends AnyActorLogic>(
                                    src: TLogic,
                                    ...__namedParameters: ConditionalRequired<
                                        [options?: (...) & (...)],
                                        IsNotNever<RequiredLogicInput<TLogic>>,
                                    >,
                                ): ActorRefFromLogic<TLogic>;
                            };
                            input: {
                                layerManagerRef: LayerManager<TLayer, TGroup>;
                                layerId: string;
                                parentRef: ParentLayerActor | null;
                                layerName: string;
                                listMode?: "hide" | "show";
                                opacity?: number;
                                timeInfo?: LayerTimeInfo;
                                layerData: TLayer;
                            };
                            self: ActorRef<
                                MachineSnapshot<
                                    LayerContext<TLayer, TGroup>,

                                        | { type: "LAYER.ENABLED" }
                                        | { type: "LAYER.DISABLED" }
                                        | { type: "PARENT.VISIBLE" }
                                        | { type: "PARENT.HIDDEN" }
                                        | { type: "PARENT.OPACITY_CHANGED"; opacity: number }
                                        | { type: "LAYER.SET_OPACITY"; opacity: number }
                                        | { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo }
                                        | { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer },
                                    Record<string, AnyActorRef | undefined>,
                                    StateValue,
                                    string,
                                    unknown,
                                    any,
                                    any,
                                >,

                                    | { type: "LAYER.ENABLED" }
                                    | { type: "LAYER.DISABLED" }
                                    | { type: "PARENT.VISIBLE" }
                                    | { type: "PARENT.HIDDEN" }
                                    | { type: "PARENT.OPACITY_CHANGED"; opacity: number }
                                    | { type: "LAYER.SET_OPACITY"; opacity: number }
                                    | { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo }
                                    | { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer },
                                AnyEventObject,
                            >;
                        },
                    ) => {
                        layerManagerRef: LayerManager<TLayer, TGroup>;
                        parentRef: ParentLayerActor | null;
                        layerId: string;
                        layerName: string;
                        listMode: "hide" | "show";
                        opacity: number;
                        computedOpacity: number;
                        layerType: "layer";
                        timeInfo: LayerTimeInfo | undefined;
                        layerData: TLayer;
                    };
                    initial: "disabled"
                    | "enabled";
                    states: {
                        enabled: {
                            initial: "hidden" | "visible";
                            description: "The layer is enabled";
                            states: {
                                visible: {
                                    description: "The layer should appear visible on the map";
                                    entry: readonly [
                                        { type: "Notify Parent that layer is visible" },
                                        {
                                            type: "Notify Manager of visibility change";
                                            params: { visible: ... };
                                        },
                                    ];
                                    exit: readonly [
                                        {
                                            type: "Notify Manager of visibility change";
                                            params: { visible: ... };
                                        },
                                    ];
                                    on: { "PARENT.HIDDEN": { target: "hidden" } };
                                };
                                hidden: {
                                    description: "The layer should appear hidden on the map as its parent is hidden";
                                    on: { "PARENT.VISIBLE": { target: "visible" } };
                                };
                            };
                            on: { "LAYER.DISABLED": { target: "disabled" } };
                        };
                        disabled: {
                            description: "The layer is disabled";
                            initial: "hidden";
                            states: {
                                hidden: {
                                    description: "The layer should always appear hidden on the map";
                                };
                            };
                            on: { "LAYER.ENABLED": { target: "enabled.visible" } };
                        };
                    };
                    on: {
                        "PARENT.OPACITY_CHANGED": {
                            actions: readonly [
                                {
                                    type: "Update Computed Opacity";
                                    params: (
                                        __namedParameters: {
                                            context: LayerContext;
                                            event: { type: ...; opacity: ... };
                                        },
                                    ) => { type: "PARENT.OPACITY_CHANGED"; opacity: number };
                                },
                            ];
                        };
                        "LAYER.SET_OPACITY": {
                            actions: readonly [
                                {
                                    type: "Change Layer Opacity";
                                    params: (
                                        __namedParameters: {
                                            context: LayerContext;
                                            event: { type: ...; opacity: ... };
                                        },
                                    ) => { type: "LAYER.SET_OPACITY"; opacity: number };
                                },
                            ];
                        };
                        "LAYER.SET_TIME_INFO": {
                            actions: readonly [
                                {
                                    type: "Change Layer Time Info";
                                    params: (
                                        __namedParameters: {
                                            context: LayerContext;
                                            event: { type: ...; timeInfo: ... };
                                        },
                                    ) => { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo };
                                },
                            ];
                        };
                        "LAYER.SET_LAYER_DATA": {
                            actions: readonly [
                                {
                                    type: "Change Layer Data";
                                    params: (
                                        __namedParameters: {
                                            context: LayerContext;
                                            event: { type: ...; layerData: ... };
                                        },
                                    ) => { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer };
                                },
                            ];
                        };
                    };
                },
            >,
        >,
        | { type: "LAYER.ENABLED" }
        | { type: "LAYER.DISABLED" }
        | { type: "PARENT.VISIBLE" }
        | { type: "PARENT.HIDDEN" }
        | { type: "PARENT.OPACITY_CHANGED"; opacity: number }
        | { type: "LAYER.SET_OPACITY"; opacity: number }
        | { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo }
        | { type: "LAYER.SET_LAYER_DATA"; layerData: TLayer },
    >