From a898043c0506758d5c147bf55ca31a548b5c879e Mon Sep 17 00:00:00 2001 From: Pieter Van Parys Date: Tue, 22 Oct 2024 10:36:27 +0200 Subject: [PATCH 1/2] ColorUsageType is not exported as usable enum This fixes the export for ColorUsageType Example where it goes wrong: ```ts (async () => { // Fetch all frames to find the ID of the frame named 'InventoryBarcode' const framesResponse = await window.SDK.frame.getAll(); const frames = framesResponse.parsedData; // Find the frame with name 'InventoryBarcode', case insensitive const inventoryBarcodeFrame = frames.find(frame => frame.name.toLowerCase() === 'inventorybarcode'); if (!inventoryBarcodeFrame) { throw new Error("Frame 'InventoryBarcode' not found"); } const frameId = inventoryBarcodeFrame.id; // Define the custom hex color const backgroundColor: ColorUsage = { color: { value: '#FF5733', type: ColorType.hex }, type: ColorUsageType.local }; // Set the background color of the 'InventoryBarcode' frame await window.SDK.barcode.setBackgroundColor(frameId, backgroundColor); })(); ``` throws errors like `'ColorUsageType' cannot be used as a value because it was exported using 'export type'.` --- packages/sdk/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 1b0d9276..5ca6ff5a 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -117,7 +117,8 @@ export type { export type { ParagraphStyle, ParagraphStyleUpdate } from './types/ParagraphStyleTypes'; export type { CharacterStyle, CharacterStyleUpdate } from './types/CharacterStyleTypes'; -export type { ColorUsage, ColorUsageUpdate, ColorUsageType } from './types/ColorStyleTypes'; +export type { ColorUsage, ColorUsageUpdate } from './types/ColorStyleTypes'; +export { ColorUsageType } from './types/ColorStyleTypes'; export type { DocumentFontStyle, From 1dafbe9cc50befc02e63d9af59fe15225e6417d0 Mon Sep 17 00:00:00 2001 From: Pieter Van Parys Date: Tue, 22 Oct 2024 12:12:50 +0200 Subject: [PATCH 2/2] Update additional offenders --- packages/sdk/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 5ca6ff5a..f61d43e8 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -54,14 +54,14 @@ export type { AutoGrowSettings, AnchorTarget, FrameAnchor, - PageAnchorTarget, - FrameAnchorTarget, RelativeFrameAnchor, StartFrameAnchor, EndFrameAnchor, StartAndEndFrameAnchor, CenterFrameAnchor } from './types/FrameTypes'; +export { PageAnchorTarget, FrameAnchorTarget } from './types/FrameTypes'; + export type { Variable, GroupVariable, @@ -102,8 +102,8 @@ export type { Id, ConnectorConfigOptions, ConnectorConfigValue, - ConnectorConfigValueType, } from './types/CommonTypes'; +export { ConnectorConfigValueType } from './types/CommonTypes'; export type { TextProperties,