first commit
This commit is contained in:
25
fog/apps/twitch-extension-panel/src/mocks/twitch-ext.mock.ts
Executable file
25
fog/apps/twitch-extension-panel/src/mocks/twitch-ext.mock.ts
Executable file
@@ -0,0 +1,25 @@
|
||||
export interface TwitchExtLike {
|
||||
onAuthorized(callback: (auth: { token: string; userId: string }) => void): void;
|
||||
onContext(callback: (context: Record<string, unknown>) => void): void;
|
||||
onVisibilityChanged(callback: (isVisible: boolean, context: unknown) => void): void;
|
||||
listen(topic: string, callback: (target: string, contentType: string, message: string) => void): void;
|
||||
}
|
||||
|
||||
export const twitchExtMock: TwitchExtLike = {
|
||||
onAuthorized(callback) {
|
||||
callback({
|
||||
token:
|
||||
'mock.jwt.token',
|
||||
userId: 'U_mock_viewer'
|
||||
});
|
||||
},
|
||||
onContext(callback) {
|
||||
callback({ theme: 'dark' });
|
||||
},
|
||||
onVisibilityChanged(callback) {
|
||||
callback(true, {});
|
||||
},
|
||||
listen(_topic, _callback) {
|
||||
// No-op in local mock mode.
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user