mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 08:00:20 +00:00
19 lines
452 B
TypeScript
19 lines
452 B
TypeScript
type LegacyInternalHookHandler = {
|
|
event: string;
|
|
module: string;
|
|
export?: string;
|
|
};
|
|
|
|
type LegacyInternalHooksCarrier = {
|
|
hooks?: {
|
|
internal?: {
|
|
handlers?: LegacyInternalHookHandler[];
|
|
};
|
|
};
|
|
};
|
|
|
|
export function getLegacyInternalHookHandlers(config: unknown): LegacyInternalHookHandler[] {
|
|
const handlers = (config as LegacyInternalHooksCarrier)?.hooks?.internal?.handlers;
|
|
return Array.isArray(handlers) ? handlers : [];
|
|
}
|