Skip to content

Commit 94609d5

Browse files
authored
Merge pull request #2434 from Shopify/fix-return-type
Fix render extension return type
2 parents f041b7d + 82991cd commit 94609d5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@shopify/ui-extensions': patch
3+
---
4+
5+
Fix return type for RenderExtension to optionally return a clean up function
6+
Remove unused RunnableExtension interface for Admin

packages/ui-extensions/src/surfaces/admin/registration.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
export interface RenderExtension<Api> {
2-
(root: HTMLElement, api: Api): Promise<() => void>;
3-
}
4-
5-
export interface RunnableExtension<Api, Output> {
6-
(api: Api): Output | Promise<Output>;
2+
(root: HTMLElement, api: Api): Promise<void | (() => void)>;
73
}
84

95
export interface ExtensionRegistrationFunction<ExtensionTargets> {

0 commit comments

Comments
 (0)