UNPKG

@ldhop/react

Version:

Follow your nose through linked data resources - for React

23 lines (22 loc) 1.09 kB
import { LdhopEngine, type LdhopQuery, type LdhopQueryBuilder, type MixedVariables, type PlainVariable, type Variable } from '@ldhop/core'; import { type QueryKey } from '@tanstack/react-query'; import { Quad, Store, type Term } from 'n3'; type Fetch = typeof globalThis.fetch; export declare const DEFAULT_QUERY_KEY = "rdfDocument"; export declare const configureQueryKey: (fn: (resource: string) => QueryKey) => void; export declare const useLdhopQuery: <V extends Variable, S extends V = V>({ query: queryInput, variables, fetch, getQueryKey, staleTime, }: { query: LdhopQuery<V> | Omit<LdhopQueryBuilder<V, S>, "add" | "_match">; variables: Partial<MixedVariables<V>>; fetch: Fetch; getQueryKey?: (resource: string) => QueryKey; staleTime?: number; }) => { store: Store<import("@rdfjs/types").Quad, Quad, import("@rdfjs/types").Quad, import("@rdfjs/types").Quad>; quads: Quad[]; variables: { [key in PlainVariable<V>]: Set<Term>; }; engine: LdhopEngine<V> | null; isLoading: boolean; isMissing: boolean; isFetching: boolean; }; export {};