Universal Layer Manager
    Preparing search index...

    Function isLayerGroupMachine

    • Type Parameters

      Parameters

      Returns layer is ActorRef<
          MachineSnapshot<
              LayerGroupContext<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: "CHILD.VISIBLE"; layerId: string }
                  | {
                      type: "LAYERS.ADD_CHILD";
                      child: ChildLayerActor;
                      index?: number;
                      position?: "top" | "bottom";
                  }
                  | { type: "LAYERS.REMOVE_CHILD"; id: string }
                  | { type: "LAYER.SET_LAYER_DATA"; layerData: TGroup },
              {},
              { disabled: "hidden" } | { enabled: "hidden" | "visible" },
              string,
              NonReducibleUnknown,
              MetaObject,
              ToStateSchema<
                  {
                      id: "layerGroup";
                      description: "A machine that represents a collection of layers that can be toggled as a group";
                      initial: "disabled";
                      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: {
                                  layerId: string;
                                  parentRef: ParentLayerActor
                                  | null;
                                  layerName: string;
                                  layerManagerRef: LayerManager<TLayer, TGroup>;
                                  listMode?: "hide" | "show" | "hide-children";
                                  timeInfo?: LayerTimeInfo;
                                  opacity?: number;
                                  layerData: TGroup;
                              };
                              self: ActorRef<
                                  MachineSnapshot<
                                      LayerGroupContext<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: "CHILD.VISIBLE"; layerId: string }
                                          | {
                                              type: "LAYERS.ADD_CHILD";
                                              child: ChildLayerActor;
                                              index?: (...) | (...);
                                              position?: (...) | (...) | (...);
                                          }
                                          | { type: "LAYERS.REMOVE_CHILD"; id: string }
                                          | { type: "LAYER.SET_LAYER_DATA"; layerData: TGroup },
                                      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: "CHILD.VISIBLE"; layerId: string }
                                      | {
                                          type: "LAYERS.ADD_CHILD";
                                          child: ChildLayerActor;
                                          index?: number;
                                          position?: "top" | "bottom";
                                      }
                                      | { type: "LAYERS.REMOVE_CHILD"; id: string }
                                      | { type: "LAYER.SET_LAYER_DATA"; layerData: TGroup },
                                  AnyEventObject,
                              >;
                          },
                      ) => {
                          layerManagerRef: LayerManager<TLayer, TGroup>;
                          layerId: string;
                          parentRef: ParentLayerActor | null;
                          children: never[];
                          childLayerOrder: never[];
                          layerName: string;
                          layerType: "layerGroup";
                          listMode: "hide" | "show" | "hide-children";
                          timeInfo: LayerTimeInfo | undefined;
                          layerData: TGroup;
                          opacity: number;
                          computedOpacity: number;
                      };
                      states: {
                          enabled: {
                              initial: "visible";
                              description: "The layer group is enabled";
                              states: {
                                  visible: {
                                      description: "The layer group should appear visible on the map";
                                      entry: readonly [
                                          { type: "Notify Parent of visibility change" },
                                          {
                                              type: "Notify children of visibility change";
                                              params: { visible: ... };
                                          },
                                          {
                                              type: "Notify Manager of visibility change";
                                              params: { visible: ... };
                                          },
                                      ];
                                      exit: readonly [
                                          {
                                              type: "Notify Manager of visibility change";
                                              params: { visible: ... };
                                          },
                                          {
                                              type: "Notify children of visibility change";
                                              params: { visible: ... };
                                          },
                                      ];
                                      on: { "PARENT.HIDDEN": { target: "hidden" } };
                                  };
                                  hidden: {
                                      description: "The layer group 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 group is disabled";
                              initial: "hidden";
                              states: {
                                  hidden: {
                                      description: "The layer group and its children always appear hidden on the map";
                                  };
                              };
                              on: {
                                  "LAYER.ENABLED": { target: "enabled" };
                                  "CHILD.VISIBLE": { target: "enabled" };
                              };
                          };
                      };
                      on: {
                          "PARENT.OPACITY_CHANGED": { actions: "Update Computed Opacity" };
                          "CHILD.VISIBLE": { actions: "Notify Parent of visibility change" };
                          "LAYERS.ADD_CHILD": {
                              actions: readonly [
                                  {
                                      type: "Update Children";
                                      params: (
                                          __namedParameters: {
                                              context: LayerGroupContext;
                                              event: { type: ...; child: ...; index?: ...; position?: ... };
                                          },
                                      ) => {
                                          type: "LAYERS.ADD_CHILD";
                                          child: ChildLayerActor;
                                          index?: (...)
                                          | (...);
                                          position?: (...) | (...) | (...);
                                      };
                                  },
                              ];
                          };
                          "LAYERS.REMOVE_CHILD": {
                              actions: readonly [
                                  {
                                      type: "Remove Child";
                                      params: (
                                          __namedParameters: {
                                              context: LayerGroupContext;
                                              event: { type: ...; id: ... };
                                          },
                                      ) => { type: "LAYERS.REMOVE_CHILD"; id: string };
                                  },
                              ];
                          };
                          "LAYER.SET_LAYER_DATA": {
                              actions: readonly [
                                  {
                                      type: "Change Layer Data";
                                      params: (
                                          __namedParameters: {
                                              context: LayerGroupContext;
                                              event: { type: ...; layerData: ... };
                                          },
                                      ) => { type: "LAYER.SET_LAYER_DATA"; layerData: TGroup };
                                  },
                              ];
                          };
                          "LAYER.SET_OPACITY": {
                              actions: readonly [
                                  {
                                      type: "Change Layer Opacity";
                                      params: (
                                          __namedParameters: {
                                              context: LayerGroupContext;
                                              event: { type: ...; opacity: ... };
                                          },
                                      ) => { type: "LAYER.SET_OPACITY"; opacity: number };
                                  },
                              ];
                          };
                          "LAYER.SET_TIME_INFO": {
                              actions: readonly [
                                  {
                                      type: "Change Layer Time Info";
                                      params: (
                                          __namedParameters: {
                                              context: LayerGroupContext;
                                              event: { type: ...; timeInfo: ... };
                                          },
                                      ) => { type: "LAYER.SET_TIME_INFO"; timeInfo: LayerTimeInfo };
                                  },
                              ];
                          };
                      };
                  },
              >,
          >,
          | { 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: "CHILD.VISIBLE"; layerId: string }
          | {
              type: "LAYERS.ADD_CHILD";
              child: ChildLayerActor;
              index?: number;
              position?: "top" | "bottom";
          }
          | { type: "LAYERS.REMOVE_CHILD"; id: string }
          | { type: "LAYER.SET_LAYER_DATA"; layerData: TGroup },
          EventObject,
      >