/** * Copyright (c) 2018 The xterm.js authors. All rights reserved. * @license MIT */ import type { Terminal } from '@jsnix/xterm'; import type { LigaturesAddon as ILigaturesApi } from '@xterm/addon-ligatures'; import { enableLigatures } from '.'; import { ILigatureOptions } from './Types'; export interface ITerminalAddon { activate(terminal: Terminal): void; dispose(): void; } export class LigaturesAddon implements ITerminalAddon, ILigaturesApi { private readonly _fallbackLigatures: string[]; private _terminal: Terminal | undefined; private _characterJoinerId: number | undefined; constructor(options?: Partial) { this._fallbackLigatures = (options?.fallbackLigatures || [ '<--', '<---', '<<-', '<-', '->', '->>', '-->', '--->', '<==', '<===', '<<=', '<=', '=>', '=>>', '==>', '===>', '>=', '>>=', '<->', '<-->', '<--->', '<---->', '<=>', '<==>', '<===>', '<====>', '-------->', '<~~', '<~', '~>', '~~>', '::', ':::', '==', '!=', '===', '!==', ':=', ':-', ':+', '<*', '<*>', '*>', '<|', '<|>', '|>', '+:', '-:', '=:', ':>', '++', '+++', '