import ApolloClient, { ApolloQueryResult } from "apollo-client"; import { GetBaseDetails, MapQueryData } from "./types"; declare abstract class BaseDetails { /** * Awaitable promise of the current query */ current: Promise> | null; /** * Apollo client */ protected client: ApolloClient | undefined; /** * Object, undefined if the initial query is not finished yet */ data: TObject | undefined; /** * Query variables containing identifier, name, etc. */ variables: TVariables | undefined; /** * Status of the current query */ get loading(): boolean; /** * Method called to get objects from API */ abstract query: GetBaseDetails; /** * Function mapping query data to object */ abstract mapQueryData: MapQueryData; constructor(client: ApolloClient); cleanup: () => void; /** * Initialize details by querying it */ init: (variables: TVariables) => Promise; } export default BaseDetails;