import type { FontshareParams } from '../../api'; import { fetchFontshareFontsQuery } from '../services'; import type { UnifiedFont } from '../types'; import { BaseFontStore } from './baseFontStore.svelte'; /** * Fontshare store wrapping TanStack Query with runes */ export class FontshareStore extends BaseFontStore { constructor(initialParams: FontshareParams = {}) { super(initialParams); } protected getQueryKey(params: FontshareParams) { return ['fontshare', params] as const; } protected async fetchFn(params: FontshareParams): Promise { return fetchFontshareFontsQuery(params); } // Provider-specific methods (shortcuts) setSearch(search: string) { this.setParams({ q: search } as any); } } export function createFontshareStore(params: FontshareParams = {}) { return new FontshareStore(params); } export const fontshareStore = new FontshareStore();