import * as store from '../storage/code-favorites-store.js';
export function listFavorites(workspaceId) {
    return store.listFavorites(workspaceId);
}
export function addFavorite(workspaceId, fav) {
    const entry = {
        ...fav,
        id: `${fav.path}:${fav.line}:${Date.now()}`,
        createdAt: Date.now(),
    };
    const favorites = store.listFavorites(workspaceId);
    favorites.unshift(entry);
    store.saveFavorites(workspaceId, favorites);
    return entry;
}
export function removeFavorite(workspaceId, id) {
    const favorites = store.listFavorites(workspaceId).filter(f => f.id !== id);
    store.saveFavorites(workspaceId, favorites);
}
export function clearFavorites(workspaceId) {
    store.saveFavorites(workspaceId, []);
}
//# sourceMappingURL=code-favorites.js.map