feat(renderer): AsciiGeneratorDialog (figlet text-to-ASCII-art)

This commit is contained in:
2026-06-06 07:40:20 +05:30
parent a8f7547c7e
commit efc7709f66
5 changed files with 161 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import figlet from 'figlet';
import type { Fonts } from 'figlet';
export const FIGLET_FONTS = ['Standard', 'Big', 'Small', 'Banner', 'Doom', 'Slant', 'Block'] as const;
export type FigletFont = typeof FIGLET_FONTS[number];
export function figletText(text: string, font: FigletFont): Promise<string> {
return new Promise((resolve, reject) => {
figlet.text(text, { font }, (err, result) => {
if (err) reject(err);
else resolve(result ?? '');
});
});
}