import { shallowRef, Ref } from 'vue'; import { InterfaceConfig } from '@directus/shared/types'; const interfacesRaw: Ref = shallowRef([]); const interfaces: Ref = shallowRef([]); export function getInterfaces(): { interfaces: Ref; interfacesRaw: Ref } { return { interfaces, interfacesRaw }; } export function getInterface(name?: string | null): InterfaceConfig | undefined { return !name ? undefined : interfaces.value.find(({ id }) => id === name); }