@mks2508/better-logger 2.0.0 → 2.1.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.
Files changed (125) hide show
  1. package/bun.lock +333 -0
  2. package/dist/Logger.d.ts +704 -0
  3. package/dist/Logger.d.ts.map +1 -0
  4. package/dist/ScopedLogger.d.ts +310 -0
  5. package/dist/ScopedLogger.d.ts.map +1 -0
  6. package/dist/chunks/Logger-B7L-ujY4.js +3503 -0
  7. package/dist/chunks/Logger-B7L-ujY4.js.map +1 -0
  8. package/dist/chunks/Logger-DzU_c5sX.js +2 -0
  9. package/dist/chunks/Logger-DzU_c5sX.js.map +1 -0
  10. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
  11. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
  12. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
  13. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
  14. package/dist/chunks/ScopedLogger-BY3-E8Ov.js +2 -0
  15. package/dist/chunks/ScopedLogger-BY3-E8Ov.js.map +1 -0
  16. package/dist/chunks/ScopedLogger-D-RbiFZn.js +361 -0
  17. package/dist/chunks/ScopedLogger-D-RbiFZn.js.map +1 -0
  18. package/dist/chunks/environment-Ba5kShbx.js +4 -0
  19. package/dist/chunks/environment-Ba5kShbx.js.map +1 -0
  20. package/dist/chunks/environment-TI2ByCPT.js +1209 -0
  21. package/dist/chunks/environment-TI2ByCPT.js.map +1 -0
  22. package/dist/chunks/formatting-Blwy-f0W.js +2 -0
  23. package/dist/chunks/formatting-Blwy-f0W.js.map +1 -0
  24. package/dist/chunks/formatting-CuNUqGks.js +380 -0
  25. package/dist/chunks/formatting-CuNUqGks.js.map +1 -0
  26. package/dist/cli/CommandProcessor.d.ts +100 -0
  27. package/dist/cli/CommandProcessor.d.ts.map +1 -0
  28. package/dist/cli/commands/ConfigCommand.d.ts +14 -0
  29. package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
  30. package/dist/cli/commands/ExportCommand.d.ts +48 -0
  31. package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
  32. package/dist/cli/commands/HistoryCommand.d.ts +47 -0
  33. package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
  34. package/dist/cli/commands/StatusCommand.d.ts +30 -0
  35. package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
  36. package/dist/cli/commands/ThemeCommand.d.ts +30 -0
  37. package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
  38. package/dist/cli/help.d.ts +12 -0
  39. package/dist/cli/help.d.ts.map +1 -0
  40. package/dist/cli/index.d.ts +15 -0
  41. package/dist/cli/index.d.ts.map +1 -0
  42. package/dist/constants.d.ts +227 -0
  43. package/dist/constants.d.ts.map +1 -0
  44. package/dist/core.cjs +2 -0
  45. package/dist/core.cjs.map +1 -0
  46. package/dist/core.d.ts +127 -0
  47. package/dist/core.d.ts.map +1 -0
  48. package/dist/core.js +291 -0
  49. package/dist/core.js.map +1 -0
  50. package/dist/example.d.ts +18 -0
  51. package/dist/example.d.ts.map +1 -0
  52. package/dist/exports-module.d.ts +196 -0
  53. package/dist/exports-module.d.ts.map +1 -0
  54. package/dist/exports.cjs +2 -0
  55. package/dist/exports.cjs.map +1 -0
  56. package/dist/exports.js +238 -0
  57. package/dist/exports.js.map +1 -0
  58. package/dist/handlers/AnalyticsLogHandler.d.ts +8 -0
  59. package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  60. package/dist/handlers/ExportLogHandler.d.ts +100 -0
  61. package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
  62. package/dist/handlers/FileLogHandler.d.ts +33 -0
  63. package/dist/handlers/FileLogHandler.d.ts.map +1 -0
  64. package/dist/handlers/RemoteLogHandler.d.ts +11 -0
  65. package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
  66. package/dist/handlers/index.d.ts +8 -0
  67. package/dist/handlers/index.d.ts.map +1 -0
  68. package/dist/index.cjs +2 -0
  69. package/dist/index.cjs.map +1 -0
  70. package/dist/index.d.ts +124 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +247 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/main.d.ts +2 -0
  75. package/dist/main.d.ts.map +1 -0
  76. package/dist/styling/LogStyleBuilder.d.ts +146 -0
  77. package/dist/styling/LogStyleBuilder.d.ts.map +1 -0
  78. package/dist/styling/SemanticStyles.d.ts +178 -0
  79. package/dist/styling/SemanticStyles.d.ts.map +1 -0
  80. package/dist/styling/SmartPresets.d.ts +22 -0
  81. package/dist/styling/SmartPresets.d.ts.map +1 -0
  82. package/dist/styling/StyleBuilder.d.ts +140 -0
  83. package/dist/styling/StyleBuilder.d.ts.map +1 -0
  84. package/dist/styling/banners.d.ts +42 -0
  85. package/dist/styling/banners.d.ts.map +1 -0
  86. package/dist/styling/index.d.ts +10 -0
  87. package/dist/styling/index.d.ts.map +1 -0
  88. package/dist/styling/themes.d.ts +7 -0
  89. package/dist/styling/themes.d.ts.map +1 -0
  90. package/dist/styling-module.d.ts +178 -0
  91. package/dist/styling-module.d.ts.map +1 -0
  92. package/dist/styling.cjs +2 -0
  93. package/dist/styling.cjs.map +1 -0
  94. package/dist/styling.js +146 -0
  95. package/dist/styling.js.map +1 -0
  96. package/dist/terminal/terminal-renderer.d.ts +63 -0
  97. package/dist/terminal/terminal-renderer.d.ts.map +1 -0
  98. package/dist/types/core.d.ts +234 -0
  99. package/dist/types/core.d.ts.map +1 -0
  100. package/dist/types/handlers.d.ts +85 -0
  101. package/dist/types/handlers.d.ts.map +1 -0
  102. package/dist/types/index.d.ts +7 -0
  103. package/dist/types/index.d.ts.map +1 -0
  104. package/dist/utils/adapter.d.ts +48 -0
  105. package/dist/utils/adapter.d.ts.map +1 -0
  106. package/dist/utils/ansi-colors.d.ts +156 -0
  107. package/dist/utils/ansi-colors.d.ts.map +1 -0
  108. package/dist/utils/environment-detector.d.ts +35 -0
  109. package/dist/utils/environment-detector.d.ts.map +1 -0
  110. package/dist/utils/environment.d.ts +47 -0
  111. package/dist/utils/environment.d.ts.map +1 -0
  112. package/dist/utils/formatting.d.ts +58 -0
  113. package/dist/utils/formatting.d.ts.map +1 -0
  114. package/dist/utils/index.d.ts +8 -0
  115. package/dist/utils/index.d.ts.map +1 -0
  116. package/dist/utils/opentui-detection.d.ts +34 -0
  117. package/dist/utils/opentui-detection.d.ts.map +1 -0
  118. package/dist/utils/output.d.ts +46 -0
  119. package/dist/utils/output.d.ts.map +1 -0
  120. package/dist/utils/stackTrace.d.ts +6 -0
  121. package/dist/utils/stackTrace.d.ts.map +1 -0
  122. package/dist/utils/timestamps.d.ts +20 -0
  123. package/dist/utils/timestamps.d.ts.map +1 -0
  124. package/dist/vite.svg +1 -0
  125. package/package.json +1 -1
