Initial API without namespaces.

This commit is contained in:
James
2017-08-31 18:38:48 +02:00
parent 60a99976ea
commit 0b991edc75
4 changed files with 122 additions and 0 deletions

98
types/peer-dial/index.d.ts vendored Normal file
View File

@@ -0,0 +1,98 @@
/** Declaration file generated by dts-gen */
/// <reference types="node" />
/// <reference types="express" />
/// <reference types="node-uuid" />
import * as events from "events";
import * as express from "express";
import * as uuid from "node-uuid";
//TODO: Needs namespaces for all of this.
export class Server extends events.EventEmitter{
constructor(options: ServerOptions);
start(): void;
stop(): void;
corsOptionsAppsDelegate(req: string, callback: (err: any, data: CorsOptions) => void): void;
}
export interface CorsOptions {
origin: boolean;
methods: string[];
exposedHeaders: string[];
}
export interface ServerOptions {
expressApp: express.Express;
prefix: string;
port: number;
host: string;
uuid: uuid.UUIDOptions;
friendlyName: string;
manufacturer: string;
modelName: string;
maxContentLength: number;
extraHeaders: Object;
delegate: Delegate;
corsAllowOrigins: boolean;
}
export class Delegate {
getApp(appName: string) : App;
launchApp(appName: string, launchData: string, callback: (data: string) => void) : void;
stopApp(appName: string, pid: string, callback: (data: boolean) => void) : void;
}
export interface App {
name: string;
state: string;
allowStop: boolean;
pid: string;
launch(launchData: string): void;
}
export class Client extends events.EventEmitter {
constructor();
getDialDevice(deviceDescriptionUrl: string, callback?: (data: DialDevice, err: any) => void) : void;
start() : void;
refresh() : void;
stop() : void;
}
export class DialDevice {
constructor(deviceInfo: DeviceInfo);
getAppInfoXml(appName: string, callback?: (data: string, err: any) => void) :void;
getAppInfo(appName: string, callback?: (data: Object, err: any) => void): void;
launchApp(appName: string, launchData: string, contentType: string, callback?: (data: string, err: any) => void): void;
stopApp(appName: string, pid: string, callback?: (data: number, err: any) => void): void;
}
interface DeviceInfo {
descriptionUrl: string;
applicationUrl: string;
deviceType: string;
friendlyName: string;
manufacturer: string;
modelName: string;
UDN: string;
iconList: Object[] | {
icon: Object
};
}

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"peer-dial-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }