Merge pull request #8562 from nicoleWjie/master

Update soap definition: soap client extends `EventEmitter`
This commit is contained in:
Masahiro Wakame
2016-03-16 01:26:15 +09:00
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -1,6 +1,7 @@
/// <reference path="soap.d.ts" />
import * as soap from 'soap';
import * as events from 'events';
const url = 'http://example.com/wsdl?wsdl';
const wsdlOptions = { name: 'value' };
@@ -15,5 +16,8 @@ soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) {
client['create']({ name: 'value' }, function(err, result) {
// result is an object
}, {});
client.on('request', function(obj: any) {
//obj is an object
});
});
+5 -1
View File
@@ -3,11 +3,15 @@
// Definitions by: Nicole Wang <https://github.com/nicoleWjie>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../node/node.d.ts' />
declare module 'soap' {
import * as events from 'events';
class WSSecurity {
constructor(username: string, password: string, options: any);
}
interface Client {
interface Client extends events.EventEmitter {
setSecurity(s: WSSecurity): void;
[method: string]: (args: any, fn: (err: any, result: any) => void, options?: any) => void;
addSoapHeader(headJSON: any): void;