chalk-ts 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Color utilities for RGB, HSL, and HEX conversions
3
+ */
4
+ export interface RGB {
5
+ r: number;
6
+ g: number;
7
+ b: number;
8
+ }
9
+ export interface HSL {
10
+ h: number;
11
+ s: number;
12
+ l: number;
13
+ }
14
+ /**
15
+ * Convert HEX color to RGB
16
+ */
17
+ export declare function hexToRgb(hex: string): RGB | null;
18
+ /**
19
+ * Convert RGB to HEX
20
+ */
21
+ export declare function rgbToHex(r: number, g: number, b: number): string;
22
+ /**
23
+ * Convert HSL to RGB
24
+ */
25
+ export declare function hslToRgb(h: number, s: number, l: number): RGB;
26
+ /**
27
+ * Convert RGB to HSL
28
+ */
29
+ export declare function rgbToHsl(r: number, g: number, b: number): HSL;
30
+ /**
31
+ * Generate RGB ANSI escape code
32
+ */
33
+ export declare function rgb(r: number, g: number, b: number, background?: boolean): string;
34
+ /**
35
+ * Generate HEX ANSI escape code
36
+ */
37
+ export declare function hex(color: string, background?: boolean): string;
38
+ /**
39
+ * Generate HSL ANSI escape code
40
+ */
41
+ export declare function hsl(h: number, s: number, l: number, background?: boolean): string;
42
+ /**
43
+ * Predefined color palette
44
+ */
45
+ export declare const COLORS: {
46
+ readonly black: {
47
+ readonly r: 0;
48
+ readonly g: 0;
49
+ readonly b: 0;
50
+ };
51
+ readonly red: {
52
+ readonly r: 255;
53
+ readonly g: 0;
54
+ readonly b: 0;
55
+ };
56
+ readonly green: {
57
+ readonly r: 0;
58
+ readonly g: 255;
59
+ readonly b: 0;
60
+ };
61
+ readonly yellow: {
62
+ readonly r: 255;
63
+ readonly g: 255;
64
+ readonly b: 0;
65
+ };
66
+ readonly blue: {
67
+ readonly r: 0;
68
+ readonly g: 0;
69
+ readonly b: 255;
70
+ };
71
+ readonly magenta: {
72
+ readonly r: 255;
73
+ readonly g: 0;
74
+ readonly b: 255;
75
+ };
76
+ readonly cyan: {
77
+ readonly r: 0;
78
+ readonly g: 255;
79
+ readonly b: 255;
80
+ };
81
+ readonly white: {
82
+ readonly r: 255;
83
+ readonly g: 255;
84
+ readonly b: 255;
85
+ };
86
+ readonly orange: {
87
+ readonly r: 255;
88
+ readonly g: 165;
89
+ readonly b: 0;
90
+ };
91
+ readonly purple: {
92
+ readonly r: 128;
93
+ readonly g: 0;
94
+ readonly b: 128;
95
+ };
96
+ readonly pink: {
97
+ readonly r: 255;
98
+ readonly g: 192;
99
+ readonly b: 203;
100
+ };
101
+ readonly brown: {
102
+ readonly r: 165;
103
+ readonly g: 42;
104
+ readonly b: 42;
105
+ };
106
+ readonly lime: {
107
+ readonly r: 0;
108
+ readonly g: 255;
109
+ readonly b: 0;
110
+ };
111
+ readonly indigo: {
112
+ readonly r: 75;
113
+ readonly g: 0;
114
+ readonly b: 130;
115
+ };
116
+ readonly violet: {
117
+ readonly r: 238;
118
+ readonly g: 130;
119
+ readonly b: 238;
120
+ };
121
+ readonly turquoise: {
122
+ readonly r: 64;
123
+ readonly g: 224;
124
+ readonly b: 208;
125
+ };
126
+ readonly gold: {
127
+ readonly r: 255;
128
+ readonly g: 215;
129
+ readonly b: 0;
130
+ };
131
+ readonly silver: {
132
+ readonly r: 192;
133
+ readonly g: 192;
134
+ readonly b: 192;
135
+ };
136
+ };
137
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAShD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,CA+B7D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,CAmC7D;AAED;;GAEG;AACH,wBAAgB,GAAG,CACjB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,UAAU,UAAQ,GACjB,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,UAAQ,GAAG,MAAM,CAI7D;AAED;;GAEG;AACH,wBAAgB,GAAG,CACjB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,UAAU,UAAQ,GACjB,MAAM,CAGR;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBT,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Advanced styling utilities and effects
3
+ */
4
+ /**
5
+ * Create a gradient effect between two colors
6
+ */
7
+ export declare function gradient(text: string, startColor: string, endColor: string): string;
8
+ /**
9
+ * Create a rainbow effect
10
+ */
11
+ export declare function rainbow(text: string): string;
12
+ /**
13
+ * Create pulsing effect (alternating bright and dim)
14
+ */
15
+ export declare function pulse(text: string, color?: string): string;
16
+ /**
17
+ * Create zebra stripes effect (alternating colors)
18
+ */
19
+ export declare function zebra(text: string, color1?: string, color2?: string): string;
20
+ /**
21
+ * Create a neon effect
22
+ */
23
+ export declare function neon(text: string, color?: string): string;
24
+ /**
25
+ * Create a shadow effect
26
+ */
27
+ export declare function shadow(text: string, color?: string, shadowColor?: string): string;
28
+ /**
29
+ * Create ASCII art box around text
30
+ */
31
+ export declare function box(text: string, options?: {
32
+ padding?: number;
33
+ color?: string;
34
+ style?: "single" | "double" | "rounded" | "thick";
35
+ }): string;
36
+ /**
37
+ * Create a progress bar
38
+ */
39
+ export declare function progressBar(progress: number, total: number, options?: {
40
+ width?: number;
41
+ complete?: string;
42
+ incomplete?: string;
43
+ showPercentage?: boolean;
44
+ color?: string;
45
+ }): string;
46
+ /**
47
+ * Create a spinner animation frame
48
+ */
49
+ export declare function spinner(frame: number, color?: string): string;
50
+ /**
51
+ * Create a table with colored headers and rows
52
+ */
53
+ export declare function table(data: string[][], options?: {
54
+ headers?: string[];
55
+ headerColor?: string;
56
+ borderColor?: string;
57
+ padding?: number;
58
+ }): string;
59
+ //# sourceMappingURL=effects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effects.d.ts","sourceRoot":"","sources":["../src/effects.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAsCR;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA4B5C;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAU,GAAG,MAAM,CAc3D;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAU,EAAE,MAAM,SAAS,GAAG,MAAM,CAW7E;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAS,GAAG,MAAM,CAGzD;AAED;;GAEG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EACZ,KAAK,SAAU,EACf,WAAW,SAAS,GACnB,MAAM,CAkBR;AAED;;GAEG;AACH,wBAAgB,GAAG,CACjB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;CAC9C,GACL,MAAM,CA2FR;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CACX,GACL,MAAM,CAuBR;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAS,GAAG,MAAM,CAK7D;AAED;;GAEG;AACH,wBAAgB,KAAK,CACnB,IAAI,EAAE,MAAM,EAAE,EAAE,EAChB,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACb,GACL,MAAM,CA2ER"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 🎨 ChalkTS - Modern terminal string styling library
3
+ *
4
+ * A powerful, TypeScript-first alternative to chalk with enhanced features,
5
+ * better performance, and modern development experience.
6
+ *
7
+ * @version 1.0.0
8
+ * @author Noor Mohammad
9
+ * @repository https://github.com/noorjsdivs/chalk-ts
10
+ */
11
+ export { ChalkTS, chalkTs as default } from './chalk';
12
+ export * from './ansi';
13
+ export * from './colors';
14
+ export * from './effects';
15
+ export { bold, dim, italic, underline, blink, inverse, hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, grey, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgGrey, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright, orange, purple, pink, brown, lime, indigo, violet, turquoise, gold, silver, } from './chalk';
16
+ export { chalkTs as chalk } from './chalk';
17
+ export type { StyleFunction, TemplateFunction } from './chalk';
18
+ export type { RGB, HSL } from './colors';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AACtD,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAG1B,OAAO,EACL,IAAI,EACJ,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,aAAa,EACb,KAAK,EACL,GAAG,EACH,KAAK,EACL,MAAM,EACN,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,MAAM,EACN,OAAO,EACP,MAAM,EACN,MAAM,EACN,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,aAAa,EACb,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,SAAS,EACT,IAAI,EACJ,MAAM,GACP,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAG3C,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC/D,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC"}