ajax.d.ts 871 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import types = require('./types');
  2. declare namespace ajax {
  3. function get(
  4. url: string,
  5. data: string | {},
  6. success: types.AnyFn,
  7. dataType?: string
  8. ): XMLHttpRequest;
  9. function get(
  10. url: string,
  11. success: types.AnyFn,
  12. dataType?: string
  13. ): XMLHttpRequest;
  14. function post(
  15. url: string,
  16. data: string | {},
  17. success: types.AnyFn,
  18. dataType?: string
  19. ): XMLHttpRequest;
  20. function post(
  21. url: string,
  22. success: types.AnyFn,
  23. dataType?: string
  24. ): XMLHttpRequest;
  25. }
  26. declare function ajax(options: {
  27. type?: string;
  28. url: string;
  29. data?: string | {};
  30. dataType?: string;
  31. contentType?: string;
  32. success?: types.AnyFn;
  33. error?: types.AnyFn;
  34. complete?: types.AnyFn;
  35. timeout?: number;
  36. }): XMLHttpRequest;
  37. export = ajax;