Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
d.ts for viber
Browse files Browse the repository at this point in the history
  • Loading branch information
tenorok committed Dec 17, 2017
1 parent 5d8dbee commit 64b894b
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 10 deletions.
30 changes: 30 additions & 0 deletions broid-viber/lib/core/Adapter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import * as Promise from 'bluebird';
import { Router } from 'express';
import { Observable } from 'rxjs/Rx';
import { IAdapterOptions } from './interfaces';
export declare class Adapter {
private avatar;
private connected;
private logger;
private logLevel;
private me;
private parser;
private serviceID;
private session;
private storeUsers;
private token;
private username;
private router;
private webhookServer;
private webhookURL;
constructor(obj: IAdapterOptions);
users(): Promise<Map<string, any>>;
channels(): Promise<Error>;
serviceName(): string;
serviceId(): string;
getRouter(): Router | null;
connect(): Observable<object | Error>;
disconnect(): Promise<null>;
listen(): Observable<object>;
send(data: object): Promise<any>;
}
13 changes: 13 additions & 0 deletions broid-viber/lib/core/Parser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { IActivityStream } from '@broid/schemas';
import * as Promise from 'bluebird';
export declare class Parser {
serviceID: string;
generatorName: string;
private logger;
constructor(serviceName: string, serviceID: string, logLevel: string);
validate(event: any): Promise<any>;
parse(event: any): Promise<IActivityStream | null>;
normalize(evt: any): Promise<any>;
private createIdentifier();
private createActivityStream(normalized);
}
14 changes: 14 additions & 0 deletions broid-viber/lib/core/WebHookServer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as Promise from 'bluebird';
import * as express from 'express';
import { IAdapterHTTPOptions } from './interfaces';
export declare class WebHookServer {
private express;
private logger;
private httpClient;
private host;
private port;
constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string);
listen(): void;
close(): Promise<null>;
private setupExpress(router);
}
2 changes: 2 additions & 0 deletions broid-viber/lib/core/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { Adapter } from './Adapter';
export = Adapter;
14 changes: 14 additions & 0 deletions broid-viber/lib/core/interfaces.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface IAdapterHTTPOptions {
host: string;
port: number;
}
export interface IAdapterOptions {
avatar: string;
http: IAdapterHTTPOptions;
logLevel: string;
serviceID: string;
token: string;
tokenSecret: string;
username: string;
webhookURL: string;
}
Empty file.
12 changes: 2 additions & 10 deletions broid-viber/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
request "^2.81.0"
valid-url "^1.0.9"

"@types/node@*":
version "8.0.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480"

"@types/node@^7.0.12":
"@types/node@*", "@types/node@^7.0.12":
version "7.0.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9"

Expand Down Expand Up @@ -3799,11 +3795,7 @@ uuid@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"

uuid@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1"

uuid@^3.1.0:
uuid@^3.0.0, uuid@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"

Expand Down

0 comments on commit 64b894b

Please sign in to comment.