Skip to content

Commit

Permalink
Fix render extension return type
Browse files Browse the repository at this point in the history
Remove RunnableExtension type from Admin surface since it is unused
  • Loading branch information
vividviolet committed Oct 24, 2024
1 parent fad8cf0 commit 82991cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/unlucky-cycles-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/ui-extensions': patch
---

Fix return type for RenderExtension to optionally return a clean up function
Remove unused RunnableExtension interface for Admin
6 changes: 1 addition & 5 deletions packages/ui-extensions/src/surfaces/admin/registration.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
export interface RenderExtension<Api> {
(root: HTMLElement, api: Api): Promise<() => void>;
}

export interface RunnableExtension<Api, Output> {
(api: Api): Output | Promise<Output>;
(root: HTMLElement, api: Api): Promise<void | (() => void)>;
}

export interface ExtensionRegistrationFunction<ExtensionTargets> {
Expand Down

0 comments on commit 82991cd

Please sign in to comment.