import { type FetchableValue } from '@makeswift/controls'; import { type Store as ApiClientStore } from '../state/api-client/store'; import * as ApiClientState from '../state/api-client/state'; import { type File, type GlobalElement, type LocalizedGlobalElement, type Page, type PagePathnameSlice, type Site, type Snippet, type Swatch, type Table, type Typography, APIResourceType } from './types'; import { type SiteVersion } from './site-version'; export type CacheData = ApiClientState.SerializedState; export declare const CacheData: { empty(): CacheData; }; export declare abstract class ApiResourcesClient { readonly store: ApiClientStore; readonly subscribe: ApiClientStore['subscribe']; constructor({ store }: { store: ApiClientStore; }); get cacheData(): CacheData; fetchSwatch(swatchId: string): Promise; readSwatch(swatchId: string): Swatch | null; resolveSwatch(swatchId: string | undefined): FetchableValue; fetchFile(fileId: string): Promise; readFile(fileId: string): File | null; resolveFile(fileId: string | undefined): FetchableValue; fetchTypography(typographyId: string): Promise; readTypography(typographyId: string): Typography | null; resolveTypography(typographyId: string | undefined): FetchableValue; fetchGlobalElement(globalElementId: string): Promise; readGlobalElement(globalElementId: string): GlobalElement | null; fetchLocalizedGlobalElement({ globalElementId, locale, }: { globalElementId: string; locale: string; }): Promise; readLocalizedGlobalElement({ globalElementId, locale, }: { globalElementId: string; locale: string; }): LocalizedGlobalElement | null; fetchPagePathnameSlice({ pageId, locale, }: { pageId: string; locale: string | null; }): Promise; readPagePathnameSlice({ pageId, locale, }: { pageId: string; locale: string | null; }): PagePathnameSlice | null; resolvePagePathnameSlice({ pageId, locale, }: { pageId: string | undefined; locale: string | null; }): FetchableValue; resolveResource(type: APIResourceType, { id, read, fetch, }: { id: string | undefined; read: (id: string) => R | null; fetch: (id: string) => Promise; }): FetchableValue; fetchTable(tableId: string): Promise; readTable(tableId: string): Table | null; readSite(siteId: string): Site | null; readPage(pageId: string): Page | null; readSnippet(snippetId: string): Snippet | null; protected abstract fetchSwatchImpl(id: string, version: SiteVersion | null): Promise; protected abstract fetchFileImpl(id: string, version: SiteVersion | null): Promise; protected abstract fetchTypographyImpl(id: string, version: SiteVersion | null): Promise; protected abstract fetchGlobalElementImpl(id: string, version: SiteVersion | null): Promise; protected abstract fetchLocalizedGlobalElementImpl(id: string, version: SiteVersion | null, locale: string): Promise; protected abstract fetchPagePathnameSliceImpl(id: string, version: SiteVersion | null, locale: string | null | undefined): Promise; protected abstract fetchTableImpl(id: string, version: SiteVersion | null): Promise
; } //# sourceMappingURL=api-resources-client.d.ts.map