From b8c63c002587527a349e6203210211db79e57398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Storl=C3=B8kken=20Melseth?= Date: Thu, 29 Apr 2021 12:45:34 +0200 Subject: [PATCH] chore: useDataQuery type definition --- src/core_modules/capture-core/flow/app-runtime_v2.x.x.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core_modules/capture-core/flow/app-runtime_v2.x.x.js b/src/core_modules/capture-core/flow/app-runtime_v2.x.x.js index 50c19d3214..deb9e4bf43 100644 --- a/src/core_modules/capture-core/flow/app-runtime_v2.x.x.js +++ b/src/core_modules/capture-core/flow/app-runtime_v2.x.x.js @@ -27,9 +27,7 @@ declare module '@dhis2/app-runtime' { [resourceId: string]: ResourceQuery, |}; - declare type QueryResultArray = Array; - declare type QueryResultObject = {| [key: string]: QueryResult |}; - declare type QueryResult = boolean | number | string | null | QueryResultArray | QueryResultObject; + declare type QueryResult = any; declare type RefetchOptions = {| variables?: QueryVariables @@ -130,10 +128,10 @@ declare module '@dhis2/app-runtime' { called: boolean, loading: boolean, error?: FetchError, - data?: QueryResult, + data: QueryResult, engine: DataEngine, refetch: QueryRefetchFunction, |}; - declare export function useDataQuery(query: Query, queryOptions: QueryOptions): QueryRenderInput; + declare export function useDataQuery(resourceQueries: ResourceQueries, queryOptions?: QueryOptions): QueryRenderInput; }