import type { FavoriteRemoval, HistoryRemoval } from '~/utils/userData' import { useStorage } from '@vueuse/core' import { namespace } from '~/constants' /** * Deletion bookkeeping kept next to `cook:favorites` and `cook:history`, which * stay in their original format. Deletions are recorded so they survive an * export/import round trip instead of resurrecting removed records. */ export interface UserDataMeta { favoriteRemovals: FavoriteRemoval[] historyRemovals: HistoryRemoval[] historyClearedAt: number } export const userDataMeta = useStorage(`${namespace}:sync`, { favoriteRemovals: [], historyRemovals: [], historyClearedAt: 0, }, undefined, { mergeDefaults: true })