chat-with-gpt/src/backend.ts

33 lines
574 B
TypeScript
Raw Normal View History

2023-03-06 13:30:58 +00:00
import EventEmitter from 'events';
import { Chat } from './types';
export let backend: Backend | null = null;
export class Backend extends EventEmitter {
constructor() {
super();
}
register() {
backend = this;
}
get isAuthenticated() {
return false;
}
async signIn(options?: any) {
}
async shareChat(chat: Chat): Promise<string|null> {
return null;
}
async getSharedChat(id: string): Promise<Chat|null> {
return null;
}
}
export function getBackend() {
return backend;
}