You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.1 KiB

10 months ago
  1. /**
  2. * Copyright (c) 2019 The xterm.js authors. All rights reserved.
  3. * @license MIT
  4. */
  5. import { Terminal, ITerminalAddon } from 'xterm';
  6. declare module 'xterm-addon-fit' {
  7. /**
  8. * An xterm.js addon that enables resizing the terminal to the dimensions of
  9. * its containing element.
  10. */
  11. export class FitAddon implements ITerminalAddon {
  12. /**
  13. * Creates a new fit addon.
  14. */
  15. constructor();
  16. /**
  17. * Activates the addon
  18. * @param terminal The terminal the addon is being loaded in.
  19. */
  20. public activate(terminal: Terminal): void;
  21. /**
  22. * Disposes the addon.
  23. */
  24. public dispose(): void;
  25. /**
  26. * Resizes the terminal to the dimensions of its containing element.
  27. */
  28. public fit(): void;
  29. /**
  30. * Gets the proposed dimensions that will be used for a fit.
  31. */
  32. public proposeDimensions(): ITerminalDimensions | undefined;
  33. }
  34. /**
  35. * Reprepresents the dimensions of a terminal.
  36. */
  37. export interface ITerminalDimensions {
  38. /**
  39. * The number of rows in the terminal.
  40. */
  41. rows: number;
  42. /**
  43. * The number of columns in the terminal.
  44. */
  45. cols: number;
  46. }
  47. }