@kosdev-code/kos-ui-sdk 2.0.24 → 2.0.26

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 (73) hide show
  1. package/index.cjs +71 -37
  2. package/index.cjs.map +1 -1
  3. package/index.js +2915 -2425
  4. package/index.js.map +1 -1
  5. package/models/models/canvas-dispatcher/canvas-dispatcher-model.d.ts +29 -0
  6. package/models/models/canvas-dispatcher/canvas-dispatcher-model.d.ts.map +1 -0
  7. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts +89 -0
  8. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts.map +1 -0
  9. package/models/models/canvas-dispatcher/index.d.ts +5 -0
  10. package/models/models/canvas-dispatcher/index.d.ts.map +1 -0
  11. package/models/models/canvas-dispatcher/services/canvas-dispatcher-services.d.ts +8 -0
  12. package/models/models/canvas-dispatcher/services/canvas-dispatcher-services.d.ts.map +1 -0
  13. package/models/models/canvas-dispatcher/services/index.d.ts +2 -0
  14. package/models/models/canvas-dispatcher/services/index.d.ts.map +1 -0
  15. package/models/models/canvas-dispatcher/types/index.d.ts +55 -0
  16. package/models/models/canvas-dispatcher/utils/renderers/base/canvas-2d-renderer.d.ts +36 -0
  17. package/models/models/canvas-dispatcher/utils/renderers/base/canvas-2d-renderer.d.ts.map +1 -0
  18. package/models/models/canvas-dispatcher/utils/renderers/base/gradient-base-renderer.d.ts +2 -0
  19. package/models/models/canvas-dispatcher/utils/renderers/base/gradient-base-renderer.d.ts.map +1 -0
  20. package/models/models/canvas-dispatcher/utils/renderers/base/video-base-renderer.d.ts +67 -0
  21. package/models/models/canvas-dispatcher/utils/renderers/base/video-base-renderer.d.ts.map +1 -0
  22. package/models/models/canvas-dispatcher/utils/renderers/base/webgl-base-renderer.d.ts +51 -0
  23. package/models/models/canvas-dispatcher/utils/renderers/base/webgl-base-renderer.d.ts.map +1 -0
  24. package/models/models/canvas-dispatcher/utils/renderers/drop-renderer.d.ts +58 -0
  25. package/models/models/canvas-dispatcher/utils/renderers/drop-renderer.d.ts.map +1 -0
  26. package/models/models/canvas-dispatcher/utils/renderers/gradient-renderer.d.ts +17 -0
  27. package/models/models/canvas-dispatcher/utils/renderers/gradient-renderer.d.ts.map +1 -0
  28. package/models/models/canvas-dispatcher/utils/renderers/image-renderer.d.ts +13 -0
  29. package/models/models/canvas-dispatcher/utils/renderers/image-renderer.d.ts.map +1 -0
  30. package/models/models/canvas-dispatcher/utils/renderers/matrix-renderer.d.ts +36 -0
  31. package/models/models/canvas-dispatcher/utils/renderers/matrix-renderer.d.ts.map +1 -0
  32. package/models/models/canvas-dispatcher/utils/renderers/mixins/one-shot-renderer-mixin.d.ts +5 -0
  33. package/models/models/canvas-dispatcher/utils/renderers/mixins/one-shot-renderer-mixin.d.ts.map +1 -0
  34. package/models/models/canvas-dispatcher/utils/renderers/renderer-factory.d.ts +30 -0
  35. package/models/models/canvas-dispatcher/utils/renderers/renderer-factory.d.ts.map +1 -0
  36. package/models/models/canvas-dispatcher/utils/renderers/solid-color-renderer.d.ts +17 -0
  37. package/models/models/canvas-dispatcher/utils/renderers/solid-color-renderer.d.ts.map +1 -0
  38. package/models/models/canvas-dispatcher/utils/renderers/sweep-renderer.d.ts +48 -0
  39. package/models/models/canvas-dispatcher/utils/renderers/sweep-renderer.d.ts.map +1 -0
  40. package/models/models/canvas-dispatcher/utils/renderers/swirl-renderer.d.ts +13 -0
  41. package/models/models/canvas-dispatcher/utils/renderers/swirl-renderer.d.ts.map +1 -0
  42. package/models/utils/core-registration-manager.d.ts.map +1 -1
  43. package/package.json +2 -2
  44. package/ui/features/canvas/components/canvas-streamer/canvas-streamer.d.ts +13 -0
  45. package/ui/features/canvas/components/canvas-streamer/canvas-streamer.d.ts.map +1 -0
  46. package/ui/features/canvas/components/canvas-streamer/index.d.ts +2 -0
  47. package/ui/features/canvas/components/canvas-streamer/index.d.ts.map +1 -0
  48. package/ui/features/canvas/components/rgb-332-visualizer/rgb-332-visualizer.d.ts +5 -0
  49. package/ui/features/canvas/components/rgb-332-visualizer/rgb-332-visualizer.d.ts.map +1 -0
  50. package/ui/features/canvas/hooks/canvas-dispatcher/index.d.ts +3 -0
  51. package/ui/features/canvas/hooks/canvas-dispatcher/index.d.ts.map +1 -0
  52. package/ui/features/canvas/hooks/canvas-dispatcher/use-canvas-dispatcher.d.ts +14 -0
  53. package/ui/features/canvas/hooks/canvas-dispatcher/use-canvas-dispatcher.d.ts.map +1 -0
  54. package/ui/features/canvas/hooks/canvas-dispatcher/with-canvas-dispatcher.d.ts +9 -0
  55. package/ui/features/canvas/hooks/canvas-dispatcher/with-canvas-dispatcher.d.ts.map +1 -0
  56. package/ui/features/canvas/hooks/use-gradient-renderer.d.ts +14 -0
  57. package/ui/features/canvas/hooks/use-gradient-renderer.d.ts.map +1 -0
  58. package/ui/features/canvas/hooks/use-image-renderer.d.ts +22 -0
  59. package/ui/features/canvas/hooks/use-image-renderer.d.ts.map +1 -0
  60. package/ui/features/canvas/hooks/use-solid-color-renderer.d.ts +11 -0
  61. package/ui/features/canvas/hooks/use-solid-color-renderer.d.ts.map +1 -0
  62. package/ui/features/canvas/hooks/use-streamable-renderer.d.ts +17 -0
  63. package/ui/features/canvas/hooks/use-streamable-renderer.d.ts.map +1 -0
  64. package/ui/features/canvas/hooks/use-sweep-renderer.d.ts +32 -0
  65. package/ui/features/canvas/hooks/use-sweep-renderer.d.ts.map +1 -0
  66. package/ui/features/canvas/hooks/use-swirl-renderer.d.ts +22 -0
  67. package/ui/features/canvas/hooks/use-swirl-renderer.d.ts.map +1 -0
  68. package/ui/features/canvas/hooks/use-video-renderer.d.ts +24 -0
  69. package/ui/features/canvas/hooks/use-video-renderer.d.ts.map +1 -0
  70. package/ui/features/canvas/utils/encode-frame.d.ts +14 -0
  71. package/ui/features/canvas/utils/encode-frame.d.ts.map +1 -0
  72. package/ui/features/canvas/utils/preview-decoder.d.ts +29 -0
  73. package/ui/features/canvas/utils/preview-decoder.d.ts.map +1 -0