@@ -0,0 +1,140 @@
1
+ /**
2
+ * @fileoverview StyleBuilder class for Advanced Logger
3
+ */
4
+ /**
5
+ * Utility class for creating dynamic console styles with method chaining
6
+ */
7
+ export declare class StyleBuilder {
8
+ private styles;
9
+ constructor(baseStyle?: string);
10
+ /**
11
+ * Add background color or gradient
12
+ */
13
+ bg(background: string): StyleBuilder;
14
+ /**
15
+ * Add text color
16
+ */
17
+ color(color: string): StyleBuilder;
18
+ /**
19
+ * Add border styling
20
+ */
21
+ border(border: string): StyleBuilder;
22
+ /**
23
+ * Add box shadow
24
+ */
25
+ shadow(shadow: string): StyleBuilder;
26
+ /**
27
+ * Add padding
28
+ */
29
+ padding(padding: string): StyleBuilder;
30
+ /**
31
+ * Add margin
32
+ */
33
+ margin(margin: string): StyleBuilder;
34
+ /**
35
+ * Add border radius
36
+ */
37
+ rounded(radius?: string): StyleBuilder;
38
+ /**
39
+ * Add font weight
40
+ */
41
+ bold(): StyleBuilder;
42
+ /**
43
+ * Add font styling
44
+ */
45
+ font(font: string): StyleBuilder;
46
+ /**
47
+ * Set monospace font family (alias for common monospace fonts)
48
+ */
49
+ mono(): StyleBuilder;
50
+ /**
51
+ * Set system font family (alias for system fonts)
52
+ */
53
+ system(): StyleBuilder;
54
+ /**
55
+ * Add font size
56
+ */
57
+ size(size: string): StyleBuilder;
58
+ /**
59
+ * Add line height
60
+ */
61
+ lineHeight(height: string): StyleBuilder;
62
+ /**
63
+ * Add text decoration
64
+ */
65
+ underline(): StyleBuilder;
66
+ /**
67
+ * Add text transform
68
+ */
69
+ uppercase(): StyleBuilder;
70
+ /**
71
+ * Add opacity
72
+ */
73
+ opacity(value: number): StyleBuilder;
74
+ /**
75
+ * Add display property
76
+ */
77
+ display(value: string): StyleBuilder;
78
+ /**
79
+ * Add position property
80
+ */
81
+ position(value: string): StyleBuilder;
82
+ /**
83
+ * Add transform property
84
+ */
85
+ transform(value: string): StyleBuilder;
86
+ /**
87
+ * Add animation property
88
+ */
89
+ animation(value: string): StyleBuilder;
90
+ /**
91
+ * Add transition property
92
+ */
93
+ transition(value: string): StyleBuilder;
94
+ /**
95
+ * Add cursor property
96
+ */
97
+ cursor(value: string): StyleBuilder;
98
+ /**
99
+ * Add any custom CSS property
100
+ */
101
+ custom(property: string, value: string): StyleBuilder;
102
+ /**
103
+ * Add any CSS property (alias for custom)
104
+ */
105
+ css(property: string, value: string): StyleBuilder;
106
+ /**
107
+ * Build the final CSS string
108
+ */
109
+ build(): string;
110
+ /**
111
+ * Clear all styles and start fresh
112
+ */
113
+ clear(): StyleBuilder;
114
+ /**
115
+ * Clone this StyleBuilder with the same styles
116
+ */
117
+ clone(): StyleBuilder;
118
+ /**
119
+ * Merge another StyleBuilder's styles into this one
120
+ */
121
+ merge(other: StyleBuilder): StyleBuilder;
122
+ }
123
+ /**
124
+ * Dynamic styler instance for external use
125
+ */
126
+ export declare const $: any;
127
+ /**
128
+ * Pre-defined style presets for common use cases
129
+ */
130
+ export declare const StylePresets: {
131
+ success: () => StyleBuilder;
132
+ error: () => StyleBuilder;
133
+ warning: () => StyleBuilder;
134
+ info: () => StyleBuilder;
135
+ debug: () => StyleBuilder;
136
+ muted: () => StyleBuilder;
137
+ accent: () => StyleBuilder;
138
+ neon: () => StyleBuilder;
139
+ };
140
+ //# sourceMappingURL=StyleBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StyleBuilder.d.ts","sourceRoot":"","sources":["../../src/styling/StyleBuilder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,qBAAa,YAAY;IACrB,OAAO,CAAC,MAAM,CAAgB;gBAElB,SAAS,SAAK;IAI1B;;OAEG;IACH,EAAE,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKlC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY;IAKtC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,OAAO,CAAC,MAAM,GAAE,MAAc,GAAG,YAAY;IAK7C;;OAEG;IACH,IAAI,IAAI,YAAY;IAKpB;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAKhC;;OAEG;IACH,IAAI,IAAI,YAAY;IAIpB;;OAEG;IACH,MAAM,IAAI,YAAY;IAItB;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAKhC;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAKxC;;OAEG;IACH,SAAS,IAAI,YAAY;IAKzB;;OAEG;IACH,SAAS,IAAI,YAAY;IAKzB;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKpC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKrC;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKtC;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKtC;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKvC;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKnC;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY;IAKrD;;OAEG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY;IAIlD;;OAEG;IACH,KAAK,IAAI,MAAM;IAIf;;OAEG;IACH,KAAK,IAAI,YAAY;IAKrB;;OAEG;IACH,KAAK,IAAI,YAAY;IAMrB;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY;CAI3C;AAqBD;;GAEG;AACH,eAAO,MAAM,CAAC,KAAiB,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;CAuDxB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { BannerType, ThemeVariant } from '../types/index.js';
2
+ /**
3
+ * Banner variants for different display capabilities
4
+ */
5
+ export declare const BANNER_VARIANTS: {
6
+ simple: {
7
+ text: string;
8
+ style: string;
9
+ };
10
+ ascii: {
11
+ text: string;
12
+ style: string;
13
+ };
14
+ unicode: {
15
+ text: string;
16
+ style: string;
17
+ };
18
+ svg: {
19
+ text: string;
20
+ style: string;
21
+ };
22
+ animated: {
23
+ text: string;
24
+ style: string;
25
+ };
26
+ };
27
+ /**
28
+ * Theme-specific banners for enhanced visual theming
29
+ */
30
+ export declare const THEME_BANNERS: Record<ThemeVariant, {
31
+ simple: string;
32
+ style: string;
33
+ }>;
34
+ /**
35
+ * Feature detection for banner capabilities
36
+ */
37
+ export declare function detectBannerCapabilities(): BannerType;
38
+ /**
39
+ * Display initialization banner with advanced styling
40
+ */
41
+ export declare function displayInitBanner(bannerType?: BannerType): void;
42
+ //# sourceMappingURL=banners.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"banners.d.ts","sourceRoot":"","sources":["../../src/styling/banners.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;CAoD3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,YAAY,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAyBjF,CAAC;AAEF;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,UAAU,CA2BrD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAuC/D"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @fileoverview Styling system exports for Advanced Logger
3
+ */
4
+ export { StyleBuilder, $, StylePresets } from './StyleBuilder.js';
5
+ export { THEME_PRESETS } from './themes.js';
6
+ export { BANNER_VARIANTS, THEME_BANNERS, detectBannerCapabilities, displayInitBanner } from './banners.js';
7
+ export { TimestampStyler, LevelStyler, PrefixStyler, MessageStyler, LocationStyler } from './SemanticStyles.js';
8
+ export { LogStyleBuilder, createLogStyleBuilder } from './LogStyleBuilder.js';
9
+ export { SMART_PRESETS, getSmartPreset, getAvailablePresets, hasPreset, PRESET_DESCRIPTIONS } from './SmartPresets.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styling/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACH,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,iBAAiB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EACH,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,mBAAmB,EACtB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ThemeVariant } from '../types/index.js';
2
+ import { LevelStyleConfig } from '../utils/index.js';
3
+ /**
4
+ * Theme configurations for different visual styles
5
+ */
6
+ export declare const THEME_PRESETS: Record<ThemeVariant, Record<string, LevelStyleConfig>>;
7
+ //# sourceMappingURL=themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/styling/themes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAgOhF,CAAC"}
@@ -0,0 +1,178 @@
1
+ import { Logger } from './Logger.js';
2
+ import { StyleBuilder } from './styling/index.js';
3
+ import { ThemeVariant, BannerType, StyleOptions } from './types/index.js';
4
+ /**
5
+ * Enhanced Logger with advanced styling capabilities
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { StyledLogger } from '@mks2508/better-logger/styling';
10
+ *
11
+ * const logger = new StyledLogger();
12
+ * logger.setTheme('neon');
13
+ * logger.logAnimated('🌟 Animated message!');
14
+ * logger.logWithSVG('Custom SVG Logo', svgContent);
15
+ * ```
16
+ */
17
+ export declare class StyledLogger extends Logger {
18
+ /**
19
+ * Log with SVG background image
20
+ *
21
+ * @param message - The message to log
22
+ * @param svgContent - SVG content as string (optional)
23
+ * @param options - Styling options
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * logger.logWithSVG('My App', '<svg>...</svg>', {
28
+ * width: 400,
29
+ * height: 80,
30
+ * padding: '40px 200px'
31
+ * });
32
+ * ```
33
+ */
34
+ logWithSVG(message: string, svgContent?: string, options?: StyleOptions): void;
35
+ /**
36
+ * Log with animated background gradient
37
+ *
38
+ * @param message - The message to log
39
+ * @param duration - Animation duration in seconds
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * logger.logAnimated('🚀 Loading...', 2);
44
+ * ```
45
+ */
46
+ logAnimated(message: string, duration?: number): void;
47
+ /**
48
+ * Display banner with specified type
49
+ *
50
+ * @param bannerType - Type of banner to display
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * logger.showBanner('animated');
55
+ * ```
56
+ */
57
+ showBanner(bannerType?: BannerType): void;
58
+ /**
59
+ * Set banner type for initialization display
60
+ *
61
+ * @param bannerType - Type of banner to display
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * logger.setBannerType('svg');
66
+ * ```
67
+ */
68
+ setBannerType(bannerType: BannerType): void;
69
+ /**
70
+ * Sets the logger theme with visual banner
71
+ *
72
+ * @param theme - Theme variant to apply
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * logger.setTheme('cyberpunk'); // Shows themed banner
77
+ * ```
78
+ */
79
+ setTheme(theme: ThemeVariant): void;
80
+ }
81
+ declare const styledLogger: StyledLogger;
82
+ /**
83
+ * Utility functions for creating custom styles
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';
88
+ *
89
+ * const myStyle = createStyle()
90
+ * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
91
+ * .color('white')
92
+ * .padding('10px')
93
+ * .build();
94
+ *
95
+ * console.log('%cCustom Message', myStyle);
96
+ * ```
97
+ */
98
+ export declare const createStyle: () => StyleBuilder;
99
+ /**
100
+ * Pre-built style presets
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * import { stylePresets } from '@mks2508/better-logger/styling';
105
+ *
106
+ * console.log('%cSuccess!', stylePresets.success);
107
+ * console.log('%cError!', stylePresets.error);
108
+ * ```
109
+ */
110
+ export declare const stylePresets: {
111
+ success: string;
112
+ error: string;
113
+ warning: string;
114
+ info: string;
115
+ accent: string;
116
+ };
117
+ /**
118
+ * Available themes for the logger
119
+ *
120
+ * @example
121
+ * ```typescript
122
+ * import { themes } from '@mks2508/better-logger/styling';
123
+ *
124
+ * console.log('Available themes:', Object.keys(themes));
125
+ * ```
126
+ */
127
+ export declare const themes: string[];
128
+ /**
129
+ * Available banner types
130
+ *
131
+ * @example
132
+ * ```typescript
133
+ * import { bannerTypes } from '@mks2508/better-logger/styling';
134
+ *
135
+ * console.log('Available banners:', bannerTypes);
136
+ * ```
137
+ */
138
+ export declare const bannerTypes: string[];
139
+ /**
140
+ * Display initialization banner
141
+ *
142
+ * @param bannerType - Type of banner to display
143
+ *
144
+ * @example
145
+ * ```typescript
146
+ * import { showInitBanner } from '@mks2508/better-logger/styling';
147
+ *
148
+ * showInitBanner('animated');
149
+ * ```
150
+ */
151
+ export declare const showInitBanner: (bannerType?: BannerType) => void;
152
+ /**
153
+ * Export individual styled logging methods
154
+ */
155
+ export declare const debug: (...args: any[]) => void;
156
+ export declare const info: (...args: any[]) => void;
157
+ export declare const warn: (...args: any[]) => void;
158
+ export declare const error: (...args: any[]) => void;
159
+ export declare const success: (...args: any[]) => void;
160
+ export declare const critical: (...args: any[]) => void;
161
+ export declare const trace: (...args: any[]) => void;
162
+ export declare const table: (data: any, columns?: string[]) => void;
163
+ export declare const group: (label: string, collapsed?: boolean) => void;
164
+ export declare const groupEnd: () => void;
165
+ export declare const time: (label: string) => void;
166
+ export declare const timeEnd: (label: string) => void;
167
+ export declare const setGlobalPrefix: (prefix: string) => void;
168
+ export declare const scope: (prefix: string) => any;
169
+ export declare const setVerbosity: (level: any) => void;
170
+ export declare const setTheme: (theme: ThemeVariant) => void;
171
+ export declare const setBannerType: (bannerType: BannerType) => void;
172
+ export declare const showBanner: (bannerType?: BannerType) => void;
173
+ export declare const logWithSVG: (message: string, svgContent?: string, options?: StyleOptions) => void;
174
+ export declare const logAnimated: (message: string, duration?: number) => void;
175
+ export default styledLogger;
176
+ export { StyleBuilder, StylePresets, THEME_PRESETS, THEME_BANNERS, BANNER_VARIANTS } from './styling/index.js';
177
+ export type { ThemeVariant, BannerType, StyleOptions } from './types/index.js';
178
+ //# sourceMappingURL=styling-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styling-module.d.ts","sourceRoot":"","sources":["../src/styling-module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EACH,YAAY,EAMf,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EACR,YAAY,EACZ,UAAU,EACV,YAAY,EACf,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;GAYG;AACH,qBAAa,YAAa,SAAQ,MAAM;IACpC;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,IAAI;IAIlF;;;;;;;;;;OAUG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,IAAI;IAIxD;;;;;;;;;OASG;IACH,UAAU,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI;IAIzC;;;;;;;;;OASG;IACH,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAA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tE,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,SAAyC,CAAC;AACxF,eAAO,MAAM,KAAK,GAAI,QAAQ,MAAM,QAA+B,CAAC;AACpE,eAAO,MAAM,YAAY,GAAI,OAAO,GAAG,SAAqC,CAAC;AAC7E,eAAO,MAAM,QAAQ,GAAI,OAAO,YAAY,SAAiC,CAAC;AAC9E,eAAO,MAAM,aAAa,GAAI,YAAY,UAAU,SAA2C,CAAC;AAChG,eAAO,MAAM,UAAU,GAAI,aAAa,UAAU,SAAwC,CAAC;AAC3F,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,aAAa,MAAM,EAAE,UAAU,YAAY,SAC9B,CAAC;AAC1D,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,WAAW,MAAM,SACf,CAAC;AAGhD,eAAe,YAAY,CAAC;AAG5B,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,eAAe,EAClB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACR,YAAY,EACZ,UAAU,EACV,YAAY,EACf,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/Logger-DzU_c5sX.js"),t=require("./chunks/environment-Ba5kShbx.js");class StyledLogger extends e.Logger{logWithSVG(e,t,s={}){super.logWithSVG(e,t,s)}logAnimated(e,t=3){super.logAnimated(e,t)}showBanner(e){super.showBanner(e)}setBannerType(e){super.setBannerType(e)}setTheme(e){super.setTheme(e)}}const s=new StyledLogger,r={success:t.StylePresets.success().build(),error:t.StylePresets.error().build(),warning:t.StylePresets.warning().build(),info:t.StylePresets.info().build(),accent:t.StylePresets.accent().build()},o=Object.keys(e.THEME_PRESETS),n=Object.keys(e.BANNER_VARIANTS);exports.BANNER_VARIANTS=e.BANNER_VARIANTS,exports.THEME_BANNERS=e.THEME_BANNERS,exports.THEME_PRESETS=e.THEME_PRESETS,exports.StyleBuilder=t.StyleBuilder,exports.StylePresets=t.StylePresets,exports.StyledLogger=StyledLogger,exports.bannerTypes=n,exports.createStyle=()=>new t.StyleBuilder,exports.critical=(...e)=>s.critical(...e),exports.debug=(...e)=>s.debug(...e),exports.default=s,exports.error=(...e)=>s.error(...e),exports.group=(e,t)=>s.group(e,t),exports.groupEnd=()=>s.groupEnd(),exports.info=(...e)=>s.info(...e),exports.logAnimated=(e,t)=>s.logAnimated(e,t),exports.logWithSVG=(e,t,r)=>s.logWithSVG(e,t,r),exports.scope=e=>s.scope(e),exports.setBannerType=e=>s.setBannerType(e),exports.setGlobalPrefix=e=>s.setGlobalPrefix(e),exports.setTheme=e=>s.setTheme(e),exports.setVerbosity=e=>s.setVerbosity(e),exports.showBanner=e=>s.showBanner(e),exports.showInitBanner=t=>{e.displayInitBanner(t)},exports.stylePresets=r,exports.success=(...e)=>s.success(...e),exports.table=(e,t)=>s.table(e,t),exports.themes=o,exports.time=e=>s.time(e),exports.timeEnd=e=>s.timeEnd(e),exports.trace=(...e)=>s.trace(...e),exports.warn=(...e)=>s.warn(...e);
2
+ //# sourceMappingURL=styling.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styling.cjs","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const scope = (prefix: string) => styledLogger.scope(prefix);\nexport const setVerbosity = (level: any) => styledLogger.setVerbosity(level);\nexport const setTheme = (theme: ThemeVariant) => styledLogger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => styledLogger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => styledLogger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n styledLogger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n styledLogger.logAnimated(message, duration);\n\n// Export the singleton as default\nexport default styledLogger;\n\n// Re-export styling utilities\nexport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Re-export types\nexport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';"],"names":["StyledLogger","Logger","logWithSVG","message","svgContent","options","super","logAnimated","duration","showBanner","bannerType","setBannerType","setTheme","theme","styledLogger","stylePresets","success","StylePresets","build","error","warning","info","accent","themes","Object","keys","THEME_PRESETS","bannerTypes","BANNER_VARIANTS","StyleBuilder","args","critical","debug","label","collapsed","group","groupEnd","prefix","scope","setGlobalPrefix","level","setVerbosity","displayInitBanner","data","columns","table","time","timeEnd","trace","warn"],"mappings":"yMAyCO,MAAMA,qBAAqBC,EAAAA,OAiB9B,UAAAC,CAAWC,EAAiBC,EAAqBC,EAAwB,CAAA,GACrEC,MAAMJ,WAAWC,EAASC,EAAYC,EAC1C,CAaA,WAAAE,CAAYJ,EAAiBK,EAAmB,GAC5CF,MAAMC,YAAYJ,EAASK,EAC/B,CAYA,UAAAC,CAAWC,GACPJ,MAAMG,WAAWC,EACrB,CAYA,aAAAC,CAAcD,GACVJ,MAAMK,cAAcD,EACxB,CAYA,QAAAE,CAASC,GACLP,MAAMM,SAASC,EACnB,EAIJ,MAAMC,EAAe,IAAId,aA+BZe,EAAe,CACxBC,QAASC,EAAAA,aAAaD,UAAUE,QAChCC,MAAOF,EAAAA,aAAaE,QAAQD,QAC5BE,QAASH,EAAAA,aAAaG,UAAUF,QAChCG,KAAMJ,EAAAA,aAAaI,OAAOH,QAC1BI,OAAQL,EAAAA,aAAaK,SAASJ,SAarBK,EAASC,OAAOC,KAAKC,EAAAA,eAYrBC,EAAcH,OAAOC,KAAKG,EAAAA,2RA3CZ,IAAM,IAAIC,EAAAA,8BAqEb,IAAIC,IAAgBhB,EAAaiB,YAAYD,iBALhD,IAAIA,IAAgBhB,EAAakB,SAASF,mCAG1C,IAAIA,IAAgBhB,EAAaK,SAASW,iBAK1C,CAACG,EAAeC,IAAwBpB,EAAaqB,MAAMF,EAAOC,oBAC/D,IAAMpB,EAAasB,wBARvB,IAAIN,IAAgBhB,EAAaO,QAAQS,uBAmBlC,CAAC3B,EAAiBK,IACzCM,EAAaP,YAAYJ,EAASK,sBAHZ,CAACL,EAAiBC,EAAqBC,IAC7DS,EAAaZ,WAAWC,EAASC,EAAYC,iBAN3BgC,GAAmBvB,EAAawB,MAAMD,yBAG9B3B,GAA2BI,EAAaH,cAAcD,2BAJpD2B,GAAmBvB,EAAayB,gBAAgBF,oBAGvDxB,GAAwBC,EAAaF,SAASC,wBAD1C2B,GAAe1B,EAAa2B,aAAaD,sBAG3C9B,GAA4BI,EAAaL,WAAWC,0BAxBhDA,IAC3BgC,EAAAA,kBAAkBhC,2CAUC,IAAIoB,IAAgBhB,EAAaE,WAAWc,iBAG9C,CAACa,EAAWC,IAAuB9B,EAAa+B,MAAMF,EAAMC,iCAG5DX,GAAkBnB,EAAagC,KAAKb,mBACjCA,GAAkBnB,EAAaiC,QAAQd,iBAL1C,IAAIH,IAAgBhB,EAAakC,SAASlB,gBAJ3C,IAAIA,IAAgBhB,EAAamC,QAAQnB"}
@@ -0,0 +1,146 @@
1
+ import { L as Logger, T as THEME_PRESETS, B as BANNER_VARIANTS, d as displayInitBanner } from "./chunks/Logger-B7L-ujY4.js";
2
+ import { a } from "./chunks/Logger-B7L-ujY4.js";
3
+ import { S as StylePresets, b as StyleBuilder } from "./chunks/environment-TI2ByCPT.js";
4
+ class StyledLogger extends Logger {
5
+ /**
6
+ * Log with SVG background image
7
+ *
8
+ * @param message - The message to log
9
+ * @param svgContent - SVG content as string (optional)
10
+ * @param options - Styling options
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * logger.logWithSVG('My App', '<svg>...</svg>', {
15
+ * width: 400,
16
+ * height: 80,
17
+ * padding: '40px 200px'
18
+ * });
19
+ * ```
20
+ */
21
+ logWithSVG(message, svgContent, options = {}) {
22
+ super.logWithSVG(message, svgContent, options);
23
+ }
24
+ /**
25
+ * Log with animated background gradient
26
+ *
27
+ * @param message - The message to log
28
+ * @param duration - Animation duration in seconds
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * logger.logAnimated('🚀 Loading...', 2);
33
+ * ```
34
+ */
35
+ logAnimated(message, duration = 3) {
36
+ super.logAnimated(message, duration);
37
+ }
38
+ /**
39
+ * Display banner with specified type
40
+ *
41
+ * @param bannerType - Type of banner to display
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * logger.showBanner('animated');
46
+ * ```
47
+ */
48
+ showBanner(bannerType) {
49
+ super.showBanner(bannerType);
50
+ }
51
+ /**
52
+ * Set banner type for initialization display
53
+ *
54
+ * @param bannerType - Type of banner to display
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * logger.setBannerType('svg');
59
+ * ```
60
+ */
61
+ setBannerType(bannerType) {
62
+ super.setBannerType(bannerType);
63
+ }
64
+ /**
65
+ * Sets the logger theme with visual banner
66
+ *
67
+ * @param theme - Theme variant to apply
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * logger.setTheme('cyberpunk'); // Shows themed banner
72
+ * ```
73
+ */
74
+ setTheme(theme) {
75
+ super.setTheme(theme);
76
+ }
77
+ }
78
+ const styledLogger = new StyledLogger();
79
+ const createStyle = () => new StyleBuilder();
80
+ const stylePresets = {
81
+ success: StylePresets.success().build(),
82
+ error: StylePresets.error().build(),
83
+ warning: StylePresets.warning().build(),
84
+ info: StylePresets.info().build(),
85
+ accent: StylePresets.accent().build()
86
+ };
87
+ const themes = Object.keys(THEME_PRESETS);
88
+ const bannerTypes = Object.keys(BANNER_VARIANTS);
89
+ const showInitBanner = (bannerType) => {
90
+ displayInitBanner(bannerType);
91
+ };
92
+ const debug = (...args) => styledLogger.debug(...args);
93
+ const info = (...args) => styledLogger.info(...args);
94
+ const warn = (...args) => styledLogger.warn(...args);
95
+ const error = (...args) => styledLogger.error(...args);
96
+ const success = (...args) => styledLogger.success(...args);
97
+ const critical = (...args) => styledLogger.critical(...args);
98
+ const trace = (...args) => styledLogger.trace(...args);
99
+ const table = (data, columns) => styledLogger.table(data, columns);
100
+ const group = (label, collapsed) => styledLogger.group(label, collapsed);
101
+ const groupEnd = () => styledLogger.groupEnd();
102
+ const time = (label) => styledLogger.time(label);
103
+ const timeEnd = (label) => styledLogger.timeEnd(label);
104
+ const setGlobalPrefix = (prefix) => styledLogger.setGlobalPrefix(prefix);
105
+ const scope = (prefix) => styledLogger.scope(prefix);
106
+ const setVerbosity = (level) => styledLogger.setVerbosity(level);
107
+ const setTheme = (theme) => styledLogger.setTheme(theme);
108
+ const setBannerType = (bannerType) => styledLogger.setBannerType(bannerType);
109
+ const showBanner = (bannerType) => styledLogger.showBanner(bannerType);
110
+ const logWithSVG = (message, svgContent, options) => styledLogger.logWithSVG(message, svgContent, options);
111
+ const logAnimated = (message, duration) => styledLogger.logAnimated(message, duration);
112
+ export {
113
+ BANNER_VARIANTS,
114
+ StyleBuilder,
115
+ StylePresets,
116
+ StyledLogger,
117
+ a as THEME_BANNERS,
118
+ THEME_PRESETS,
119
+ bannerTypes,
120
+ createStyle,
121
+ critical,
122
+ debug,
123
+ styledLogger as default,
124
+ error,
125
+ group,
126
+ groupEnd,
127
+ info,
128
+ logAnimated,
129
+ logWithSVG,
130
+ scope,
131
+ setBannerType,
132
+ setGlobalPrefix,
133
+ setTheme,
134
+ setVerbosity,
135
+ showBanner,
136
+ showInitBanner,
137
+ stylePresets,
138
+ success,
139
+ table,
140
+ themes,
141
+ time,
142
+ timeEnd,
143
+ trace,
144
+ warn
145
+ };
146
+ //# sourceMappingURL=styling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styling.js","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const scope = (prefix: string) => styledLogger.scope(prefix);\nexport const setVerbosity = (level: any) => styledLogger.setVerbosity(level);\nexport const setTheme = (theme: ThemeVariant) => styledLogger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => styledLogger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => styledLogger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n styledLogger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n styledLogger.logAnimated(message, duration);\n\n// Export the singleton as default\nexport default styledLogger;\n\n// Re-export styling utilities\nexport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Re-export types\nexport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';"],"names":[],"mappings":";;;AAyCO,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBrC,WAAW,SAAi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IAAI,SAAgB,aAAa,MAAM,GAAG,IAAI;AAC5D,MAAM,UAAU,IAAI,SAAgB,aAAa,QAAQ,GAAG,IAAI;AAChE,MAAM,WAAW,IAAI,SAAgB,aAAa,SAAS,GAAG,IAAI;AAClE,MAAM,QAAQ,IAAI,SAAgB,aAAa,MAAM,GAAG,IAAI;AAC5D,MAAM,QAAQ,CAAC,MAAW,YAAuB,aAAa,MAAM,MAAM,OAAO;AACjF,MAAM,QAAQ,CAAC,OAAe,cAAwB,aAAa,MAAM,OAAO,SAAS;AACzF,MAAM,WAAW,MAAM,aAAa,SAAA;AACpC,MAAM,OAAO,CAAC,UAAkB,aAAa,KAAK,KAAK;AACvD,MAAM,UAAU,CAAC,UAAkB,aAAa,QAAQ,KAAK;AAC7D,MAAM,kBAAkB,CAAC,WAAmB,aAAa,gBAAgB,MAAM;AAC/E,MAAM,QAAQ,CAAC,WAAmB,aAAa,MAAM,MAAM;AAC3D,MAAM,eAAe,CAAC,UAAe,aAAa,aAAa,KAAK;AACpE,MAAM,WAAW,CAAC,UAAwB,aAAa,SAAS,KAAK;AACrE,MAAM,gBAAgB,CAAC,eAA2B,aAAa,cAAc,UAAU;AACvF,MAAM,aAAa,CAAC,eAA4B,aAAa,WAAW,UAAU;AAClF,MAAM,aAAa,CAAC,SAAiB,YAAqB,YAC7D,aAAa,WAAW,SAAS,YAAY,OAAO;AACjD,MAAM,cAAc,CAAC,SAAiB,aACzC,aAAa,YAAY,SAAS,QAAQ;"}
@@ -0,0 +1,63 @@
1
+ import { LogLevel, LogStyles } from '../types/index.js';
2
+ export type ANSIStyle = {
3
+ text: string;
4
+ timestamp?: string;
5
+ level?: string;
6
+ prefix?: string;
7
+ message?: string;
8
+ location?: string;
9
+ reset: string;
10
+ };
11
+ export declare class TerminalRenderer {
12
+ private colorCapability;
13
+ constructor(colorCapability?: 'full' | 'basic' | 'none');
14
+ /**
15
+ * Get ANSI color codes for basic colors
16
+ */
17
+ private getColorCode;
18
+ /**
19
+ * Get ANSI style codes
20
+ */
21
+ private getStyleCode;
22
+ /**
23
+ * Convert log styles to ANSI formatting
24
+ */
25
+ renderTerminal(level: LogLevel, message: string, timestamp?: string, prefix?: string, location?: string, styles?: LogStyles): ANSIStyle;
26
+ /**
27
+ * Style timestamp based on preset or defaults
28
+ */
29
+ private styleTimestamp;
30
+ /**
31
+ * Style level with appropriate colors and formatting
32
+ */
33
+ private styleLevel;
34
+ /**
35
+ * Style prefix based on preset - now as a badge
36
+ */
37
+ private stylePrefix;
38
+ /**
39
+ * Style message based on preset
40
+ */
41
+ private styleMessage;
42
+ /**
43
+ * Style location (file:line) information
44
+ */
45
+ private styleLocation;
46
+ /**
47
+ * Get text representation of log level
48
+ */
49
+ getLevelText(level: LogLevel): string;
50
+ /**
51
+ * Create cyberpunk-style ANSI rendering
52
+ */
53
+ renderCyberpunk(level: LogLevel, message: string, timestamp?: string, prefix?: string, location?: string): ANSIStyle;
54
+ /**
55
+ * Create minimal ANSI rendering
56
+ */
57
+ renderMinimal(level: LogLevel, message: string, timestamp?: string, prefix?: string): ANSIStyle;
58
+ /**
59
+ * Get chalk instance for log level (for compatibility with adapter)
60
+ */
61
+ getChalkForLevel(level: LogLevel): any;
62
+ }
63
+ //# sourceMappingURL=terminal-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-renderer.d.ts","sourceRoot":"","sources":["../../src/terminal/terminal-renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ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