@hkdigital/lib-core 0.4.9 → 0.4.11
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.
- package/README.md +44 -0
- package/package.json +8 -8
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.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "HKdigital",
|
|
6
6
|
"url": "https://hkdigital.nl"
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
"./*": "./dist/*"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@eslint/js": "^9.
|
|
75
|
+
"@eslint/js": "^9.33.0",
|
|
76
76
|
"@skeletonlabs/skeleton": "^3.1.7",
|
|
77
77
|
"@steeze-ui/heroicons": "^2.4.2",
|
|
78
|
-
"@sveltejs/kit": "^2.
|
|
79
|
-
"eslint-plugin-import": "^2.
|
|
80
|
-
"pino": "^9.
|
|
81
|
-
"pino-pretty": "^13.
|
|
82
|
-
"runed": "^0.
|
|
83
|
-
"svelte": "^5.
|
|
78
|
+
"@sveltejs/kit": "^2.28.0",
|
|
79
|
+
"eslint-plugin-import": "^2.32.0",
|
|
80
|
+
"pino": "^9.8.0",
|
|
81
|
+
"pino-pretty": "^13.1.1",
|
|
82
|
+
"runed": "^0.31.1",
|
|
83
|
+
"svelte": "^5.38.1",
|
|
84
84
|
"svelte-preprocess": "^6.0.3",
|
|
85
85
|
"valibot": "^1.1.0",
|
|
86
86
|
"vite-imagetools": "^8.0.0"
|