offline-exporting.src.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*!*
  2. *
  3. * Copyright (c) Highsoft AS. All rights reserved.
  4. *
  5. *!*/
  6. import * as globals from "../globals.src";
  7. import * as _Highcharts from "../highcharts.src";
  8. /**
  9. * Adds the module to the imported Highcharts namespace.
  10. *
  11. * @param highcharts
  12. * The imported Highcharts namespace to extend.
  13. */
  14. export function factory(highcharts: typeof Highcharts): void;
  15. declare module "../highcharts.src" {
  16. interface Chart {
  17. /**
  18. * Exporting and offline-exporting modules required. Export a chart to
  19. * an image locally in the user's browser.
  20. *
  21. * @param exportingOptions
  22. * Exporting options, the same as in
  23. * Highcharts.Chart#exportChart.
  24. *
  25. * @param chartOptions
  26. * Additional chart options for the exported chart. For example a
  27. * different background color can be added here, or `dataLabels`
  28. * for export only.
  29. */
  30. exportChartLocal(exportingOptions?: ExportingOptions, chartOptions?: Options): void;
  31. }
  32. /**
  33. * Get data URL to an image of an SVG and call download on it options
  34. * object:
  35. *
  36. * - **filename:** Name of resulting downloaded file without extension.
  37. * Default is `chart`.
  38. *
  39. * - **type:** File type of resulting download. Default is `image/png`.
  40. *
  41. * - **scale:** Scaling factor of downloaded image compared to source.
  42. * Default is `1`.
  43. *
  44. * - **libURL:** URL pointing to location of dependency scripts to download
  45. * on demand. Default is the exporting.libURL option of the global
  46. * Highcharts options pointing to our server.
  47. *
  48. * @param svg
  49. * The generated SVG
  50. *
  51. * @param options
  52. * The exporting options
  53. *
  54. * @param failCallback
  55. * The callback function in case of errors
  56. *
  57. * @param successCallback
  58. * The callback function in case of success
  59. */
  60. function downloadSVGLocal(svg: string, options: ExportingOptions, failCallback: Function, successCallback?: Function): void;
  61. }
  62. export default factory;
  63. export let Highcharts: typeof _Highcharts;