rpc.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]
  2. // Project: [~THE PROJECT NAME~]
  3. // Definitions by: [~YOUR NAME~] <[~A URL FOR YOU~]>
  4. /*~ This is the module template file for class modules.
  5. *~ You should rename it to index.d.ts and place it in a folder with the same name as the module.
  6. *~ For example, if you were writing a file for "super-greeter", this
  7. *~ file should be 'super-greeter/index.d.ts'
  8. */
  9. /*~ Note that ES6 modules cannot directly export class objects.
  10. *~ This file should be imported using the CommonJS-style:
  11. *~ import x = require('someLibrary');
  12. *~
  13. *~ Refer to the documentation to understand common
  14. *~ workarounds for this limitation of ES6 modules.
  15. */
  16. /*~ This declaration specifies that the class constructor function
  17. *~ is the exported object from the file
  18. */
  19. export = RPCClient;
  20. /*~ Write your module's methods and properties in this class */
  21. declare class RPCClient {
  22. constructor(config: RPCClient.Config);
  23. request<T>(action: String, params: Object, options?: Object): Promise<T>;
  24. }
  25. /*~ If you want to expose types from your module as well, you can
  26. *~ place them in this block.
  27. */
  28. declare namespace RPCClient {
  29. export interface Config {
  30. endpoint: string;
  31. apiVersion: string;
  32. accessKeyId: string;
  33. accessKeySecret: string;
  34. codes?: (string | number)[];
  35. opts?: object;
  36. }
  37. }