import { getContext, setContext } from "svelte";
import { writable } from "svelte/store";

export function getSelectionContext(): ReturnType<typeof createSelectionContext> {
  return getContext('selection')
}

export function createSelectionContext() {

  const ctx = {
    selected: writable<string | undefined>()
  }

  setContext('selection', ctx)

  return ctx;

}
