// Generated by dts-bundle v0.7.2 // Dependencies for this module: // ../bluebird // ../natural declare module 'test' { import { GreetingFunction } from 'test/types/bot'; export { Intent, Incoming, GreetingFunction } from 'test/types/bot'; export { User } from 'test/types/user'; export { PlatformMiddleware } from 'test/types/platform'; export { MessageTypes } from 'test/types/message'; import Script from 'test/scripting/script'; import Alana from 'test/bot'; export default Alana; import TestPlatform from 'test/testing/platform'; import Tester from 'test/testing/tester'; export { TestPlatform }; global { const newScript: (name?: string) => Script; const newTest: (userId?: string) => Tester; const addGreeting: (greeting: GreetingFunction) => void; } } declare module 'test/types/bot' { import { User } from 'test/types/user'; import * as Promise from 'bluebird'; import { IncomingMessage } from 'test/types/message'; import Outgoing from 'test/outgoing'; export interface Intent { action: string; topic: string; details: { confidence: number; } | any; } export { IncomingMessage }; export interface InternalMessageDetails { _eaten: boolean; } export interface Incoming { user: User; message: IncomingMessage & InternalMessageDetails; intent: Intent; } import * as Message from 'test/types/message'; export { Message }; export type StopFunction = () => void; export type DialogFunction = (incoming: Incoming, response: Outgoing, stop: StopFunction) => Promise; export type GreetingFunction = (user: User, response: Outgoing) => Promise; export class IntentGenerator { getIntents: (message: IncomingMessage, user: User) => Promise>; } export interface SkillFunction { (user: User): Promise; } export interface ReducerFunction { (intents: Array, user?: User): Promise; } export interface Logger { error(message?: any, ...optionalParams: any[]): void; info(message?: any, ...optionalParams: any[]): void; log(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; } } declare module 'test/types/user' { import * as Bot from 'test/types/bot'; import { PlatformMiddleware } from 'test/types/platform'; import * as Promise from 'bluebird'; export interface User extends BasicUser { conversation: Array; state: any; script: string; scriptStage: number; scriptArguments: any; } export interface BasicUser { id: string; platform: string; _platform: PlatformMiddleware; } export class UserMiddleware { getUser: (user: BasicUser) => Promise; saveUser: (user: U) => Promise; } } declare module 'test/types/platform' { import * as Promise from 'bluebird'; import { OutgoingMessage } from 'test/types/message'; import { User } from 'test/types/user'; export class PlatformMiddleware { start: () => Promise; stop: () => Promise; send: (user: U, message: OutgoingMessage) => Promise; } } declare module 'test/types/message' { export interface Message { type: MessageType; } export type Text = 'text'; export type Image = 'image'; export type Button = 'button'; export type Greeting = 'greeting'; export type Postback = 'postback'; export type Audio = 'audio'; import { TextMessage } from 'test/types/messages/text'; import { ImageMessage } from 'test/types/messages/image'; import { ButtonMessage } from 'test/types/messages/button'; import { PostbackMessage } from 'test/types/messages/postback'; import { GreetingMessage } from 'test/types/messages/greeting'; import { AudioMessage } from 'test/types/messages/audio'; export type IncomingMessage = TextMessage | PostbackMessage | GreetingMessage | ImageMessage; export type MessageType = Text | Image | Button | Greeting | Postback | Audio; export type OutgoingMessage = TextMessage | ImageMessage | ButtonMessage | AudioMessage; export const MessageTypes: { text: Text; image: Image; button: Button; greeting: Greeting; postback: Postback; audio: Audio; }; export { TextMessage, ButtonMessage, PostbackMessage, ImageMessage, GreetingMessage, AudioMessage }; } declare module 'test/scripting/script' { import * as Promise from 'bluebird'; import { Incoming, DialogFunction } from 'test/types/bot'; import { MinimalScriptActions, ExpectInput, IntentAlways, DialogInput, ButtonInput } from 'test/types/script'; import Outgoing from 'test/outgoing'; import Botler from 'test/bot'; export enum StopScriptReasons { Called = 0, NewScript = 1, ExpectCaught = 2, } export class StopException extends Error { reason: StopScriptReasons; constructor(reason: StopScriptReasons); } export enum EndScriptReasons { Called = 0, Reached = 1, } export class EndScriptException extends Error { reason: EndScriptReasons; constructor(reason: EndScriptReasons); } export class GotoDialogException extends Error { dialogName: string; constructor(dialogName: string); } export default class Script implements MinimalScriptActions { expect: ExpectInput; intent: IntentAlways; dialog: DialogInput; button: ButtonInput; constructor(bot: Botler, scriptName: string); readonly length: number; run(incoming: Incoming, outgoing: Outgoing, nextScript: () => Promise, step?: number): Promise; begin(dialogFunction: DialogFunction): this; _dialog(dialogFunction: DialogFunction): this; _dialog(name: string, dialogFunction: DialogFunction): this; } export function stopFunction(reason?: StopScriptReasons): void; } declare module 'test/bot' { import * as Promise from 'bluebird'; import { PlatformMiddleware } from 'test/types/platform'; import { Intent, IncomingMessage, IntentGenerator, ReducerFunction, GreetingFunction, DialogFunction, Logger } from 'test/types/bot'; import { UserMiddleware, User, BasicUser } from 'test/types/user'; export { TopicCollection } from 'test/nlp/classifier'; export { Intent, PlatformMiddleware }; import Script from 'test/scripting/script'; export default class Alana { debugOn: Boolean; userMiddleware: UserMiddleware; onErrorScript: DialogFunction; constructor(classifierFile?: string); addIntent(newIntent: IntentGenerator): this; unshiftIntent(newIntent: IntentGenerator): this; newScript(name?: string): Script; getScript(name?: string): Script; readonly scripts: string[]; addGreeting(script: GreetingFunction): this; setReducer(newReducer: ReducerFunction): this; setUserMiddlware(middleware: UserMiddleware): this; addPlatform(platform: PlatformMiddleware): this; addErrorHandler(dialog: DialogFunction): this; turnOnDebug(): this; setLogger(logger: Logger): this; readonly logger: Logger; createEmptyIntent(): Intent; createEmptyUser(defaults?: any): User; start(): void; stop(): void; processMessage(basicUser: BasicUser, message: IncomingMessage): Promise; } } declare module 'test/testing/platform' { import * as Promise from 'bluebird'; import { PlatformMiddleware } from 'test/types/platform'; import { IncomingMessage, Message } from 'test/types/message'; import { User } from 'test/types/user'; import Tester from 'test/testing/tester'; import Botler from 'test/bot'; export default class TestPlatform implements PlatformMiddleware { testers: { [key: string]: Tester; }; constructor(bot: Botler); start(): Promise; stop(): Promise; send(user: U, message: M): Promise; receive(userId: string, message: IncomingMessage): Promise; newTest(userId?: string): Tester; } } declare module 'test/testing/tester' { import * as Promise from 'bluebird'; import { Message } from 'test/types/message'; import { Button } from 'test/types/messages/button'; import TestPlatform from 'test/testing/platform'; export default class Tester { readonly userId: string; constructor(platform: TestPlatform, userId?: string); /** * Wait to recieve a text message from bot */ expectText(allowedPhrases: Array | string): this; /** * Wait to recieve a set of buttons from bot * @todo create a better inirializer to create button object * @param text Text for the button message to have * @param button Array of raw button strctures */ expectButtons(text: string, button: Array