import type { SyncType } from './types'; import type { AddLayerPayload, DeleteLayerPayload, MoveLayerPayload, SetAutoLayerIdPayload, SetBaseLayersPayload } from '../../map/types'; import type { CoreAppStore } from '../../types'; import type { SyncLayerPayloads, LayerActionPayloadsWithLayerIds } from '../types'; interface FoundTargets { payload: SyncLayerPayloads; targetId: string; layerId: string; } /** * Tries to find the layerId's in the other map based on the payload of the action. It works for all layer actions. * @param state * @param mapId * @param targetMapId * @param payload * @returns */ export declare const getTargetLayerIdFromPayload: (state: CoreAppStore, mapId: string, targetMapId: string, payload: SyncLayerPayloads) => string; /** * Local helper function used by getLayerDeleteActionsTargets, getLayerActionsTargets, getAddLayerActionsTargets, getTargetLayerIdFromPayload to find the targets * @param state * @param payload * @param actionType * @param sourceMapId * @returns The found targets */ export declare const findTargets: (state: CoreAppStore, payload: SyncLayerPayloads, actionType: SyncType, sourceMapId: string) => FoundTargets[]; /** * These targets are found for layer actions that work with a layerId like: SetLayerName, SetLayerEnabled, SetLayerOpacity, SetLayerDimension and SetLayerStyle * @param state * @param payload * @param actionType * @returns */ export declare const getLayerActionsTargets: (state: CoreAppStore, payload: LayerActionPayloadsWithLayerIds, actionType: SyncType) => LayerActionPayloadsWithLayerIds[]; /** * These targets are found for the layer/map action AddLayer. AddLayer does not have a layerId (because it's new) * @param state * @param payload * @param actionType * @returns */ export declare const getAddLayerActionsTargets: (state: CoreAppStore, payload: AddLayerPayload, actionType: SyncType) => AddLayerPayload[]; /** * These targets are found for the layer/map action DeleteLayer. The layer is already gone, so there is no layerId anymore. Using layerIndex instead. * @param state * @param payload * @param actionType * @returns */ export declare const getLayerDeleteActionsTargets: (state: CoreAppStore, payload: DeleteLayerPayload, actionType: SyncType) => DeleteLayerPayload[]; /** * These targets are found for the layer/map action MoveLayer. Here layers are referenced by newIndex and oldIndex. * @param state * @param payload * @param actionType * @returns */ export declare const getLayerMoveActionsTargets: (state: CoreAppStore, payload: MoveLayerPayload, actionType: SyncType) => MoveLayerPayload[]; /** * These targets are found for the map action SetAutoLayerId. It needs both a target mapId and layerId * @param state * @param payload * @param actionType * @returns */ export declare const getSetAutoLayerIdActionsTargets: (state: CoreAppStore, payload: SetAutoLayerIdPayload, actionType: SyncType) => LayerActionPayloadsWithLayerIds[]; /** * These targets are found for baselayer actions that work with a mapId like: setBaseLayers * @param state * @param payload * @param actionType * @returns */ export declare const getMapBaseLayerActionsTargets: (state: CoreAppStore, payload: SetBaseLayersPayload, actionType: SyncType) => SetBaseLayersPayload[]; export {};