Skip to content

Commit 5f1db2e

Browse files
committed
Update types for native images
1 parent 46746c0 commit 5f1db2e

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

packages/pluggable-widgets-tools/src/typings-generator/__tests__/outputs/image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const imageNativeOutput = `export interface MyWidgetProps<Style> {
3232
style: Style[];
3333
image: DynamicValue<NativeImage>;
3434
image2?: DynamicValue<NativeImage>;
35-
image3: EditableImageValue<NativeImage>;
35+
image3: DynamicValue<NativeImage>;
3636
description: EditableValue<string>;
3737
action?: ActionValue;
3838
}`;

packages/pluggable-widgets-tools/src/typings-generator/generateClientTypes.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,8 @@ function toClientPropType(
130130
return "Big";
131131
case "icon":
132132
return isNative ? "DynamicValue<NativeIcon>" : "DynamicValue<WebIcon>";
133-
case "image": {
134-
const allowUpload = prop.$.allowUpload === "true";
135-
const imageType = isNative ? "NativeImage" : "WebImage";
136-
return allowUpload ? `EditableImageValue<${imageType}>` : `DynamicValue<${imageType}>`;
137-
}
133+
case "image":
134+
return isNative ? "DynamicValue<NativeImage>" : prop.$.allowUpload === "true" ? "EditableImageValue<WebImage>" : "DynamicValue<WebImage>";
138135
case "file":
139136
return prop.$.allowUpload ? "EditableFileValue<FileValue>" : "DynamicValue<FileValue>";
140137
case "datasource":

0 commit comments

Comments
 (0)