@viji-dev/core 0.2.3 → 0.2.5

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/LICENSE ADDED
@@ -0,0 +1,12 @@
1
+ Copyright (c) 2025 Artem Verkhovskiy and Dmitry Manoilenko.
2
+ All rights reserved.
3
+
4
+ Permission is granted to install and use this software only for the purpose
5
+ of developing and running creative scenes within the VIJI platform environment.
6
+
7
+ Commercial use, redistribution, or integration of this software into external
8
+ applications, platforms, or services is strictly prohibited without prior written
9
+ permission from the copyright holders.
10
+
11
+ This license does not grant any rights to copy, modify, sublicense, or
12
+ commercialize the VIJI Core, nor to use the VIJI name or brand without permission.
package/README.md CHANGED
@@ -269,10 +269,10 @@ core.onParameterError((error) => {
269
269
  #### Capability-Aware Parameters
270
270
 
271
271
  ```typescript
272
- // Get all parameter groups
273
- const allGroups = core.getParameterGroups();
272
+ // Get all parameter groups (unfiltered, use for saving scene parameters)
273
+ const allGroups = core.getAllParameterGroups();
274
274
 
275
- // Get parameter groups filtered by active capabilities
275
+ // Get parameter groups filtered by active capabilities (for UI)
276
276
  const visibleGroups = core.getVisibleParameterGroups();
277
277
 
278
278
  // Check current capabilities
@@ -1184,11 +1184,13 @@ Use the core directly in custom applications for creative scene rendering with f
1184
1184
 
1185
1185
  ## 📄 License
1186
1186
 
1187
- MIT License - see LICENSE file for details.
1187
+ Copyright (c) 2025 Artem Verkhovskiy and Dmitry Manoilenko.
1188
+ All rights reserved - see the LICENSE file for details.
1188
1189
 
1189
- ## 🤝 Contributing
1190
+ ## Contributor License Agreement
1190
1191
 
1191
- The Viji Core package is part of the larger Viji Creative SDK ecosystem. For contribution guidelines and development setup, please refer to the main Viji project documentation.
1192
+ By contributing, you agree to the [CLA](./CLA.md).
1193
+ Please also confirm your agreement by filling out this short [form](https://forms.gle/A49WTz8nj5b99Yev7).
1192
1194
 
1193
1195
  ---
1194
1196
 
@@ -1 +1 @@
1
- export const artistDts = "declare namespace VijiCore {\ndeclare interface AnalysisConfiguration {\r\n fftSize?: number;\r\n smoothing?: number;\r\n frequencyBands?: FrequencyBand[];\r\n beatDetection?: boolean;\r\n onsetDetection?: boolean;\r\n}\r\n\r\ndeclare interface AudioAPI {\r\n isConnected: boolean;\r\n volume: {\r\n rms: number;\r\n peak: number;\r\n };\r\n beat?: {\r\n isKick: boolean;\r\n confidence: number;\r\n };\r\n bands: Record<string, number>;\r\n getFrequencyData: () => Uint8Array;\r\n}\r\n\r\ndeclare interface CaptureFrameOptions {\r\n /** MIME type for output, e.g., 'image/png', 'image/jpeg', 'image/webp' */\r\n type?: string;\r\n /**\r\n * Target resolution.\r\n * - number: scale factor relative to current canvas size (e.g., 0.5 = 50%)\r\n * - { width, height }: exact output size; if aspect ratio differs from canvas,\r\n * the source is center-cropped to match the target aspect ratio before scaling\r\n */\r\n resolution?: number | {\r\n width: number;\r\n height: number;\r\n };\r\n}\r\n\r\ndeclare interface ColorConfig {\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n}\r\n\r\ndeclare interface ColorParameter {\r\n value: string;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n}\r\n\r\ndeclare interface CoreCapabilities {\r\n /** Audio input is active and connected */\r\n hasAudio: boolean;\r\n /** Video input is active and connected */\r\n hasVideo: boolean;\r\n /** User interactions (mouse, touch, keyboard) are enabled */\r\n hasInteraction: boolean;\r\n /** General parameters are always available */\r\n hasGeneral: boolean;\r\n}\r\n\r\ndeclare interface FaceData {\r\n bounds: {\r\n x: number;\r\n y: number;\r\n width: number;\r\n height: number;\r\n };\r\n confidence: number;\r\n landmarks: {\r\n x: number;\r\n y: number;\r\n }[];\r\n expressions: Record<string, number>;\r\n}\r\n\r\ndeclare interface FrameRateInfo {\r\n mode: FrameRateMode;\r\n screenRefreshRate: number;\r\n effectiveRefreshRate: number;\r\n}\r\n\r\ndeclare type FrameRateMode = 'full' | 'half';\r\n\r\ndeclare interface FrequencyBand {\r\n name: string;\r\n min: number;\r\n max: number;\r\n}\r\n\r\ndeclare interface HandData {\r\n palm: {\r\n x: number;\r\n y: number;\r\n };\r\n fingers: {\r\n x: number;\r\n y: number;\r\n }[];\r\n gestures: Record<string, boolean>;\r\n}\r\n\r\ndeclare interface KeyboardAPI {\r\n isPressed(key: string): boolean;\r\n wasPressed(key: string): boolean;\r\n wasReleased(key: string): boolean;\r\n activeKeys: Set<string>;\r\n pressedThisFrame: Set<string>;\r\n releasedThisFrame: Set<string>;\r\n lastKeyPressed: string;\r\n lastKeyReleased: string;\r\n shift: boolean;\r\n ctrl: boolean;\r\n alt: boolean;\r\n meta: boolean;\r\n}\r\n\r\ndeclare interface MouseAPI {\r\n x: number;\r\n y: number;\r\n isInCanvas: boolean;\r\n isPressed: boolean;\r\n leftButton: boolean;\r\n rightButton: boolean;\r\n middleButton: boolean;\r\n velocity: {\r\n x: number;\r\n y: number;\r\n };\r\n deltaX: number;\r\n deltaY: number;\r\n wheelDelta: number;\r\n wheelX: number;\r\n wheelY: number;\r\n wasPressed: boolean;\r\n wasReleased: boolean;\r\n wasMoved: boolean;\r\n}\r\n\r\ndeclare interface NumberConfig {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n}\r\n\r\ndeclare interface NumberParameter {\r\n value: number;\r\n min: number;\r\n max: number;\r\n step: number;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n}\r\n\r\ndeclare interface ParameterAPI {\r\n define(groups: ParameterGroup[]): void;\r\n [key: string]: any;\r\n}\r\n\r\ndeclare type ParameterCategory = 'audio' | 'video' | 'interaction' | 'general';\r\n\r\ndeclare interface ParameterConfig {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n options?: string[] | number[];\r\n maxLength?: number;\r\n label?: string;\r\n description?: string;\r\n hidden?: boolean;\r\n precision?: number;\r\n}\r\n\r\ndeclare interface ParameterDefinition {\r\n type: 'slider' | 'color' | 'toggle' | 'select' | 'text' | 'number';\r\n defaultValue: any;\r\n label?: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n config?: ParameterConfig;\r\n validate?: (value: any) => boolean;\r\n}\r\n\r\ndeclare interface ParameterGroup {\r\n groupName: string;\r\n category?: ParameterCategory;\r\n description?: string;\r\n collapsed?: boolean;\r\n order?: number;\r\n parameters: Record<string, ParameterDefinition>;\r\n}\r\n\r\ndeclare type ParameterValue = string | number | boolean;\r\n\r\ndeclare interface PerformanceStats {\r\n frameTime: number;\r\n resolution: Resolution;\r\n scale: number;\r\n frameRate: FrameRateInfo;\r\n memoryUsage?: number;\r\n activeStreams?: number;\r\n parameterCount?: number;\r\n}\r\n\r\ndeclare type Resolution = {\r\n width: number;\r\n height: number;\r\n};\r\n\r\ndeclare interface SelectConfig {\r\n options: string[] | number[];\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n}\r\n\r\ndeclare interface SelectParameter {\r\n value: string | number;\r\n options: string[] | number[];\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n}\r\n\r\ndeclare interface SliderConfig {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n}\r\n\r\ndeclare interface SliderParameter {\r\n value: number;\r\n min: number;\r\n max: number;\r\n step: number;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n}\r\n\r\ndeclare interface TextConfig {\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n maxLength?: number;\r\n}\r\n\r\ndeclare interface TextParameter {\r\n value: string;\r\n maxLength?: number;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n}\r\n\r\ndeclare interface ToggleConfig {\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n}\r\n\r\ndeclare interface ToggleParameter {\r\n value: boolean;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n}\r\n\r\ndeclare interface TouchAPI {\r\n points: TouchPoint[];\r\n count: number;\r\n started: TouchPoint[];\r\n moved: TouchPoint[];\r\n ended: TouchPoint[];\r\n primary: TouchPoint | null;\r\n gestures: TouchGestureAPI;\r\n}\r\n\r\ndeclare interface TouchGestureAPI {\r\n isPinching: boolean;\r\n isRotating: boolean;\r\n isPanning: boolean;\r\n isTapping: boolean;\r\n pinchScale: number;\r\n pinchDelta: number;\r\n rotationAngle: number;\r\n rotationDelta: number;\r\n panDelta: {\r\n x: number;\r\n y: number;\r\n };\r\n tapCount: number;\r\n lastTapTime: number;\r\n tapPosition: {\r\n x: number;\r\n y: number;\r\n } | null;\r\n}\r\n\r\ndeclare interface TouchPoint {\r\n id: number;\r\n x: number;\r\n y: number;\r\n pressure: number;\r\n radius: number;\r\n radiusX: number;\r\n radiusY: number;\r\n rotationAngle: number;\r\n force: number;\r\n deltaX: number;\r\n deltaY: number;\r\n velocity: {\r\n x: number;\r\n y: number;\r\n };\r\n isNew: boolean;\r\n isActive: boolean;\r\n isEnding: boolean;\r\n}\r\n\r\ndeclare const VERSION = \"0.2.2\";\r\n\r\ndeclare interface VideoAPI {\r\n isConnected: boolean;\r\n currentFrame: OffscreenCanvas | null;\r\n frameWidth: number;\r\n frameHeight: number;\r\n frameRate: number;\r\n getFrameData: () => ImageData | null;\r\n faces: FaceData[];\r\n hands: HandData[];\r\n}\r\n\r\ndeclare interface VijiAPI {\r\n canvas: OffscreenCanvas;\r\n ctx?: OffscreenCanvasRenderingContext2D;\r\n gl?: WebGL2RenderingContext;\r\n width: number;\r\n height: number;\r\n pixelRatio: number;\r\n time: number;\r\n deltaTime: number;\r\n frameCount: number;\r\n fps: number;\r\n audio: AudioAPI;\r\n video: VideoAPI;\r\n mouse: MouseAPI;\r\n keyboard: KeyboardAPI;\r\n touches: TouchAPI[];\r\n slider: (defaultValue: number, config: SliderConfig) => SliderParameter;\r\n color: (defaultValue: string, config: ColorConfig) => ColorParameter;\r\n toggle: (defaultValue: boolean, config: ToggleConfig) => ToggleParameter;\r\n select: (defaultValue: string | number, config: SelectConfig) => SelectParameter;\r\n text: (defaultValue: string, config: TextConfig) => TextParameter;\r\n number: (defaultValue: number, config: NumberConfig) => NumberParameter;\r\n useContext(type: '2d' | 'webgl'): OffscreenCanvasRenderingContext2D | WebGLRenderingContext | WebGL2RenderingContext | null;\r\n}\r\n\r\n/**\r\n * Main VijiCore class - Universal execution engine for creative scenes.\r\n *\r\n * Orchestrates secure IFrame + WebWorker execution with controlled communication.\r\n * Provides the foundation for scene execution across platform and SDK contexts.\r\n */\r\ndeclare class VijiCore {\r\n private iframeManager;\r\n private workerManager;\r\n private interactionManager;\r\n private audioSystem;\r\n private videoCoordinator;\r\n private isInitialized;\r\n private isDestroyed;\r\n private isInitializing;\r\n private instanceId;\r\n private screenRefreshRate;\r\n private debugMode;\r\n /**\r\n * Debug logging helper\r\n */\r\n private debugLog;\r\n private config;\r\n private currentAudioStream;\r\n private currentVideoStream;\r\n private currentInteractionEnabled;\r\n private parameterGroups;\r\n private parameterValues;\r\n private parametersInitialized;\r\n private parameterListeners;\r\n private parameterDefinedListeners;\r\n private parameterErrorListeners;\r\n private capabilitiesChangeListeners;\r\n private stats;\r\n constructor(config: VijiCoreConfig);\r\n /**\r\n * Capture current scene frame as an image Blob.\r\n * Resolution can be a scale (0-1+) or explicit width/height with center-crop.\r\n */\r\n captureFrame(options?: CaptureFrameOptions): Promise<Blob>;\r\n /**\r\n * Enable or disable debug logging\r\n */\r\n setDebugMode(enabled: boolean): void;\r\n /**\r\n * Get current debug mode status\r\n */\r\n getDebugMode(): boolean;\r\n /**\r\n * Initializes the core components in sequence\r\n */\r\n initialize(): Promise<void>;\r\n /**\r\n * Creates canvas with retry logic to handle timing issues\r\n */\r\n private createCanvasWithRetry;\r\n /**\r\n * Sets up the interaction system for Phase 7\r\n */\r\n private setupInteractionSystem;\r\n /**\r\n * Sets up communication between components\r\n */\r\n private setupCommunication;\r\n /**\r\n * Handle parameter definitions received from worker\r\n */\r\n private handleParametersDefined;\r\n /**\r\n * Handle parameter validation errors\r\n */\r\n private handleParameterError;\r\n /**\r\n * Set a single parameter value\r\n */\r\n setParameter(name: string, value: ParameterValue): Promise<void>;\r\n /**\r\n * Set multiple parameter values efficiently\r\n */\r\n setParameters(values: Record<string, ParameterValue>): Promise<void>;\r\n /**\r\n * Get current parameter value\r\n */\r\n getParameter(name: string): ParameterValue | undefined;\r\n /**\r\n * Get all current parameter values\r\n */\r\n getParameterValues(): Record<string, ParameterValue>;\r\n /**\r\n * Get parameter groups (for UI generation)\r\n */\r\n getParameterGroups(): ParameterGroup[];\r\n /**\r\n * Get current core capabilities (what's currently active)\r\n */\r\n getCapabilities(): CoreCapabilities;\r\n /**\r\n * Get parameter groups filtered by active capabilities\r\n */\r\n getVisibleParameterGroups(): ParameterGroup[];\r\n /**\r\n * Check if a specific parameter category is currently active\r\n */\r\n isCategoryActive(category: ParameterCategory): boolean;\r\n /**\r\n * Check if parameters have been initialized\r\n */\r\n get parametersReady(): boolean;\r\n /**\r\n * Send all current parameter values to worker (used for initial sync)\r\n */\r\n private syncAllParametersToWorker;\r\n /**\r\n * Add listener for when parameters are defined\r\n */\r\n onParametersDefined(listener: (groups: ParameterGroup[]) => void): void;\r\n /**\r\n * Remove parameter defined listener\r\n */\r\n offParametersDefined(listener: (groups: ParameterGroup[]) => void): void;\r\n /**\r\n * Add listener for parameter value changes\r\n */\r\n onParameterChange(parameterName: string, listener: (value: ParameterValue) => void): void;\r\n /**\r\n * Remove parameter change listener\r\n */\r\n offParameterChange(parameterName: string, listener: (value: ParameterValue) => void): void;\r\n /**\r\n * Add listener for parameter errors\r\n */\r\n onParameterError(listener: (error: {\r\n message: string;\r\n code: string;\r\n }) => void): void;\r\n /**\r\n * Add listener for when core capabilities change (audio/video/interaction state)\r\n */\r\n onCapabilitiesChange(listener: (capabilities: CoreCapabilities) => void): void;\r\n /**\r\n * Remove capabilities change listener\r\n */\r\n removeCapabilitiesListener(listener: (capabilities: CoreCapabilities) => void): void;\r\n /**\r\n * Notify capability change listeners\r\n */\r\n private notifyCapabilitiesChange;\r\n /**\r\n * Remove parameter error listener\r\n */\r\n offParameterError(listener: (error: {\r\n message: string;\r\n code: string;\r\n }) => void): void;\r\n /**\r\n * Notify parameter change listeners\r\n */\r\n private notifyParameterListeners;\r\n /**\r\n * Sets the frame rate to full speed (every animation frame)\r\n */\r\n setFullFrameRate(): Promise<void>;\r\n /**\r\n * Sets the frame rate to half speed (every second animation frame)\r\n */\r\n setHalfFrameRate(): Promise<void>;\r\n /**\r\n * Updates the canvas resolution by sending effective dimensions to the worker\r\n */\r\n updateResolution(): void;\r\n /**\r\n * Sets the audio stream for analysis\r\n */\r\n setAudioStream(audioStream: MediaStream | null): Promise<void>;\r\n /**\r\n * Sets the video stream for processing\r\n */\r\n setVideoStream(videoStream: MediaStream | null): Promise<void>;\r\n /**\r\n * Gets the current audio stream\r\n */\r\n getAudioStream(): MediaStream | null;\r\n /**\r\n * Gets the current video stream\r\n */\r\n getVideoStream(): MediaStream | null;\r\n /**\r\n * Enables or disables user interactions (mouse, keyboard, touch) at runtime\r\n */\r\n setInteractionEnabled(enabled: boolean): Promise<void>;\r\n /**\r\n * Gets the current interaction enabled state\r\n */\r\n getInteractionEnabled(): boolean;\r\n /**\r\n * Updates audio analysis configuration\r\n */\r\n setAudioAnalysisConfig(config: {\r\n fftSize?: number;\r\n smoothing?: number;\r\n }): Promise<void>;\r\n /**\r\n * Updates the canvas resolution by scale\r\n */\r\n setResolution(scale: number): void;\r\n /**\r\n * Detects the screen refresh rate\r\n */\r\n private detectScreenRefreshRate;\r\n /**\r\n * Updates frame rate statistics\r\n */\r\n private updateFrameRateStats;\r\n /**\r\n * Gets current performance statistics\r\n */\r\n getStats(): PerformanceStats;\r\n /**\r\n * Checks if the core is ready for use\r\n */\r\n get ready(): boolean;\r\n /**\r\n * Gets the current configuration\r\n */\r\n get configuration(): Readonly<VijiCoreConfig>;\r\n /**\r\n * Destroys the core instance and cleans up all resources\r\n */\r\n destroy(): Promise<void>;\r\n /**\r\n * Validates that the core is ready for operations\r\n */\r\n private validateReady;\r\n /**\r\n * Validates the provided configuration\r\n */\r\n private validateConfig;\r\n /**\r\n * Cleans up all resources\r\n */\r\n private cleanup;\r\n}\r\n\r\ndeclare interface VijiCoreConfig {\r\n /** Container element where the scene will be rendered */\r\n hostContainer: HTMLElement;\r\n /** Artist scene code to execute */\r\n sceneCode: string;\r\n /** Frame rate mode - 'full' for every animation frame, 'half' for every second frame */\r\n frameRateMode?: FrameRateMode;\r\n /** Enable automatic performance optimization */\r\n autoOptimize?: boolean;\r\n /** Audio input stream */\r\n audioStream?: MediaStream;\r\n /** Video input stream */\r\n videoStream?: MediaStream;\r\n /** Audio analysis configuration */\r\n analysisConfig?: AnalysisConfiguration;\r\n /** Initial parameter values */\r\n parameters?: ParameterGroup[];\r\n /** Disable input processing (for preview instances) */\r\n noInputs?: boolean;\r\n /** Enable user interaction events */\r\n allowUserInteraction?: boolean;\r\n}\r\n\r\ndeclare class VijiCoreError extends Error {\r\n code: string;\r\n context?: any | undefined;\r\n constructor(message: string, code: string, context?: any | undefined);\r\n}\r\n\r\n{ }\r\n\n}\n\n// Global artist runtime symbols for editor IntelliSense\ndeclare const viji: VijiCore.ArtistAPI;\ndeclare function render(viji: VijiCore.ArtistAPI): void;\n";
1
+ export const artistDts = "declare namespace VijiCore {\n declare interface AnalysisConfiguration {\r\n fftSize?: number;\r\n smoothing?: number;\r\n frequencyBands?: FrequencyBand[];\r\n beatDetection?: boolean;\r\n onsetDetection?: boolean;\r\n }\r\n\n declare interface AudioAPI {\r\n isConnected: boolean;\r\n volume: {\r\n rms: number;\r\n peak: number;\r\n };\r\n beat?: {\r\n isKick: boolean;\r\n confidence: number;\r\n };\r\n bands: Record<string, number>;\r\n getFrequencyData: () => Uint8Array;\r\n }\r\n\n declare interface CaptureFrameOptions {\r\n /** MIME type for output, e.g., 'image/png', 'image/jpeg', 'image/webp' */\r\n type?: string;\r\n /**\r\n * Target resolution.\r\n * - number: scale factor relative to current canvas size (e.g., 0.5 = 50%)\r\n * - { width, height }: exact output size; if aspect ratio differs from canvas,\r\n * the source is center-cropped to match the target aspect ratio before scaling\r\n */\r\n resolution?: number | {\r\n width: number;\r\n height: number;\r\n };\r\n }\r\n\n declare interface ColorConfig {\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n }\r\n\n declare interface ColorParameter {\r\n value: string;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n }\r\n\n declare interface FaceData {\r\n bounds: {\r\n x: number;\r\n y: number;\r\n width: number;\r\n height: number;\r\n };\r\n confidence: number;\r\n landmarks: {\r\n x: number;\r\n y: number;\r\n }[];\r\n expressions: Record<string, number>;\r\n }\r\n\n declare type FrameRateMode = 'full' | 'half';\r\n\n declare interface FrequencyBand {\r\n name: string;\r\n min: number;\r\n max: number;\r\n }\r\n\n declare interface HandData {\r\n palm: {\r\n x: number;\r\n y: number;\r\n };\r\n fingers: {\r\n x: number;\r\n y: number;\r\n }[];\r\n gestures: Record<string, boolean>;\r\n }\r\n\n declare interface KeyboardAPI {\r\n isPressed(key: string): boolean;\r\n wasPressed(key: string): boolean;\r\n wasReleased(key: string): boolean;\r\n activeKeys: Set<string>;\r\n pressedThisFrame: Set<string>;\r\n releasedThisFrame: Set<string>;\r\n lastKeyPressed: string;\r\n lastKeyReleased: string;\r\n shift: boolean;\r\n ctrl: boolean;\r\n alt: boolean;\r\n meta: boolean;\r\n }\r\n\n declare interface MouseAPI {\r\n x: number;\r\n y: number;\r\n isInCanvas: boolean;\r\n isPressed: boolean;\r\n leftButton: boolean;\r\n rightButton: boolean;\r\n middleButton: boolean;\r\n velocity: {\r\n x: number;\r\n y: number;\r\n };\r\n deltaX: number;\r\n deltaY: number;\r\n wheelDelta: number;\r\n wheelX: number;\r\n wheelY: number;\r\n wasPressed: boolean;\r\n wasReleased: boolean;\r\n wasMoved: boolean;\r\n }\r\n\n declare interface NumberConfig {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n }\r\n\n declare interface NumberParameter {\r\n value: number;\r\n min: number;\r\n max: number;\r\n step: number;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n }\r\n\n declare type ParameterCategory = 'audio' | 'video' | 'interaction' | 'general';\r\n\n declare type Resolution = {\r\n width: number;\r\n height: number;\r\n };\r\n\n declare interface SelectConfig {\r\n options: string[] | number[];\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n }\r\n\n declare interface SelectParameter {\r\n value: string | number;\r\n options: string[] | number[];\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n }\r\n\n declare interface SliderConfig {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n }\r\n\n declare interface SliderParameter {\r\n value: number;\r\n min: number;\r\n max: number;\r\n step: number;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n }\r\n\n declare interface TextConfig {\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n maxLength?: number;\r\n }\r\n\n declare interface TextParameter {\r\n value: string;\r\n maxLength?: number;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n }\r\n\n declare interface ToggleConfig {\r\n label: string;\r\n description?: string;\r\n group?: string;\r\n category?: ParameterCategory;\r\n }\r\n\n declare interface ToggleParameter {\r\n value: boolean;\r\n label: string;\r\n description?: string;\r\n group: string;\r\n category: ParameterCategory;\r\n }\r\n\n declare interface TouchAPI {\r\n points: TouchPoint[];\r\n count: number;\r\n started: TouchPoint[];\r\n moved: TouchPoint[];\r\n ended: TouchPoint[];\r\n primary: TouchPoint | null;\r\n gestures: TouchGestureAPI;\r\n }\r\n\n declare interface TouchGestureAPI {\r\n isPinching: boolean;\r\n isRotating: boolean;\r\n isPanning: boolean;\r\n isTapping: boolean;\r\n pinchScale: number;\r\n pinchDelta: number;\r\n rotationAngle: number;\r\n rotationDelta: number;\r\n panDelta: {\r\n x: number;\r\n y: number;\r\n };\r\n tapCount: number;\r\n lastTapTime: number;\r\n tapPosition: {\r\n x: number;\r\n y: number;\r\n } | null;\r\n }\r\n\n declare interface TouchPoint {\r\n id: number;\r\n x: number;\r\n y: number;\r\n pressure: number;\r\n radius: number;\r\n radiusX: number;\r\n radiusY: number;\r\n rotationAngle: number;\r\n force: number;\r\n deltaX: number;\r\n deltaY: number;\r\n velocity: {\r\n x: number;\r\n y: number;\r\n };\r\n isNew: boolean;\r\n isActive: boolean;\r\n isEnding: boolean;\r\n }\r\n\n declare const VERSION = \"0.2.4\";\r\n\n declare interface VideoAPI {\r\n isConnected: boolean;\r\n currentFrame: OffscreenCanvas | null;\r\n frameWidth: number;\r\n frameHeight: number;\r\n frameRate: number;\r\n getFrameData: () => ImageData | null;\r\n faces: FaceData[];\r\n hands: HandData[];\r\n }\r\n\n declare interface VijiAPI {\r\n canvas: OffscreenCanvas;\r\n ctx?: OffscreenCanvasRenderingContext2D;\r\n gl?: WebGL2RenderingContext;\r\n width: number;\r\n height: number;\r\n pixelRatio: number;\r\n time: number;\r\n deltaTime: number;\r\n frameCount: number;\r\n fps: number;\r\n audio: AudioAPI;\r\n video: VideoAPI;\r\n mouse: MouseAPI;\r\n keyboard: KeyboardAPI;\r\n touches: TouchAPI[];\r\n slider: (defaultValue: number, config: SliderConfig) => SliderParameter;\r\n color: (defaultValue: string, config: ColorConfig) => ColorParameter;\r\n toggle: (defaultValue: boolean, config: ToggleConfig) => ToggleParameter;\r\n select: (defaultValue: string | number, config: SelectConfig) => SelectParameter;\r\n text: (defaultValue: string, config: TextConfig) => TextParameter;\r\n number: (defaultValue: number, config: NumberConfig) => NumberParameter;\r\n useContext(type: '2d'): OffscreenCanvasRenderingContext2D;\n useContext(type: 'webgl'): WebGLRenderingContext | WebGL2RenderingContext;\r\n }\r\n}\n\ndeclare const viji: VijiCore.VijiAPI;\ndeclare function render(viji: VijiCore.VijiAPI): void;\n";