@autumnsgrove/gossamer 0.0.1 → 0.1.1

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 (53) hide show
  1. package/dist/animation.d.ts +80 -0
  2. package/dist/animation.d.ts.map +1 -0
  3. package/dist/characters.d.ts +49 -0
  4. package/dist/characters.d.ts.map +1 -0
  5. package/dist/colors.d.ts +312 -0
  6. package/dist/colors.d.ts.map +1 -0
  7. package/dist/index.d.ts +39 -11
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1826 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/patterns.d.ts +217 -0
  12. package/dist/patterns.d.ts.map +1 -0
  13. package/dist/renderer.d.ts +140 -0
  14. package/dist/renderer.d.ts.map +1 -0
  15. package/dist/style.css +124 -0
  16. package/dist/svelte/GossamerBorder.svelte.d.ts +1 -0
  17. package/dist/svelte/GossamerClouds.svelte.d.ts +1 -0
  18. package/dist/svelte/GossamerImage.svelte.d.ts +1 -0
  19. package/dist/svelte/GossamerOverlay.svelte.d.ts +1 -0
  20. package/dist/svelte/GossamerText.svelte.d.ts +1 -0
  21. package/dist/svelte/index.d.ts +20 -0
  22. package/dist/svelte/index.d.ts.map +1 -0
  23. package/dist/svelte/index.js +3648 -0
  24. package/dist/svelte/index.js.map +1 -0
  25. package/dist/svelte/presets.d.ts +38 -0
  26. package/dist/svelte/presets.d.ts.map +1 -0
  27. package/dist/utils/canvas.d.ts +73 -0
  28. package/dist/utils/canvas.d.ts.map +1 -0
  29. package/dist/utils/image.d.ts +74 -0
  30. package/dist/utils/image.d.ts.map +1 -0
  31. package/dist/utils/performance.d.ts +86 -0
  32. package/dist/utils/performance.d.ts.map +1 -0
  33. package/package.json +34 -7
  34. package/src/animation.test.ts +254 -0
  35. package/src/animation.ts +243 -0
  36. package/src/characters.test.ts +148 -0
  37. package/src/characters.ts +219 -0
  38. package/src/colors.ts +234 -0
  39. package/src/index.test.ts +115 -0
  40. package/src/index.ts +164 -11
  41. package/src/patterns.test.ts +273 -0
  42. package/src/patterns.ts +760 -0
  43. package/src/renderer.ts +470 -0
  44. package/src/svelte/GossamerBorder.svelte +326 -0
  45. package/src/svelte/GossamerClouds.svelte +269 -0
  46. package/src/svelte/GossamerImage.svelte +266 -0
  47. package/src/svelte/GossamerOverlay.svelte +232 -0
  48. package/src/svelte/GossamerText.svelte +239 -0
  49. package/src/svelte/index.ts +75 -0
  50. package/src/svelte/presets.ts +174 -0
  51. package/src/utils/canvas.ts +210 -0
  52. package/src/utils/image.ts +275 -0
  53. package/src/utils/performance.ts +282 -0
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Gossamer Animation Utilities
3
+ *
4
+ * FPS limiting, animation loop management, and timing utilities.
5
+ */
6
+ /**
7
+ * Animation state for tracking loop execution
8
+ */
9
+ export interface AnimationState {
10
+ /** Whether animation is currently running */
11
+ isRunning: boolean;
12
+ /** Current animation frame ID */
13
+ frameId: number | null;
14
+ /** Timestamp of last frame */
15
+ lastFrameTime: number;
16
+ /** Frame interval in ms (derived from FPS) */
17
+ frameInterval: number;
18
+ /** Total elapsed time in ms */
19
+ elapsedTime: number;
20
+ /** Current frame count */
21
+ frameCount: number;
22
+ }
23
+ /**
24
+ * Options for creating an animation loop
25
+ */
26
+ export interface AnimationOptions {
27
+ /** Target frames per second (default: 30) */
28
+ fps?: number;
29
+ /** Callback when animation starts */
30
+ onStart?: () => void;
31
+ /** Callback when animation stops */
32
+ onStop?: () => void;
33
+ /** Callback for each frame - return false to stop */
34
+ onFrame: (time: number, deltaTime: number, frameCount: number) => boolean | void;
35
+ }
36
+ /**
37
+ * Create a managed animation loop with FPS limiting
38
+ */
39
+ export declare function createAnimationLoop(options: AnimationOptions): {
40
+ start: () => void;
41
+ stop: () => void;
42
+ pause: () => void;
43
+ resume: () => void;
44
+ getState: () => AnimationState;
45
+ };
46
+ /**
47
+ * Simple throttle function for limiting function execution
48
+ */
49
+ export declare function throttle<T extends (...args: unknown[]) => unknown>(fn: T, limit: number): (...args: Parameters<T>) => void;
50
+ /**
51
+ * Debounce function for delaying execution until activity stops
52
+ */
53
+ export declare function debounce<T extends (...args: unknown[]) => unknown>(fn: T, delay: number): (...args: Parameters<T>) => void;
54
+ /**
55
+ * Calculate actual FPS from frame times
56
+ */
57
+ export declare function calculateFPS(frameTimes: number[], sampleSize?: number): number;
58
+ /**
59
+ * Easing functions for smooth animations
60
+ */
61
+ export declare const easings: {
62
+ /** Linear - no easing */
63
+ linear: (t: number) => number;
64
+ /** Ease in - slow start */
65
+ easeIn: (t: number) => number;
66
+ /** Ease out - slow end */
67
+ easeOut: (t: number) => number;
68
+ /** Ease in/out - slow start and end */
69
+ easeInOut: (t: number) => number;
70
+ /** Sine ease in */
71
+ sineIn: (t: number) => number;
72
+ /** Sine ease out */
73
+ sineOut: (t: number) => number;
74
+ /** Sine ease in/out */
75
+ sineInOut: (t: number) => number;
76
+ /** Bounce at end */
77
+ bounceOut: (t: number) => number;
78
+ };
79
+ export type EasingFunction = (t: number) => number;
80
+ //# sourceMappingURL=animation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../src/animation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,SAAS,EAAE,OAAO,CAAC;IACnB,iCAAiC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,8BAA8B;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,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AM,KAAG,MAAM;IAE3B,oBAAoB;iBACP,MAAM,KAAG,MAAM;IAE5B,uBAAuB;mBACR,MAAM,KAAG,MAAM;IAE9B,oBAAoB;mBACL,MAAM,KAAG,MAAM;CAc/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Gossamer Character Sets
3
+ *
4
+ * Predefined character sets for ASCII rendering, ordered from light to dark.
5
+ * Character density determines which character represents each brightness level.
6
+ */
7
+ /**
8
+ * Character set configuration
9
+ */
10
+ export interface CharacterSet {
11
+ /** Unique identifier for the character set */
12
+ name: string;
13
+ /** Description of the set's aesthetic */
14
+ description: string;
15
+ /** Characters ordered from lightest (space) to darkest */
16
+ characters: string;
17
+ /** Recommended use cases */
18
+ bestFor: string[];
19
+ }
20
+ /**
21
+ * Standard character sets for ASCII rendering
22
+ */
23
+ export declare const CHARACTER_SETS: Record<string, CharacterSet>;
24
+ /**
25
+ * Get a character set by name
26
+ */
27
+ export declare function getCharacterSet(name: string): CharacterSet | undefined;
28
+ /**
29
+ * Get just the characters string from a named set
30
+ */
31
+ export declare function getCharacters(name: string): string;
32
+ /**
33
+ * List all available character set names
34
+ */
35
+ export declare function getCharacterSetNames(): string[];
36
+ /**
37
+ * Create a custom character set
38
+ */
39
+ export declare function createCharacterSet(name: string, characters: string, description?: string, bestFor?: string[]): CharacterSet;
40
+ /**
41
+ * Validate that a character string is suitable for ASCII rendering
42
+ * (should start with space and have at least 2 characters)
43
+ */
44
+ export declare function validateCharacterSet(characters: string): boolean;
45
+ /**
46
+ * Reverse a character set (for inverted brightness mapping)
47
+ */
48
+ export declare function invertCharacters(characters: string): string;
49
+ //# sourceMappingURL=characters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../src/characters.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CA2IvD,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEtE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,WAAW,GAAE,MAAW,EACxB,OAAO,GAAE,MAAM,EAAO,GACrB,YAAY,CAOd;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAIhE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3D"}
@@ -0,0 +1,312 @@
1
+ /**
2
+ * Gossamer Color Palettes
3
+ *
4
+ * Grove-themed color palettes for ASCII effects.
5
+ * Designed to complement Glass UI components.
6
+ */
7
+ /**
8
+ * Color definition with metadata
9
+ */
10
+ export interface ColorDef {
11
+ /** Hex color value */
12
+ hex: string;
13
+ /** Human-readable name */
14
+ name: string;
15
+ /** Recommended opacity for glass overlays (0-1) */
16
+ glassOpacity?: number;
17
+ }
18
+ /**
19
+ * Grove Green palette - Primary brand colors
20
+ */
21
+ export declare const GROVE_GREEN: {
22
+ readonly 50: {
23
+ readonly hex: "#f0fdf4";
24
+ readonly name: "Grove Green 50";
25
+ readonly glassOpacity: 0.3;
26
+ };
27
+ readonly 100: {
28
+ readonly hex: "#dcfce7";
29
+ readonly name: "Grove Green 100";
30
+ readonly glassOpacity: 0.25;
31
+ };
32
+ readonly 200: {
33
+ readonly hex: "#bbf7d0";
34
+ readonly name: "Grove Green 200";
35
+ readonly glassOpacity: 0.2;
36
+ };
37
+ readonly 300: {
38
+ readonly hex: "#86efac";
39
+ readonly name: "Grove Green 300";
40
+ readonly glassOpacity: 0.18;
41
+ };
42
+ readonly 400: {
43
+ readonly hex: "#4ade80";
44
+ readonly name: "Grove Green 400";
45
+ readonly glassOpacity: 0.15;
46
+ };
47
+ readonly 500: {
48
+ readonly hex: "#22c55e";
49
+ readonly name: "Grove Green 500";
50
+ readonly glassOpacity: 0.12;
51
+ };
52
+ readonly 600: {
53
+ readonly hex: "#16a34a";
54
+ readonly name: "Grove Green 600";
55
+ readonly glassOpacity: 0.1;
56
+ };
57
+ readonly 700: {
58
+ readonly hex: "#15803d";
59
+ readonly name: "Grove Green 700";
60
+ readonly glassOpacity: 0.1;
61
+ };
62
+ readonly 800: {
63
+ readonly hex: "#166534";
64
+ readonly name: "Grove Green 800";
65
+ readonly glassOpacity: 0.08;
66
+ };
67
+ readonly 900: {
68
+ readonly hex: "#14532d";
69
+ readonly name: "Grove Green 900";
70
+ readonly glassOpacity: 0.08;
71
+ };
72
+ };
73
+ /**
74
+ * Cream palette - Light/warm backgrounds
75
+ */
76
+ export declare const CREAM: {
77
+ readonly 50: {
78
+ readonly hex: "#fefdfb";
79
+ readonly name: "Cream 50";
80
+ readonly glassOpacity: 0.4;
81
+ };
82
+ readonly 100: {
83
+ readonly hex: "#fdfcf8";
84
+ readonly name: "Cream 100";
85
+ readonly glassOpacity: 0.35;
86
+ };
87
+ readonly 200: {
88
+ readonly hex: "#faf8f3";
89
+ readonly name: "Cream 200";
90
+ readonly glassOpacity: 0.3;
91
+ };
92
+ readonly 300: {
93
+ readonly hex: "#f5f2ea";
94
+ readonly name: "Cream 300";
95
+ readonly glassOpacity: 0.25;
96
+ };
97
+ readonly 400: {
98
+ readonly hex: "#ede9de";
99
+ readonly name: "Cream 400";
100
+ readonly glassOpacity: 0.2;
101
+ };
102
+ readonly 500: {
103
+ readonly hex: "#e2ddd0";
104
+ readonly name: "Cream 500";
105
+ readonly glassOpacity: 0.18;
106
+ };
107
+ readonly 600: {
108
+ readonly hex: "#d4cec0";
109
+ readonly name: "Cream 600";
110
+ readonly glassOpacity: 0.15;
111
+ };
112
+ readonly 700: {
113
+ readonly hex: "#c4bdb0";
114
+ readonly name: "Cream 700";
115
+ readonly glassOpacity: 0.12;
116
+ };
117
+ readonly 800: {
118
+ readonly hex: "#b0a99c";
119
+ readonly name: "Cream 800";
120
+ readonly glassOpacity: 0.1;
121
+ };
122
+ readonly 900: {
123
+ readonly hex: "#9a9387";
124
+ readonly name: "Cream 900";
125
+ readonly glassOpacity: 0.08;
126
+ };
127
+ };
128
+ /**
129
+ * Bark palette - Dark/earth tones
130
+ */
131
+ export declare const BARK: {
132
+ readonly 50: {
133
+ readonly hex: "#faf7f5";
134
+ readonly name: "Bark 50";
135
+ readonly glassOpacity: 0.3;
136
+ };
137
+ readonly 100: {
138
+ readonly hex: "#f0ebe6";
139
+ readonly name: "Bark 100";
140
+ readonly glassOpacity: 0.25;
141
+ };
142
+ readonly 200: {
143
+ readonly hex: "#e0d5cc";
144
+ readonly name: "Bark 200";
145
+ readonly glassOpacity: 0.2;
146
+ };
147
+ readonly 300: {
148
+ readonly hex: "#ccb59c";
149
+ readonly name: "Bark 300";
150
+ readonly glassOpacity: 0.18;
151
+ };
152
+ readonly 400: {
153
+ readonly hex: "#b89a7a";
154
+ readonly name: "Bark 400";
155
+ readonly glassOpacity: 0.15;
156
+ };
157
+ readonly 500: {
158
+ readonly hex: "#a57c5a";
159
+ readonly name: "Bark 500";
160
+ readonly glassOpacity: 0.12;
161
+ };
162
+ readonly 600: {
163
+ readonly hex: "#8a6344";
164
+ readonly name: "Bark 600";
165
+ readonly glassOpacity: 0.1;
166
+ };
167
+ readonly 700: {
168
+ readonly hex: "#6f4d39";
169
+ readonly name: "Bark 700";
170
+ readonly glassOpacity: 0.1;
171
+ };
172
+ readonly 800: {
173
+ readonly hex: "#553a2a";
174
+ readonly name: "Bark 800";
175
+ readonly glassOpacity: 0.08;
176
+ };
177
+ readonly 900: {
178
+ readonly hex: "#3d2914";
179
+ readonly name: "Bark 900";
180
+ readonly glassOpacity: 0.06;
181
+ };
182
+ };
183
+ /**
184
+ * Status colors
185
+ */
186
+ export declare const STATUS: {
187
+ readonly success: {
188
+ readonly hex: "#22c55e";
189
+ readonly name: "Success";
190
+ readonly glassOpacity: 0.12;
191
+ };
192
+ readonly warning: {
193
+ readonly hex: "#f59e0b";
194
+ readonly name: "Warning";
195
+ readonly glassOpacity: 0.12;
196
+ };
197
+ readonly error: {
198
+ readonly hex: "#dc2626";
199
+ readonly name: "Error";
200
+ readonly glassOpacity: 0.1;
201
+ };
202
+ readonly info: {
203
+ readonly hex: "#0ea5e9";
204
+ readonly name: "Info";
205
+ readonly glassOpacity: 0.12;
206
+ };
207
+ };
208
+ /**
209
+ * Combined Grove color schemes for easy access
210
+ */
211
+ export declare const GROVE_COLORS: {
212
+ readonly grove: "#22c55e";
213
+ readonly 'grove-light': "#86efac";
214
+ readonly 'grove-dark': "#15803d";
215
+ readonly 'grove-muted': "#4ade80";
216
+ readonly cream: "#fefdfb";
217
+ readonly 'cream-warm': "#faf8f3";
218
+ readonly 'cream-deep': "#e2ddd0";
219
+ readonly bark: "#3d2914";
220
+ readonly 'bark-light': "#a57c5a";
221
+ readonly 'bark-medium': "#6f4d39";
222
+ readonly white: "#ffffff";
223
+ readonly black: "#000000";
224
+ readonly transparent: "transparent";
225
+ };
226
+ /**
227
+ * Glass-optimized color schemes
228
+ * Pre-configured for use with Glass components
229
+ */
230
+ export declare const GLASS_SCHEMES: {
231
+ readonly 'grove-mist': {
232
+ readonly color: "#22c55e";
233
+ readonly background: "transparent";
234
+ readonly opacity: 0.12;
235
+ readonly description: "Subtle green mist for light glass";
236
+ };
237
+ readonly 'cream-haze': {
238
+ readonly color: "#d4cec0";
239
+ readonly background: "transparent";
240
+ readonly opacity: 0.15;
241
+ readonly description: "Warm cream haze for cozy glass";
242
+ };
243
+ readonly 'bark-shadow': {
244
+ readonly color: "#6f4d39";
245
+ readonly background: "transparent";
246
+ readonly opacity: 0.08;
247
+ readonly description: "Soft earth shadow for depth";
248
+ };
249
+ readonly 'grove-glow': {
250
+ readonly color: "#4ade80";
251
+ readonly background: "#1a1915";
252
+ readonly opacity: 0.15;
253
+ readonly description: "Glowing green for dark glass";
254
+ };
255
+ readonly 'cream-dust': {
256
+ readonly color: "#f5f2ea";
257
+ readonly background: "#1a1915";
258
+ readonly opacity: 0.1;
259
+ readonly description: "Dusty cream particles in dark";
260
+ };
261
+ readonly moonlight: {
262
+ readonly color: "#e2e8f0";
263
+ readonly background: "#1a1915";
264
+ readonly opacity: 0.08;
265
+ readonly description: "Cool moonlight glow";
266
+ };
267
+ readonly 'spring-fresh': {
268
+ readonly color: "#86efac";
269
+ readonly background: "transparent";
270
+ readonly opacity: 0.18;
271
+ readonly description: "Fresh spring green overlay";
272
+ };
273
+ readonly 'autumn-warm': {
274
+ readonly color: "#d97706";
275
+ readonly background: "transparent";
276
+ readonly opacity: 0.1;
277
+ readonly description: "Warm autumn amber tones";
278
+ };
279
+ readonly 'winter-frost': {
280
+ readonly color: "#93c5fd";
281
+ readonly background: "transparent";
282
+ readonly opacity: 0.12;
283
+ readonly description: "Cool frost blue overlay";
284
+ };
285
+ };
286
+ export type GroveColorName = keyof typeof GROVE_COLORS;
287
+ export type GlassSchemeName = keyof typeof GLASS_SCHEMES;
288
+ /**
289
+ * Get a Grove color by name
290
+ */
291
+ export declare function getGroveColor(name: GroveColorName | string): string;
292
+ /**
293
+ * Get a glass scheme by name
294
+ */
295
+ export declare function getGlassScheme(name: GlassSchemeName | string): {
296
+ color: string;
297
+ background: string;
298
+ opacity: number;
299
+ };
300
+ /**
301
+ * List all Grove color names
302
+ */
303
+ export declare function getGroveColorNames(): string[];
304
+ /**
305
+ * List all glass scheme names
306
+ */
307
+ export declare function getGlassSchemeNames(): string[];
308
+ /**
309
+ * Apply opacity to a hex color, returning rgba string
310
+ */
311
+ export declare function hexToRgba(hex: string, opacity: number): string;
312
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWd,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWR,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWP,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAKT,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAqBf,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DhB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,YAAY,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,aAAa,CAAC;AAEzD;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,CAUnE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,GAAG;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAeA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAK9D"}
package/dist/index.d.ts CHANGED
@@ -26,6 +26,27 @@ export interface GossamerConfig {
26
26
  /** Target FPS for animation */
27
27
  fps?: number;
28
28
  }
