From eefec13ba88c7aa63e950b71dc242de4b9a46b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Wed, 16 Feb 2022 12:16:36 +0100 Subject: [PATCH] Adjust TS types --- .../src/hooks/use-resource-permissions.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/core-data/src/hooks/use-resource-permissions.ts b/packages/core-data/src/hooks/use-resource-permissions.ts index b026341d31c896..abad77edf37681 100644 --- a/packages/core-data/src/hooks/use-resource-permissions.ts +++ b/packages/core-data/src/hooks/use-resource-permissions.ts @@ -22,15 +22,19 @@ interface ResolutionDetails { * Is the data still being resolved? */ isResolving: boolean; - /** - * Is the data resolved by now? - */ - hasResolved: boolean; } -type ResourcePermissionsResolution< IdType > = ResolutionDetails & - GlobalResourcePermissionsResolution & - ( IdType extends void ? SpecificResourcePermissionsResolution : {} ); +/** + * Is the data resolved by now? + */ +type HasResolved = boolean; + +type ResourcePermissionsResolution< IdType > = [ + HasResolved, + ResolutionDetails & + GlobalResourcePermissionsResolution & + ( IdType extends void ? SpecificResourcePermissionsResolution : {} ) +]; /** * Resolves resource permissions.