undo button - not functional yet but gives a good idea of what will happen

This commit is contained in:
Andrew Gundersen 2021-03-31 08:41:13 -05:00
commit f89c9944e7
13 changed files with 137 additions and 18 deletions

View file

@ -1,4 +1,11 @@
/* eslint-disable */
import { Emitter } from "mitt";
// Backend emitter
type Mitt = Emitter;
const EventEmitter = require('events');
class BackgroundMitt extends EventEmitter { }

View file

@ -1,4 +1,4 @@
import { RenderMessage, ClientMessage, AuthRequest, LogoutRequest } from "@/types/message/index";
import { RenderMessage, ClientMessage, ClientRequest, AuthRequest, LogoutRequest } from "@/types";
import { v4 as uuidv4 } from 'uuid';
function getTimeStamp(): number {
@ -31,6 +31,15 @@ export const clientMessage = (text: string, audio: string | boolean, uid: string
}
)
export const clientRequest = (intent: string, params: object, epic: string | boolean): ClientRequest => (
{
intent: intent,
params: params,
epic: epic,
confidence: 1.0
}
)
export const authRequest = (key: boolean | string, usr: boolean | string, pwd: boolean | string): AuthRequest => (
{
key,

View file

@ -1,6 +1,6 @@
import { ref } from 'vue';
import useScroll from "@/modules/scroll";
import { RenderMessage, Annotation } from "@/types/message/index";
import { RenderMessage, Annotation } from "@/types";
const messages = ref(new Map());

View file

@ -1,5 +1,9 @@
import { inject } from "vue";
import { Mitt } from "@/types/mitt/index";
import { Emitter } from "mitt";
// Frontend emitter
type Mitt = Emitter;
let emitter: Mitt;