From f42acd817f5353f86ba353ff483ff8d0e7bf7a61 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Tue, 6 Apr 2021 19:38:19 -0700 Subject: [PATCH] fix(core): Enums deprecation adjustment (#9306) --- packages/core/core-types/index.d.ts | 49 ++++++++++++++++++++--------- packages/core/core-types/index.ts | 49 ++++++++++++++++++++--------- 2 files changed, 70 insertions(+), 28 deletions(-) diff --git a/packages/core/core-types/index.d.ts b/packages/core/core-types/index.d.ts index 2a664338b..19dbb1f17 100644 --- a/packages/core/core-types/index.d.ts +++ b/packages/core/core-types/index.d.ts @@ -742,20 +742,6 @@ export type LengthType = CoreTypes.LengthType; */ export type PercentLengthType = CoreTypes.PercentLengthType; -/** - * @deprecated Use `CoreTypes` instead. Enums will be removed in 9.0 - */ -export namespace Enums { - export type DeviceOrientationType = CoreTypes.DeviceOrientationType; - export type HorizontalAlignmentType = CoreTypes.HorizontalAlignmentType; - export type VerticalAlignmentTextType = CoreTypes.VerticalAlignmentTextType; - export type VerticalAlignmentType = CoreTypes.VerticalAlignmentType; - export type OrientationType = CoreTypes.OrientationType; - export type TextAlignmentType = CoreTypes.TextAlignmentType; - export type TextTransformType = CoreTypes.TextTransformType; - export type VisibilityType = CoreTypes.VisibilityType; -} - /** * @deprecated Use `CoreTypes.AnimationCurve` instead. */ @@ -770,3 +756,38 @@ export type HorizontalAlignment = CoreTypes.HorizontalAlignmentType; * @deprecated Use `CoreTypes.VerticalAlignmentType` instead. */ export type VerticalAlignment = CoreTypes.VerticalAlignmentType; + +/** + * @deprecated Use `CoreTypes` instead. Enums will be removed in 9.0 + */ +export declare const Enums: { + Accuracy: typeof CoreTypes.Accuracy; + AndroidActionBarIconVisibility: typeof CoreTypes.AndroidActionBarIconVisibility; + AndroidActionItemPosition: typeof CoreTypes.AndroidActionItemPosition; + AnimationCurve: typeof CoreTypes.AnimationCurve; + AutocapitalizationType: typeof CoreTypes.AutocapitalizationType; + BackgroundRepeat: typeof CoreTypes.BackgroundRepeat; + DeviceOrientation: typeof CoreTypes.DeviceOrientation; + DeviceType: typeof CoreTypes.DeviceType; + Dock: typeof CoreTypes.Dock; + FontAttributes: typeof CoreTypes.FontAttributes; + FontStyle: typeof CoreTypes.FontStyle; + FontWeight: typeof CoreTypes.FontWeight; + HorizontalAlignment: typeof CoreTypes.HorizontalAlignment; + IOSActionItemPosition: typeof CoreTypes.IOSActionItemPosition; + ImageFormat: typeof CoreTypes.ImageFormat; + KeyboardType: typeof CoreTypes.KeyboardType; + NavigationBarVisibility: typeof CoreTypes.NavigationBarVisibility; + Orientation: typeof CoreTypes.Orientation; + ReturnKeyType: typeof CoreTypes.ReturnKeyType; + StatusBarStyle: typeof CoreTypes.StatusBarStyle; + Stretch: typeof CoreTypes.ImageStretch; + SystemAppearance: typeof CoreTypes.SystemAppearance; + TextAlignment: CoreTypes.TextAlignmentType; + TextDecoration: CoreTypes.TextDecorationType; + TextTransform: CoreTypes.TextTransformType; + UpdateTextTrigger: CoreTypes.UpdateTextTriggerType; + VerticalAlignment: CoreTypes.VerticalAlignmentType; + Visibility: CoreTypes.VisibilityType; + WhiteSpace: CoreTypes.WhiteSpaceType; +}; diff --git a/packages/core/core-types/index.ts b/packages/core/core-types/index.ts index 62f835e8f..66bcae408 100644 --- a/packages/core/core-types/index.ts +++ b/packages/core/core-types/index.ts @@ -306,20 +306,6 @@ export type LengthType = CoreTypes.LengthType; */ export type PercentLengthType = CoreTypes.PercentLengthType; -/** - * @deprecated Use `CoreTypes` instead. Enums will be removed in 9.0 - */ -export namespace Enums { - export type DeviceOrientationType = CoreTypes.DeviceOrientationType; - export type HorizontalAlignmentType = CoreTypes.HorizontalAlignmentType; - export type VerticalAlignmentTextType = CoreTypes.VerticalAlignmentTextType; - export type VerticalAlignmentType = CoreTypes.VerticalAlignmentType; - export type OrientationType = CoreTypes.OrientationType; - export type TextAlignmentType = CoreTypes.TextAlignmentType; - export type TextTransformType = CoreTypes.TextTransformType; - export type VisibilityType = CoreTypes.VisibilityType; -} - /** * @deprecated Use `CoreTypes.AnimationCurve` instead. */ @@ -334,3 +320,38 @@ export type HorizontalAlignment = CoreTypes.HorizontalAlignmentType; * @deprecated Use `CoreTypes.VerticalAlignmentType` instead. */ export type VerticalAlignment = CoreTypes.VerticalAlignmentType; + +/** + * @deprecated Use `CoreTypes` instead. Enums will be removed in 9.0 + */ +export const Enums = { + Accuracy: CoreTypes.Accuracy, + AndroidActionBarIconVisibility: CoreTypes.AndroidActionBarIconVisibility, + AndroidActionItemPosition: CoreTypes.AndroidActionItemPosition, + AnimationCurve: CoreTypes.AnimationCurve, + AutocapitalizationType: CoreTypes.AutocapitalizationType, + BackgroundRepeat: CoreTypes.BackgroundRepeat, + DeviceOrientation: CoreTypes.DeviceOrientation, + DeviceType: CoreTypes.DeviceType, + Dock: CoreTypes.Dock, + FontAttributes: CoreTypes.FontAttributes, + FontStyle: CoreTypes.FontStyle, + FontWeight: CoreTypes.FontWeight, + HorizontalAlignment: CoreTypes.HorizontalAlignment, + IOSActionItemPosition: CoreTypes.IOSActionItemPosition, + ImageFormat: CoreTypes.ImageFormat, + KeyboardType: CoreTypes.KeyboardType, + NavigationBarVisibility: CoreTypes.NavigationBarVisibility, + Orientation: CoreTypes.Orientation, + ReturnKeyType: CoreTypes.ReturnKeyType, + StatusBarStyle: CoreTypes.StatusBarStyle, + Stretch: CoreTypes.ImageStretch, + SystemAppearance: CoreTypes.SystemAppearance, + TextAlignment: CoreTypes.TextAlignment, + TextDecoration: CoreTypes.TextDecoration, + TextTransform: CoreTypes.TextTransform, + UpdateTextTrigger: CoreTypes.UpdateTextTrigger, + VerticalAlignment: CoreTypes.VerticalAlignment, + Visibility: CoreTypes.Visibility, + WhiteSpace: CoreTypes.WhiteSpace, +};