import type { FetchError } from '../errors/FetchError' import type { JsonMap } from './JsonValue' import type { PossiblyDynamic } from './PossiblyDynamic' import type { QueryParameters } from './QueryParameters' export type QueryVariables = Record export interface ResourceQuery { resource: string id?: PossiblyDynamic data?: PossiblyDynamic params?: PossiblyDynamic } export interface ResolvedResourceQuery extends ResourceQuery { id?: string data?: any params?: QueryParameters } export type Query = Record export type QueryResult = JsonMap export interface QueryOptions { variables?: QueryVariables onComplete?: (data: TQueryResult) => void onError?: (error: FetchError) => void lazy?: boolean }