From 82991cd94f022cf7e898979aa8c23e22c32f22d3 Mon Sep 17 00:00:00 2001 From: Trish Ta Date: Thu, 24 Oct 2024 12:14:52 -0400 Subject: [PATCH] Fix render extension return type Remove RunnableExtension type from Admin surface since it is unused --- .changeset/unlucky-cycles-invite.md | 6 ++++++ packages/ui-extensions/src/surfaces/admin/registration.ts | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .changeset/unlucky-cycles-invite.md diff --git a/.changeset/unlucky-cycles-invite.md b/.changeset/unlucky-cycles-invite.md new file mode 100644 index 000000000..9e54cc9dd --- /dev/null +++ b/.changeset/unlucky-cycles-invite.md @@ -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 diff --git a/packages/ui-extensions/src/surfaces/admin/registration.ts b/packages/ui-extensions/src/surfaces/admin/registration.ts index 5cb55190a..4860319ba 100644 --- a/packages/ui-extensions/src/surfaces/admin/registration.ts +++ b/packages/ui-extensions/src/surfaces/admin/registration.ts @@ -1,9 +1,5 @@ export interface RenderExtension { - (root: HTMLElement, api: Api): Promise<() => void>; -} - -export interface RunnableExtension { - (api: Api): Output | Promise; + (root: HTMLElement, api: Api): Promise void)>; } export interface ExtensionRegistrationFunction {