beautify soap definition files

This commit is contained in:
etuxxyl
2016-03-08 13:13:09 +08:00
parent cbfaf727e1
commit 3d51b999a3
2 changed files with 12 additions and 12 deletions
+3 -3
View File
@@ -3,16 +3,16 @@
import * as soap from 'soap';
const url = 'http://example.com/wsdl?wsdl';
const wsdlOptions = {name: 'value'};
const wsdlOptions = { name: 'value' };
soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) {
let securityOptions = { 'hasTimeStamp': false };
client.setSecurity(new soap.WSSecurity('user', 'password', securityOptions));
client.addSoapHeader({});
client['create']({name: 'value'}, function(err, result) {
client['create']({ name: 'value' }, function(err, result) {
// result is an object
});
client['create']({name: 'value'}, function(err, result) {
client['create']({ name: 'value' }, function(err, result) {
// result is an object
}, {});
});
+9 -9
View File
@@ -4,14 +4,14 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'soap' {
class WSSecurity {
constructor(username: string, password: string, options: any);
}
interface Client {
setSecurity(s: WSSecurity): void;
[method: string]: (args: any, fn: (err: any, result: any) => void, options?: any) => void;
addSoapHeader(headJSON: any): void;
}
function createClient(wsdlPath: string, options: any, fn: (err: any, client: Client) => void): void;
class WSSecurity {
constructor(username: string, password: string, options: any);
}
interface Client {
setSecurity(s: WSSecurity): void;
[method: string]: (args: any, fn: (err: any, result: any) => void, options?: any) => void;
addSoapHeader(headJSON: any): void;
}
function createClient(wsdlPath: string, options: any, fn: (err: any, client: Client) => void): void;
}