import type { GoogleFontsParams } from '../../api'; import { fetchGoogleFontsQuery } from '../services'; import type { UnifiedFont } from '../types'; import { BaseFontStore } from './baseFontStore.svelte'; /** * Google Fonts store wrapping TanStack Query with runes */ export class GoogleFontsStore extends BaseFontStore { constructor(initialParams: GoogleFontsParams = {}) { super(initialParams); } protected getQueryKey(params: GoogleFontsParams) { return ['googleFonts', params] as const; } protected async fetchFn(params: GoogleFontsParams): Promise { return fetchGoogleFontsQuery(params); } } export function createGoogleFontsStore(params: GoogleFontsParams = {}) { return new GoogleFontsStore(params); } export const googleFontsStore = new GoogleFontsStore();