@@ -0,0 +1,48 @@
1
+ import { Canvas2DRendererBase } from './base/canvas-2d-renderer';
2
+ import { Renderer } from '../../types';
3
+
4
+ /**
5
+ * A horizontal hue sweep renderer using 2D canvas.
6
+ *
7
+ * This renderer generates a horizontally scrolling gradient across a configurable hue range.
8
+ * The hue scrolls left-to-right in HSL color space, creating a smooth and colorful sweep animation.
9
+ */
10
+ export declare class SweepRenderer extends Canvas2DRendererBase implements Renderer {
11
+ /** The horizontal pixel offset into the hue sweep */
12
+ private offset;
13
+ /** Minimum hue (in degrees) to include in the sweep (e.g. 0 for red) */
14
+ private minHue;
15
+ /** Maximum hue (in degrees) to include in the sweep (e.g. 60 for yellow) */
16
+ private maxHue;
17
+ /** Horizontal sweep speed in pixels per update step */
18
+ private speed;
19
+ /**
20
+ * Constructs a sweep renderer.
21
+ *
22
+ * @param minHue - Start of the hue range (in degrees, default 0)
23
+ * @param maxHue - End of the hue range (in degrees, default 360)
24
+ * @param speed - Horizontal speed of the sweep (pixels per update, default 1)
25
+ */
26
+ constructor(minHue?: number, maxHue?: number, speed?: number);
27
+ /**
28
+ * Resets the animation state to the beginning of the sweep.
29
+ */
30
+ reset(): void;
31
+ /**
32
+ * Converts an HSL color to RGB.
33
+ *
34
+ * @param h - Hue [0, 1]
35
+ * @param s - Saturation [0, 1]
36
+ * @param l - Lightness [0, 1]
37
+ * @returns Tuple of [r, g, b] in range [0, 255]
38
+ */
39
+ private hslToRgb;
40
+ /**
41
+ * Renders the current frame by drawing a hue-mapped horizontal gradient across the canvas.
42
+ *
43
+ * @param width - Width of the canvas in pixels
44
+ * @param height - Height of the canvas in pixels
45
+ */
46
+ renderFrame(width: number, height: number): void;
47
+ }
48
+ //# sourceMappingURL=sweep-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sweep-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/canvas-dispatcher/utils/renderers/sweep-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,oBAAqB,YAAW,QAAQ;IACzE,qDAAqD;IACrD,OAAO,CAAC,MAAM,CAAK;IAEnB,wEAAwE;IACxE,OAAO,CAAC,MAAM,CAAS;IAEvB,4EAA4E;IAC5E,OAAO,CAAC,MAAM,CAAS;IAEvB,uDAAuD;IACvD,OAAO,CAAC,KAAK,CAAS;IAEtB;;;;;;OAMG;gBACS,MAAM,SAAI,EAAE,MAAM,SAAM,EAAE,KAAK,SAAI;IAO/C;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ;IAyBhB;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CA4BjD"}
@@ -0,0 +1,13 @@
1
+ import { VideoRendererBase } from './base/video-base-renderer';
2
+
3
+ /**
4
+ * The `SwirlRenderer` class extends the `VideoRendererBase` to provide
5
+ * functionality for rendering a swirling video effect. It initializes
6
+ * the renderer with a predefined video asset (`swirl.mp4`).
7
+ *
8
+ * @extends VideoRendererBase
9
+ */
10
+ export declare class SwirlRenderer extends VideoRendererBase {
11
+ constructor();
12
+ }
13
+ //# sourceMappingURL=swirl-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swirl-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/canvas-dispatcher/utils/renderers/swirl-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,iBAAiB;;CAInD"}
@@ -1 +1 @@
1
- {"version":3,"file":"core-registration-manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-sdk/src/models/utils/core-registration-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAGnB,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAC;AAgBpB,eAAO,MAAM,kBAAkB,YACnB,CAAC;;;;;CA2BV,CAAC;AAEJ,KAAK,aAAa,CAAC,CAAC,IAAI;IACtB,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC,CAAC,CAAC,CAAA;KAAE,CAAC;IAC9C,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACnE,KAAK,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7D,SAAS,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;CACtE,CAAC;AAEF,QAAA,MAAM,iBAAiB,IAAK,CAAC;AAc7B,KAAK,oBAAoB,GAAG,aAAa,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEpE,QAAA,MAAM,gBAAgB,EAAE,oBAA+C,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"core-registration-manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-sdk/src/models/utils/core-registration-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAGnB,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAC;AAiBpB,eAAO,MAAM,kBAAkB,YACnB,CAAC;;;;;CA4BV,CAAC;AAEJ,KAAK,aAAa,CAAC,CAAC,IAAI;IACtB,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC,CAAC,CAAC,CAAA;KAAE,CAAC;IAC9C,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACnE,KAAK,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7D,SAAS,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;CACtE,CAAC;AAEF,QAAA,MAAM,iBAAiB,IAAK,CAAC;AAc7B,KAAK,oBAAoB,GAAG,aAAa,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEpE,QAAA,MAAM,gBAAgB,EAAE,oBAA+C,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosdev-code/kos-ui-sdk",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "kos": {
38
38
  "build": {
39
- "gitHash": "43f323a329e357e40c5554b416c109bc9c1ea45b"
39
+ "gitHash": "67f4216ff76cccb352c0ac2f5b624d38934476b1"
40
40
  }
41
41
  }
