mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 19:10:10 +00:00
parent
dc82cc01d0
commit
b674514f1b
2
index.d.ts
vendored
2
index.d.ts
vendored
@ -46,6 +46,8 @@ export interface Color {
|
|||||||
zalgo: Color;
|
zalgo: Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function enable(): void;
|
||||||
|
export function disable(): void;
|
||||||
export function setTheme(theme: any): void;
|
export function setTheme(theme: any): void;
|
||||||
|
|
||||||
export let enabled: boolean;
|
export let enabled: boolean;
|
||||||
|
|||||||
@ -42,6 +42,14 @@ if (typeof colors.enabled === "undefined") {
|
|||||||
colors.enabled = colors.supportsColor() !== false;
|
colors.enabled = colors.supportsColor() !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
colors.enable = function () {
|
||||||
|
colors.enabled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
colors.disable = function () {
|
||||||
|
colors.enabled = false;
|
||||||
|
};
|
||||||
|
|
||||||
colors.stripColors = colors.strip = function(str){
|
colors.stripColors = colors.strip = function(str){
|
||||||
return ("" + str).replace(/\x1B\[\d+m/g, '');
|
return ("" + str).replace(/\x1B\[\d+m/g, '');
|
||||||
};
|
};
|
||||||
|
|||||||
2
safe.d.ts
vendored
2
safe.d.ts
vendored
@ -4,6 +4,8 @@
|
|||||||
// Definitions: https://github.com/Marak/colors.js
|
// Definitions: https://github.com/Marak/colors.js
|
||||||
|
|
||||||
export const enabled: boolean;
|
export const enabled: boolean;
|
||||||
|
export function enable(): void;
|
||||||
|
export function disable(): void;
|
||||||
|
|
||||||
export function strip(str: string): string;
|
export function strip(str: string): string;
|
||||||
export function stripColors(str: string): string;
|
export function stripColors(str: string): string;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user