exporting.d.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*!*
  2. *
  3. * Copyright (c) Highsoft AS. All rights reserved.
  4. *
  5. *!*/
  6. import * as globals from "../globals";
  7. import * as _Highcharts from "../highcharts";
  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" {
  16. interface Chart {
  17. fullscreen: Fullscreen;
  18. /**
  19. * Exporting module required. Submit an SVG version of the chart to a
  20. * server along with some parameters for conversion.
  21. *
  22. * @param exportingOptions
  23. * Exporting options in addition to those defined in exporting.
  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. exportChart(exportingOptions: ExportingOptions, chartOptions: Options): void;
  31. /**
  32. * Return the unfiltered innerHTML of the chart container. Used as hook
  33. * for plugins. In styled mode, it also takes care of inlining CSS style
  34. * rules.
  35. *
  36. * @return The unfiltered SVG of the chart.
  37. */
  38. getChartHTML(): string;
  39. /**
  40. * Get the default file name used for exported charts. By default it
  41. * creates a file name based on the chart title.
  42. *
  43. * @return A file name without extension.
  44. */
  45. getFilename(): string;
  46. /**
  47. * Return an SVG representation of the chart.
  48. *
  49. * @param chartOptions
  50. * Additional chart options for the generated SVG representation.
  51. * For collections like `xAxis`, `yAxis` or `series`, the
  52. * additional options is either merged in to the original item of
  53. * the same `id`, or to the first item if a common id is not
  54. * found.
  55. *
  56. * @return The SVG representation of the rendered chart.
  57. *
  58. * @fires Highcharts.Chart#getSVG
  59. */
  60. getSVG(chartOptions?: Options): string;
  61. /**
  62. * Exporting module required. Clears away other elements in the page and
  63. * prints the chart as it is displayed. By default, when the exporting
  64. * module is enabled, a context button with a drop down menu in the
  65. * upper right corner accesses this function.
  66. *
  67. * @fires Highcharts.Chart#beforePrint
  68. * @fires Highcharts.Chart#afterPrint
  69. */
  70. print(): void;
  71. }
  72. /**
  73. * Handles displaying chart's container in the fullscreen mode.
  74. *
  75. * **Note**: Fullscreen is not supported on iPhone due to iOS limitations.
  76. */
  77. class Fullscreen {
  78. /**
  79. * Chart managed by the fullscreen controller.
  80. */
  81. chart: Chart;
  82. /**
  83. * The flag is set to `true` when the chart is displayed in the
  84. * fullscreen mode.
  85. */
  86. isOpen?: boolean;
  87. /**
  88. * Stops displaying the chart in fullscreen mode. Exporting module
  89. * required.
  90. */
  91. close(): void;
  92. /**
  93. * Displays the chart in fullscreen mode. When fired customly by user
  94. * before exporting context button is created, button's text will not be
  95. * replaced - it's on the user side. Exporting module required.
  96. */
  97. open(): void;
  98. /**
  99. * Toggles displaying the chart in fullscreen mode. By default, when the
  100. * exporting module is enabled, a context button with a drop down menu
  101. * in the upper right corner accesses this function. Exporting module
  102. * required.
  103. */
  104. toggle(): void;
  105. }
  106. }
  107. export default factory;
  108. export let Highcharts: typeof _Highcharts;