@bmqube/xmlrpc
Version:
A pure TypeScript XML-RPC client and server. Forked from (https://github.com/baalexander/node-xmlrpc)
48 lines (47 loc) • 1.53 kB
text/typescript
import sax from "sax";
type XMLRPCValue = null | boolean | number | string | Date | Buffer | XMLRPCValue[] | {
[key: string]: XMLRPCValue;
};
type MethodResponseCallback = (error: Error | null, result?: any) => void;
type MethodCallCallback = (error: Error | null, methodName?: string, params?: any[]) => void;
export default class Deserializer {
type: "methodresponse" | "methodcall" | null;
responseType: "params" | "fault" | null;
stack: XMLRPCValue[];
marks: number[];
data: string[];
methodname: string | null;
encoding: BufferEncoding;
value: boolean;
callback: ((error: Error | null, result?: any) => void) | null;
error: Error | null;
parser: sax.SAXStream;
constructor(encoding?: BufferEncoding);
deserializeMethodResponse(stream: NodeJS.ReadableStream, callback: MethodResponseCallback): void;
deserializeMethodCall(stream: NodeJS.ReadableStream, callback: MethodCallCallback): void;
private onDone;
private onError;
private push;
private onOpentag;
private onText;
private onCDATA;
private onClosetag;
private endNil;
private endBoolean;
private endInt;
private endDouble;
private endString;
private endArray;
private endStruct;
private endBase64;
private endDateTime;
private static readonly isInteger;
private endI8;
private endValue;
private endParams;
private endFault;
private endMethodResponse;
private endMethodName;
private endMethodCall;
}
export {};