import type { LassoToolsStore } from './provider/types'

export function getMaskValues({
  values,
}: {
  values?: LassoToolsStore['data'][number]['values']
}) {
  return Object.values(values ?? {}).filter((value) => value.type === 'mask')
}

/**
 * All lasso geometries (mask + draw). Used to feed the editable layer so draw
 * geometries render alongside masks; the GPU mask layer keeps using
 * {@link getMaskValues} so only `mask` geometries clip the data layers.
 */
export function getAllValues({
  values,
}: {
  values?: LassoToolsStore['data'][number]['values']
}) {
  return Object.values(values ?? {})
}
