|
2 | 2 | * The `XtermAddon` class provides static methods to dynamically import various addons for the xterm.js library. |
3 | 3 | */ |
4 | 4 | export class XtermAddon { |
5 | | - /** |
6 | | - * Dynamically imports the 'attach' addon from `@xterm/addon-attach`. |
7 | | - * @returns A promise that resolves to the 'attach' addon module. |
8 | | - */ |
9 | | - static AttachAddon = async () => await import('@xterm/addon-attach'); |
| 5 | + /** |
| 6 | + * Dynamically imports the 'attach' addon from `@xterm/addon-attach`. |
| 7 | + * @returns A promise that resolves to the 'attach' addon module. |
| 8 | + */ |
| 9 | + static AttachAddon = async () => await import('@xterm/addon-attach'); |
10 | 10 |
|
11 | | - /** |
12 | | - * Dynamically imports the 'canvas' addon from `@xterm/addon-canvas`. |
13 | | - * For more details, visit: https://github.com/xtermjs/xterm.js/tree/master/addons/addon-canvas |
14 | | - * @returns A promise that resolves to the 'canvas' addon module. |
15 | | - */ |
16 | | - static CanvasAddon = async () => await import('@xterm/addon-canvas'); |
| 11 | + /** |
| 12 | + * Dynamically imports the 'canvas' addon from `@xterm/addon-canvas`. |
| 13 | + * For more details, visit: https://github.com/xtermjs/xterm.js/tree/master/addons/addon-canvas |
| 14 | + * @returns A promise that resolves to the 'canvas' addon module. |
| 15 | + */ |
| 16 | + static CanvasAddon = async () => await import('@xterm/addon-canvas'); |
17 | 17 |
|
18 | | - /** |
19 | | - * Dynamically imports the 'clipboard' addon from `@xterm/addon-clipboard`. |
20 | | - * @returns A promise that resolves to the 'clipboard' addon module. |
21 | | - */ |
22 | | - static ClipboardAddon = async () => await import('@xterm/addon-clipboard'); |
| 18 | + /** |
| 19 | + * Dynamically imports the 'clipboard' addon from `@xterm/addon-clipboard`. |
| 20 | + * @returns A promise that resolves to the 'clipboard' addon module. |
| 21 | + */ |
| 22 | + static ClipboardAddon = async () => await import('@xterm/addon-clipboard'); |
23 | 23 |
|
24 | | - /** |
25 | | - * Dynamically imports the 'fit' addon from `@xterm/addon-fit`. |
26 | | - * @returns A promise that resolves to the 'fit' addon module. |
27 | | - */ |
28 | | - static FitAddon = async () => await import('@xterm/addon-fit'); |
| 24 | + /** |
| 25 | + * Dynamically imports the 'fit' addon from `@xterm/addon-fit`. |
| 26 | + * @returns A promise that resolves to the 'fit' addon module. |
| 27 | + */ |
| 28 | + static FitAddon = async () => await import('@xterm/addon-fit'); |
29 | 29 |
|
30 | | - /** |
31 | | - * Dynamically imports the 'image' addon from `@xterm/addon-image`. |
32 | | - * @returns A promise that resolves to the 'image' addon module. |
33 | | - */ |
34 | | - static ImageAddon = async () => await import('@xterm/addon-image'); |
| 30 | + /** |
| 31 | + * Dynamically imports the 'image' addon from `@xterm/addon-image`. |
| 32 | + * @returns A promise that resolves to the 'image' addon module. |
| 33 | + */ |
| 34 | + static ImageAddon = async () => await import('@xterm/addon-image'); |
35 | 35 |
|
36 | | - /** |
37 | | - * Dynamically imports the 'ligatures' addon from `@xterm/addon-ligatures`. |
38 | | - * |
39 | | - * This addon is designed to be used in environments with access to Node.js APIs (such as Electron). |
40 | | - * |
41 | | - * @returns A promise that resolves to the 'ligatures' addon module. |
42 | | - */ |
43 | | - // static LigaturesAddon = async () => { |
44 | | - // // @ts-ignore |
45 | | - // if (typeof process === 'undefined' || process.versions == null || process.versions.node == null) { |
46 | | - // // This is not a Node.js environment |
47 | | - // throw new Error('This module can only be imported in a Node.js environment'); |
48 | | - // } |
| 36 | + /** |
| 37 | + * Dynamically imports the 'ligatures' addon from `@xterm/addon-ligatures`. |
| 38 | + * |
| 39 | + * This addon is designed to be used in environments with access to Node.js APIs (such as Electron). |
| 40 | + * |
| 41 | + * @returns A promise that resolves to the 'ligatures' addon module. |
| 42 | + */ |
| 43 | + // static LigaturesAddon = async () => { |
| 44 | + // // @ts-ignore |
| 45 | + // if (typeof process === 'undefined' || process.versions == null || process.versions.node == null) { |
| 46 | + // // This is not a Node.js environment |
| 47 | + // throw new Error('This module can only be imported in a Node.js environment'); |
| 48 | + // } |
49 | 49 |
|
50 | | - // return await import('@xterm/addon-ligatures'); |
51 | | - // } |
| 50 | + // return await import('@xterm/addon-ligatures'); |
| 51 | + // } |
52 | 52 |
|
53 | | - /** |
54 | | - * Dynamically imports the 'search' addon from `@xterm/addon-search`. |
55 | | - * @returns A promise that resolves to the 'search' addon module. |
56 | | - */ |
57 | | - static SearchAddon = async () => await import('@xterm/addon-search'); |
| 53 | + /** |
| 54 | + * Dynamically imports the 'search' addon from `@xterm/addon-search`. |
| 55 | + * @returns A promise that resolves to the 'search' addon module. |
| 56 | + */ |
| 57 | + static SearchAddon = async () => await import('@xterm/addon-search'); |
58 | 58 |
|
59 | | - /** |
60 | | - * Dynamically imports the 'serialize' addon from `@xterm/addon-serialize`. |
61 | | - * @returns A promise that resolves to the 'serialize' addon module. |
62 | | - */ |
63 | | - static SerializeAddon = async () => await import('@xterm/addon-serialize'); |
| 59 | + /** |
| 60 | + * Dynamically imports the 'serialize' addon from `@xterm/addon-serialize`. |
| 61 | + * @returns A promise that resolves to the 'serialize' addon module. |
| 62 | + */ |
| 63 | + static SerializeAddon = async () => await import('@xterm/addon-serialize'); |
64 | 64 |
|
65 | | - // This addon is not yet published to npm |
66 | | - // https://github.com/xtermjs/xterm.js/tree/master/addons/addon-unicode-graphemes |
67 | | - // static UnicodeGraphemesAddon = async () => await import('@xterm/addon-unicode-graphemes'); |
| 65 | + // This addon is not yet published to npm |
| 66 | + // https://github.com/xtermjs/xterm.js/tree/master/addons/addon-unicode-graphemes |
| 67 | + // static UnicodeGraphemesAddon = async () => await import('@xterm/addon-unicode-graphemes'); |
68 | 68 |
|
69 | | - /** |
70 | | - * Dynamically imports the 'unicode11' addon from `@xterm/addon-unicode11`. |
71 | | - * @returns A promise that resolves to the 'unicode11' addon module. |
72 | | - */ |
73 | | - static Unicode11Addon = async () => await import('@xterm/addon-unicode11'); |
| 69 | + /** |
| 70 | + * Dynamically imports the 'unicode11' addon from `@xterm/addon-unicode11`. |
| 71 | + * @returns A promise that resolves to the 'unicode11' addon module. |
| 72 | + */ |
| 73 | + static Unicode11Addon = async () => await import('@xterm/addon-unicode11'); |
74 | 74 |
|
75 | | - /** |
76 | | - * Dynamically imports the 'web-links' addon from `@xterm/addon-web-links`. |
77 | | - * @returns A promise that resolves to the 'web-links' addon module. |
78 | | - */ |
79 | | - static WebLinksAddon = async () => await import('@xterm/addon-web-links'); |
| 75 | + /** |
| 76 | + * Dynamically imports the 'web-links' addon from `@xterm/addon-web-links`. |
| 77 | + * @returns A promise that resolves to the 'web-links' addon module. |
| 78 | + */ |
| 79 | + static WebLinksAddon = async () => await import('@xterm/addon-web-links'); |
80 | 80 |
|
81 | | - /** |
82 | | - * Dynamically imports the 'webgl' addon from `@xterm/addon-webgl`. |
83 | | - * @returns A promise that resolves to the 'webgl' addon module. |
84 | | - */ |
85 | | - static WebglAddon = async () => await import('@xterm/addon-webgl'); |
| 81 | + /** |
| 82 | + * Dynamically imports the 'webgl' addon from `@xterm/addon-webgl`. |
| 83 | + * @returns A promise that resolves to the 'webgl' addon module. |
| 84 | + */ |
| 85 | + static WebglAddon = async () => await import('@xterm/addon-webgl'); |
86 | 86 | } |
0 commit comments