mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 13:17:08 +00:00
16 lines
337 B
TypeScript
16 lines
337 B
TypeScript
![]() |
import { createContext } from "preact";
|
||
|
import type { BridgeAPI } from "./BridgeAPI";
|
||
|
|
||
|
interface IBridgeContext {
|
||
|
bridgeApi: BridgeAPI;
|
||
|
}
|
||
|
|
||
|
const fakeBridgeContext = {
|
||
|
get bridgeApi(): BridgeAPI {
|
||
|
throw Error('No context provided');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export const BridgeContext = createContext<IBridgeContext>(fakeBridgeContext);
|
||
|
|