@frybynite/image-cloud 0.3.7 → 0.4.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.
package/dist/index.d.ts CHANGED
@@ -179,7 +179,7 @@ declare interface ClusterLayoutOptions extends Partial<LayoutConfig> {
179
179
  fixedHeight?: number;
180
180
  }
181
181
 
182
- export declare class ClusterPlacementGenerator implements PlacementGenerator {
182
+ export declare class ClusterPlacementLayout implements PlacementLayout {
183
183
  private config;
184
184
  private imageConfig;
185
185
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -688,7 +688,7 @@ declare interface GridLayoutOptions extends Partial<LayoutConfig> {
688
688
  fixedHeight?: number;
689
689
  }
690
690
 
691
- export declare class GridPlacementGenerator implements PlacementGenerator {
691
+ export declare class GridPlacementLayout implements PlacementLayout {
692
692
  private config;
693
693
  private imageConfig;
694
694
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -1020,13 +1020,13 @@ export declare class LayoutEngine {
1020
1020
  private config;
1021
1021
  private imageConfig;
1022
1022
  private layouts;
1023
- private generator;
1023
+ private placementLayout;
1024
1024
  constructor(config: LayoutEngineConfig);
1025
1025
  /**
1026
- * Initialize the appropriate generator based on config type
1027
- * @returns Initialized placement generator
1026
+ * Initialize the appropriate placement layout based on config type
1027
+ * @returns Initialized placement layout
1028
1028
  */
1029
- private initGenerator;
1029
+ private initLayout;
1030
1030
  /**
1031
1031
  * Generate layout positions for images
1032
1032
  * @param imageCount - Number of images to layout
@@ -1127,7 +1127,7 @@ declare interface PerformanceRenderingConfig {
1127
1127
  imageQuality?: 'auto' | 'high' | 'medium' | 'low';
1128
1128
  }
1129
1129
 
1130
- export declare interface PlacementGenerator {
1130
+ export declare interface PlacementLayout {
1131
1131
  generate(imageCount: number, containerBounds: ContainerBounds, options?: Partial<LayoutConfig>): ImageLayout[];
1132
1132
  }
1133
1133
 
@@ -1140,7 +1140,7 @@ declare interface RadialLayoutOptions extends Partial<LayoutConfig> {
1140
1140
  fixedHeight?: number;
1141
1141
  }
1142
1142
 
1143
- export declare class RadialPlacementGenerator implements PlacementGenerator {
1143
+ export declare class RadialPlacementLayout implements PlacementLayout {
1144
1144
  private config;
1145
1145
  private imageConfig;
1146
1146
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -1172,7 +1172,7 @@ declare interface RandomLayoutOptions extends Partial<LayoutConfig> {
1172
1172
  fixedHeight?: number;
1173
1173
  }
1174
1174
 
1175
- export declare class RandomPlacementGenerator implements PlacementGenerator {
1175
+ export declare class RandomPlacementLayout implements PlacementLayout {
1176
1176
  private config;
1177
1177
  private imageConfig;
1178
1178
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -1261,7 +1261,7 @@ declare interface SpiralLayoutOptions extends Partial<LayoutConfig> {
1261
1261
  fixedHeight?: number;
1262
1262
  }
1263
1263
 
1264
- export declare class SpiralPlacementGenerator implements PlacementGenerator {
1264
+ export declare class SpiralPlacementLayout implements PlacementLayout {
1265
1265
  private config;
1266
1266
  private imageConfig;
1267
1267
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -1448,6 +1448,10 @@ declare interface WaveAlgorithmConfig {
1448
1448
  synchronization: 'offset' | 'synchronized' | 'alternating';
1449
1449
  }
1450
1450
 
1451
+ declare interface WaveLayoutOptions extends Partial<LayoutConfig> {
1452
+ fixedHeight?: number;
1453
+ }
1454
+
1451
1455
  export declare interface WavePathConfig {
1452
1456
  amplitude: number;
1453
1457
  frequency: number;
@@ -1458,6 +1462,49 @@ export declare interface WavePathConfig {
1458
1462
 
1459
1463
  export declare type WavePathPreset = 'gentle' | 'playful' | 'serpentine' | 'flutter';
1460
1464
 
1465
+ export declare class WavePlacementLayout implements PlacementLayout {
1466
+ private config;
1467
+ private imageConfig;
1468
+ constructor(config: LayoutConfig, imageConfig?: ImageConfig);
1469
+ /**
1470
+ * Generate wave layout positions for images
1471
+ * @param imageCount - Number of images to layout
1472
+ * @param containerBounds - Container dimensions {width, height}
1473
+ * @param options - Optional overrides
1474
+ * @returns Array of layout objects with position, rotation, scale
1475
+ */
1476
+ generate(imageCount: number, containerBounds: ContainerBounds, options?: WaveLayoutOptions): ImageLayout[];
1477
+ /**
1478
+ * Calculate Y position displacement on wave curve
1479
+ * @param x - Horizontal position
1480
+ * @param containerWidth - Container width
1481
+ * @param amplitude - Wave amplitude
1482
+ * @param frequency - Wave frequency
1483
+ * @param phase - Phase offset
1484
+ * @returns Y displacement from baseline
1485
+ */
1486
+ private calculateWaveY;
1487
+ /**
1488
+ * Calculate rotation based on wave tangent
1489
+ * @param x - Horizontal position
1490
+ * @param containerWidth - Container width
1491
+ * @param amplitude - Wave amplitude
1492
+ * @param frequency - Wave frequency
1493
+ * @param phase - Phase offset
1494
+ * @returns Rotation angle in degrees
1495
+ */
1496
+ private calculateRotation;
1497
+ /**
1498
+ * Estimate image width based on height
1499
+ /**
1500
+ * Utility: Generate random number between min and max
1501
+ * @param min - Minimum value
1502
+ * @param max - Maximum value
1503
+ * @returns Random number in range
1504
+ */
1505
+ private random;
1506
+ }
1507
+
1461
1508
  export declare class ZoomEngine {
1462
1509
  private config;
1463
1510
  private animationEngine;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frybynite/image-cloud",
3
- "version": "0.3.7",
3
+ "version": "0.4.0",
4
4
  "description": "Javascript/TypeScript image cloud library with custom loaders, various layouts, full images styling, with animation and zoom effects",
5
5
  "type": "module",
6
6
  "main": "./dist/image-cloud.umd.js",