import { Ref, ShallowRef } from 'vue'; import { Cluster, Source } from 'ol/source'; import { Layer } from 'ol/layer'; import { Feature } from 'ol'; import { IfAny } from '@vue/shared'; /** * Create a Source and watch for source, prop and layer changes * @param SourceClass The Class of the source which should be created * @param layer A `ref` carrying the parent components layer the layer should be applied to * @param props The properties which should be passed to the SourceClass * @param eventsToHandle The event names list for events that should be passed from the source through the component */ export default function useSource(SourceClass: new (...args: any[]) => T, layer: Ref | Ref> | null | undefined, props: ConstructorParameters[0], eventsToHandle?: string[], sourceUpdateActions?: (source: T) => void): { source: Ref extends T ? T extends T & Ref ? IfAny, T> : ShallowRef : ShallowRef; updateSource: () => Ref extends T ? T extends T & Ref ? IfAny, T> : ShallowRef : ShallowRef; removeSource: () => void; };