* Build the context-level `openModal` closure, or `undefined` when the surface * can't open one. Requires both `adapter.openModal` and a platform `triggerId`; * otherwise the context omits `openModal` (callers guard `ctx.openModal?.(view)`).
(
adapter: PlatformAdapter,
replyTarget: unknown,
triggerId: string | undefined,
)
| 359 | * otherwise the context omits `openModal` (callers guard `ctx.openModal?.(view)`). |
| 360 | */ |
| 361 | function makeOpenModal( |
| 362 | adapter: PlatformAdapter, |
| 363 | replyTarget: unknown, |
| 364 | triggerId: string | undefined, |
| 365 | ): |
| 366 | | ((view: ModalView) => Promise<{ ok: boolean; error?: string }>) |
| 367 | | undefined { |
| 368 | if (!adapter.openModal || !triggerId) return undefined; |
| 369 | return (view: ModalView) => |
| 370 | adapter.openModal!(replyTarget, triggerId, renderToIR(view)); |
| 371 | } |
| 372 | |
| 373 | function makeSink(adapter: PlatformAdapter): IngressSink { |
| 374 | return { |
no test coverage detected
searching dependent graphs…