Skip to content

Commit

Permalink
Adjust TS types
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Feb 16, 2022
1 parent 12c7433 commit eefec13
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/core-data/src/hooks/use-resource-permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit eefec13

Please sign in to comment.