@touchcastllc/napster-companion-api-dev 1.0.0-alpha.43

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 (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +830 -0
  3. package/lib/components/Avatar/index.d.ts +35 -0
  4. package/lib/components/Embed/index.d.ts +25 -0
  5. package/lib/components/InactiveOverlay/index.d.ts +15 -0
  6. package/lib/components/Preview/index.d.ts +18 -0
  7. package/lib/components/StyledTooltip/index.d.ts +16 -0
  8. package/lib/components/VolumeControl/index.d.ts +18 -0
  9. package/lib/components/WaveForm/index.d.ts +19 -0
  10. package/lib/components/index.d.ts +2 -0
  11. package/lib/constants/events.d.ts +52 -0
  12. package/lib/constants/greenscreen.d.ts +28 -0
  13. package/lib/constants/index.d.ts +6 -0
  14. package/lib/constants/waveform.d.ts +34 -0
  15. package/lib/index.css +1 -0
  16. package/lib/index.d.ts +34 -0
  17. package/lib/index.esm.js +1 -0
  18. package/lib/index.js +1 -0
  19. package/lib/index.standalone.js +1 -0
  20. package/lib/services/analytics.d.ts +148 -0
  21. package/lib/services/faceTracking.d.ts +13 -0
  22. package/lib/services/screenShare.d.ts +15 -0
  23. package/lib/services/webrtc.d.ts +29 -0
  24. package/lib/setupTests.d.ts +1 -0
  25. package/lib/stores/index.d.ts +8 -0
  26. package/lib/stores/middleware/featuresUpdateMiddleware.d.ts +4 -0
  27. package/lib/stores/selectors.d.ts +30 -0
  28. package/lib/stores/slices/appSlice.d.ts +12 -0
  29. package/lib/stores/slices/avatarSlice.d.ts +26 -0
  30. package/lib/stores/store.d.ts +11 -0
  31. package/lib/types/abstract-typing.d.ts +35 -0
  32. package/lib/types/analytics.d.ts +95 -0
  33. package/lib/types/errors.d.ts +143 -0
  34. package/lib/types/index.d.ts +354 -0
  35. package/lib/umd.d.ts +1 -0
  36. package/lib/utils/InactiveOverlayManager.d.ts +77 -0
  37. package/lib/utils/MediaCapture.d.ts +13 -0
  38. package/lib/utils/classnames.d.ts +50 -0
  39. package/lib/utils/debug.d.ts +84 -0
  40. package/lib/utils/domFactory.d.ts +56 -0
  41. package/lib/utils/greenscreen/GreenScreenProcessor.d.ts +25 -0
  42. package/lib/utils/greenscreen/index.d.ts +1 -0
  43. package/lib/utils/index.d.ts +25 -0
  44. package/lib/utils/mouthDetection.d.ts +33 -0
  45. package/lib/utils/sendCommand.d.ts +2 -0
  46. package/lib/utils/svg.d.ts +34 -0
  47. package/package.json +56 -0
@@ -0,0 +1,25 @@
1
+ import { FeatureConfig } from "../types";
2
+ export * from "./classnames";
3
+ export * from "./domFactory";
4
+ export * from "./greenscreen";
5
+ export * from "./svg";
6
+ export * from "./sendCommand";
7
+ export * from "./MediaCapture";
8
+ export interface DecodedBase64TokenType {
9
+ connection: {
10
+ id: string;
11
+ signalingEndpoint: string;
12
+ };
13
+ expiresAt: string;
14
+ }
15
+ export declare const decodeBase64: (str: string) => DecodedBase64TokenType | null;
16
+ /**
17
+ * Validates and adjusts the feature configuration as needed.
18
+ * Specifically checks for the inactiveTimeout feature to ensure
19
+ * the duration does not exceed the maximum allowed value.
20
+ *
21
+ * @param featureName - The name of the feature to validate.
22
+ * @param config - The configuration object for the feature.
23
+ * @returns The validated and possibly adjusted configuration object.
24
+ */
25
+ export declare const validateFeaturesConfig: (featureName: keyof FeatureConfig, config: FeatureConfig[keyof FeatureConfig]) => FeatureConfig[keyof FeatureConfig];
@@ -0,0 +1,33 @@
1
+ import type { MouthLandmarks } from "../types";
2
+ /**
3
+ * MediaPipe Face Mesh landmark indices for mouth detection.
4
+ */
5
+ export declare const MOUTH_LANDMARK_INDICES: {
6
+ readonly upperLip: 13;
7
+ readonly lowerLip: 14;
8
+ readonly leftCorner: 61;
9
+ readonly rightCorner: 291;
10
+ };
11
+ /**
12
+ * Creates a rolling average smoother for mouth-opening ratios.
13
+ */
14
+ export declare function createMouthOpeningSmoothing(windowSize?: number): {
15
+ push(value: number): number;
16
+ reset(): void;
17
+ };
18
+ /**
19
+ * Calculates mouth opening ratio and normalized mouth landmarks from raw keypoints.
20
+ *
21
+ * @param keypoints - Raw face mesh keypoints (pixel coordinates)
22
+ * @param videoWidth - Video width for normalization
23
+ * @param videoHeight - Video height for normalization
24
+ * @returns Mouth landmarks (normalized 0–1) and raw opening ratio, or null if landmarks are missing
25
+ */
26
+ export declare function calculateMouthOpening(keypoints: Array<{
27
+ x: number;
28
+ y: number;
29
+ z?: number;
30
+ }>, videoWidth: number, videoHeight: number): {
31
+ mouthLandmarks: MouthLandmarks;
32
+ openingRatio: number;
33
+ } | null;
@@ -0,0 +1,2 @@
1
+ import type { DataChannelCommand } from "../types";
2
+ export declare const sendCommand: (command: DataChannelCommand) => boolean;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * SVG utility class for creating SVG elements programmatically
3
+ */
4
+ export interface SVGElementConfig {
5
+ tag: string;
6
+ attributes?: Record<string, string | number>;
7
+ children?: SVGElementConfig[];
8
+ textContent?: string;
9
+ }
10
+ export declare class SVGBuilder {
11
+ private readonly svgNS;
12
+ /**
13
+ * Create an SVG element from configuration
14
+ */
15
+ createElement(config: SVGElementConfig): SVGElement;
16
+ /**
17
+ * Create a complete SVG with viewBox and children
18
+ */
19
+ createSVG(width: number | string, height: number | string, viewBox: string, children: SVGElementConfig[], className?: string): SVGSVGElement;
20
+ }
21
+ export declare const svgBuilder: SVGBuilder;
22
+ /**
23
+ * Predefined SVG icons for WaveForm component
24
+ */
25
+ export declare const WaveFormIcons: {
26
+ micUnmuted(): SVGSVGElement;
27
+ micMuted(): SVGSVGElement;
28
+ stop(): SVGSVGElement;
29
+ volumeHigh(level: number): SVGSVGElement;
30
+ volumeMuted(): SVGSVGElement;
31
+ screenShare(): SVGSVGElement;
32
+ screenShareActive(): SVGSVGElement;
33
+ end(): SVGSVGElement;
34
+ };
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@touchcastllc/napster-companion-api-dev",
3
+ "version": "1.0.0-alpha.43",
4
+ "keywords": [
5
+ "napster",
6
+ "companion-api",
7
+ "typescript",
8
+ "sdk",
9
+ "AI-powered",
10
+ "realtime",
11
+ "avatar",
12
+ "webrtc"
13
+ ],
14
+ "license": "MIT",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./lib/index.d.ts",
18
+ "browser": "./lib/index.esm.js",
19
+ "import": "./lib/index.esm.js",
20
+ "require": "./lib/index.js",
21
+ "default": "./lib/index.esm.js"
22
+ },
23
+ "./styles": "./lib/index.css"
24
+ },
25
+ "typesVersions": {
26
+ "*": {
27
+ "core": [
28
+ "lib/core/index.d.ts"
29
+ ]
30
+ }
31
+ },
32
+ "main": "lib/index.js",
33
+ "module": "lib/index.esm.js",
34
+ "types": "lib/index.d.ts",
35
+ "files": [
36
+ "lib/**/*",
37
+ "!lib/**/*.test.*",
38
+ "!lib/**/*.spec.*"
39
+ ],
40
+ "peerDependencies": {
41
+ "@reduxjs/toolkit": "^2.0.0",
42
+ "@tensorflow-models/face-landmarks-detection": "^1.0.0",
43
+ "@tensorflow/tfjs": "^4.0.0"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "@tensorflow/tfjs": {
47
+ "optional": true
48
+ },
49
+ "@tensorflow-models/face-landmarks-detection": {
50
+ "optional": true
51
+ }
52
+ },
53
+ "publishConfig": {
54
+ "access": "public"
55
+ }
56
+ }