From d02d6b49e54c68c7da4f43cfdaa1bc7ae1b713fa Mon Sep 17 00:00:00 2001 From: hyeongrok7874 Date: Mon, 23 Sep 2024 07:02:09 +0900 Subject: [PATCH 1/2] feat: Add InitialViewportKeyUnion type --- code/addons/viewport/src/defaults.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/addons/viewport/src/defaults.ts b/code/addons/viewport/src/defaults.ts index 4190ccb7f3cc..014c90f22b34 100644 --- a/code/addons/viewport/src/defaults.ts +++ b/code/addons/viewport/src/defaults.ts @@ -1,6 +1,6 @@ import type { ViewportMap } from './types'; -export const INITIAL_VIEWPORTS: ViewportMap = { +const INITIAL_VIEWPORTS_DATA = { iphone5: { name: 'iPhone 5', styles: { @@ -225,7 +225,12 @@ export const INITIAL_VIEWPORTS: ViewportMap = { }, type: 'mobile', }, -}; +} as const; + +export type InitialViewportKeyUnion = keyof typeof INITIAL_VIEWPORTS_DATA; + +export const INITIAL_VIEWPORTS: ViewportMap = INITIAL_VIEWPORTS_DATA; + export const DEFAULT_VIEWPORT = 'responsive'; export const MINIMAL_VIEWPORTS: ViewportMap = { From 538de4239c406d0a394ab5fcb8ab93917a41d34a Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Tue, 24 Sep 2024 12:45:40 +0200 Subject: [PATCH 2/2] Update code/addons/viewport/src/defaults.ts --- code/addons/viewport/src/defaults.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/viewport/src/defaults.ts b/code/addons/viewport/src/defaults.ts index 014c90f22b34..d29e380ac230 100644 --- a/code/addons/viewport/src/defaults.ts +++ b/code/addons/viewport/src/defaults.ts @@ -227,7 +227,7 @@ const INITIAL_VIEWPORTS_DATA = { }, } as const; -export type InitialViewportKeyUnion = keyof typeof INITIAL_VIEWPORTS_DATA; +export type InitialViewportKeys = keyof typeof INITIAL_VIEWPORTS_DATA; export const INITIAL_VIEWPORTS: ViewportMap = INITIAL_VIEWPORTS_DATA;