// SPDX-FileCopyrightText: 2026 Stan Grams // // SPDX-License-Identifier: GPL-2.0-or-later export interface DecoderPlugin { readonly id: string; onMessage?(message: TMessage): void; onBatch?(messages: TMessage[]): void; restore?(messages: TMessage[]): void; reset?(): void; prune?(): void; /** Replay everything the plugin is holding onto the map. Called when the map * module attaches, which can happen long after the decodes arrived. */ syncMap?(): void; } export interface TrxPluginRuntime { registerDecoder(plugin: DecoderPlugin): () => void; dispatch(id: string, message: unknown): boolean; dispatchBatch(id: string, messages: unknown[]): boolean; restore(id: string, messages: unknown[]): boolean; reset(id: string): boolean; resetAll(): void; prune(id: string): boolean; syncMapAll(): void; clearQueued(): void; hasDecoder(id: string): boolean; } export interface PluginRuntimeWindow { trxPluginRuntime: TrxPluginRuntime }