Skip to content

Commit

Permalink
Merge pull request #2434 from Shopify/fix-return-type
Browse files Browse the repository at this point in the history
Fix render extension return type
  • Loading branch information
vividviolet authored Oct 24, 2024
2 parents f041b7d + 82991cd commit 94609d5
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 94609d5

Please sign in to comment.