From fc41028263a40aa6efc723f07eb6a470a72ee912 Mon Sep 17 00:00:00 2001 From: Thodoris Greasidis Date: Fri, 25 Oct 2024 18:54:11 +0300 Subject: [PATCH] Simplify the custom typings pinejs-client after the Concept type unification Change-type: patch --- typings/pinejs-client-core.d.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/typings/pinejs-client-core.d.ts b/typings/pinejs-client-core.d.ts index 31a28d16c..734e168f2 100644 --- a/typings/pinejs-client-core.d.ts +++ b/typings/pinejs-client-core.d.ts @@ -1,7 +1,6 @@ import type { WebResourceFile } from 'balena-request'; import type { AnyObject, - PropsAssignableWithType, PropsOfType, StringKeyof, Dictionary, @@ -37,7 +36,6 @@ export type OptionalNavigationResource = export type ReverseNavigationResource = T[] | undefined; export type AssociatedResource = - | ConceptTypeNavigationResource | NavigationResource | OptionalNavigationResource | ReverseNavigationResource; @@ -55,8 +53,6 @@ export type SelectableProps = >; // This is the normal typed case export type ExpandableProps = PropsOfType> & - // TODO: Drop me once Pine unifies ConceptTypeNavigationResource with NavigationResource - PropsAssignableWithType & string; type SelectedProperty = @@ -64,9 +60,7 @@ type SelectedProperty = ? PineDeferred : T[K] extends OptionalNavigationResource ? PineDeferred | null - : T[K] extends ConceptTypeNavigationResource - ? Exclude - : T[K]; + : T[K]; type SelectResultObject = { [P in Props]: SelectedProperty; @@ -92,7 +86,7 @@ type ExpandedProperty< > = KOpts extends ODataOptionsWithCount ? number - : T[K] extends NavigationResource | ConceptTypeNavigationResource + : T[K] extends NavigationResource ? [TypedResult, KOpts>] : T[K] extends OptionalNavigationResource ? [TypedResult, KOpts>] | []