import { Context, Profile } from '.'; import { Author } from './author'; import { Pagination } from './pagination'; import { Post } from './post'; import { Recommendation } from './recommendation'; import { Tag } from './tag'; export interface StoreListResponse { posts?: Post[]; tags?: Tag[]; authors?: Author[]; profiles?: Profile[]; related?: Post[]; recommendations?: Recommendation[]; pagination: Pagination; } export type StoreObject = Post | Tag | Author | Recommendation | Profile; export type StoreObjectType = "posts" | "tags" | "authors" | "recommendations" | "profiles" | "related"; export interface StoreListRequest { type: StoreObjectType; id?: string; slug?: string; filter?: string; tag?: string; author?: string; limit?: number; page?: number; kinds?: number[]; hashtags?: string[]; ids?: string[]; } export interface Store { prepare(getUrl: (o: StoreObject) => string): Promise; update(context: Context): Promise; isValidType(type: string): boolean; list: (request: StoreListRequest) => Promise; get: (slugId: string, type?: string, sync?: boolean) => Promise; getUrl: (id: string, type?: StoreObjectType) => string | undefined; destroy(): void; }