mirror of
				https://github.com/flynx/colors.js.git
				synced 2025-10-31 12:00:08 +00:00 
			
		
		
		
	Merge pull request #222 from bcaudan/expose-enable-disable-methods
Expose enable/disable methods
This commit is contained in:
		
						commit
						89a14420c7
					
				
							
								
								
									
										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; | ||||||
|  | |||||||
| @ -43,6 +43,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, ''); | ||||||
| }; | }; | ||||||
|  | |||||||
							
								
								
									
										3
									
								
								safe.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								safe.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -4,6 +4,9 @@ | |||||||
| // 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 setTheme(theme: any): 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