Files
RUWIO/src/composables/useKfSelection.ts
T
2026-04-20 00:07:08 +02:00

24 lines
537 B
TypeScript

import { computed, ref } from 'vue'
export interface KfSelectionKey {
layerId: string
kind: 'main' | 'position' | 'rotation'
keyframeId: string
}
const selectedKfs = ref<KfSelectionKey[]>([])
export function kfSelectionKey(k: KfSelectionKey): string {
return `${k.layerId}:${k.kind}:${k.keyframeId}`
}
const selectedKfSet = computed(() => {
const s = new Set<string>()
for (const k of selectedKfs.value) s.add(kfSelectionKey(k))
return s
})
export function useKfSelection() {
return { selectedKfs, selectedKfSet }
}