import Cache from "./cache"; export type GraphQLResponse = { errors: Object[] | null; data: TData | null; }; export type CachedEntry = { error: Object | Object[] | null; data: TData | null; }; export type MinimalOnMutationPayload = { refreshActiveQueries: (query: string) => void; }; export type OnMutationPayload = { cache: Cache; softReset: (newResults: Object) => void; hardReset: () => void; refresh: () => void; currentResults: TResults; isActive: () => boolean; refreshActiveQueries: (query: string) => void; }; export type SubscriptionTrigger = string | RegExp; export type SubscriptionItem = { when: SubscriptionTrigger; run(onChangeOptions: MinimalOnMutationPayload, resp?: any, variables?: any): void; }; export type BasicSubscriptionEntry = SubscriptionItem & { type: "Basic"; }; export type FullSubscriptionItem = { when: SubscriptionTrigger; run(onChangeOptions: OnMutationPayload, resp?: unknown, variables?: unknown): void; }; export type FullSubscriptionEntry = FullSubscriptionItem & { type: "Full"; }; export type SubscriptionEntry = BasicSubscriptionEntry | FullSubscriptionEntry;