@hkdigital/lib-core 0.4.9 → 0.4.10

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 (2) hide show
  1. package/README.md +44 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -132,6 +132,50 @@ This library includes a complete design system with Tailwind CSS integration. Ba
132
132
  export default config;
133
133
  ```
134
134
 
135
+ 5. **TypeScript support for imagetools** - Add image import definitions to `app.d.ts`:
136
+ ```typescript
137
+ // src/app.d.ts
138
+ import '@hkdigital/lib-core/config/imagetools.d.ts';
139
+
140
+ // See https://svelte.dev/docs/kit/types#app.d.ts
141
+ // for information about these interfaces
142
+ declare global {
143
+ namespace App {
144
+ // interface Error {}
145
+ // interface Locals {}
146
+ // interface PageData {}
147
+ // interface PageState {}
148
+ // interface Platform {}
149
+ }
150
+ }
151
+
152
+ export {};
153
+ ```
154
+
155
+ **What this enables:**
156
+ - Type definitions for image imports with query parameters (e.g., `hero.jpg?preset=photo`)
157
+ - IntelliSense and autocompletion for imagetools directives in your editor
158
+ - Prevents TypeScript errors when importing processed images
159
+ - Works for both TypeScript and JavaScript projects (VS Code uses TypeScript for JS intellisense)
160
+
161
+ **Available presets:**
162
+ - `default` - AVIF format, 90% quality
163
+ - `photo` - JPG format, 95% quality, returns metadata
164
+ - `render` - JPG format, 95% quality, returns metadata
165
+ - `gradient` - JPG format, 95% quality, returns metadata
166
+ - `drawing` - AVIF format, 90% quality, returns metadata
167
+ - `savedata` - AVIF format, 85% quality, returns metadata
168
+ - `blur` - AVIF format, 50% quality with blur effect, returns metadata
169
+
170
+ **Usage examples:**
171
+ ```javascript
172
+ // Basic usage
173
+ import heroImage from '$lib/assets/hero.jpg?preset=photo';
174
+
175
+ // Responsive images
176
+ import heroResponsive from '$lib/assets/hero.jpg?preset=photo&responsive';
177
+ ```
178
+
135
179
  ### Logging System
136
180
 
137
181
  The library includes a comprehensive logging system that provides:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"