29
+ /**
30
+ * Preset configuration for effects
31
+ */
32
+ export interface PresetConfig {
33
+ /** Preset display name */
34
+ name: string;
35
+ /** Preset description */
36
+ description: string;
37
+ /** Character set */
38
+ characters: string;
39
+ /** Pattern type */
40
+ pattern: 'perlin' | 'waves' | 'static' | 'ripple' | 'fbm' | 'clouds' | 'plasma' | 'vortex' | 'matrix' | 'gradient' | 'diamond' | 'fractal';
41
+ /** Pattern frequency */
42
+ frequency: number;
43
+ /** Pattern amplitude */
44
+ amplitude: number;
45
+ /** Animation speed */
46
+ speed: number;
47
+ /** Default opacity */
48
+ opacity: number;
49
+ }
29
50
  /**
30
51
  * Default character set ordered from light to dark
31
52
  */
@@ -43,17 +64,24 @@ export declare function calculateBrightness(r: number, g: number, b: number): nu
43
64
  * Map a brightness value (0-255) to an ASCII character
44
65
  */
45
66
  export declare function brightnessToChar(brightness: number, characters?: string): string;
67
+ export { GossamerRenderer } from './renderer';
68
+ export type { RenderConfig } from './renderer';
69
+ export { perlinNoise2D, fbmNoise, staticNoise, seededNoise2D, wavePattern, ripplePattern, cloudsPattern, plasmaPattern, vortexPattern, matrixPattern, gradientPattern, diamondPattern, fractalPattern, generateBrightnessGrid, gridToImageData, createBrightnessBuffer, fillBrightnessBuffer, getBufferValue, DEFAULT_PATTERN_CONFIG, } from './patterns';
70
+ export type { PatternConfig, PatternType, BrightnessBuffer } from './patterns';
71
+ export { CHARACTER_SETS, getCharacterSet, getCharacters, getCharacterSetNames, createCharacterSet, validateCharacterSet, invertCharacters, } from './characters';
72
+ export type { CharacterSet } from './characters';
73
+ export { GROVE_GREEN, CREAM, BARK, STATUS, GROVE_COLORS, GLASS_SCHEMES, getGroveColor, getGlassScheme, getGroveColorNames, getGlassSchemeNames, hexToRgba, } from './colors';
74
+ export type { ColorDef, GroveColorName, GlassSchemeName } from './colors';
75
+ export { createAnimationLoop, throttle, debounce, calculateFPS, easings, } from './animation';
76
+ export type { AnimationState, AnimationOptions, EasingFunction } from './animation';
77
+ export { createCanvas, getDevicePixelRatio, resizeCanvasToContainer, createOffscreenCanvas, clearCanvas, getImageData, optimizeContext, setupTextRendering, measureTextWidth, calculateCellSize, setBlendMode, } from './utils/canvas';
78
+ export type { CanvasOptions } from './utils/canvas';
79
+ export { loadImage, loadAndScaleImage, imageToPixelData, extractBrightness, sampleImageCells, rgbToHex, hexToRgb, adjustBrightness, adjustContrast, invertColors, toGrayscale, } from './utils/image';
80
+ export type { ImageLoadOptions } from './utils/image';
81
+ export { createVisibilityObserver, createResizeObserver, prefersReducedMotion, onReducedMotionChange, isLowPowerMode, getRecommendedFPS, createFPSCounter, requestIdleCallback, cancelIdleCallback, isBrowser, isCanvasSupported, isOffscreenCanvasSupported, } from './utils/performance';
82
+ export type { VisibilityCallback, PerformanceMetrics } from './utils/performance';
46
83
  /**
47
- * Gossamer v0.0.1 - Placeholder release
48
- *
49
- * Full implementation coming soon. This package will provide:
50
- * - 2D Canvas ASCII rendering
51
- * - Ambient pattern generation
52
- * - Image-to-ASCII conversion
53
- * - Animation loops
54
- * - Framework adapters (Svelte, React, Vue)
55
- *
56
- * @see https://github.com/AutumnsGrove/Gossamer
84
+ * Gossamer version
57
85
  */
58
- export declare const VERSION = "0.0.1";
86
+ export declare const VERSION = "0.1.0";
59
87
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+BAA+B;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,cAAc,CASnD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,UAAU,GAAE,MAA2B,GACtC,MAAM,CAGR;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,UAAU,CAAC,E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