42
42
  }
@@ -0,0 +1,13 @@
1
+ import { CanvasDispatcherModel } from '../../../../../models/models/canvas-dispatcher';
2
+
3
+ interface CanvasStreamerProps {
4
+ height?: number;
5
+ width?: number;
6
+ defaultFps?: number;
7
+ showPreview?: boolean;
8
+ canvasDispatcher: CanvasDispatcherModel;
9
+ }
10
+ export declare const CanvasStreamerBase: React.FunctionComponent<CanvasStreamerProps>;
11
+ export declare const CanvasStreamer: (props: Omit<CanvasStreamerProps, "canvasDispatcher">) => import("@emotion/react/jsx-runtime").JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=canvas-streamer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvas-streamer.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/components/canvas-streamer/canvas-streamer.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAW5F,UAAU,mBAAmB;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,qBAAqB,CAAC;CACzC;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,iBAAiB,CAAC,mBAAmB,CAiKzE,CAAC;AAEJ,eAAO,MAAM,cAAc,4GAA2C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './canvas-streamer';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/components/canvas-streamer/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+
3
+ declare const RGB332Visualizer: React.FC;
4
+ export default RGB332Visualizer;
5
+ //# sourceMappingURL=rgb-332-visualizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rgb-332-visualizer.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/components/rgb-332-visualizer/rgb-332-visualizer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EA8D7B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './use-canvas-dispatcher';
2
+ export * from './with-canvas-dispatcher';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/canvas-dispatcher/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { CanvasDispatcherModel } from '../../../../../models/models/canvas-dispatcher';
2
+
3
+ export declare const useCanvasDispatcher: () => {
4
+ model: CanvasDispatcherModel | undefined;
5
+ ready: boolean;
6
+ error: string | undefined;
7
+ status: {
8
+ model: CanvasDispatcherModel | undefined;
9
+ ready: boolean;
10
+ error: string | undefined;
11
+ };
12
+ KosModelLoader: import('react').FunctionComponent<import('react').PropsWithChildren<import('../../../../components/error-boundary/error-boundary').ErrorBoundaryProps & import('../../../..').KosModelLoaderProps>>;
13
+ };
14
+ //# sourceMappingURL=use-canvas-dispatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-canvas-dispatcher.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/canvas-dispatcher/use-canvas-dispatcher.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,gDAAgD,CAAC;AAGxD,eAAO,MAAM,mBAAmB;;;;;;;;;;CAS/B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { CanvasDispatcherModel } from '../../../../../models/models/canvas-dispatcher';
2
+
3
+ interface CanvasDispatcherProps {
4
+ canvasDispatcher: CanvasDispatcherModel;
5
+ }
6
+ type HoCCanvasDispatcherProps = CanvasDispatcherProps;
7
+ export declare function withCanvasDispatcher<T extends HoCCanvasDispatcherProps = HoCCanvasDispatcherProps>(WrappedComponent: React.ComponentType<T>): (props: Omit<T, keyof CanvasDispatcherProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=with-canvas-dispatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-canvas-dispatcher.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/canvas-dispatcher/with-canvas-dispatcher.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAG5F,UAAU,qBAAqB;IAC7B,gBAAgB,EAAE,qBAAqB,CAAC;CACzC;AAED,KAAK,wBAAwB,GAAG,qBAAqB,CAAC;AAEtD,wBAAgB,oBAAoB,CAClC,CAAC,SAAS,wBAAwB,GAAG,wBAAwB,EAC7D,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,WACzB,KAAK,CAAC,EAAE,MAAM,qBAAqB,CAAC,sDASpD"}
@@ -0,0 +1,14 @@
1
+ import { GradientDirection } from '../../../../models/models/canvas-dispatcher/utils/renderers/gradient-renderer';
2
+
3
+ interface UseGradientRendererProps {
4
+ width: number;
5
+ height: number;
6
+ onFrame?: (rgba: Uint8ClampedArray) => void;
7
+ colors: string[];
8
+ direction: GradientDirection;
9
+ speed?: number;
10
+ loop?: boolean;
11
+ }
12
+ export declare const useGradientRenderer: ({ width, height, onFrame, colors, direction, speed, loop, }: UseGradientRendererProps) => readonly [boolean, () => void];
13
+ export {};
14
+ //# sourceMappingURL=use-gradient-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-gradient-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/use-gradient-renderer.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,+EAA+E,CAAC;AAGvF,UAAU,wBAAwB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,mBAAmB,gEAQ7B,wBAAwB,mCAe1B,CAAC"}
@@ -0,0 +1,22 @@
1
+ interface UseImageRendererProps {
2
+ width: number;
3
+ height: number;
4
+ onFrame?: (rgba: Uint8ClampedArray) => void;
5
+ src: string;
6
+ }
7
+ /**
8
+ * A custom hook that initializes and manages a video renderer for streaming video frames.
9
+ *
10
+ * @param {UseImageRendererProps} props - The properties required to configure the video renderer.
11
+ * @param {number} props.width - The width of the image frame.
12
+ * @param {number} props.height - The height of the image frame.
13
+ * @param {Function} props.onFrame - A callback function invoked for each rendered frame.
14
+ * @param {string} props.src - The source URL or path of the image to be rendered.
15
+ *
16
+ * @returns {readonly [boolean, () => void]} A tuple containing:
17
+ * - `isStreaming` (boolean): Indicates whether the video is currently streaming.
18
+ * - `startStreaming` (Function): A function to start the video streaming process.
19
+ */
20
+ export declare const useImageRenderer: ({ width, height, onFrame, src, }: UseImageRendererProps) => readonly [boolean, () => void];
21
+ export {};
22
+ //# sourceMappingURL=use-image-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-image-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/use-image-renderer.ts"],"names":[],"mappings":"AAIA,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,GAAG,EAAE,MAAM,CAAC;CACb;AACD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,qCAM1B,qBAAqB,mCAWvB,CAAC"}
@@ -0,0 +1,11 @@
1
+ interface UseSolidColorRendererProps {
2
+ width: number;
3
+ height: number;
4
+ onFrame?: (rgba: Uint8ClampedArray) => void;
5
+ r: number;
6
+ g: number;
7
+ b: number;
8
+ }
9
+ export declare const useSolidColorRenderer: ({ width, height, onFrame, r, g, b, }: UseSolidColorRendererProps) => readonly [boolean, () => void];
10
+ export {};
11
+ //# sourceMappingURL=use-solid-color-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-solid-color-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/use-solid-color-renderer.ts"],"names":[],"mappings":"AAIA,UAAU,0BAA0B;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,eAAO,MAAM,qBAAqB,yCAO/B,0BAA0B,mCAkB5B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { Renderer } from '../../../../models/models/canvas-dispatcher';
2
+
3
+ interface UseStreamableRendererProps {
4
+ renderer: Renderer | null;
5
+ width: number;
6
+ height: number;
7
+ fps: number;
8
+ durationMs?: number;
9
+ onFrame?: (rgba: Uint8ClampedArray) => void;
10
+ }
11
+ export declare function useStreamableRenderer({ renderer, width, height, fps, durationMs, onFrame, }: UseStreamableRendererProps): {
12
+ isStreaming: boolean;
13
+ startStreaming: () => void;
14
+ stopStreaming: () => void;
15
+ };
16
+ export {};
17
+ //# sourceMappingURL=use-streamable-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-streamable-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/use-streamable-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,QAAQ,EACT,MAAM,6CAA6C,CAAC;AAErD,UAAU,0BAA0B;IAClC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7C;AAMD,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,GAAG,EACH,UAAiB,EACjB,OAAO,GACR,EAAE,0BAA0B;;;;EAuF5B"}
@@ -0,0 +1,32 @@
1
+ interface UseSweepRendererProps {
2
+ width: number;
3
+ height: number;
4
+ fps: number;
5
+ durationMs?: number;
6
+ onFrame?: (rgba: Uint8ClampedArray) => void;
7
+ minHue?: number;
8
+ maxHue?: number;
9
+ speed?: number;
10
+ }
11
+ /**
12
+ * A custom hook that initializes and manages a `SweepRenderer` instance for rendering
13
+ * animations with configurable hue sweeps. It also integrates with a streamable renderer
14
+ * to handle streaming frames.
15
+ *
16
+ * @param {Object} props - The properties for configuring the sweep renderer.
17
+ * @param {number} props.width - The width of the rendering canvas.
18
+ * @param {number} props.height - The height of the rendering canvas.
19
+ * @param {number} props.fps - The frames per second for the rendering.
20
+ * @param {Function} props.onFrame - A callback function invoked on each frame render.
21
+ * @param {number} [props.durationMs=5000] - The total duration of the rendering in milliseconds.
22
+ * @param {number} [props.minHue=0] - The minimum hue value for the sweep.
23
+ * @param {number} [props.maxHue=360] - The maximum hue value for the sweep.
24
+ * @param {number} [props.speed=1] - The speed of the hue sweep animation.
25
+ *
26
+ * @returns {readonly [boolean, () => void]} A tuple containing:
27
+ * - `isStreaming` (boolean): Indicates whether the rendering is currently streaming.
28
+ * - `startStreaming` (Function): A function to start the rendering stream.
29
+ */
30
+ export declare const useSweepRenderer: ({ width, height, fps, onFrame, durationMs, minHue, maxHue, speed, }: UseSweepRendererProps) => readonly [boolean, () => void];
31
+ export {};
32
+ //# sourceMappingURL=use-sweep-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-sweep-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/use-sweep-renderer.ts"],"names":[],"mappings":"AAIA,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,wEAS1B,qBAAqB,mCAgBvB,CAAC"}
@@ -0,0 +1,22 @@
1
+ interface UseSwirlRendererProps {
2
+ width: number;
3
+ height: number;
4
+ fps: number;
5
+ onFrame?: (rgba: Uint8ClampedArray) => void;
6
+ }
7
+ /**
8
+ * Custom hook to initialize and manage a swirl video renderer.
9
+ *
10
+ * @param {UseSwirlRendererProps} props - The properties required to configure the swirl renderer.
11
+ * @param {number} props.width - The width of the video renderer.
12
+ * @param {number} props.height - The height of the video renderer.
13
+ * @param {number} props.fps - The frames per second for the video renderer.
14
+ * @param {Function} props.onFrame - Callback function invoked on each frame render.
15
+ *
16
+ * @returns {readonly [boolean, () => void]} A tuple containing:
17
+ * - `isStreaming` (boolean): Indicates whether the video renderer is currently streaming.
18
+ * - `startStreaming` (function): A function to start the video streaming process.
19
+ */
20
+ export declare const useSwirlRenderer: ({ width, height, fps, onFrame, }: UseSwirlRendererProps) => readonly [boolean, () => void];
21
+ export {};
22
+ //# sourceMappingURL=use-swirl-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-swirl-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/use-swirl-renderer.ts"],"names":[],"mappings":"AAEA,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7C;AACD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,qCAK1B,qBAAqB,mCAUvB,CAAC"}
@@ -0,0 +1,24 @@
1
+ interface UseVideoRendererProps {
2
+ width: number;
3
+ height: number;
4
+ fps: number;
5
+ onFrame?: (rgba: Uint8ClampedArray) => void;
6
+ src: string;
7
+ }
8
+ /**
9
+ * A custom hook that initializes and manages a video renderer for streaming video frames.
10
+ *
11
+ * @param {UseVideoRendererProps} props - The properties required to configure the video renderer.
12
+ * @param {number} props.width - The width of the video frame.
13
+ * @param {number} props.height - The height of the video frame.
14
+ * @param {number} props.fps - The frames per second for the video stream.
15
+ * @param {Function} props.onFrame - A callback function invoked for each rendered frame.
16
+ * @param {string} props.src - The source URL or path of the video to be rendered.
17
+ *
18
+ * @returns {readonly [boolean, () => void]} A tuple containing:
19
+ * - `isStreaming` (boolean): Indicates whether the video is currently streaming.
20
+ * - `startStreaming` (Function): A function to start the video streaming process.
21
+ */
22
+ export declare const useVideoRenderer: ({ width, height, fps, onFrame, src, }: UseVideoRendererProps) => readonly [boolean, () => void];
23
+ export {};
24
+ //# sourceMappingURL=use-video-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-video-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/hooks/use-video-renderer.ts"],"names":[],"mappings":"AAIA,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,GAAG,EAAE,MAAM,CAAC;CACb;AACD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,0CAM1B,qBAAqB,mCAWvB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Encodes an RGBA frame into a specified format.
3
+ *
4
+ * @param rgba - A `Uint8ClampedArray` containing the RGBA pixel data of the frame.
5
+ * @param format - The desired output format. Can be either `'base64'` or `'rgb332'`.
6
+ * - `'base64'`: Encodes the frame as a Base64 string.
7
+ * - `'rgb332'`: Encodes the frame using the RGB332 color format.
8
+ * @param stripAlpha - A boolean indicating whether to exclude the alpha channel
9
+ * from the encoding. If `true`, the alpha channel is removed.
10
+
11
+ * @returns A string representing the encoded frame in the specified format.
12
+ */
13
+ export declare function encodeFrame(rgba: Uint8ClampedArray, format: "base64" | "rgb332", stripAlpha: boolean): string;
14
+ //# sourceMappingURL=encode-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encode-frame.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/utils/encode-frame.tsx"],"names":[],"mappings":"AAgBA;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAC3B,UAAU,EAAE,OAAO,GAClB,MAAM,CAaR"}
@@ -0,0 +1,29 @@
1
+ export declare const decodeBase64RGB: (base64: string, width: number, height: number) => Uint8ClampedArray;
2
+ export declare const decodeRGB332: (data: string, width: number, height: number) => Uint8ClampedArray;
3
+ /**
4
+ * Renders a decoded preview onto a canvas context by decoding image data
5
+ * from a specified format and scaling it to the desired size.
6
+ *
7
+ * @param ctx - The 2D rendering context of the target canvas.
8
+ * @param format - The format of the input data string. Can be either 'base64' or 'rgb332'.
9
+ * @param dataString - The encoded image data as a string.
10
+ * @param width - The width of the image in pixels.
11
+ * @param height - The height of the image in pixels.
12
+ * @param pixelSize - The scaling factor for each pixel in the rendered image.
13
+ *
14
+ * @remarks
15
+ * - If `format` is 'base64', the `dataString` is decoded using `decodeBase64RGB`.
16
+ * - If `format` is 'rgb332', the `dataString` is decoded using `decodeRGB332`.
17
+ * - The function creates a temporary canvas to decode and render the image data
18
+ * before scaling it onto the target canvas.
19
+ * - Image smoothing is disabled to preserve the pixelated appearance of the image.
20
+ */
21
+ export declare function renderDecodedPreview({ ctx, format, dataString, width, height, pixelSize, }: {
22
+ ctx: CanvasRenderingContext2D;
23
+ format: "base64" | "rgb332";
24
+ dataString: string;
25
+ width: number;
26
+ height: number;
27
+ pixelSize: number;
28
+ }): void;
29
+ //# sourceMappingURL=preview-decoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-decoder.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/ui/features/canvas/utils/preview-decoder.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,WAClB,MAAM,SACP,MAAM,UACL,MAAM,KACb,iBAUF,CAAC;AAEF,eAAO,MAAM,YAAY,SACjB,MAAM,SACL,MAAM,UACL,MAAM,KACb,iBAcF,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,GAAG,EACH,MAAM,EACN,UAAU,EACV,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE;IACD,GAAG,EAAE,wBAAwB,CAAC;IAC9B,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,QAeA"}