@lonik/oh-image 1.0.2 → 1.0.3

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,6 @@
1
+ import type { ImageSrc } from "@lonik/oh-image/plugin";
2
+
3
+ declare module "*?oh" {
4
+ const imageSrc: ImageSrc;
5
+ export default imageSrc;
6
+ }
package/dist/plugin.d.ts CHANGED
@@ -39,6 +39,32 @@ interface ImageOptions {
39
39
  /** Output format for srcSet images */
40
40
  srcSetsF: keyof FormatEnum;
41
41
  }
42
+ /**
43
+ * Represents a single entry in the srcSet array.
44
+ * Used for responsive image loading at different viewport widths.
45
+ */
46
+ interface ImageSrcSet {
47
+ /** Width descriptor (e.g., '640w', '1080w') */
48
+ width: string;
49
+ /** URL or path to the image at this breakpoint */
50
+ src: string;
51
+ }
52
+ /**
53
+ * The processed image source object returned by the plugin.
54
+ * Contains all URLs and metadata needed for responsive image rendering.
55
+ */
56
+ interface ImageSrc {
57
+ /** Original width of the source image in pixels */
58
+ width: number;
59
+ /** Original height of the source image in pixels */
60
+ height: number;
61
+ /** URL to the placeholder image (if placeholder was enabled) */
62
+ placeholderUrl?: string;
63
+ /** Array of responsive image sources at different breakpoints */
64
+ srcSets: ImageSrcSet[];
65
+ /** URL to the main processed image */
66
+ src: string;
67
+ }
42
68
  //#endregion
43
69
  //#region src/plugin/plugin.d.ts
44
70
  declare function ohImage(options?: Partial<PluginConfig>): {
@@ -55,4 +81,4 @@ declare function ohImage(options?: Partial<PluginConfig>): {
55
81
  writeBundle(this: rollup0.PluginContext): Promise<void>;
56
82
  };
57
83
  //#endregion
58
- export { ohImage };
84
+ export { type ImageOptions, type ImageSrc, type ImageSrcSet, type PluginConfig, ohImage };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lonik/oh-image",
3
3
  "type": "module",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "description": "A React component library for optimized image handling.",
6
6
  "author": "Luka Onikadze <lukonik@gmail.com>",
7
7
  "license": "MIT",
@@ -22,6 +22,9 @@
22
22
  "./react": {
23
23
  "types": "./dist/react.d.ts",
24
24
  "default": "./dist/react.js"
25
+ },
26
+ "./client": {
27
+ "types": "./dist/client.d.ts"
25
28
  }
26
29
  },
27
30
  "files": [