From b19bd9dd6c727384d935e81791e20cbea8ef42ee Mon Sep 17 00:00:00 2001 From: mtchalim Date: Fri, 1 Oct 2021 12:06:46 -0400 Subject: [PATCH 1/2] fix(types): add optional environment SpaceLink to Sys interface --- index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.d.ts b/index.d.ts index 6bfd34fde..822ae04d1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -159,6 +159,9 @@ export interface Sys { space?: { sys: SpaceLink; }; + environment?: { + sys: SpaceLink; + }; contentType: { sys: ContentTypeLink; }; From 1c038925368b421f35b2225a683d60f8a0ba3813 Mon Sep 17 00:00:00 2001 From: Janko Marklein Date: Mon, 4 Oct 2021 17:09:36 +0200 Subject: [PATCH 2/2] fix(types): adjust link types and add EnvironmentLink --- index.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/index.d.ts b/index.d.ts index 822ae04d1..4acfaeab5 100644 --- a/index.d.ts +++ b/index.d.ts @@ -160,25 +160,25 @@ export interface Sys { sys: SpaceLink; }; environment?: { - sys: SpaceLink; + sys: EnvironmentLink; }; contentType: { sys: ContentTypeLink; }; } -export interface SpaceLink { - type: 'Link'; - linkType: 'Space'; - id: string; -} +export type LinkType = 'Space' | 'ContentType' | 'Environment' -export interface ContentTypeLink { - type: 'Link'; - linkType: 'ContentType'; - id: string; +export interface Link { + type: 'Link' + linkType: T + id: string } +export type SpaceLink = Link<'Space'> +export type EnvironmentLink = Link<'Environment'> +export type ContentTypeLink = Link<'ContentType'> + export interface Field { disabled: boolean; id: string;