From b1a38270b32d792261344ef89658656908625d46 Mon Sep 17 00:00:00 2001 From: Patrick Browne Date: Mon, 1 Mar 2021 18:17:50 +0100 Subject: [PATCH] fix: Convert intersection type to union type for UseQueryReturnValue --- packages/cozy-client/src/types.js | 2 +- packages/cozy-client/types/types.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cozy-client/src/types.js b/packages/cozy-client/src/types.js index 0891cd610e..324d5f6309 100644 --- a/packages/cozy-client/src/types.js +++ b/packages/cozy-client/src/types.js @@ -36,7 +36,7 @@ import { QueryDefinition } from './queries/dsl' */ /** - * @typedef {QueryState & FetchMoreAble} UseQueryReturnValue + * @typedef {QueryState|FetchMoreAble} UseQueryReturnValue */ /** diff --git a/packages/cozy-client/types/types.d.ts b/packages/cozy-client/types/types.d.ts index dcf6808e9e..05f885766b 100644 --- a/packages/cozy-client/types/types.d.ts +++ b/packages/cozy-client/types/types.d.ts @@ -9,7 +9,7 @@ export type ReduxStore = any; export type Token = any; export type ClientResponse = any; export type Manifest = any; -export type QueryFetchStatus = "loading" | "loaded" | "pending" | "failed"; +export type QueryFetchStatus = "failed" | "loading" | "pending" | "loaded"; export type QueryState = { id: string; definition: QueryDefinition; @@ -25,7 +25,7 @@ export type QueryState = { export type FetchMoreAble = { fetchMore: Function; }; -export type UseQueryReturnValue = QueryState & FetchMoreAble; +export type UseQueryReturnValue = QueryState | FetchMoreAble; /** * A reference to a document (special case of a relationship used between photos and albums) * https://docs.cozy.io/en/cozy-doctypes/docs/io.cozy.files/#references