diff --git a/.changeset/silent-trainers-learn.md b/.changeset/silent-trainers-learn.md new file mode 100644 index 0000000000000..5de34f4b5e4ae --- /dev/null +++ b/.changeset/silent-trainers-learn.md @@ -0,0 +1,5 @@ +--- +"@directus/extensions": patch +--- + +Fixed extension-sdk defineHook and defineEndpoint types diff --git a/packages/extensions/src/shared/utils/define-extension.ts b/packages/extensions/src/shared/utils/define-extension.ts index b4ac605f94959..a8b52fec8d220 100644 --- a/packages/extensions/src/shared/utils/define-extension.ts +++ b/packages/extensions/src/shared/utils/define-extension.ts @@ -11,9 +11,9 @@ import type { PanelConfig, } from '../types/index.js'; -type CustomConfig = { [K in string]: K extends keyof T ? never : unknown }; +type CustomConfig = { [K in string]: K extends keyof T ? never : unknown }; -type ExtendedConfig = Prettify>; +type ExtendedConfig = Prettify>; export function defineInterface>( config: ExtendedConfig, @@ -45,15 +45,11 @@ export function definePanel>( return config; } -export function defineHook>( - config: ExtendedConfig, -): ExtendedConfig { +export function defineHook(config: HookConfig): HookConfig { return config; } -export function defineEndpoint>( - config: ExtendedConfig, -): ExtendedConfig { +export function defineEndpoint(config: EndpointConfig): EndpointConfig { return config; }