PageRenderTime 43ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/dojo/dojox.socket.d.ts

https://github.com/vilic/DefinitelyTyped
TypeScript Typings | 61 lines | 17 code | 2 blank | 42 comment | 0 complexity | cab0c4b324cc46f3100d2671b1bb06cf MD5 | raw file
Possible License(s): MIT
  1. // Type definitions for Dojo v1.9
  2. // Project: http://dojotoolkit.org
  3. // Definitions by: Michael Van Sickle <https://github.com/vansimke>
  4. // Definitions: https://github.com/borisyankov/DefinitelyTyped
  5. declare module dojox {
  6. /**
  7. * Permalink: http://dojotoolkit.org/api/1.9/dojox/socket.html
  8. *
  9. * Provides a simple socket connection using WebSocket, or alternate
  10. * communication mechanisms in legacy browsers for comet-style communication. This is based
  11. * on the WebSocket API and returns an object that implements the WebSocket interface:
  12. * http://dev.w3.org/html5/websockets/#websocket
  13. * Provides socket connections. This can be used with virtually any Comet protocol.
  14. *
  15. * @param argsOrUrl This uses the same arguments as the other I/O functions in Dojo, or aURL to connect to. The URL should be a relative URL in order to properlywork with WebSockets (it can still be host relative, like //other-site.org/endpoint)
  16. */
  17. interface socket{(argsOrUrl: Object): void}
  18. module socket {
  19. /**
  20. * Provides a simple long-poll based comet-style socket/connection to a server and returns an
  21. * object implementing the WebSocket interface:
  22. * http://dev.w3.org/html5/websockets/#websocket
  23. *
  24. * @param args This uses the same arguments as the other I/O functions in Dojo, with this addition:args.interval:Indicates the amount of time (in milliseconds) after a response was receivedbefore another request is made. By default, a request is made immediatelyafter getting a response. The interval can be increased to reduce load on theserver or to do simple time-based polling where the server always respondsimmediately.args.transport:Provide an alternate transport like dojo.io.script.get
  25. */
  26. interface LongPoll{(args: Object): any}
  27. /**
  28. *
  29. * @param socket
  30. * @param newSocket
  31. * @param listenForOpen
  32. */
  33. interface replace{(socket: any, newSocket: any, listenForOpen: any): void}
  34. /**
  35. * A wrapper for WebSocket, than handles standard args and relative URLs
  36. *
  37. * @param args
  38. * @param fallback
  39. */
  40. interface WebSocket{(args: any, fallback: any): void}
  41. /**
  42. * Permalink: http://dojotoolkit.org/api/1.9/dojox/socket/Reconnect.html
  43. *
  44. * Provides auto-reconnection to a websocket after it has been closed
  45. *
  46. * @param socket Socket to add reconnection support to.
  47. * @param options
  48. */
  49. interface Reconnect{(socket: any, options: any): void}
  50. }
  51. }
  52. declare module "dojox/socket" {
  53. var exp: dojox.socket
  54. export=exp;
  55. }
  56. declare module "dojox/socket/Reconnect" {
  57. var exp: dojox.socket.Reconnect
  58. export=exp;
  59. }