Skip to content

Commit

Permalink
Add typescript definition for juicy-chat-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
J12934 committed Apr 30, 2023
1 parent d816d29 commit 5ef0011
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { VM } from 'vm2';

interface Response {
action: string;
handler: string;
body: string;
}

interface Training {
state: boolean;
data: unknown;
}

export class Bot {
public factory: VM;
public training: Training;

constructor(name: string, greeting: string, trainingSet: string, defaultResponse: string);
addUser(id: string, name: string): void;
greet(id: string): string;
respond(query: string, id: string): Promise<Response>;
train(): unknown;
}

0 comments on commit 5ef0011

Please sign in to comment.