Files
SnowLuma/.pnpm-store/v11/files/07/585ee5ca4e2b6a7542490f636f179dcfe00b62463423f20bc493df5ca24d70d8aea73b2a7709c18df3f7e2b958f93c59c56b7811bdf6a01f7d4d3d4dafa46e
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

85 lines
2.9 KiB
Plaintext

export declare type CallbackFunction<T = string> = (error: Error | null, result?: T) => void;
declare type CustomFont = string & {};
export declare interface FigletDefaults {
font: FontName;
fontPath: string;
fetchFontIfMissing: boolean;
}
declare class FigletFont {
options: FontMetadata;
comment: string;
numChars: number;
[charCode: number]: string[];
constructor();
}
declare interface FigletModule {
loadFont: (font: FontName, callback?: CallbackFunction<FontMetadata>) => Promise<FontMetadata | null>;
loadFontSync: (font: FontName) => FontMetadata;
fonts: (callback?: CallbackFunction<FontName[]>) => Promise<FontName[]>;
fontsSync: () => FontName[];
parseFont: (font: FontName, data: string, override?: boolean) => FontMetadata;
preloadFonts: (fonts: FontName[], callback?: (error?: Error) => void) => Promise<void>;
loadedFonts: () => string[];
clearLoadedFonts: () => void;
textSync: (text: string, options?: FigletOptions) => string;
text: (text: string, optionsOrFontOrCallback?: FigletOptions | FontName | CallbackFunction<string>, callback?: CallbackFunction<string>) => Promise<string>;
(text: string, optionsOrFontOrCallback?: FigletOptions | FontName | CallbackFunction<string>, callback?: CallbackFunction<string>): Promise<string>;
figFonts: Record<string, FigletFont>;
defaults: (opts?: Partial<FigletDefaults>) => FigletDefaults;
metadata: (fontName: FontName, callback?: (error: Error | null, fontOptions?: FontMetadata, comment?: string) => void) => Promise<[FontMetadata, string] | null>;
}
export declare interface FigletOptions {
font?: FontName;
horizontalLayout?: KerningMethods;
verticalLayout?: KerningMethods;
width?: number;
whitespaceBreak?: boolean;
printDirection?: PrintDirection;
showHardBlanks?: boolean;
}
declare interface FittingRules {
hLayout: number;
hRule1: boolean;
hRule2: boolean;
hRule3: boolean;
hRule4: boolean;
hRule5: boolean;
hRule6: boolean;
vLayout: number;
vRule1: boolean;
vRule2: boolean;
vRule3: boolean;
vRule4: boolean;
vRule5: boolean;
}
export declare interface FontMetadata {
baseline?: number;
codeTagCount?: number | null;
fittingRules: FittingRules;
fullLayout?: number | null;
hardBlank?: string;
height?: number;
maxLength?: number;
numCommentLines?: number;
oldLayout?: number;
printDirection?: PrintDirection;
}
export declare type FontName = "1Row" | "3-D" | "3D Diagonal" | "3D-ASCII" | "3x5" | "4Max" | "5 Line Oblique" | "Standard" | "Ghost" | "Big" | "Block" | "Bubble" | "Digital" | "Ivrit" | "Mini" | "Script" | "Shadow" | "Slant" | "Small" | "Speed" | "Tinker-Toy" | CustomFont;
declare type KerningMethods = "default" | "full" | "fitted" | "controlled smushing" | "universal smushing";
declare const nodeFiglet: FigletModule;
export default nodeFiglet;
declare type PrintDirection = -1 | 0 | 1;
export { }