fix(client): widen slot-face types to the harness's real call shapes
SlotRegistration.inject is invoked without a session id for root-scope keyed slots (settings.plugin.item), and slot components receive harness-injected props beyond sessionId (useProjection, hooks). The narrower types made the plugin's own registrations fail a strict typecheck of the test harness's faithful slot registry.
This commit is contained in:
1 parent
ecd9af93a8
commit
4e5e71a96c
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -90,7 +90,7 @@ function apply(ctx: ClientCtx): void {
|
||||
ctx.slots.inject('conversation.input.overlay', () => {
|
||||
return ctx.slots.register(
|
||||
{ name: 'conversation.input.overlay', id: 'context-modal', order: 10, locale: NS,
|
||||
inject: (sessionId: string) => ({ hooks: { contextModal: modalStoreOf(sessionId) } }) },
|
||||
inject: (sessionId = '') => ({ hooks: { contextModal: modalStoreOf(sessionId) } }) },
|
||||
props => h(ContextModal, props),
|
||||
)
|
||||
})
|
||||
|
||||
@@ -30,14 +30,14 @@ export interface SlotRegistration {
|
||||
locale?: string
|
||||
label?: () => string
|
||||
/** optional business face factory; a `hooks` compartment binds selector hooks onto props. */
|
||||
inject?: (sessionId: string) => unknown
|
||||
inject?: (sessionId?: string) => unknown
|
||||
}
|
||||
|
||||
export interface SlotsService {
|
||||
inject(name: string, callback: () => unknown): unknown
|
||||
register(
|
||||
registration: SlotRegistration,
|
||||
component: (props: { sessionId?: string }) => unknown,
|
||||
component: (props: { sessionId?: string } & Record<string, unknown>) => unknown,
|
||||
): unknown
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user