mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #14715 from mtgto/xmlrpc-custom
[xmlrpc] Add CustomType.
This commit is contained in:
Vendored
+7
@@ -84,6 +84,13 @@ declare module 'xmlrpc' {
|
||||
decodeIso8601(time: string): Date;
|
||||
encodeIso8601(date: Date): string;
|
||||
}
|
||||
|
||||
export class CustomType {
|
||||
tagName: string;
|
||||
raw: string;
|
||||
constructor(raw: string);
|
||||
serialize(xml: any): any; // XMLElementOrXMLNode declared by xmlbuilder
|
||||
}
|
||||
}
|
||||
|
||||
export = xmlrpc;
|
||||
|
||||
@@ -23,4 +23,14 @@ const server = xmlrpc.createServer(serverOpts, () => {
|
||||
client.methodCall('hello', ['world'], (err, val) => {
|
||||
console.log(val);
|
||||
});
|
||||
|
||||
class Value extends xmlrpc.CustomType {
|
||||
constructor(value: any) {
|
||||
super(value);
|
||||
this.tagName = 'Value';
|
||||
}
|
||||
}
|
||||
client.methodCall('hello', [new Value('custom_string_value')], (err, val) => {
|
||||
console.log(val);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user