declare namespace dojo { namespace rpc { /* dojo/rpc/JsonpService */ interface JsonpService extends RpcService { strictArgChecks: boolean; /** * JSONP bind method. Takes remote method, parameters, * deferred, and a url, calls createRequest to make a JSON-RPC * envelope and passes that off with bind. */ bind(method: string, parameters: string[], deferredRequestHandler: dojo._base.Deferred, url?: string): void; /** * create a JSONP req */ createRequest(parameters: string[]): string[]; } interface JsonpServiceConstructor { new (args: string | RpcServiceArgs, requiredArgs: string[]): JsonpService; } /* dojo/rpc/JsonService */ interface JsonService extends RpcService { bustCache: boolean; contentType: string; lastSubmissionId: number; /** * call an arbitrary remote method without requiring it to be * predefined with SMD */ callRemote(method: string, params: string[]): dojo._base.Deferred; /** * JSON-RPC bind method. Takes remote method, parameters, * deferred, and a url, calls createRequest to make a JSON-RPC * envelope and passes that off with bind. */ bind(method: string, parameters: string[], deferredRequestHandler: dojo._base.Deferred, url: string): void; /** * create a JSON-RPC envelope for the request */ createRequest(method: string, params: string[]): string; /** * parse the result envelope and pass the results back to * the callback function */ parseResults(obj: any): T; } interface JsonServiceConstructor { new (args: string | RpcServiceArgs): JsonService; } /* dojo/rpc/RpcService */ interface SmdMethod { name: string; parameters?: string[]; url?: string; serviceUrl?: string; serviceURL?: string; } interface SmdObj { methods?: SmdMethod[]; serviceUrl?: string; serviceURL?: string; required?: boolean; } interface RpcServiceArgs { smdStr?: string; serviceUrl?: string; strictArgChecks?: boolean; smdObj?: SmdObj; } interface RpcService { strictArgChecks: boolean; serviceUrl: string; /** * parse the results coming back from an rpc request. this * base implementation, just returns the full object * subclasses should parse and only return the actual results */ parseResults(obj: any): T; /** * create callback that calls the Deferred errback method */ errorCallback(deferredRequestHandler: dojo._base.Deferred): (data: any) => void; /** * create callback that calls the Deferred's callback method */ resultCallback(deferredRequestHandler: dojo._base.Deferred): (obj: any) => void; /** * generate the local bind methods for the remote object */ generateMethod(method: string, parameters: string[], url: string): dojo._base.Deferred; /** * callback method for receipt of a smd object. Parse the smd * and generate functions based on the description */ processSmd(obj: SmdObj): void; } interface RpcServiceConstructor { /** * Take a string as a url to retrieve an smd or an object that is an smd or partial smd to use * as a definition for the service */ new (args: string | RpcServiceArgs): RpcService; } } }