af-motion 0.0.0-stage → 1.0.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/CHANGELOG.md +33 -0
- package/LICENSE +201 -0
- package/README.md +203 -3
- package/RELEASE_NOTES.md +115 -0
- package/bin/af-motion.js +16 -0
- package/bin/mcp-server.js +21 -0
- package/dist/3d/adapter.d.ts +29 -0
- package/dist/3d/assets/cache.d.ts +71 -0
- package/dist/3d/assets/index.d.ts +10 -0
- package/dist/3d/assets/inspection.d.ts +19 -0
- package/dist/3d/assets/loaders.d.ts +30 -0
- package/dist/3d/assets/manager.d.ts +69 -0
- package/dist/3d/assets/scene-integration.d.ts +23 -0
- package/dist/3d/assets/types.d.ts +80 -0
- package/dist/3d/assets/validation.d.ts +12 -0
- package/dist/3d/camera/index.d.ts +7 -0
- package/dist/3d/camera/presets.d.ts +8 -0
- package/dist/3d/camera/transitions.d.ts +19 -0
- package/dist/3d/camera/types.d.ts +37 -0
- package/dist/3d/camera/validation.d.ts +9 -0
- package/dist/3d/capabilities.d.ts +11 -0
- package/dist/3d/composition/fallback.d.ts +20 -0
- package/dist/3d/composition/generation.d.ts +24 -0
- package/dist/3d/composition/index.d.ts +12 -0
- package/dist/3d/composition/quality.d.ts +35 -0
- package/dist/3d/composition/recipes.d.ts +34 -0
- package/dist/3d/composition/types.d.ts +88 -0
- package/dist/3d/composition/unified.d.ts +18 -0
- package/dist/3d/environment/index.d.ts +6 -0
- package/dist/3d/environment/presets.d.ts +8 -0
- package/dist/3d/environment/types.d.ts +36 -0
- package/dist/3d/environment/validation.d.ts +9 -0
- package/dist/3d/geometry/cache.d.ts +37 -0
- package/dist/3d/geometry/generators.d.ts +24 -0
- package/dist/3d/geometry/hash.d.ts +10 -0
- package/dist/3d/geometry/index.d.ts +9 -0
- package/dist/3d/geometry/three-adapter.d.ts +15 -0
- package/dist/3d/geometry/types.d.ts +120 -0
- package/dist/3d/geometry/validation.d.ts +6 -0
- package/dist/3d/index.d.ts +32 -0
- package/dist/3d/interaction/camera-controls.d.ts +58 -0
- package/dist/3d/interaction/index.d.ts +8 -0
- package/dist/3d/interaction/manager.d.ts +61 -0
- package/dist/3d/interaction/presets.d.ts +9 -0
- package/dist/3d/interaction/raycaster.d.ts +20 -0
- package/dist/3d/interaction/types.d.ts +78 -0
- package/dist/3d/lighting/index.d.ts +6 -0
- package/dist/3d/lighting/presets.d.ts +8 -0
- package/dist/3d/lighting/types.d.ts +31 -0
- package/dist/3d/lighting/validation.d.ts +17 -0
- package/dist/3d/materials/bridge.d.ts +11 -0
- package/dist/3d/materials/index.d.ts +7 -0
- package/dist/3d/materials/presets.d.ts +9 -0
- package/dist/3d/materials/types.d.ts +43 -0
- package/dist/3d/materials/validation.d.ts +9 -0
- package/dist/3d/morphing/animator.d.ts +19 -0
- package/dist/3d/morphing/correspondence.d.ts +32 -0
- package/dist/3d/morphing/geometry.d.ts +28 -0
- package/dist/3d/morphing/index.d.ts +16 -0
- package/dist/3d/morphing/interpolation.d.ts +45 -0
- package/dist/3d/morphing/morph.d.ts +18 -0
- package/dist/3d/morphing/presets.d.ts +31 -0
- package/dist/3d/morphing/react.d.ts +29 -0
- package/dist/3d/morphing/topology.d.ts +34 -0
- package/dist/3d/morphing/types.d.ts +138 -0
- package/dist/3d/morphing/validation.d.ts +19 -0
- package/dist/3d/optimization/analysis.d.ts +14 -0
- package/dist/3d/optimization/colliders.d.ts +16 -0
- package/dist/3d/optimization/geometry.d.ts +22 -0
- package/dist/3d/optimization/hierarchy.d.ts +14 -0
- package/dist/3d/optimization/index.d.ts +33 -0
- package/dist/3d/optimization/lod.d.ts +13 -0
- package/dist/3d/optimization/materials.d.ts +12 -0
- package/dist/3d/optimization/recommendations.d.ts +13 -0
- package/dist/3d/optimization/skeleton.d.ts +20 -0
- package/dist/3d/optimization/types.d.ts +252 -0
- package/dist/3d/physics/benchmark.d.ts +76 -0
- package/dist/3d/physics/body/inertia.d.ts +61 -0
- package/dist/3d/physics/collision/ccd.d.ts +26 -0
- package/dist/3d/physics/collision/narrowphase.d.ts +15 -0
- package/dist/3d/physics/collision/shapes.d.ts +45 -0
- package/dist/3d/physics/constraints/advanced.d.ts +40 -0
- package/dist/3d/physics/constraints/solver.d.ts +34 -0
- package/dist/3d/physics/constraints/types.d.ts +106 -0
- package/dist/3d/physics/events.d.ts +34 -0
- package/dist/3d/physics/index.d.ts +29 -0
- package/dist/3d/physics/material.d.ts +27 -0
- package/dist/3d/physics/math.d.ts +79 -0
- package/dist/3d/physics/soft/cloth.d.ts +12 -0
- package/dist/3d/physics/soft/collision.d.ts +12 -0
- package/dist/3d/physics/soft/gpu.d.ts +19 -0
- package/dist/3d/physics/soft/pbd.d.ts +20 -0
- package/dist/3d/physics/soft/rope.d.ts +16 -0
- package/dist/3d/physics/soft/soft-body.d.ts +12 -0
- package/dist/3d/physics/soft/types.d.ts +212 -0
- package/dist/3d/physics/solver/integrators.d.ts +25 -0
- package/dist/3d/physics/solver/types.d.ts +28 -0
- package/dist/3d/physics/spatial/spatial-hash.d.ts +51 -0
- package/dist/3d/physics/types.d.ts +579 -0
- package/dist/3d/physics/world.d.ts +106 -0
- package/dist/3d/r3f.d.ts +34 -0
- package/dist/3d/scene.d.ts +8 -0
- package/dist/3d/schema.d.ts +739 -0
- package/dist/3d/schemas/ai-integration.d.ts +201 -0
- package/dist/3d/schemas/correction.d.ts +11 -0
- package/dist/3d/schemas/index.d.ts +12 -0
- package/dist/3d/schemas/schemas.d.ts +361 -0
- package/dist/3d/schemas/serialization.d.ts +22 -0
- package/dist/3d/schemas/types.d.ts +199 -0
- package/dist/3d/schemas/validation.d.ts +33 -0
- package/dist/3d/scroll/controller.d.ts +32 -0
- package/dist/3d/scroll/index.d.ts +6 -0
- package/dist/3d/scroll/presets.d.ts +9 -0
- package/dist/3d/scroll/types.d.ts +53 -0
- package/dist/3d/terrain/biomes.d.ts +18 -0
- package/dist/3d/terrain/chunks.d.ts +20 -0
- package/dist/3d/terrain/erosion.d.ts +15 -0
- package/dist/3d/terrain/heightmap.d.ts +27 -0
- package/dist/3d/terrain/index.d.ts +18 -0
- package/dist/3d/terrain/materials.d.ts +20 -0
- package/dist/3d/terrain/noise.d.ts +25 -0
- package/dist/3d/terrain/physics.d.ts +34 -0
- package/dist/3d/terrain/terrain.d.ts +12 -0
- package/dist/3d/terrain/types.d.ts +235 -0
- package/dist/3d/terrain/vegetation.d.ts +14 -0
- package/dist/3d/types.d.ts +176 -0
- package/dist/3d/world/hydrology.d.ts +12 -0
- package/dist/3d/world/index.d.ts +15 -0
- package/dist/3d/world/lighting.d.ts +16 -0
- package/dist/3d/world/pipeline.d.ts +20 -0
- package/dist/3d/world/population.d.ts +12 -0
- package/dist/3d/world/presets.d.ts +11 -0
- package/dist/3d/world/streaming.d.ts +13 -0
- package/dist/3d/world/types.d.ts +272 -0
- package/dist/3d/world/world.d.ts +64 -0
- package/dist/backgrounds/advanced-gradient.d.ts +32 -0
- package/dist/backgrounds/atmospheric-backgrounds.d.ts +79 -0
- package/dist/backgrounds/aurora.d.ts +24 -0
- package/dist/backgrounds/cosmic-background.d.ts +31 -0
- package/dist/backgrounds/energy-effects.d.ts +78 -0
- package/dist/backgrounds/floating-orbs.d.ts +26 -0
- package/dist/backgrounds/fluid-backgrounds.d.ts +72 -0
- package/dist/backgrounds/geometric-backgrounds.d.ts +78 -0
- package/dist/backgrounds/gradient.d.ts +20 -0
- package/dist/backgrounds/grid.d.ts +22 -0
- package/dist/backgrounds/internal/canvas-lifecycle.d.ts +29 -0
- package/dist/backgrounds/noise.d.ts +20 -0
- package/dist/backgrounds/particle-background.d.ts +37 -0
- package/dist/backgrounds/particle-field.d.ts +22 -0
- package/dist/backgrounds/spotlight.d.ts +20 -0
- package/dist/backgrounds/wave.d.ts +22 -0
- package/dist/catalogue.d.ts +227 -0
- package/dist/catalogue.js +4 -0
- package/dist/chunks/catalogue-ZmbeEdRo.js +59850 -0
- package/dist/chunks/core-animation-CeiI_TEe.js +1394 -0
- package/dist/chunks/motion-choreography-DC6LWvDk.js +4089 -0
- package/dist/chunks/pointer-capture-lrnKAl2I.js +158 -0
- package/dist/chunks/safe-json-D5j34GEB.js +62 -0
- package/dist/chunks/scroll-velocity-BNUHaS0-.js +904 -0
- package/dist/cli/commands/doctor.d.ts +9 -0
- package/dist/cli/commands/example.d.ts +9 -0
- package/dist/cli/commands/info.d.ts +8 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/presets.d.ts +10 -0
- package/dist/cli/commands/validate.d.ts +9 -0
- package/dist/cli/index.d.ts +22 -0
- package/dist/cli/types.d.ts +115 -0
- package/dist/cli/utils/safety.d.ts +11 -0
- package/dist/cli/utils/templates.d.ts +16 -0
- package/dist/cli/utils/terminal.d.ts +29 -0
- package/dist/cli.js +825 -0
- package/dist/core/adaptive-motion.d.ts +100 -0
- package/dist/core/adaptive-quality/controller.d.ts +61 -0
- package/dist/core/adaptive-quality/index.d.ts +13 -0
- package/dist/core/adaptive-quality/metrics.d.ts +33 -0
- package/dist/core/adaptive-quality/policies.d.ts +40 -0
- package/dist/core/adaptive-quality/profile.d.ts +58 -0
- package/dist/core/adaptive-quality/react.d.ts +57 -0
- package/dist/core/adaptive-quality/recommendation.d.ts +12 -0
- package/dist/core/adaptive-quality/resolution.d.ts +22 -0
- package/dist/core/adaptive-quality/types.d.ts +362 -0
- package/dist/core/advanced-motion/adapters.d.ts +20 -0
- package/dist/core/advanced-motion/controller.d.ts +52 -0
- package/dist/core/advanced-motion/index.d.ts +12 -0
- package/dist/core/advanced-motion/recipes.d.ts +16 -0
- package/dist/core/advanced-motion/timeline.d.ts +35 -0
- package/dist/core/advanced-motion/types.d.ts +174 -0
- package/dist/core/advanced-motion/validation.d.ts +11 -0
- package/dist/core/agent-workflows/agent-registry.d.ts +21 -0
- package/dist/core/agent-workflows/agents/accessibility-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/composition-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/design-to-motion-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/index.d.ts +13 -0
- package/dist/core/agent-workflows/agents/motion-intelligence-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/performance-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/scene-generation-agent.d.ts +9 -0
- package/dist/core/agent-workflows/collaboration-planner.d.ts +38 -0
- package/dist/core/agent-workflows/collaboration-workflows.d.ts +83 -0
- package/dist/core/agent-workflows/communication.d.ts +29 -0
- package/dist/core/agent-workflows/conflict-resolver.d.ts +25 -0
- package/dist/core/agent-workflows/context.d.ts +36 -0
- package/dist/core/agent-workflows/execution-engine.d.ts +30 -0
- package/dist/core/agent-workflows/index.d.ts +20 -0
- package/dist/core/agent-workflows/orchestration-types.d.ts +144 -0
- package/dist/core/agent-workflows/orchestrator.d.ts +29 -0
- package/dist/core/agent-workflows/react.d.ts +71 -0
- package/dist/core/agent-workflows/shared-context.d.ts +36 -0
- package/dist/core/agent-workflows/task-planner.d.ts +42 -0
- package/dist/core/agent-workflows/templates.d.ts +14 -0
- package/dist/core/agent-workflows/tool-registry.d.ts +24 -0
- package/dist/core/agent-workflows/types.d.ts +167 -0
- package/dist/core/ai-ecosystem/capability-registry.d.ts +23 -0
- package/dist/core/ai-ecosystem/index.d.ts +13 -0
- package/dist/core/ai-ecosystem/pipeline.d.ts +19 -0
- package/dist/core/ai-ecosystem/provider.d.ts +19 -0
- package/dist/core/ai-ecosystem/types.d.ts +69 -0
- package/dist/core/ai-motion-intelligence/engine.d.ts +51 -0
- package/dist/core/ai-motion-intelligence/explanation-engine.d.ts +8 -0
- package/dist/core/ai-motion-intelligence/index.d.ts +15 -0
- package/dist/core/ai-motion-intelligence/intent-classifier.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/knowledge-base.d.ts +12 -0
- package/dist/core/ai-motion-intelligence/provider.d.ts +31 -0
- package/dist/core/ai-motion-intelligence/quality-evaluator.d.ts +9 -0
- package/dist/core/ai-motion-intelligence/react.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/recommendation-engine.d.ts +16 -0
- package/dist/core/ai-motion-intelligence/types.d.ts +134 -0
- package/dist/core/ai-motion-registry.d.ts +201 -0
- package/dist/core/animate.d.ts +57 -0
- package/dist/core/animation-intelligence/engine.d.ts +42 -0
- package/dist/core/animation-intelligence/index.d.ts +11 -0
- package/dist/core/animation-intelligence/intent.d.ts +15 -0
- package/dist/core/animation-intelligence/schema.d.ts +42 -0
- package/dist/core/animation-intelligence/scoring.d.ts +15 -0
- package/dist/core/animation-intelligence/types.d.ts +91 -0
- package/dist/core/animation-parallel.d.ts +37 -0
- package/dist/core/animation-presets.d.ts +56 -0
- package/dist/core/animation-sequence.d.ts +37 -0
- package/dist/core/animation-timeline.d.ts +46 -0
- package/dist/core/animation.d.ts +48 -0
- package/dist/core/built-in-palettes.d.ts +331 -0
- package/dist/core/choreography-intelligence/bridge.d.ts +43 -0
- package/dist/core/choreography-intelligence/generator.d.ts +11 -0
- package/dist/core/choreography-intelligence/index.d.ts +11 -0
- package/dist/core/choreography-intelligence/intent.d.ts +11 -0
- package/dist/core/choreography-intelligence/schema.d.ts +76 -0
- package/dist/core/choreography-intelligence/types.d.ts +87 -0
- package/dist/core/composition.d.ts +170 -0
- package/dist/core/configuration-corrector.d.ts +85 -0
- package/dist/core/design-intelligence.d.ts +199 -0
- package/dist/core/design-system.d.ts +206 -0
- package/dist/core/design-to-motion/design-analyzer.d.ts +13 -0
- package/dist/core/design-to-motion/engine.d.ts +34 -0
- package/dist/core/design-to-motion/generator.d.ts +16 -0
- package/dist/core/design-to-motion/index.d.ts +15 -0
- package/dist/core/design-to-motion/input-parser.d.ts +17 -0
- package/dist/core/design-to-motion/motion-planner.d.ts +11 -0
- package/dist/core/design-to-motion/presets.d.ts +11 -0
- package/dist/core/design-to-motion/react.d.ts +13 -0
- package/dist/core/design-to-motion/types.d.ts +221 -0
- package/dist/core/design-to-motion/validator.d.ts +13 -0
- package/dist/core/device-capabilities/classification.d.ts +25 -0
- package/dist/core/device-capabilities/detection.d.ts +27 -0
- package/dist/core/device-capabilities/graphics.d.ts +22 -0
- package/dist/core/device-capabilities/hardware.d.ts +27 -0
- package/dist/core/device-capabilities/index.d.ts +14 -0
- package/dist/core/device-capabilities/monitor.d.ts +19 -0
- package/dist/core/device-capabilities/react.d.ts +24 -0
- package/dist/core/device-capabilities/runtime.d.ts +11 -0
- package/dist/core/device-capabilities/scoring.d.ts +18 -0
- package/dist/core/device-capabilities/types.d.ts +171 -0
- package/dist/core/effect-composer.d.ts +41 -0
- package/dist/core/generation-pipeline.d.ts +135 -0
- package/dist/core/inertia.d.ts +30 -0
- package/dist/core/interactions/cursor-controller.d.ts +9 -0
- package/dist/core/interactions/custom-gestures.d.ts +28 -0
- package/dist/core/interactions/device-capabilities.d.ts +12 -0
- package/dist/core/interactions/drag-controller.d.ts +60 -0
- package/dist/core/interactions/errors.d.ts +13 -0
- package/dist/core/interactions/gesture-classifier.d.ts +43 -0
- package/dist/core/interactions/gesture-intelligence-controller.d.ts +9 -0
- package/dist/core/interactions/gesture-recognizers.d.ts +160 -0
- package/dist/core/interactions/gesture-sequence.d.ts +9 -0
- package/dist/core/interactions/index.d.ts +27 -0
- package/dist/core/interactions/input-normalizer.d.ts +8 -0
- package/dist/core/interactions/interaction-manager.d.ts +43 -0
- package/dist/core/interactions/keyboard-manager.d.ts +16 -0
- package/dist/core/interactions/magnetic-controller.d.ts +9 -0
- package/dist/core/interactions/magnetic-group.d.ts +11 -0
- package/dist/core/interactions/multitouch-controller.d.ts +62 -0
- package/dist/core/interactions/pointer-controller.d.ts +34 -0
- package/dist/core/interactions/pointer-tracker.d.ts +32 -0
- package/dist/core/interactions/prioritizer.d.ts +17 -0
- package/dist/core/interactions/touch-controller.d.ts +35 -0
- package/dist/core/interactions/types.d.ts +710 -0
- package/dist/core/layout/controller.d.ts +56 -0
- package/dist/core/layout/flip.d.ts +21 -0
- package/dist/core/layout/group.d.ts +46 -0
- package/dist/core/layout/index.d.ts +12 -0
- package/dist/core/layout/measure.d.ts +30 -0
- package/dist/core/layout/presets.d.ts +24 -0
- package/dist/core/layout/types.d.ts +189 -0
- package/dist/core/microinteractions/generator.d.ts +11 -0
- package/dist/core/microinteractions/index.d.ts +11 -0
- package/dist/core/microinteractions/intent.d.ts +11 -0
- package/dist/core/microinteractions/runtime.d.ts +25 -0
- package/dist/core/microinteractions/schema.d.ts +82 -0
- package/dist/core/microinteractions/types.d.ts +79 -0
- package/dist/core/motion-choreography.d.ts +163 -0
- package/dist/core/motion-dna.d.ts +129 -0
- package/dist/core/motion-path/animator.d.ts +13 -0
- package/dist/core/motion-path/engine.d.ts +27 -0
- package/dist/core/motion-path/follower.d.ts +8 -0
- package/dist/core/motion-path/index.d.ts +15 -0
- package/dist/core/motion-path/lut.d.ts +33 -0
- package/dist/core/motion-path/parser.d.ts +26 -0
- package/dist/core/motion-path/segments.d.ts +16 -0
- package/dist/core/motion-path/types.d.ts +178 -0
- package/dist/core/motion-path/vector3.d.ts +49 -0
- package/dist/core/motion-recipe.d.ts +171 -0
- package/dist/core/motion-states.d.ts +43 -0
- package/dist/core/motion-validation/consistency.d.ts +11 -0
- package/dist/core/motion-validation/index.d.ts +11 -0
- package/dist/core/motion-validation/optimizer.d.ts +11 -0
- package/dist/core/motion-validation/schema.d.ts +81 -0
- package/dist/core/motion-validation/types.d.ts +53 -0
- package/dist/core/motion-validation/validator.d.ts +11 -0
- package/dist/core/motion.d.ts +7 -0
- package/dist/core/natural-motion.d.ts +110 -0
- package/dist/core/palette-colors.d.ts +16 -0
- package/dist/core/palette-styles.d.ts +12 -0
- package/dist/core/palettes.d.ts +59 -0
- package/dist/core/performance-intelligence/conflicts.d.ts +21 -0
- package/dist/core/performance-intelligence/context.d.ts +48 -0
- package/dist/core/performance-intelligence/coordinator.d.ts +84 -0
- package/dist/core/performance-intelligence/decisions.d.ts +17 -0
- package/dist/core/performance-intelligence/history.d.ts +44 -0
- package/dist/core/performance-intelligence/index.d.ts +15 -0
- package/dist/core/performance-intelligence/policies.d.ts +59 -0
- package/dist/core/performance-intelligence/react.d.ts +78 -0
- package/dist/core/performance-intelligence/report.d.ts +16 -0
- package/dist/core/performance-intelligence/scoring.d.ts +16 -0
- package/dist/core/performance-intelligence/types.d.ts +203 -0
- package/dist/core/performance-optimizer/bottlenecks.d.ts +9 -0
- package/dist/core/performance-optimizer/index.d.ts +13 -0
- package/dist/core/performance-optimizer/optimizer.d.ts +43 -0
- package/dist/core/performance-optimizer/profiler.d.ts +38 -0
- package/dist/core/performance-optimizer/react.d.ts +55 -0
- package/dist/core/performance-optimizer/strategies.d.ts +22 -0
- package/dist/core/performance-optimizer/types.d.ts +227 -0
- package/dist/core/performance-optimizer/workers.d.ts +27 -0
- package/dist/core/physics/collision-constraints.d.ts +15 -0
- package/dist/core/physics/collision-detection.d.ts +93 -0
- package/dist/core/physics/collision-response.d.ts +24 -0
- package/dist/core/physics/collision-types.d.ts +381 -0
- package/dist/core/physics/collision-world.d.ts +11 -0
- package/dist/core/physics/composition-behaviors.d.ts +97 -0
- package/dist/core/physics/composition-choreography.d.ts +14 -0
- package/dist/core/physics/composition-engine.d.ts +25 -0
- package/dist/core/physics/composition-recipes.d.ts +46 -0
- package/dist/core/physics/composition-types.d.ts +265 -0
- package/dist/core/physics/composition-validation.d.ts +33 -0
- package/dist/core/physics/index.d.ts +37 -0
- package/dist/core/physics/inertia-animation.d.ts +11 -0
- package/dist/core/physics/inertia-math.d.ts +56 -0
- package/dist/core/physics/inertia-presets.d.ts +25 -0
- package/dist/core/physics/inertia-simulation.d.ts +11 -0
- package/dist/core/physics/inertia-types.d.ts +355 -0
- package/dist/core/physics/inertia-validation.d.ts +22 -0
- package/dist/core/physics/math.d.ts +99 -0
- package/dist/core/physics/presets.d.ts +28 -0
- package/dist/core/physics/simulation.d.ts +11 -0
- package/dist/core/physics/spring-animation.d.ts +11 -0
- package/dist/core/physics/spring-math.d.ts +47 -0
- package/dist/core/physics/spring-presets.d.ts +29 -0
- package/dist/core/physics/spring-simulation.d.ts +11 -0
- package/dist/core/physics/spring-types.d.ts +350 -0
- package/dist/core/physics/spring-validation.d.ts +22 -0
- package/dist/core/physics/stepper.d.ts +24 -0
- package/dist/core/physics/types.d.ts +280 -0
- package/dist/core/physics/validation.d.ts +62 -0
- package/dist/core/pointer-capture.d.ts +7 -0
- package/dist/core/reference-analysis/index.d.ts +10 -0
- package/dist/core/reference-analysis/interpreter.d.ts +12 -0
- package/dist/core/reference-analysis/planner.d.ts +15 -0
- package/dist/core/reference-analysis/specification.d.ts +14 -0
- package/dist/core/reference-analysis/types.d.ts +244 -0
- package/dist/core/resource-intelligence/cache.d.ts +43 -0
- package/dist/core/resource-intelligence/gpu.d.ts +19 -0
- package/dist/core/resource-intelligence/index.d.ts +16 -0
- package/dist/core/resource-intelligence/leaks.d.ts +13 -0
- package/dist/core/resource-intelligence/memory.d.ts +27 -0
- package/dist/core/resource-intelligence/pooling.d.ts +32 -0
- package/dist/core/resource-intelligence/pressure.d.ts +32 -0
- package/dist/core/resource-intelligence/react.d.ts +63 -0
- package/dist/core/resource-intelligence/registry.d.ts +33 -0
- package/dist/core/resource-intelligence/reports.d.ts +14 -0
- package/dist/core/resource-intelligence/types.d.ts +232 -0
- package/dist/core/scene-generation/engine.d.ts +31 -0
- package/dist/core/scene-generation/generator.d.ts +14 -0
- package/dist/core/scene-generation/index.d.ts +14 -0
- package/dist/core/scene-generation/input-parser.d.ts +24 -0
- package/dist/core/scene-generation/presets.d.ts +10 -0
- package/dist/core/scene-generation/react.d.ts +13 -0
- package/dist/core/scene-generation/scene-analyzer.d.ts +9 -0
- package/dist/core/scene-generation/scene-planner.d.ts +12 -0
- package/dist/core/scene-generation/types.d.ts +236 -0
- package/dist/core/scene-generation/validator.d.ts +18 -0
- package/dist/core/schema.d.ts +185 -0
- package/dist/core/scroll-intelligence/generator.d.ts +11 -0
- package/dist/core/scroll-intelligence/index.d.ts +11 -0
- package/dist/core/scroll-intelligence/intent.d.ts +11 -0
- package/dist/core/scroll-intelligence/runtime.d.ts +21 -0
- package/dist/core/scroll-intelligence/schema.d.ts +78 -0
- package/dist/core/scroll-intelligence/types.d.ts +85 -0
- package/dist/core/spring.d.ts +38 -0
- package/dist/core/svg-morph/animator.d.ts +10 -0
- package/dist/core/svg-morph/arc-to-cubic.d.ts +11 -0
- package/dist/core/svg-morph/index.d.ts +10 -0
- package/dist/core/svg-morph/interpolate.d.ts +23 -0
- package/dist/core/svg-morph/normalize.d.ts +34 -0
- package/dist/core/svg-morph/parser.d.ts +13 -0
- package/dist/core/svg-morph/shapes.d.ts +32 -0
- package/dist/core/svg-morph/types.d.ts +144 -0
- package/dist/core/transform.d.ts +27 -0
- package/dist/core/transitions/controller.d.ts +45 -0
- package/dist/core/transitions/engine.d.ts +26 -0
- package/dist/core/transitions/group-transition.d.ts +30 -0
- package/dist/core/transitions/index.d.ts +15 -0
- package/dist/core/transitions/presets.d.ts +16 -0
- package/dist/core/transitions/schema.d.ts +71 -0
- package/dist/core/transitions/shared-element-transition.d.ts +88 -0
- package/dist/core/transitions/shared-element.d.ts +84 -0
- package/dist/core/transitions/types.d.ts +185 -0
- package/dist/core/transitions/view-transition.d.ts +25 -0
- package/dist/core/typography/engine.d.ts +19 -0
- package/dist/core/typography/index.d.ts +15 -0
- package/dist/core/typography/path-motion.d.ts +24 -0
- package/dist/core/typography/presets.d.ts +14 -0
- package/dist/core/typography/properties.d.ts +19 -0
- package/dist/core/typography/segmenter.d.ts +32 -0
- package/dist/core/typography/stagger.d.ts +15 -0
- package/dist/core/typography/transitions.d.ts +11 -0
- package/dist/core/typography/types.d.ts +154 -0
- package/dist/core/utils/safe-json.d.ts +50 -0
- package/dist/core/visual-style-registry.d.ts +659 -0
- package/dist/easing/easings.d.ts +44 -0
- package/dist/effects/border-beam.d.ts +28 -0
- package/dist/effects/count-up.d.ts +30 -0
- package/dist/effects/cursor-trail.d.ts +23 -0
- package/dist/effects/drag.d.ts +41 -0
- package/dist/effects/draw-svg.d.ts +19 -0
- package/dist/effects/follow-pointer.d.ts +19 -0
- package/dist/effects/glow.d.ts +25 -0
- package/dist/effects/gradient-text.d.ts +22 -0
- package/dist/effects/hover-motion.d.ts +32 -0
- package/dist/effects/in-view.d.ts +14 -0
- package/dist/effects/magnetic.d.ts +40 -0
- package/dist/effects/morph-svg.d.ts +15 -0
- package/dist/effects/parallax.d.ts +42 -0
- package/dist/effects/pinch.d.ts +27 -0
- package/dist/effects/reveal.d.ts +33 -0
- package/dist/effects/ripple.d.ts +21 -0
- package/dist/effects/scroll-animate.d.ts +23 -0
- package/dist/effects/scroll-direction.d.ts +19 -0
- package/dist/effects/scroll-progress.d.ts +29 -0
- package/dist/effects/scroll-trigger.d.ts +22 -0
- package/dist/effects/scroll-velocity.d.ts +29 -0
- package/dist/effects/shine.d.ts +23 -0
- package/dist/effects/split-text.d.ts +17 -0
- package/dist/effects/spotlight.d.ts +24 -0
- package/dist/effects/stagger.d.ts +46 -0
- package/dist/effects/swipe.d.ts +27 -0
- package/dist/effects/text-highlight.d.ts +25 -0
- package/dist/effects/text-mask.d.ts +25 -0
- package/dist/effects/text-reveal.d.ts +28 -0
- package/dist/effects/text-scramble.d.ts +18 -0
- package/dist/effects/tilt.d.ts +42 -0
- package/dist/effects/typewriter.d.ts +26 -0
- package/dist/graphics/capabilities.d.ts +12 -0
- package/dist/graphics/composition/engine.d.ts +14 -0
- package/dist/graphics/composition/fallback.d.ts +13 -0
- package/dist/graphics/composition/index.d.ts +10 -0
- package/dist/graphics/composition/ordering.d.ts +29 -0
- package/dist/graphics/composition/quality.d.ts +24 -0
- package/dist/graphics/composition/schema.d.ts +156 -0
- package/dist/graphics/composition/types.d.ts +81 -0
- package/dist/graphics/composition/unified.d.ts +23 -0
- package/dist/graphics/effects/advanced/engine.d.ts +9 -0
- package/dist/graphics/effects/advanced/index.d.ts +1 -0
- package/dist/graphics/effects/composer.d.ts +9 -0
- package/dist/graphics/effects/distortion/engine.d.ts +9 -0
- package/dist/graphics/effects/distortion/index.d.ts +1 -0
- package/dist/graphics/effects/fluid/engine.d.ts +9 -0
- package/dist/graphics/effects/fluid/index.d.ts +1 -0
- package/dist/graphics/effects/index.d.ts +10 -0
- package/dist/graphics/effects/particles/engine.d.ts +9 -0
- package/dist/graphics/effects/particles/index.d.ts +2 -0
- package/dist/graphics/effects/particles/pool.d.ts +17 -0
- package/dist/graphics/effects/schema.d.ts +312 -0
- package/dist/graphics/effects/types.d.ts +85 -0
- package/dist/graphics/engine.d.ts +5 -0
- package/dist/graphics/environment/clouds.d.ts +28 -0
- package/dist/graphics/environment/environment.d.ts +50 -0
- package/dist/graphics/environment/fire-smoke.d.ts +32 -0
- package/dist/graphics/environment/fog.d.ts +28 -0
- package/dist/graphics/environment/index.d.ts +18 -0
- package/dist/graphics/environment/lightning.d.ts +33 -0
- package/dist/graphics/environment/rain.d.ts +33 -0
- package/dist/graphics/environment/snow.d.ts +30 -0
- package/dist/graphics/environment/types.d.ts +184 -0
- package/dist/graphics/environment/weather.d.ts +19 -0
- package/dist/graphics/environment/wind.d.ts +23 -0
- package/dist/graphics/fluid/flow-field.d.ts +74 -0
- package/dist/graphics/fluid/grid.d.ts +43 -0
- package/dist/graphics/fluid/index.d.ts +13 -0
- package/dist/graphics/fluid/interactions.d.ts +39 -0
- package/dist/graphics/fluid/rendering.d.ts +32 -0
- package/dist/graphics/fluid/simulation.d.ts +50 -0
- package/dist/graphics/fluid/solver.d.ts +19 -0
- package/dist/graphics/fluid/types.d.ts +186 -0
- package/dist/graphics/gpu-simulation/backends/backend.d.ts +24 -0
- package/dist/graphics/gpu-simulation/backends/cpu.d.ts +21 -0
- package/dist/graphics/gpu-simulation/backends/selection.d.ts +15 -0
- package/dist/graphics/gpu-simulation/backends/webgl2.d.ts +28 -0
- package/dist/graphics/gpu-simulation/backends/webgpu.d.ts +23 -0
- package/dist/graphics/gpu-simulation/capabilities.d.ts +14 -0
- package/dist/graphics/gpu-simulation/device.d.ts +17 -0
- package/dist/graphics/gpu-simulation/engine.d.ts +8 -0
- package/dist/graphics/gpu-simulation/index.d.ts +22 -0
- package/dist/graphics/gpu-simulation/ping-pong.d.ts +23 -0
- package/dist/graphics/gpu-simulation/pipeline.d.ts +18 -0
- package/dist/graphics/gpu-simulation/resource-manager.d.ts +8 -0
- package/dist/graphics/gpu-simulation/shaders.d.ts +50 -0
- package/dist/graphics/gpu-simulation/types.d.ts +288 -0
- package/dist/graphics/index.d.ts +23 -0
- package/dist/graphics/materials/glass.d.ts +22 -0
- package/dist/graphics/materials/index.d.ts +9 -0
- package/dist/graphics/materials/lighting.d.ts +22 -0
- package/dist/graphics/materials/presets.d.ts +28 -0
- package/dist/graphics/materials/schema.d.ts +574 -0
- package/dist/graphics/materials/surface.d.ts +13 -0
- package/dist/graphics/materials/types.d.ts +150 -0
- package/dist/graphics/particle-fields/composition.d.ts +32 -0
- package/dist/graphics/particle-fields/forces.d.ts +103 -0
- package/dist/graphics/particle-fields/index.d.ts +12 -0
- package/dist/graphics/particle-fields/interaction.d.ts +32 -0
- package/dist/graphics/particle-fields/spatial-index.d.ts +20 -0
- package/dist/graphics/particle-fields/system.d.ts +52 -0
- package/dist/graphics/particle-fields/types.d.ts +138 -0
- package/dist/graphics/particles/behaviors.d.ts +11 -0
- package/dist/graphics/particles/controller.d.ts +82 -0
- package/dist/graphics/particles/data-layout.d.ts +51 -0
- package/dist/graphics/particles/emitters.d.ts +24 -0
- package/dist/graphics/particles/index.d.ts +15 -0
- package/dist/graphics/particles/random.d.ts +25 -0
- package/dist/graphics/particles/rendering.d.ts +16 -0
- package/dist/graphics/particles/simulation.d.ts +23 -0
- package/dist/graphics/particles/types.d.ts +282 -0
- package/dist/graphics/renderer.d.ts +66 -0
- package/dist/graphics/resource-manager.d.ts +6 -0
- package/dist/graphics/schema.d.ts +177 -0
- package/dist/graphics/simulation/adapters.d.ts +36 -0
- package/dist/graphics/simulation/coordinator.d.ts +64 -0
- package/dist/graphics/simulation/index.d.ts +11 -0
- package/dist/graphics/simulation/optimizer.d.ts +101 -0
- package/dist/graphics/simulation/resource-manager.d.ts +40 -0
- package/dist/graphics/simulation/types.d.ts +126 -0
- package/dist/graphics/textures/cache.d.ts +29 -0
- package/dist/graphics/textures/canvas-utils.d.ts +31 -0
- package/dist/graphics/textures/engine.d.ts +34 -0
- package/dist/graphics/textures/generators.d.ts +29 -0
- package/dist/graphics/textures/index.d.ts +11 -0
- package/dist/graphics/textures/material-integration.d.ts +20 -0
- package/dist/graphics/textures/prng.d.ts +27 -0
- package/dist/graphics/textures/schema.d.ts +219 -0
- package/dist/graphics/textures/types.d.ts +80 -0
- package/dist/graphics/types.d.ts +152 -0
- package/dist/graphics/viewport.d.ts +32 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +4921 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/prompts.d.ts +9 -0
- package/dist/mcp/resources.d.ts +9 -0
- package/dist/mcp/server.d.ts +29 -0
- package/dist/mcp/tools.d.ts +9 -0
- package/dist/mcp/transport.d.ts +33 -0
- package/dist/mcp/types.d.ts +96 -0
- package/dist/presets.d.ts +176 -0
- package/dist/presets.js +3 -0
- package/dist/react.d.ts +5358 -0
- package/dist/react.js +7557 -0
- package/package.json +112 -6
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AF Motion Universal Interaction & Gestures — Type Contracts
|
|
3
|
+
*
|
|
4
|
+
* Framework-independent contracts for normalized input, pointer tracking,
|
|
5
|
+
* multi-touch gestures, keyboard interactions, priority resolution, and lifecycle controls.
|
|
6
|
+
*/
|
|
7
|
+
export declare const INTERACTION_VERSION = "1.0.0";
|
|
8
|
+
export type InputSourceType = "pointer" | "mouse" | "touch" | "keyboard";
|
|
9
|
+
export type PointerType = "mouse" | "touch" | "pen" | "keyboard";
|
|
10
|
+
export interface Point2D {
|
|
11
|
+
readonly x: number;
|
|
12
|
+
readonly y: number;
|
|
13
|
+
}
|
|
14
|
+
export interface InteractionPoint {
|
|
15
|
+
readonly x: number;
|
|
16
|
+
readonly y: number;
|
|
17
|
+
readonly clientX: number;
|
|
18
|
+
readonly clientY: number;
|
|
19
|
+
readonly pageX: number;
|
|
20
|
+
readonly pageY: number;
|
|
21
|
+
readonly screenX: number;
|
|
22
|
+
readonly screenY: number;
|
|
23
|
+
}
|
|
24
|
+
export interface Velocity2D {
|
|
25
|
+
readonly vx: number;
|
|
26
|
+
readonly vy: number;
|
|
27
|
+
readonly speed: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ModifierKeys {
|
|
30
|
+
readonly alt: boolean;
|
|
31
|
+
readonly ctrl: boolean;
|
|
32
|
+
readonly meta: boolean;
|
|
33
|
+
readonly shift: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface NormalizedInputEvent {
|
|
36
|
+
readonly source: InputSourceType;
|
|
37
|
+
readonly type: string;
|
|
38
|
+
readonly pointerId: number | null;
|
|
39
|
+
readonly pointerType: PointerType;
|
|
40
|
+
readonly isPrimary: boolean;
|
|
41
|
+
readonly point: InteractionPoint | null;
|
|
42
|
+
readonly movement: Point2D;
|
|
43
|
+
readonly pressure: number;
|
|
44
|
+
readonly tiltX: number;
|
|
45
|
+
readonly tiltY: number;
|
|
46
|
+
readonly twist: number;
|
|
47
|
+
readonly width?: number;
|
|
48
|
+
readonly height?: number;
|
|
49
|
+
readonly modifiers: ModifierKeys;
|
|
50
|
+
readonly key: string | null;
|
|
51
|
+
readonly code: string | null;
|
|
52
|
+
readonly repeat: boolean;
|
|
53
|
+
readonly timeStamp: number;
|
|
54
|
+
readonly target: EventTarget | null;
|
|
55
|
+
readonly originalEvent: Event;
|
|
56
|
+
preventDefault(): void;
|
|
57
|
+
stopPropagation(): void;
|
|
58
|
+
}
|
|
59
|
+
export interface TrackedPointer {
|
|
60
|
+
readonly id: number;
|
|
61
|
+
readonly pointerType: PointerType;
|
|
62
|
+
readonly isPrimary: boolean;
|
|
63
|
+
readonly startPoint: InteractionPoint;
|
|
64
|
+
readonly currentPoint: InteractionPoint;
|
|
65
|
+
readonly previousPoint: InteractionPoint;
|
|
66
|
+
readonly startTime: number;
|
|
67
|
+
readonly lastUpdateTime: number;
|
|
68
|
+
readonly distance: number;
|
|
69
|
+
readonly deltaX: number;
|
|
70
|
+
readonly deltaY: number;
|
|
71
|
+
readonly velocityX: number;
|
|
72
|
+
readonly velocityY: number;
|
|
73
|
+
readonly accelerationX: number;
|
|
74
|
+
readonly accelerationY: number;
|
|
75
|
+
readonly width?: number;
|
|
76
|
+
readonly height?: number;
|
|
77
|
+
readonly history: readonly {
|
|
78
|
+
readonly point: Point2D;
|
|
79
|
+
readonly time: number;
|
|
80
|
+
}[];
|
|
81
|
+
}
|
|
82
|
+
export interface MultiPointerState {
|
|
83
|
+
readonly count: number;
|
|
84
|
+
readonly pointers: readonly TrackedPointer[];
|
|
85
|
+
readonly center: Point2D;
|
|
86
|
+
readonly distance: number;
|
|
87
|
+
readonly angle: number;
|
|
88
|
+
readonly angleDegrees: number;
|
|
89
|
+
}
|
|
90
|
+
export type GestureType = "tap" | "double-tap" | "long-press" | "drag" | "pan" | "swipe" | "pinch" | "rotation";
|
|
91
|
+
export type GestureStatus = "possible" | "recognized" | "began" | "changed" | "ended" | "cancelled" | "failed";
|
|
92
|
+
export interface TapGesture {
|
|
93
|
+
readonly type: "tap";
|
|
94
|
+
readonly point: InteractionPoint;
|
|
95
|
+
readonly duration: number;
|
|
96
|
+
readonly tapCount: number;
|
|
97
|
+
readonly pointerType: PointerType;
|
|
98
|
+
}
|
|
99
|
+
export interface DoubleTapGesture {
|
|
100
|
+
readonly type: "double-tap";
|
|
101
|
+
readonly point: InteractionPoint;
|
|
102
|
+
readonly interval: number;
|
|
103
|
+
readonly pointerType: PointerType;
|
|
104
|
+
}
|
|
105
|
+
export interface LongPressGesture {
|
|
106
|
+
readonly type: "long-press";
|
|
107
|
+
readonly point: InteractionPoint;
|
|
108
|
+
readonly duration: number;
|
|
109
|
+
readonly pointerType: PointerType;
|
|
110
|
+
}
|
|
111
|
+
export interface DragGesture {
|
|
112
|
+
readonly type: "drag";
|
|
113
|
+
readonly status: GestureStatus;
|
|
114
|
+
readonly point: InteractionPoint;
|
|
115
|
+
readonly startPoint: InteractionPoint;
|
|
116
|
+
readonly offset: Point2D;
|
|
117
|
+
readonly delta: Point2D;
|
|
118
|
+
readonly velocity: Velocity2D;
|
|
119
|
+
readonly axis: "x" | "y" | "both";
|
|
120
|
+
readonly cancelled: boolean;
|
|
121
|
+
}
|
|
122
|
+
export interface PanGesture {
|
|
123
|
+
readonly type: "pan";
|
|
124
|
+
readonly status: GestureStatus;
|
|
125
|
+
readonly point: InteractionPoint;
|
|
126
|
+
readonly offset: Point2D;
|
|
127
|
+
readonly delta: Point2D;
|
|
128
|
+
readonly velocity: Velocity2D;
|
|
129
|
+
readonly pointerCount: number;
|
|
130
|
+
readonly cancelled: boolean;
|
|
131
|
+
}
|
|
132
|
+
export interface SwipeGesture {
|
|
133
|
+
readonly type: "swipe";
|
|
134
|
+
readonly direction: "up" | "down" | "left" | "right";
|
|
135
|
+
readonly distance: number;
|
|
136
|
+
readonly duration: number;
|
|
137
|
+
readonly velocity: number;
|
|
138
|
+
readonly pointerType: PointerType;
|
|
139
|
+
}
|
|
140
|
+
export interface PinchGesture {
|
|
141
|
+
readonly type: "pinch";
|
|
142
|
+
readonly status: GestureStatus;
|
|
143
|
+
readonly scale: number;
|
|
144
|
+
readonly deltaScale: number;
|
|
145
|
+
readonly distance: number;
|
|
146
|
+
readonly initialDistance: number;
|
|
147
|
+
readonly center: Point2D;
|
|
148
|
+
readonly cancelled: boolean;
|
|
149
|
+
}
|
|
150
|
+
export interface RotationGesture {
|
|
151
|
+
readonly type: "rotation";
|
|
152
|
+
readonly status: GestureStatus;
|
|
153
|
+
readonly rotation: number;
|
|
154
|
+
readonly deltaRotation: number;
|
|
155
|
+
readonly rotationRad: number;
|
|
156
|
+
readonly center: Point2D;
|
|
157
|
+
readonly cancelled: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface TapOptions {
|
|
160
|
+
readonly maxDelayMs?: number;
|
|
161
|
+
readonly maxDistance?: number;
|
|
162
|
+
readonly onTap?: (gesture: TapGesture) => void;
|
|
163
|
+
}
|
|
164
|
+
export interface DoubleTapOptions {
|
|
165
|
+
readonly maxDelayMs?: number;
|
|
166
|
+
readonly maxDistance?: number;
|
|
167
|
+
readonly onDoubleTap?: (gesture: DoubleTapGesture) => void;
|
|
168
|
+
}
|
|
169
|
+
export interface LongPressOptions {
|
|
170
|
+
readonly minDurationMs?: number;
|
|
171
|
+
readonly maxDistance?: number;
|
|
172
|
+
readonly onLongPress?: (gesture: LongPressGesture) => void;
|
|
173
|
+
}
|
|
174
|
+
export interface DragOptions {
|
|
175
|
+
readonly axis?: "x" | "y" | "both";
|
|
176
|
+
readonly threshold?: number;
|
|
177
|
+
readonly bounds?: {
|
|
178
|
+
readonly minX?: number;
|
|
179
|
+
readonly maxX?: number;
|
|
180
|
+
readonly minY?: number;
|
|
181
|
+
readonly maxY?: number;
|
|
182
|
+
};
|
|
183
|
+
readonly inertia?: boolean;
|
|
184
|
+
readonly friction?: number;
|
|
185
|
+
readonly onDragStart?: (gesture: DragGesture) => void;
|
|
186
|
+
readonly onDrag?: (gesture: DragGesture) => void;
|
|
187
|
+
readonly onDragEnd?: (gesture: DragGesture) => void;
|
|
188
|
+
}
|
|
189
|
+
export interface PanOptions {
|
|
190
|
+
readonly threshold?: number;
|
|
191
|
+
readonly lockAxis?: boolean;
|
|
192
|
+
readonly onPanStart?: (gesture: PanGesture) => void;
|
|
193
|
+
readonly onPan?: (gesture: PanGesture) => void;
|
|
194
|
+
readonly onPanEnd?: (gesture: PanGesture) => void;
|
|
195
|
+
}
|
|
196
|
+
export interface SwipeOptions {
|
|
197
|
+
readonly minDistance?: number;
|
|
198
|
+
readonly maxDuration?: number;
|
|
199
|
+
readonly minVelocity?: number;
|
|
200
|
+
readonly onSwipe?: (gesture: SwipeGesture) => void;
|
|
201
|
+
}
|
|
202
|
+
export interface PinchOptions {
|
|
203
|
+
readonly minDistance?: number;
|
|
204
|
+
readonly onPinchStart?: (gesture: PinchGesture) => void;
|
|
205
|
+
readonly onPinch?: (gesture: PinchGesture) => void;
|
|
206
|
+
readonly onPinchEnd?: (gesture: PinchGesture) => void;
|
|
207
|
+
}
|
|
208
|
+
export interface RotationOptions {
|
|
209
|
+
readonly threshold?: number;
|
|
210
|
+
readonly onRotationStart?: (gesture: RotationGesture) => void;
|
|
211
|
+
readonly onRotation?: (gesture: RotationGesture) => void;
|
|
212
|
+
readonly onRotationEnd?: (gesture: RotationGesture) => void;
|
|
213
|
+
}
|
|
214
|
+
export interface KeyBinding {
|
|
215
|
+
readonly key: string | readonly string[];
|
|
216
|
+
readonly modifiers?: Partial<ModifierKeys>;
|
|
217
|
+
readonly action: (event: NormalizedInputEvent) => void;
|
|
218
|
+
readonly preventDefault?: boolean;
|
|
219
|
+
readonly description?: string;
|
|
220
|
+
}
|
|
221
|
+
export interface KeyboardOptions {
|
|
222
|
+
readonly enabled?: boolean;
|
|
223
|
+
readonly bindings?: readonly KeyBinding[];
|
|
224
|
+
readonly onKeyDown?: (event: NormalizedInputEvent) => void;
|
|
225
|
+
readonly onKeyUp?: (event: NormalizedInputEvent) => void;
|
|
226
|
+
readonly onActivate?: (event: NormalizedInputEvent) => void;
|
|
227
|
+
readonly onCancel?: (event: NormalizedInputEvent) => void;
|
|
228
|
+
}
|
|
229
|
+
export type InteractionPriority = "low" | "normal" | "high" | "critical" | number;
|
|
230
|
+
export type ConflictPolicy = "simultaneous" | "exclusive" | "require-failure";
|
|
231
|
+
export interface GesturePrioritizationRule {
|
|
232
|
+
readonly gesture: GestureType;
|
|
233
|
+
readonly priority: InteractionPriority;
|
|
234
|
+
readonly policy?: ConflictPolicy;
|
|
235
|
+
readonly blocks?: readonly GestureType[];
|
|
236
|
+
readonly requiresFailureOf?: readonly GestureType[];
|
|
237
|
+
}
|
|
238
|
+
export interface InteractionOptions {
|
|
239
|
+
readonly priority?: InteractionPriority;
|
|
240
|
+
readonly capturePointer?: boolean;
|
|
241
|
+
readonly passive?: boolean;
|
|
242
|
+
readonly preventDefault?: boolean | ((event: NormalizedInputEvent) => boolean);
|
|
243
|
+
readonly tap?: TapOptions | boolean;
|
|
244
|
+
readonly doubleTap?: DoubleTapOptions | boolean;
|
|
245
|
+
readonly longPress?: LongPressOptions | boolean;
|
|
246
|
+
readonly drag?: DragOptions | boolean;
|
|
247
|
+
readonly pan?: PanOptions | boolean;
|
|
248
|
+
readonly swipe?: SwipeOptions | boolean;
|
|
249
|
+
readonly pinch?: PinchOptions | boolean;
|
|
250
|
+
readonly rotation?: RotationOptions | boolean;
|
|
251
|
+
readonly keyboard?: KeyboardOptions | boolean;
|
|
252
|
+
readonly prioritizationRules?: readonly GesturePrioritizationRule[];
|
|
253
|
+
readonly onPointerDown?: (event: NormalizedInputEvent) => void;
|
|
254
|
+
readonly onPointerMove?: (event: NormalizedInputEvent) => void;
|
|
255
|
+
readonly onPointerUp?: (event: NormalizedInputEvent) => void;
|
|
256
|
+
readonly onPointerEnter?: (event: NormalizedInputEvent) => void;
|
|
257
|
+
readonly onPointerLeave?: (event: NormalizedInputEvent) => void;
|
|
258
|
+
readonly onPointerCancel?: (event: NormalizedInputEvent) => void;
|
|
259
|
+
}
|
|
260
|
+
export interface InteractionControls {
|
|
261
|
+
readonly target: EventTarget;
|
|
262
|
+
readonly activePointers: ReadonlyMap<number, TrackedPointer>;
|
|
263
|
+
readonly isInteracting: boolean;
|
|
264
|
+
updateOptions(options: Partial<InteractionOptions>): void;
|
|
265
|
+
cancel(): void;
|
|
266
|
+
destroy(): void;
|
|
267
|
+
}
|
|
268
|
+
export interface DeviceCapabilities {
|
|
269
|
+
readonly touchSupport: boolean;
|
|
270
|
+
readonly pointerSupport: boolean;
|
|
271
|
+
readonly maxTouchPoints: number;
|
|
272
|
+
readonly primaryInput: "mouse" | "touch" | "pen";
|
|
273
|
+
readonly hoverSupport: boolean;
|
|
274
|
+
}
|
|
275
|
+
export interface PointerControllerOptions {
|
|
276
|
+
readonly sampleWindowMs?: number;
|
|
277
|
+
readonly maxHistory?: number;
|
|
278
|
+
readonly capturePointer?: boolean;
|
|
279
|
+
readonly onPointerEnter?: (event: NormalizedInputEvent) => void;
|
|
280
|
+
readonly onPointerLeave?: (event: NormalizedInputEvent) => void;
|
|
281
|
+
readonly onHoverChange?: (isHovered: boolean, event: NormalizedInputEvent) => void;
|
|
282
|
+
readonly onPointerDown?: (event: NormalizedInputEvent, pointer: TrackedPointer) => void;
|
|
283
|
+
readonly onPointerMove?: (event: NormalizedInputEvent, pointer: TrackedPointer) => void;
|
|
284
|
+
readonly onPointerUp?: (event: NormalizedInputEvent, pointer: TrackedPointer) => void;
|
|
285
|
+
readonly onPointerCancel?: (event: NormalizedInputEvent, pointer: TrackedPointer | null) => void;
|
|
286
|
+
}
|
|
287
|
+
export interface PointerControllerState {
|
|
288
|
+
readonly isHovered: boolean;
|
|
289
|
+
readonly activePointers: ReadonlyMap<number, TrackedPointer>;
|
|
290
|
+
readonly pointerCount: number;
|
|
291
|
+
readonly primaryPointer: TrackedPointer | null;
|
|
292
|
+
readonly deviceCapabilities: DeviceCapabilities;
|
|
293
|
+
}
|
|
294
|
+
export interface PointerController {
|
|
295
|
+
readonly target: HTMLElement;
|
|
296
|
+
getState(): PointerControllerState;
|
|
297
|
+
isHovered(): boolean;
|
|
298
|
+
getActivePointers(): ReadonlyMap<number, TrackedPointer>;
|
|
299
|
+
getPrimaryPointer(): TrackedPointer | null;
|
|
300
|
+
getDeviceCapabilities(): DeviceCapabilities;
|
|
301
|
+
cancel(): void;
|
|
302
|
+
destroy(): void;
|
|
303
|
+
}
|
|
304
|
+
export type DragAxisMode = "x" | "y" | "both" | "none";
|
|
305
|
+
export interface DragBounds {
|
|
306
|
+
readonly minX?: number;
|
|
307
|
+
readonly maxX?: number;
|
|
308
|
+
readonly minY?: number;
|
|
309
|
+
readonly maxY?: number;
|
|
310
|
+
}
|
|
311
|
+
export interface DragPosition {
|
|
312
|
+
readonly x: number;
|
|
313
|
+
readonly y: number;
|
|
314
|
+
}
|
|
315
|
+
export interface SnapPoint {
|
|
316
|
+
readonly x: number;
|
|
317
|
+
readonly y: number;
|
|
318
|
+
}
|
|
319
|
+
export interface AdvancedDragOptions {
|
|
320
|
+
readonly axis?: DragAxisMode;
|
|
321
|
+
readonly directionLock?: boolean;
|
|
322
|
+
readonly threshold?: number;
|
|
323
|
+
readonly delayMs?: number;
|
|
324
|
+
readonly bounds?: DragBounds | HTMLElement | string;
|
|
325
|
+
readonly grid?: number | readonly [number, number];
|
|
326
|
+
readonly snapPoints?: readonly SnapPoint[];
|
|
327
|
+
readonly snapRadius?: number;
|
|
328
|
+
readonly elastic?: boolean | number;
|
|
329
|
+
readonly resistance?: number;
|
|
330
|
+
readonly transformCoordinate?: (point: DragPosition) => DragPosition;
|
|
331
|
+
readonly inertia?: boolean;
|
|
332
|
+
readonly friction?: number;
|
|
333
|
+
readonly maxVelocity?: number;
|
|
334
|
+
readonly springBack?: boolean;
|
|
335
|
+
readonly applyTransform?: boolean;
|
|
336
|
+
readonly isolate?: boolean;
|
|
337
|
+
readonly canDrag?: (event: NormalizedInputEvent) => boolean;
|
|
338
|
+
readonly buttons?: readonly number[];
|
|
339
|
+
readonly shiftAxisLock?: boolean;
|
|
340
|
+
readonly keyboardEnabled?: boolean;
|
|
341
|
+
readonly keyboardStep?: number;
|
|
342
|
+
readonly keyboardFastStep?: number;
|
|
343
|
+
readonly onDragStart?: (state: AdvancedDragState) => void;
|
|
344
|
+
readonly onDrag?: (state: AdvancedDragState) => void;
|
|
345
|
+
readonly onDragEnd?: (state: AdvancedDragState) => void;
|
|
346
|
+
readonly onSnap?: (point: SnapPoint, state: AdvancedDragState) => void;
|
|
347
|
+
}
|
|
348
|
+
export interface AdvancedDragState {
|
|
349
|
+
readonly isDragging: boolean;
|
|
350
|
+
readonly isSnapping: boolean;
|
|
351
|
+
readonly position: DragPosition;
|
|
352
|
+
readonly offset: DragPosition;
|
|
353
|
+
readonly delta: DragPosition;
|
|
354
|
+
readonly velocity: Velocity2D;
|
|
355
|
+
readonly axis: DragAxisMode;
|
|
356
|
+
readonly lockedAxis: "x" | "y" | null;
|
|
357
|
+
readonly pointerId: number | null;
|
|
358
|
+
readonly pointerType: PointerType;
|
|
359
|
+
readonly cancelled: boolean;
|
|
360
|
+
}
|
|
361
|
+
export interface AdvancedDragControls {
|
|
362
|
+
readonly target: HTMLElement;
|
|
363
|
+
getState(): AdvancedDragState;
|
|
364
|
+
getPosition(): DragPosition;
|
|
365
|
+
setPosition(pos: Partial<DragPosition>): void;
|
|
366
|
+
isDragging(): boolean;
|
|
367
|
+
cancel(): void;
|
|
368
|
+
reset(): void;
|
|
369
|
+
destroy(): void;
|
|
370
|
+
}
|
|
371
|
+
export interface TouchControllerOptions {
|
|
372
|
+
readonly touchAction?: string;
|
|
373
|
+
readonly passive?: boolean;
|
|
374
|
+
readonly preventDefault?: boolean | ((event: NormalizedInputEvent) => boolean);
|
|
375
|
+
readonly isolate?: boolean;
|
|
376
|
+
readonly onTouchStart?: (event: NormalizedInputEvent, pointer: TrackedPointer) => void;
|
|
377
|
+
readonly onTouchMove?: (event: NormalizedInputEvent, pointer: TrackedPointer) => void;
|
|
378
|
+
readonly onTouchEnd?: (event: NormalizedInputEvent, pointer: TrackedPointer) => void;
|
|
379
|
+
readonly onTouchCancel?: (event: NormalizedInputEvent, pointer: TrackedPointer | null) => void;
|
|
380
|
+
readonly onTouchesChange?: (touches: readonly TrackedPointer[]) => void;
|
|
381
|
+
}
|
|
382
|
+
export interface TouchControllerState {
|
|
383
|
+
readonly touchCount: number;
|
|
384
|
+
readonly activeTouches: readonly TrackedPointer[];
|
|
385
|
+
readonly centroid: Point2D;
|
|
386
|
+
readonly isTouching: boolean;
|
|
387
|
+
}
|
|
388
|
+
export interface TouchController {
|
|
389
|
+
readonly target: HTMLElement;
|
|
390
|
+
getState(): TouchControllerState;
|
|
391
|
+
getActiveTouches(): readonly TrackedPointer[];
|
|
392
|
+
cancel(): void;
|
|
393
|
+
destroy(): void;
|
|
394
|
+
}
|
|
395
|
+
export interface TouchTransform {
|
|
396
|
+
readonly translation: Point2D;
|
|
397
|
+
readonly scale: number;
|
|
398
|
+
readonly rotation: number;
|
|
399
|
+
readonly rotationRad: number;
|
|
400
|
+
readonly center: Point2D;
|
|
401
|
+
}
|
|
402
|
+
export type PinchDirection = "in" | "out" | "none";
|
|
403
|
+
export interface MultiTouchState {
|
|
404
|
+
readonly isActive: boolean;
|
|
405
|
+
readonly touchCount: number;
|
|
406
|
+
readonly pointers: readonly TrackedPointer[];
|
|
407
|
+
readonly centroid: Point2D;
|
|
408
|
+
readonly deltaCentroid: Point2D;
|
|
409
|
+
readonly translation: Point2D;
|
|
410
|
+
readonly scale: number;
|
|
411
|
+
readonly deltaScale: number;
|
|
412
|
+
readonly rotation: number;
|
|
413
|
+
readonly deltaRotation: number;
|
|
414
|
+
readonly pinchDirection: PinchDirection;
|
|
415
|
+
readonly velocity: Velocity2D;
|
|
416
|
+
readonly angularVelocity: number;
|
|
417
|
+
readonly scaleVelocity: number;
|
|
418
|
+
}
|
|
419
|
+
export interface MultiTouchControllerOptions {
|
|
420
|
+
readonly enablePan?: boolean;
|
|
421
|
+
readonly enablePinch?: boolean;
|
|
422
|
+
readonly enableRotation?: boolean;
|
|
423
|
+
readonly singleFingerPan?: boolean;
|
|
424
|
+
readonly twoFingerPan?: boolean;
|
|
425
|
+
readonly panAxis?: "x" | "y" | "both" | "none";
|
|
426
|
+
readonly minScale?: number;
|
|
427
|
+
readonly maxScale?: number;
|
|
428
|
+
readonly minRotation?: number;
|
|
429
|
+
readonly maxRotation?: number;
|
|
430
|
+
readonly bounds?: DragBounds;
|
|
431
|
+
readonly elastic?: boolean | number;
|
|
432
|
+
readonly panThreshold?: number;
|
|
433
|
+
readonly pinchThreshold?: number;
|
|
434
|
+
readonly rotationThreshold?: number;
|
|
435
|
+
readonly touchAction?: string;
|
|
436
|
+
readonly passive?: boolean;
|
|
437
|
+
readonly preventDefault?: boolean | ((event: NormalizedInputEvent) => boolean);
|
|
438
|
+
readonly isolate?: boolean;
|
|
439
|
+
readonly inertia?: boolean;
|
|
440
|
+
readonly friction?: number;
|
|
441
|
+
readonly springBack?: boolean;
|
|
442
|
+
readonly applyTransform?: boolean;
|
|
443
|
+
readonly onStart?: (state: MultiTouchState) => void;
|
|
444
|
+
readonly onMove?: (state: MultiTouchState) => void;
|
|
445
|
+
readonly onEnd?: (state: MultiTouchState) => void;
|
|
446
|
+
readonly onPinch?: (scale: number, state: MultiTouchState) => void;
|
|
447
|
+
readonly onRotate?: (rotation: number, state: MultiTouchState) => void;
|
|
448
|
+
readonly onPan?: (translation: Point2D, state: MultiTouchState) => void;
|
|
449
|
+
readonly onTransform?: (transform: TouchTransform, state: MultiTouchState) => void;
|
|
450
|
+
readonly onCancel?: (state: MultiTouchState) => void;
|
|
451
|
+
}
|
|
452
|
+
export interface MultiTouchController {
|
|
453
|
+
readonly target: HTMLElement;
|
|
454
|
+
getState(): MultiTouchState;
|
|
455
|
+
getTransform(): TouchTransform;
|
|
456
|
+
setTranslation(pos: Partial<Point2D>): void;
|
|
457
|
+
setScale(scale: number): void;
|
|
458
|
+
setRotation(rotation: number): void;
|
|
459
|
+
isActive(): boolean;
|
|
460
|
+
cancel(): void;
|
|
461
|
+
reset(): void;
|
|
462
|
+
destroy(): void;
|
|
463
|
+
}
|
|
464
|
+
export type GestureDirection = "up" | "down" | "left" | "right" | "up-left" | "up-right" | "down-left" | "down-right" | "horizontal" | "vertical" | "any";
|
|
465
|
+
export type GestureEdge = "left" | "right" | "top" | "bottom";
|
|
466
|
+
export interface GestureSample {
|
|
467
|
+
readonly id?: string;
|
|
468
|
+
readonly pointerCount: number;
|
|
469
|
+
readonly durationMs: number;
|
|
470
|
+
readonly distance: number;
|
|
471
|
+
readonly deltaX: number;
|
|
472
|
+
readonly deltaY: number;
|
|
473
|
+
readonly velocityX: number;
|
|
474
|
+
readonly velocityY: number;
|
|
475
|
+
readonly speed: number;
|
|
476
|
+
readonly accelerationX?: number;
|
|
477
|
+
readonly accelerationY?: number;
|
|
478
|
+
readonly startPoint: Point2D;
|
|
479
|
+
readonly currentPoint: Point2D;
|
|
480
|
+
readonly targetBounds?: DragBounds;
|
|
481
|
+
readonly scaleChange?: number;
|
|
482
|
+
readonly rotationChange?: number;
|
|
483
|
+
readonly pathLength?: number;
|
|
484
|
+
readonly pointerType?: PointerType;
|
|
485
|
+
}
|
|
486
|
+
export interface GestureExplanation {
|
|
487
|
+
readonly directionMatch: number;
|
|
488
|
+
readonly velocityMatch: number;
|
|
489
|
+
readonly distanceMatch: number;
|
|
490
|
+
readonly durationMatch: number;
|
|
491
|
+
readonly pointerCountMatch: number;
|
|
492
|
+
readonly linearity: number;
|
|
493
|
+
readonly edgeMatch?: number;
|
|
494
|
+
readonly scaleMatch?: number;
|
|
495
|
+
readonly rotationMatch?: number;
|
|
496
|
+
readonly summary: string;
|
|
497
|
+
}
|
|
498
|
+
export interface GestureClassificationResult {
|
|
499
|
+
readonly gestureId: string;
|
|
500
|
+
readonly name: string;
|
|
501
|
+
readonly confidence: number;
|
|
502
|
+
readonly isMatch: boolean;
|
|
503
|
+
readonly explanation: GestureExplanation;
|
|
504
|
+
readonly sample: GestureSample;
|
|
505
|
+
readonly recognizedAt: number;
|
|
506
|
+
}
|
|
507
|
+
export interface CustomGestureDefinition {
|
|
508
|
+
readonly id: string;
|
|
509
|
+
readonly name?: string;
|
|
510
|
+
readonly pointerCount?: number | {
|
|
511
|
+
readonly min?: number;
|
|
512
|
+
readonly max?: number;
|
|
513
|
+
};
|
|
514
|
+
readonly direction?: GestureDirection;
|
|
515
|
+
readonly minDistance?: number;
|
|
516
|
+
readonly maxDistance?: number;
|
|
517
|
+
readonly minDurationMs?: number;
|
|
518
|
+
readonly maxDurationMs?: number;
|
|
519
|
+
readonly minVelocity?: number;
|
|
520
|
+
readonly maxVelocity?: number;
|
|
521
|
+
readonly minLinearity?: number;
|
|
522
|
+
readonly edge?: GestureEdge;
|
|
523
|
+
readonly edgeThreshold?: number;
|
|
524
|
+
readonly minScaleChange?: number;
|
|
525
|
+
readonly minRotationChange?: number;
|
|
526
|
+
readonly priority?: InteractionPriority;
|
|
527
|
+
readonly conflictPolicy?: ConflictPolicy;
|
|
528
|
+
readonly onRecognized?: (match: GestureClassificationResult) => void;
|
|
529
|
+
}
|
|
530
|
+
export interface GestureSequenceStage {
|
|
531
|
+
readonly gestureId: string;
|
|
532
|
+
readonly optional?: boolean;
|
|
533
|
+
readonly timeoutMs?: number;
|
|
534
|
+
}
|
|
535
|
+
export interface GestureSequenceOptions {
|
|
536
|
+
readonly id?: string;
|
|
537
|
+
readonly name?: string;
|
|
538
|
+
readonly stages: readonly GestureSequenceStage[];
|
|
539
|
+
readonly sequenceTimeoutMs?: number;
|
|
540
|
+
readonly onStageCompleted?: (stage: GestureSequenceStage, stageIndex: number) => void;
|
|
541
|
+
readonly onSequenceCompleted?: (results: readonly GestureClassificationResult[]) => void;
|
|
542
|
+
readonly onSequenceFailed?: (reason: string, stageIndex: number) => void;
|
|
543
|
+
readonly onReset?: () => void;
|
|
544
|
+
}
|
|
545
|
+
export interface GestureSequenceState {
|
|
546
|
+
readonly stageIndex: number;
|
|
547
|
+
readonly totalStages: number;
|
|
548
|
+
readonly completedStages: readonly string[];
|
|
549
|
+
readonly completedResults: readonly GestureClassificationResult[];
|
|
550
|
+
readonly isMatched: boolean;
|
|
551
|
+
readonly isFailed: boolean;
|
|
552
|
+
readonly timeRemainingMs: number;
|
|
553
|
+
}
|
|
554
|
+
export interface GestureSequenceController {
|
|
555
|
+
readonly id: string;
|
|
556
|
+
getState(): GestureSequenceState;
|
|
557
|
+
feed(match: GestureClassificationResult): boolean;
|
|
558
|
+
cancel(): void;
|
|
559
|
+
reset(): void;
|
|
560
|
+
destroy(): void;
|
|
561
|
+
}
|
|
562
|
+
export interface GestureRecognitionOptions {
|
|
563
|
+
readonly edgeThreshold?: number;
|
|
564
|
+
readonly minConfidence?: number;
|
|
565
|
+
readonly sequences?: readonly GestureSequenceOptions[];
|
|
566
|
+
readonly prioritizationRules?: readonly GesturePrioritizationRule[];
|
|
567
|
+
readonly onGestureRecognized?: (result: GestureClassificationResult) => void;
|
|
568
|
+
readonly onGestureCandidate?: (result: GestureClassificationResult) => void;
|
|
569
|
+
readonly onSequenceCompleted?: (sequenceId: string, results: readonly GestureClassificationResult[]) => void;
|
|
570
|
+
}
|
|
571
|
+
export interface GestureRecognitionController {
|
|
572
|
+
readonly target: HTMLElement;
|
|
573
|
+
getActiveGestures(): readonly GestureClassificationResult[];
|
|
574
|
+
getSequences(): readonly GestureSequenceController[];
|
|
575
|
+
cancel(): void;
|
|
576
|
+
destroy(): void;
|
|
577
|
+
}
|
|
578
|
+
export type CursorMode = "default" | "magnetic" | "follower" | "hover-reactive" | "proximity" | "repulsive" | "custom";
|
|
579
|
+
export interface CursorState {
|
|
580
|
+
readonly x: number;
|
|
581
|
+
readonly y: number;
|
|
582
|
+
readonly targetX: number;
|
|
583
|
+
readonly targetY: number;
|
|
584
|
+
readonly velocityX: number;
|
|
585
|
+
readonly velocityY: number;
|
|
586
|
+
readonly speed: number;
|
|
587
|
+
readonly accelerationX: number;
|
|
588
|
+
readonly accelerationY: number;
|
|
589
|
+
readonly angle: number;
|
|
590
|
+
readonly isVisible: boolean;
|
|
591
|
+
readonly isHovering: boolean;
|
|
592
|
+
readonly hoveredElement: HTMLElement | null;
|
|
593
|
+
readonly mode: CursorMode;
|
|
594
|
+
readonly customState: string | null;
|
|
595
|
+
readonly scale: number;
|
|
596
|
+
readonly opacity: number;
|
|
597
|
+
}
|
|
598
|
+
export interface CursorProximityTarget {
|
|
599
|
+
readonly element: HTMLElement;
|
|
600
|
+
readonly radius?: number;
|
|
601
|
+
readonly onEnter?: (target: HTMLElement, distance: number) => void;
|
|
602
|
+
readonly onLeave?: (target: HTMLElement) => void;
|
|
603
|
+
readonly onProximity?: (target: HTMLElement, distance: number, normalizedDistance: number) => void;
|
|
604
|
+
}
|
|
605
|
+
export interface CursorControllerOptions {
|
|
606
|
+
readonly smoothing?: number;
|
|
607
|
+
readonly lagMs?: number;
|
|
608
|
+
readonly mode?: CursorMode;
|
|
609
|
+
readonly hideNativeCursor?: boolean;
|
|
610
|
+
readonly hoverSelector?: string;
|
|
611
|
+
readonly proximityRadius?: number;
|
|
612
|
+
readonly proximityTargets?: readonly (HTMLElement | CursorProximityTarget)[];
|
|
613
|
+
readonly snapToCenterOnHover?: boolean;
|
|
614
|
+
readonly touchFallback?: "hide" | "ignore" | "follow";
|
|
615
|
+
readonly respectReducedMotion?: boolean;
|
|
616
|
+
readonly onPositionChange?: (state: CursorState) => void;
|
|
617
|
+
readonly onStateChange?: (state: CursorState) => void;
|
|
618
|
+
readonly onHoverStart?: (element: HTMLElement, state: CursorState) => void;
|
|
619
|
+
readonly onHoverEnd?: (element: HTMLElement, state: CursorState) => void;
|
|
620
|
+
}
|
|
621
|
+
export interface CursorController {
|
|
622
|
+
readonly element: HTMLElement | null;
|
|
623
|
+
getState(): CursorState;
|
|
624
|
+
setMode(mode: CursorMode): void;
|
|
625
|
+
setCustomState(stateName: string | null): void;
|
|
626
|
+
setVisibility(visible: boolean): void;
|
|
627
|
+
setPosition(x: number, y: number, immediate?: boolean): void;
|
|
628
|
+
addProximityTarget(target: HTMLElement | CursorProximityTarget): () => void;
|
|
629
|
+
removeProximityTarget(element: HTMLElement): void;
|
|
630
|
+
enable(): void;
|
|
631
|
+
disable(): void;
|
|
632
|
+
reset(): void;
|
|
633
|
+
destroy(): void;
|
|
634
|
+
}
|
|
635
|
+
export type MagneticFalloff = "linear" | "exponential" | "smoothstep" | "inverse-square";
|
|
636
|
+
export type MagneticAxis = "x" | "y" | "both";
|
|
637
|
+
export type MagneticMode = "attract" | "repel";
|
|
638
|
+
export interface MagneticAnchor {
|
|
639
|
+
readonly x: number;
|
|
640
|
+
readonly y: number;
|
|
641
|
+
readonly isFraction?: boolean;
|
|
642
|
+
}
|
|
643
|
+
export interface MagneticState {
|
|
644
|
+
readonly isAttracted: boolean;
|
|
645
|
+
readonly distance: number;
|
|
646
|
+
readonly normalizedDistance: number;
|
|
647
|
+
readonly angle: number;
|
|
648
|
+
readonly offsetX: number;
|
|
649
|
+
readonly offsetY: number;
|
|
650
|
+
readonly targetX: number;
|
|
651
|
+
readonly targetY: number;
|
|
652
|
+
readonly pointerX: number;
|
|
653
|
+
readonly pointerY: number;
|
|
654
|
+
readonly isRepelling: boolean;
|
|
655
|
+
}
|
|
656
|
+
export interface MagneticControllerOptions {
|
|
657
|
+
readonly radius?: number;
|
|
658
|
+
readonly strength?: number;
|
|
659
|
+
readonly maxDisplacement?: number;
|
|
660
|
+
readonly axis?: MagneticAxis;
|
|
661
|
+
readonly mode?: MagneticMode;
|
|
662
|
+
readonly falloff?: MagneticFalloff;
|
|
663
|
+
readonly resistance?: number;
|
|
664
|
+
readonly anchor?: MagneticAnchor;
|
|
665
|
+
readonly springConfig?: {
|
|
666
|
+
readonly stiffness?: number;
|
|
667
|
+
readonly damping?: number;
|
|
668
|
+
readonly mass?: number;
|
|
669
|
+
};
|
|
670
|
+
readonly easing?: (t: number) => number;
|
|
671
|
+
readonly snapPoints?: readonly Point2D[];
|
|
672
|
+
readonly snapDistance?: number;
|
|
673
|
+
readonly container?: HTMLElement;
|
|
674
|
+
readonly respectReducedMotion?: boolean;
|
|
675
|
+
readonly onAttractStart?: (state: MagneticState) => void;
|
|
676
|
+
readonly onAttractUpdate?: (state: MagneticState) => void;
|
|
677
|
+
readonly onAttractEnd?: (state: MagneticState) => void;
|
|
678
|
+
readonly onSnap?: (point: Point2D, state: MagneticState) => void;
|
|
679
|
+
}
|
|
680
|
+
export interface MagneticController {
|
|
681
|
+
readonly target: HTMLElement;
|
|
682
|
+
getState(): MagneticState;
|
|
683
|
+
updateOptions(options: Partial<MagneticControllerOptions>): void;
|
|
684
|
+
setMode(mode: MagneticMode): void;
|
|
685
|
+
enable(): void;
|
|
686
|
+
disable(): void;
|
|
687
|
+
reset(): void;
|
|
688
|
+
destroy(): void;
|
|
689
|
+
}
|
|
690
|
+
export interface MagneticGroupMember {
|
|
691
|
+
readonly element: HTMLElement;
|
|
692
|
+
readonly controller: MagneticController;
|
|
693
|
+
readonly options?: MagneticControllerOptions;
|
|
694
|
+
}
|
|
695
|
+
export interface MagneticGroupOptions {
|
|
696
|
+
readonly maxActiveMembers?: number;
|
|
697
|
+
readonly prioritizeClosest?: boolean;
|
|
698
|
+
readonly sharedRadius?: number;
|
|
699
|
+
readonly onActiveMemberChange?: (activeMember: HTMLElement | null) => void;
|
|
700
|
+
}
|
|
701
|
+
export interface MagneticGroupController {
|
|
702
|
+
readonly members: readonly MagneticGroupMember[];
|
|
703
|
+
addMember(element: HTMLElement, options?: MagneticControllerOptions): MagneticController;
|
|
704
|
+
removeMember(element: HTMLElement): void;
|
|
705
|
+
getActiveMember(): HTMLElement | null;
|
|
706
|
+
enable(): void;
|
|
707
|
+
disable(): void;
|
|
708
|
+
reset(): void;
|
|
709
|
+
destroy(): void;
|
|
710
|
+
}
|