@unrulysystems/native-motion-core 0.1.0-alpha.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 +9 -0
- package/LICENSE +21 -0
- package/README.md +48 -0
- package/dist/clock.cjs +71 -0
- package/dist/clock.d.cts +23 -0
- package/dist/clock.d.ts +23 -0
- package/dist/clock.js +66 -0
- package/dist/collect-reads.cjs +68 -0
- package/dist/collect-reads.d.cts +23 -0
- package/dist/collect-reads.d.ts +23 -0
- package/dist/collect-reads.js +62 -0
- package/dist/component/boundedArray.cjs +74 -0
- package/dist/component/boundedArray.d.cts +25 -0
- package/dist/component/boundedArray.d.ts +25 -0
- package/dist/component/boundedArray.js +68 -0
- package/dist/component/index.cjs +57 -0
- package/dist/component/index.d.cts +12 -0
- package/dist/component/index.d.ts +12 -0
- package/dist/component/index.js +22 -0
- package/dist/component/orchestration.cjs +129 -0
- package/dist/component/orchestration.d.cts +66 -0
- package/dist/component/orchestration.d.ts +66 -0
- package/dist/component/orchestration.js +124 -0
- package/dist/component/resolve.cjs +104 -0
- package/dist/component/resolve.d.cts +11 -0
- package/dist/component/resolve.d.ts +11 -0
- package/dist/component/resolve.js +97 -0
- package/dist/component/transition.cjs +352 -0
- package/dist/component/transition.d.cts +33 -0
- package/dist/component/transition.d.ts +33 -0
- package/dist/component/transition.js +339 -0
- package/dist/component/types.cjs +114 -0
- package/dist/component/types.d.cts +60 -0
- package/dist/component/types.d.ts +60 -0
- package/dist/component/types.js +111 -0
- package/dist/component/validate.cjs +1015 -0
- package/dist/component/validate.d.cts +37 -0
- package/dist/component/validate.d.ts +37 -0
- package/dist/component/validate.js +1002 -0
- package/dist/component/variants.cjs +333 -0
- package/dist/component/variants.d.cts +106 -0
- package/dist/component/variants.d.ts +106 -0
- package/dist/component/variants.js +321 -0
- package/dist/config/constants.cjs +41 -0
- package/dist/config/constants.d.cts +29 -0
- package/dist/config/constants.d.ts +29 -0
- package/dist/config/constants.js +38 -0
- package/dist/delay.cjs +72 -0
- package/dist/delay.d.cts +26 -0
- package/dist/delay.d.ts +26 -0
- package/dist/delay.js +70 -0
- package/dist/derived.cjs +143 -0
- package/dist/derived.d.cts +41 -0
- package/dist/derived.d.ts +41 -0
- package/dist/derived.js +139 -0
- package/dist/driver/index.cjs +22 -0
- package/dist/driver/index.d.cts +7 -0
- package/dist/driver/index.d.ts +7 -0
- package/dist/driver/index.js +14 -0
- package/dist/driver/keyframeTiming.cjs +130 -0
- package/dist/driver/keyframeTiming.d.cts +18 -0
- package/dist/driver/keyframeTiming.d.ts +18 -0
- package/dist/driver/keyframeTiming.js +124 -0
- package/dist/driver/keyframeTimingConfig.cjs +24 -0
- package/dist/driver/keyframeTimingConfig.d.cts +5 -0
- package/dist/driver/keyframeTimingConfig.d.ts +5 -0
- package/dist/driver/keyframeTimingConfig.js +22 -0
- package/dist/driver/prepare.cjs +459 -0
- package/dist/driver/prepare.d.cts +4 -0
- package/dist/driver/prepare.d.ts +4 -0
- package/dist/driver/prepare.js +454 -0
- package/dist/driver/reference.cjs +762 -0
- package/dist/driver/reference.d.cts +53 -0
- package/dist/driver/reference.d.ts +53 -0
- package/dist/driver/reference.js +757 -0
- package/dist/driver/step.cjs +55 -0
- package/dist/driver/step.d.cts +9 -0
- package/dist/driver/step.d.ts +9 -0
- package/dist/driver/step.js +52 -0
- package/dist/driver/tiers.cjs +40 -0
- package/dist/driver/tiers.d.cts +2 -0
- package/dist/driver/tiers.d.ts +2 -0
- package/dist/driver/tiers.js +37 -0
- package/dist/driver/types.cjs +9 -0
- package/dist/driver/types.d.cts +68 -0
- package/dist/driver/types.d.ts +68 -0
- package/dist/driver/types.js +8 -0
- package/dist/external-animation-ledger.cjs +1250 -0
- package/dist/external-animation-ledger.d.cts +416 -0
- package/dist/external-animation-ledger.d.ts +416 -0
- package/dist/external-animation-ledger.js +1243 -0
- package/dist/gesture/directionLock.cjs +25 -0
- package/dist/gesture/directionLock.d.cts +8 -0
- package/dist/gesture/directionLock.d.ts +8 -0
- package/dist/gesture/directionLock.js +21 -0
- package/dist/gesture/dragConfig.cjs +634 -0
- package/dist/gesture/dragConfig.d.cts +298 -0
- package/dist/gesture/dragConfig.d.ts +298 -0
- package/dist/gesture/dragConfig.js +624 -0
- package/dist/gesture/elastic.cjs +44 -0
- package/dist/gesture/elastic.d.cts +4 -0
- package/dist/gesture/elastic.d.ts +4 -0
- package/dist/gesture/elastic.js +39 -0
- package/dist/gesture/handoffSession.cjs +161 -0
- package/dist/gesture/handoffSession.d.cts +35 -0
- package/dist/gesture/handoffSession.d.ts +35 -0
- package/dist/gesture/handoffSession.js +158 -0
- package/dist/gesture/index.cjs +37 -0
- package/dist/gesture/index.d.cts +12 -0
- package/dist/gesture/index.d.ts +12 -0
- package/dist/gesture/index.js +11 -0
- package/dist/gesture/projection.cjs +95 -0
- package/dist/gesture/projection.d.cts +7 -0
- package/dist/gesture/projection.d.ts +7 -0
- package/dist/gesture/projection.js +87 -0
- package/dist/gesture/session.cjs +162 -0
- package/dist/gesture/session.d.cts +29 -0
- package/dist/gesture/session.d.ts +29 -0
- package/dist/gesture/session.js +158 -0
- package/dist/gesture/types.cjs +5 -0
- package/dist/gesture/types.d.cts +13 -0
- package/dist/gesture/types.d.ts +13 -0
- package/dist/gesture/types.js +4 -0
- package/dist/gesture/viewportConstraints.cjs +38 -0
- package/dist/gesture/viewportConstraints.d.cts +6 -0
- package/dist/gesture/viewportConstraints.d.ts +6 -0
- package/dist/gesture/viewportConstraints.js +34 -0
- package/dist/graph.cjs +226 -0
- package/dist/graph.d.cts +2 -0
- package/dist/graph.d.ts +2 -0
- package/dist/graph.js +223 -0
- package/dist/index.cjs +140 -0
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +70 -0
- package/dist/inertia.cjs +214 -0
- package/dist/inertia.d.cts +53 -0
- package/dist/inertia.d.ts +53 -0
- package/dist/inertia.js +212 -0
- package/dist/instant.cjs +66 -0
- package/dist/instant.d.cts +16 -0
- package/dist/instant.d.ts +16 -0
- package/dist/instant.js +63 -0
- package/dist/internal-driver.cjs +81 -0
- package/dist/internal-driver.d.cts +19 -0
- package/dist/internal-driver.d.ts +19 -0
- package/dist/internal-driver.js +35 -0
- package/dist/keyframes.cjs +191 -0
- package/dist/keyframes.d.cts +13 -0
- package/dist/keyframes.d.ts +13 -0
- package/dist/keyframes.js +188 -0
- package/dist/layout/commitDetector.cjs +67 -0
- package/dist/layout/commitDetector.d.cts +21 -0
- package/dist/layout/commitDetector.d.ts +21 -0
- package/dist/layout/commitDetector.js +64 -0
- package/dist/layout/compose.cjs +67 -0
- package/dist/layout/compose.d.cts +30 -0
- package/dist/layout/compose.d.ts +30 -0
- package/dist/layout/compose.js +65 -0
- package/dist/layout/constants.cjs +13 -0
- package/dist/layout/constants.d.cts +6 -0
- package/dist/layout/constants.d.ts +6 -0
- package/dist/layout/constants.js +10 -0
- package/dist/layout/identity.cjs +700 -0
- package/dist/layout/identity.d.cts +67 -0
- package/dist/layout/identity.d.ts +67 -0
- package/dist/layout/identity.js +698 -0
- package/dist/layout/index.cjs +36 -0
- package/dist/layout/index.d.cts +18 -0
- package/dist/layout/index.d.ts +18 -0
- package/dist/layout/index.js +13 -0
- package/dist/layout/measure.cjs +81 -0
- package/dist/layout/measure.d.cts +43 -0
- package/dist/layout/measure.d.ts +43 -0
- package/dist/layout/measure.js +78 -0
- package/dist/layout/projection.cjs +99 -0
- package/dist/layout/projection.d.cts +23 -0
- package/dist/layout/projection.d.ts +23 -0
- package/dist/layout/projection.js +97 -0
- package/dist/layout/scroll.cjs +27 -0
- package/dist/layout/scroll.d.cts +13 -0
- package/dist/layout/scroll.d.ts +13 -0
- package/dist/layout/scroll.js +24 -0
- package/dist/layout/session.cjs +207 -0
- package/dist/layout/session.d.cts +73 -0
- package/dist/layout/session.d.ts +73 -0
- package/dist/layout/session.js +205 -0
- package/dist/layout/tree.cjs +826 -0
- package/dist/layout/tree.d.cts +70 -0
- package/dist/layout/tree.d.ts +70 -0
- package/dist/layout/tree.js +823 -0
- package/dist/layout/types.cjs +36 -0
- package/dist/layout/types.d.cts +31 -0
- package/dist/layout/types.d.ts +31 -0
- package/dist/layout/types.js +35 -0
- package/dist/motion-arc.cjs +184 -0
- package/dist/motion-arc.d.cts +78 -0
- package/dist/motion-arc.d.ts +78 -0
- package/dist/motion-arc.js +183 -0
- package/dist/motion-mix.cjs +205 -0
- package/dist/motion-mix.d.cts +3 -0
- package/dist/motion-mix.d.ts +3 -0
- package/dist/motion-mix.js +202 -0
- package/dist/motion-value-driver-port.cjs +636 -0
- package/dist/motion-value-driver-port.d.cts +406 -0
- package/dist/motion-value-driver-port.d.ts +406 -0
- package/dist/motion-value-driver-port.js +627 -0
- package/dist/motion-value.cjs +189 -0
- package/dist/motion-value.d.cts +51 -0
- package/dist/motion-value.d.ts +51 -0
- package/dist/motion-value.js +185 -0
- package/dist/presence/controller.cjs +657 -0
- package/dist/presence/controller.d.cts +6 -0
- package/dist/presence/controller.d.ts +6 -0
- package/dist/presence/controller.js +652 -0
- package/dist/presence/index.cjs +19 -0
- package/dist/presence/index.d.cts +4 -0
- package/dist/presence/index.d.ts +4 -0
- package/dist/presence/index.js +12 -0
- package/dist/presence/machine.cjs +50 -0
- package/dist/presence/machine.d.cts +10 -0
- package/dist/presence/machine.d.ts +10 -0
- package/dist/presence/machine.js +46 -0
- package/dist/presence/types.cjs +6 -0
- package/dist/presence/types.d.cts +32 -0
- package/dist/presence/types.d.ts +32 -0
- package/dist/presence/types.js +5 -0
- package/dist/repeat.cjs +311 -0
- package/dist/repeat.d.cts +174 -0
- package/dist/repeat.d.ts +174 -0
- package/dist/repeat.js +300 -0
- package/dist/spring.cjs +128 -0
- package/dist/spring.d.cts +18 -0
- package/dist/spring.d.ts +18 -0
- package/dist/spring.js +125 -0
- package/dist/subscriptions.cjs +74 -0
- package/dist/subscriptions.d.cts +19 -0
- package/dist/subscriptions.d.ts +19 -0
- package/dist/subscriptions.js +69 -0
- package/dist/subset/index.cjs +23 -0
- package/dist/subset/index.d.cts +6 -0
- package/dist/subset/index.d.ts +6 -0
- package/dist/subset/index.js +13 -0
- package/dist/subset/normalize.cjs +90 -0
- package/dist/subset/normalize.d.cts +10 -0
- package/dist/subset/normalize.d.ts +10 -0
- package/dist/subset/normalize.js +85 -0
- package/dist/subset/registry.cjs +259 -0
- package/dist/subset/registry.d.cts +25 -0
- package/dist/subset/registry.d.ts +25 -0
- package/dist/subset/registry.js +256 -0
- package/dist/subset/resolve.cjs +98 -0
- package/dist/subset/resolve.d.cts +24 -0
- package/dist/subset/resolve.d.ts +24 -0
- package/dist/subset/resolve.js +90 -0
- package/dist/timing.cjs +206 -0
- package/dist/timing.d.cts +17 -0
- package/dist/timing.d.ts +17 -0
- package/dist/timing.js +201 -0
- package/dist/transformTemplate.cjs +219 -0
- package/dist/transformTemplate.d.cts +29 -0
- package/dist/transformTemplate.d.ts +29 -0
- package/dist/transformTemplate.js +215 -0
- package/dist/transition.cjs +231 -0
- package/dist/transition.d.cts +89 -0
- package/dist/transition.d.ts +89 -0
- package/dist/transition.js +223 -0
- package/dist/types.cjs +4 -0
- package/dist/types.d.cts +175 -0
- package/dist/types.d.ts +175 -0
- package/dist/types.js +3 -0
- package/dist/value-types/color.cjs +220 -0
- package/dist/value-types/color.d.cts +19 -0
- package/dist/value-types/color.d.ts +19 -0
- package/dist/value-types/color.js +218 -0
- package/dist/value-types/complex.cjs +160 -0
- package/dist/value-types/complex.d.cts +19 -0
- package/dist/value-types/complex.d.ts +19 -0
- package/dist/value-types/complex.js +155 -0
- package/dist/value-types/constants.cjs +15 -0
- package/dist/value-types/constants.d.cts +6 -0
- package/dist/value-types/constants.d.ts +6 -0
- package/dist/value-types/constants.js +12 -0
- package/dist/value-types/discrete.cjs +62 -0
- package/dist/value-types/discrete.d.cts +4 -0
- package/dist/value-types/discrete.d.ts +4 -0
- package/dist/value-types/discrete.js +56 -0
- package/dist/value-types/index.cjs +59 -0
- package/dist/value-types/index.d.cts +14 -0
- package/dist/value-types/index.d.ts +14 -0
- package/dist/value-types/index.js +24 -0
- package/dist/value-types/measure-resolve.cjs +325 -0
- package/dist/value-types/measure-resolve.d.cts +91 -0
- package/dist/value-types/measure-resolve.d.ts +91 -0
- package/dist/value-types/measure-resolve.js +313 -0
- package/dist/value-types/mix.cjs +90 -0
- package/dist/value-types/mix.d.cts +27 -0
- package/dist/value-types/mix.d.ts +27 -0
- package/dist/value-types/mix.js +85 -0
- package/dist/value-types/named-colors.cjs +61 -0
- package/dist/value-types/named-colors.d.cts +2 -0
- package/dist/value-types/named-colors.d.ts +2 -0
- package/dist/value-types/named-colors.js +58 -0
- package/dist/value-types/numeric.cjs +86 -0
- package/dist/value-types/numeric.d.cts +16 -0
- package/dist/value-types/numeric.d.ts +16 -0
- package/dist/value-types/numeric.js +79 -0
- package/dist/worklet-layout/config/constants.js +39 -0
- package/dist/worklet-layout/layout/constants.js +11 -0
- package/dist/worklet-layout/layout/identity.js +699 -0
- package/dist/worklet-layout/layout/projection.js +98 -0
- package/dist/worklet-layout/layout/session.js +206 -0
- package/dist/worklet-layout/layout/tree.js +824 -0
- package/dist/worklet-layout/layout/types.js +36 -0
- package/dist/worklet-layout/spring.js +125 -0
- package/dist/worklet-layout/timing.js +201 -0
- package/dist/worklet-layout/transition.js +223 -0
- package/dist/worklet-layout.cjs +47 -0
- package/dist/worklet-layout.d.cts +15 -0
- package/dist/worklet-layout.d.ts +15 -0
- package/dist/worklet-layout.js +28 -0
- package/dist/wrap.cjs +7 -0
- package/dist/wrap.d.cts +1 -0
- package/dist/wrap.d.ts +1 -0
- package/dist/wrap.js +4 -0
- package/package.json +45 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import type { DragConstraints, SnapConfig } from "./types.cjs";
|
|
2
|
+
import type { MotionValue } from "../types.cjs";
|
|
3
|
+
export type DragAxis = 'x' | 'y';
|
|
4
|
+
export type DragProp = DragAxis | true | false;
|
|
5
|
+
export type DragConfigSeverity = 'development' | 'production';
|
|
6
|
+
export interface DragInfo {
|
|
7
|
+
readonly point: {
|
|
8
|
+
readonly x: number;
|
|
9
|
+
readonly y: number;
|
|
10
|
+
};
|
|
11
|
+
readonly delta: {
|
|
12
|
+
readonly x: number;
|
|
13
|
+
readonly y: number;
|
|
14
|
+
};
|
|
15
|
+
readonly offset: {
|
|
16
|
+
readonly x: number;
|
|
17
|
+
readonly y: number;
|
|
18
|
+
};
|
|
19
|
+
readonly velocity: {
|
|
20
|
+
readonly x: number;
|
|
21
|
+
readonly y: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare const DEFAULT_DRAG_ELASTIC = 0.35;
|
|
25
|
+
export interface DragConstraintsInput {
|
|
26
|
+
readonly left?: number;
|
|
27
|
+
readonly right?: number;
|
|
28
|
+
readonly top?: number;
|
|
29
|
+
readonly bottom?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface DragSnapPointsInput {
|
|
32
|
+
readonly x?: readonly number[];
|
|
33
|
+
readonly y?: readonly number[];
|
|
34
|
+
}
|
|
35
|
+
export type DragCallback = (event: unknown, info: DragInfo) => void;
|
|
36
|
+
export interface MeasuredDragConstraints {
|
|
37
|
+
top: number;
|
|
38
|
+
left: number;
|
|
39
|
+
bottom: number;
|
|
40
|
+
right: number;
|
|
41
|
+
}
|
|
42
|
+
export type MeasureDragConstraintsCallback = (constraints: MeasuredDragConstraints) => MeasuredDragConstraints | void;
|
|
43
|
+
export declare function validateMeasureReplacementBox(replaced: MeasuredDragConstraints): MeasuredDragConstraints;
|
|
44
|
+
export interface TapInfo {
|
|
45
|
+
readonly point: {
|
|
46
|
+
readonly x: number;
|
|
47
|
+
readonly y: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export type TapCallback = (event: unknown, info: TapInfo) => void;
|
|
51
|
+
export interface DragSnapPointsX {
|
|
52
|
+
readonly x: readonly [number, ...number[]];
|
|
53
|
+
readonly y?: undefined;
|
|
54
|
+
}
|
|
55
|
+
export interface DragSnapPointsY {
|
|
56
|
+
readonly y: readonly [number, ...number[]];
|
|
57
|
+
readonly x?: undefined;
|
|
58
|
+
}
|
|
59
|
+
export type DragConstraintsX = {
|
|
60
|
+
readonly left: number;
|
|
61
|
+
readonly right: number;
|
|
62
|
+
readonly top?: undefined;
|
|
63
|
+
readonly bottom?: undefined;
|
|
64
|
+
readonly current?: undefined;
|
|
65
|
+
} | {
|
|
66
|
+
readonly left: number;
|
|
67
|
+
readonly right?: undefined;
|
|
68
|
+
readonly top?: undefined;
|
|
69
|
+
readonly bottom?: undefined;
|
|
70
|
+
readonly current?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
readonly left?: undefined;
|
|
73
|
+
readonly right: number;
|
|
74
|
+
readonly top?: undefined;
|
|
75
|
+
readonly bottom?: undefined;
|
|
76
|
+
readonly current?: undefined;
|
|
77
|
+
};
|
|
78
|
+
export type DragConstraintsY = {
|
|
79
|
+
readonly top: number;
|
|
80
|
+
readonly bottom: number;
|
|
81
|
+
readonly left?: undefined;
|
|
82
|
+
readonly right?: undefined;
|
|
83
|
+
readonly current?: undefined;
|
|
84
|
+
} | {
|
|
85
|
+
readonly top: number;
|
|
86
|
+
readonly bottom?: undefined;
|
|
87
|
+
readonly left?: undefined;
|
|
88
|
+
readonly right?: undefined;
|
|
89
|
+
readonly current?: undefined;
|
|
90
|
+
} | {
|
|
91
|
+
readonly top?: undefined;
|
|
92
|
+
readonly bottom: number;
|
|
93
|
+
readonly left?: undefined;
|
|
94
|
+
readonly right?: undefined;
|
|
95
|
+
readonly current?: undefined;
|
|
96
|
+
};
|
|
97
|
+
export type DragConstraintsBoth = {
|
|
98
|
+
readonly left: number;
|
|
99
|
+
readonly right?: number | undefined;
|
|
100
|
+
readonly top?: number | undefined;
|
|
101
|
+
readonly bottom?: number | undefined;
|
|
102
|
+
readonly current?: undefined;
|
|
103
|
+
} | {
|
|
104
|
+
readonly left?: number | undefined;
|
|
105
|
+
readonly right: number;
|
|
106
|
+
readonly top?: number | undefined;
|
|
107
|
+
readonly bottom?: number | undefined;
|
|
108
|
+
readonly current?: undefined;
|
|
109
|
+
} | {
|
|
110
|
+
readonly left?: number | undefined;
|
|
111
|
+
readonly right?: number | undefined;
|
|
112
|
+
readonly top: number;
|
|
113
|
+
readonly bottom?: number | undefined;
|
|
114
|
+
readonly current?: undefined;
|
|
115
|
+
} | {
|
|
116
|
+
readonly left?: number | undefined;
|
|
117
|
+
readonly right?: number | undefined;
|
|
118
|
+
readonly top?: number | undefined;
|
|
119
|
+
readonly bottom: number;
|
|
120
|
+
readonly current?: undefined;
|
|
121
|
+
};
|
|
122
|
+
export interface DragConstraintsRef {
|
|
123
|
+
readonly current: unknown;
|
|
124
|
+
readonly left?: undefined;
|
|
125
|
+
readonly right?: undefined;
|
|
126
|
+
readonly top?: undefined;
|
|
127
|
+
readonly bottom?: undefined;
|
|
128
|
+
}
|
|
129
|
+
export interface DragControlOptions {
|
|
130
|
+
readonly distanceThreshold?: number | undefined;
|
|
131
|
+
readonly snapToCursor?: boolean | undefined;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Runtime-validate DragControls.start options (G-INV-8; seal review r6/r7/r8).
|
|
135
|
+
* Shared by native and web so both engines refuse malformed options identically.
|
|
136
|
+
* Omitted options stay undefined (pin defaults at the session); present keys must match shape.
|
|
137
|
+
* Closed plain-object shape only — unknown keys and non-plain objects refuse loud.
|
|
138
|
+
*/
|
|
139
|
+
export declare function validateDragControlOptions(options: unknown): DragControlOptions | undefined;
|
|
140
|
+
export interface DragControlsHandle {
|
|
141
|
+
start(event: unknown, options?: DragControlOptions): void;
|
|
142
|
+
cancel(): void;
|
|
143
|
+
/** Pin-shaped zero-arg stop (native may ignore optional trailing args at the entry). */
|
|
144
|
+
stop(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Runtime-required for both engines (pin motion.div + native MotionView subscribe).
|
|
147
|
+
* Optional on the type so pin/class typings without an explicit subscribe member still
|
|
148
|
+
* assign; `isDragControlsHandle` refuses at resolve when the method is missing (r8 major).
|
|
149
|
+
*/
|
|
150
|
+
subscribe?(controls: unknown): () => void;
|
|
151
|
+
}
|
|
152
|
+
interface DragCallbackProps {
|
|
153
|
+
/** R15 D5: number in [0,1] or boolean (true → 0.35, false → 0). Per-side object deferred. */
|
|
154
|
+
readonly dragElastic?: number | boolean | undefined;
|
|
155
|
+
readonly dragPropagation?: boolean | undefined;
|
|
156
|
+
/** Imperative hub (REQ-API-043). Structural — each entry's useDragControls() returns a compatible instance. */
|
|
157
|
+
readonly dragControls?: DragControlsHandle | undefined;
|
|
158
|
+
/** When false, element-originated start is refused — hub-only initiation (REQ-API-043). Default true. */
|
|
159
|
+
readonly dragListener?: boolean | undefined;
|
|
160
|
+
/** R15 D4 (REQ-API-044): fix session to first axis past the pin 10px threshold. */
|
|
161
|
+
readonly dragDirectionLock?: boolean | undefined;
|
|
162
|
+
/** R15 D4: fires once when the lock axis is acquired. */
|
|
163
|
+
readonly onDirectionLock?: ((axis: DragAxis) => void) | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* R15 D5 (REQ-API-045): gates the release velocity seed. Default true (pin).
|
|
166
|
+
* `false` zeroes platform velocity BEFORE projection (settle-at-release / nearest-to-origin,
|
|
167
|
+
* never a projected slide — the pin's `velocity: dragMomentum ? v : 0`).
|
|
168
|
+
*/
|
|
169
|
+
readonly dragMomentum?: boolean | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* R15 D5 (REQ-API-045): release inertia customization. Pin spreads InertiaOptions;
|
|
172
|
+
* `bounceStiffness`/`bounceDamping` name the BOUNDARY spring the two-phase inertia generator
|
|
173
|
+
* (R16, REQ-GESTURE-023) switches to at a wall — their pin meaning. The R15 D5 mapping onto
|
|
174
|
+
* the shared release spring is superseded for free-drag (the snap/cancel spring path keeps it
|
|
175
|
+
* until the snap-curve rung).
|
|
176
|
+
*/
|
|
177
|
+
readonly dragTransition?: {
|
|
178
|
+
readonly bounceStiffness?: number;
|
|
179
|
+
readonly bounceDamping?: number;
|
|
180
|
+
} | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* R15 D5 (REQ-API-045): force release target to origin on the named axes.
|
|
183
|
+
* `true` → both dragged axes; `'x'`/`'y'` → that axis only.
|
|
184
|
+
*/
|
|
185
|
+
readonly dragSnapToOrigin?: boolean | 'x' | 'y' | undefined;
|
|
186
|
+
readonly onDragStart?: DragCallback | undefined;
|
|
187
|
+
readonly onDrag?: DragCallback | undefined;
|
|
188
|
+
readonly onDragEnd?: DragCallback | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* R15 D5 (REQ-API-046): consumer-supplied MotionValues the drag session writes.
|
|
191
|
+
* Runtime already accepts these on native; they were missing from the public union.
|
|
192
|
+
*/
|
|
193
|
+
readonly _dragX?: MotionValue<number> | undefined;
|
|
194
|
+
readonly _dragY?: MotionValue<number> | undefined;
|
|
195
|
+
}
|
|
196
|
+
interface DragMeasureHookProps {
|
|
197
|
+
readonly onMeasureDragConstraints?: MeasureDragConstraintsCallback | undefined;
|
|
198
|
+
}
|
|
199
|
+
interface DragNoMeasureHookProps {
|
|
200
|
+
readonly onMeasureDragConstraints?: undefined;
|
|
201
|
+
}
|
|
202
|
+
export type DragProps = {
|
|
203
|
+
readonly drag?: undefined;
|
|
204
|
+
readonly dragConstraints?: undefined;
|
|
205
|
+
readonly dragElastic?: undefined;
|
|
206
|
+
readonly dragSnapPoints?: undefined;
|
|
207
|
+
readonly dragPropagation?: undefined;
|
|
208
|
+
readonly dragControls?: undefined;
|
|
209
|
+
readonly dragListener?: undefined;
|
|
210
|
+
readonly onMeasureDragConstraints?: undefined;
|
|
211
|
+
readonly onDragStart?: undefined;
|
|
212
|
+
readonly onDrag?: undefined;
|
|
213
|
+
readonly onDragEnd?: undefined;
|
|
214
|
+
readonly _dragX?: undefined;
|
|
215
|
+
readonly _dragY?: undefined;
|
|
216
|
+
} | ({
|
|
217
|
+
readonly drag: 'x';
|
|
218
|
+
readonly dragSnapPoints?: undefined;
|
|
219
|
+
readonly dragConstraints: DragConstraintsRef;
|
|
220
|
+
} & DragCallbackProps & DragMeasureHookProps) | ({
|
|
221
|
+
readonly drag: 'x';
|
|
222
|
+
readonly dragSnapPoints?: DragSnapPointsX | undefined;
|
|
223
|
+
readonly dragConstraints?: DragConstraintsX | undefined;
|
|
224
|
+
} & DragCallbackProps & DragNoMeasureHookProps) | ({
|
|
225
|
+
readonly drag: 'y';
|
|
226
|
+
readonly dragSnapPoints?: undefined;
|
|
227
|
+
readonly dragConstraints: DragConstraintsRef;
|
|
228
|
+
} & DragCallbackProps & DragMeasureHookProps) | ({
|
|
229
|
+
readonly drag: 'y';
|
|
230
|
+
readonly dragSnapPoints?: DragSnapPointsY | undefined;
|
|
231
|
+
readonly dragConstraints?: DragConstraintsY | undefined;
|
|
232
|
+
} & DragCallbackProps & DragNoMeasureHookProps) | ({
|
|
233
|
+
readonly drag: true;
|
|
234
|
+
readonly dragSnapPoints?: undefined;
|
|
235
|
+
readonly dragConstraints: DragConstraintsRef;
|
|
236
|
+
} & DragCallbackProps & DragMeasureHookProps) | ({
|
|
237
|
+
readonly drag: true;
|
|
238
|
+
readonly dragSnapPoints?: undefined;
|
|
239
|
+
readonly dragConstraints?: DragConstraintsBoth | undefined;
|
|
240
|
+
} & DragCallbackProps & DragNoMeasureHookProps) | ({
|
|
241
|
+
readonly drag: false;
|
|
242
|
+
readonly dragSnapPoints?: undefined;
|
|
243
|
+
readonly dragConstraints?: undefined;
|
|
244
|
+
} & DragCallbackProps & DragNoMeasureHookProps);
|
|
245
|
+
export interface DragConfigInput {
|
|
246
|
+
readonly drag: unknown;
|
|
247
|
+
readonly dragConstraints?: unknown;
|
|
248
|
+
readonly dragElastic?: unknown;
|
|
249
|
+
readonly dragSnapPoints?: unknown;
|
|
250
|
+
readonly dragPropagation?: unknown;
|
|
251
|
+
readonly onMeasureDragConstraints?: unknown;
|
|
252
|
+
/** R15 D3 (REQ-API-043): structural hub — validated at the shared resolver boundary. */
|
|
253
|
+
readonly dragControls?: unknown;
|
|
254
|
+
/** R15 D3 (REQ-API-043): element-originated start gate — boolean only. */
|
|
255
|
+
readonly dragListener?: unknown;
|
|
256
|
+
/** R15 D4 (REQ-API-044): axis lock after pin 10px threshold. */
|
|
257
|
+
readonly dragDirectionLock?: unknown;
|
|
258
|
+
/** R15 D5 (REQ-API-045). */
|
|
259
|
+
readonly dragMomentum?: unknown;
|
|
260
|
+
readonly dragTransition?: unknown;
|
|
261
|
+
readonly dragSnapToOrigin?: unknown;
|
|
262
|
+
}
|
|
263
|
+
export interface ResolvedDragAxisConfig {
|
|
264
|
+
readonly constraints?: DragConstraints | undefined;
|
|
265
|
+
readonly snap?: SnapConfig | undefined;
|
|
266
|
+
readonly constraintsRef?: {
|
|
267
|
+
readonly ref: DragConstraintsRef;
|
|
268
|
+
readonly elastic: number;
|
|
269
|
+
} | undefined;
|
|
270
|
+
}
|
|
271
|
+
interface ResolvedDragHubFields {
|
|
272
|
+
readonly dragPropagation: boolean;
|
|
273
|
+
/** Canonical: omitted and true both resolve true (pin default element listener). */
|
|
274
|
+
readonly dragListener: boolean;
|
|
275
|
+
/** Process-local identity token for the hub object, or null when absent. */
|
|
276
|
+
readonly dragControlsToken: number | null;
|
|
277
|
+
/** R15 D4: omitted and false are identical (default off). */
|
|
278
|
+
readonly dragDirectionLock: boolean;
|
|
279
|
+
/** R15 D5: omitted and true are identical (pin default momentum on). */
|
|
280
|
+
readonly dragMomentum: boolean;
|
|
281
|
+
/** R15 D5: resolved bounce spring override (undefined → GESTURE_RELEASE_SPRING). */
|
|
282
|
+
readonly dragTransition: {
|
|
283
|
+
readonly bounceStiffness?: number;
|
|
284
|
+
readonly bounceDamping?: number;
|
|
285
|
+
} | null;
|
|
286
|
+
/** R15 D5: which axes force release target 0. */
|
|
287
|
+
readonly dragSnapToOrigin: false | true | 'x' | 'y';
|
|
288
|
+
}
|
|
289
|
+
export type ResolvedDragConfig = {
|
|
290
|
+
readonly x?: ResolvedDragAxisConfig | undefined;
|
|
291
|
+
readonly y?: ResolvedDragAxisConfig | undefined;
|
|
292
|
+
} & ResolvedDragHubFields;
|
|
293
|
+
export declare function resolvedDragAxes(config: ResolvedDragConfig): readonly DragAxis[];
|
|
294
|
+
export declare function dragConfigMountSignature(config: ResolvedDragConfig | null): string;
|
|
295
|
+
export declare function describeValue(value: unknown): string;
|
|
296
|
+
export declare function gateOrphanDragCallbacks(callbackName: string, severity: DragConfigSeverity, report: (error: Error) => void): void;
|
|
297
|
+
export declare function resolveDragConfig(input: DragConfigInput, severity: DragConfigSeverity, report: (error: Error) => void): ResolvedDragConfig | null;
|
|
298
|
+
export {};
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import type { DragConstraints, SnapConfig } from "./types.js";
|
|
2
|
+
import type { MotionValue } from "../types.js";
|
|
3
|
+
export type DragAxis = 'x' | 'y';
|
|
4
|
+
export type DragProp = DragAxis | true | false;
|
|
5
|
+
export type DragConfigSeverity = 'development' | 'production';
|
|
6
|
+
export interface DragInfo {
|
|
7
|
+
readonly point: {
|
|
8
|
+
readonly x: number;
|
|
9
|
+
readonly y: number;
|
|
10
|
+
};
|
|
11
|
+
readonly delta: {
|
|
12
|
+
readonly x: number;
|
|
13
|
+
readonly y: number;
|
|
14
|
+
};
|
|
15
|
+
readonly offset: {
|
|
16
|
+
readonly x: number;
|
|
17
|
+
readonly y: number;
|
|
18
|
+
};
|
|
19
|
+
readonly velocity: {
|
|
20
|
+
readonly x: number;
|
|
21
|
+
readonly y: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare const DEFAULT_DRAG_ELASTIC = 0.35;
|
|
25
|
+
export interface DragConstraintsInput {
|
|
26
|
+
readonly left?: number;
|
|
27
|
+
readonly right?: number;
|
|
28
|
+
readonly top?: number;
|
|
29
|
+
readonly bottom?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface DragSnapPointsInput {
|
|
32
|
+
readonly x?: readonly number[];
|
|
33
|
+
readonly y?: readonly number[];
|
|
34
|
+
}
|
|
35
|
+
export type DragCallback = (event: unknown, info: DragInfo) => void;
|
|
36
|
+
export interface MeasuredDragConstraints {
|
|
37
|
+
top: number;
|
|
38
|
+
left: number;
|
|
39
|
+
bottom: number;
|
|
40
|
+
right: number;
|
|
41
|
+
}
|
|
42
|
+
export type MeasureDragConstraintsCallback = (constraints: MeasuredDragConstraints) => MeasuredDragConstraints | void;
|
|
43
|
+
export declare function validateMeasureReplacementBox(replaced: MeasuredDragConstraints): MeasuredDragConstraints;
|
|
44
|
+
export interface TapInfo {
|
|
45
|
+
readonly point: {
|
|
46
|
+
readonly x: number;
|
|
47
|
+
readonly y: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export type TapCallback = (event: unknown, info: TapInfo) => void;
|
|
51
|
+
export interface DragSnapPointsX {
|
|
52
|
+
readonly x: readonly [number, ...number[]];
|
|
53
|
+
readonly y?: undefined;
|
|
54
|
+
}
|
|
55
|
+
export interface DragSnapPointsY {
|
|
56
|
+
readonly y: readonly [number, ...number[]];
|
|
57
|
+
readonly x?: undefined;
|
|
58
|
+
}
|
|
59
|
+
export type DragConstraintsX = {
|
|
60
|
+
readonly left: number;
|
|
61
|
+
readonly right: number;
|
|
62
|
+
readonly top?: undefined;
|
|
63
|
+
readonly bottom?: undefined;
|
|
64
|
+
readonly current?: undefined;
|
|
65
|
+
} | {
|
|
66
|
+
readonly left: number;
|
|
67
|
+
readonly right?: undefined;
|
|
68
|
+
readonly top?: undefined;
|
|
69
|
+
readonly bottom?: undefined;
|
|
70
|
+
readonly current?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
readonly left?: undefined;
|
|
73
|
+
readonly right: number;
|
|
74
|
+
readonly top?: undefined;
|
|
75
|
+
readonly bottom?: undefined;
|
|
76
|
+
readonly current?: undefined;
|
|
77
|
+
};
|
|
78
|
+
export type DragConstraintsY = {
|
|
79
|
+
readonly top: number;
|
|
80
|
+
readonly bottom: number;
|
|
81
|
+
readonly left?: undefined;
|
|
82
|
+
readonly right?: undefined;
|
|
83
|
+
readonly current?: undefined;
|
|
84
|
+
} | {
|
|
85
|
+
readonly top: number;
|
|
86
|
+
readonly bottom?: undefined;
|
|
87
|
+
readonly left?: undefined;
|
|
88
|
+
readonly right?: undefined;
|
|
89
|
+
readonly current?: undefined;
|
|
90
|
+
} | {
|
|
91
|
+
readonly top?: undefined;
|
|
92
|
+
readonly bottom: number;
|
|
93
|
+
readonly left?: undefined;
|
|
94
|
+
readonly right?: undefined;
|
|
95
|
+
readonly current?: undefined;
|
|
96
|
+
};
|
|
97
|
+
export type DragConstraintsBoth = {
|
|
98
|
+
readonly left: number;
|
|
99
|
+
readonly right?: number | undefined;
|
|
100
|
+
readonly top?: number | undefined;
|
|
101
|
+
readonly bottom?: number | undefined;
|
|
102
|
+
readonly current?: undefined;
|
|
103
|
+
} | {
|
|
104
|
+
readonly left?: number | undefined;
|
|
105
|
+
readonly right: number;
|
|
106
|
+
readonly top?: number | undefined;
|
|
107
|
+
readonly bottom?: number | undefined;
|
|
108
|
+
readonly current?: undefined;
|
|
109
|
+
} | {
|
|
110
|
+
readonly left?: number | undefined;
|
|
111
|
+
readonly right?: number | undefined;
|
|
112
|
+
readonly top: number;
|
|
113
|
+
readonly bottom?: number | undefined;
|
|
114
|
+
readonly current?: undefined;
|
|
115
|
+
} | {
|
|
116
|
+
readonly left?: number | undefined;
|
|
117
|
+
readonly right?: number | undefined;
|
|
118
|
+
readonly top?: number | undefined;
|
|
119
|
+
readonly bottom: number;
|
|
120
|
+
readonly current?: undefined;
|
|
121
|
+
};
|
|
122
|
+
export interface DragConstraintsRef {
|
|
123
|
+
readonly current: unknown;
|
|
124
|
+
readonly left?: undefined;
|
|
125
|
+
readonly right?: undefined;
|
|
126
|
+
readonly top?: undefined;
|
|
127
|
+
readonly bottom?: undefined;
|
|
128
|
+
}
|
|
129
|
+
export interface DragControlOptions {
|
|
130
|
+
readonly distanceThreshold?: number | undefined;
|
|
131
|
+
readonly snapToCursor?: boolean | undefined;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Runtime-validate DragControls.start options (G-INV-8; seal review r6/r7/r8).
|
|
135
|
+
* Shared by native and web so both engines refuse malformed options identically.
|
|
136
|
+
* Omitted options stay undefined (pin defaults at the session); present keys must match shape.
|
|
137
|
+
* Closed plain-object shape only — unknown keys and non-plain objects refuse loud.
|
|
138
|
+
*/
|
|
139
|
+
export declare function validateDragControlOptions(options: unknown): DragControlOptions | undefined;
|
|
140
|
+
export interface DragControlsHandle {
|
|
141
|
+
start(event: unknown, options?: DragControlOptions): void;
|
|
142
|
+
cancel(): void;
|
|
143
|
+
/** Pin-shaped zero-arg stop (native may ignore optional trailing args at the entry). */
|
|
144
|
+
stop(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Runtime-required for both engines (pin motion.div + native MotionView subscribe).
|
|
147
|
+
* Optional on the type so pin/class typings without an explicit subscribe member still
|
|
148
|
+
* assign; `isDragControlsHandle` refuses at resolve when the method is missing (r8 major).
|
|
149
|
+
*/
|
|
150
|
+
subscribe?(controls: unknown): () => void;
|
|
151
|
+
}
|
|
152
|
+
interface DragCallbackProps {
|
|
153
|
+
/** R15 D5: number in [0,1] or boolean (true → 0.35, false → 0). Per-side object deferred. */
|
|
154
|
+
readonly dragElastic?: number | boolean | undefined;
|
|
155
|
+
readonly dragPropagation?: boolean | undefined;
|
|
156
|
+
/** Imperative hub (REQ-API-043). Structural — each entry's useDragControls() returns a compatible instance. */
|
|
157
|
+
readonly dragControls?: DragControlsHandle | undefined;
|
|
158
|
+
/** When false, element-originated start is refused — hub-only initiation (REQ-API-043). Default true. */
|
|
159
|
+
readonly dragListener?: boolean | undefined;
|
|
160
|
+
/** R15 D4 (REQ-API-044): fix session to first axis past the pin 10px threshold. */
|
|
161
|
+
readonly dragDirectionLock?: boolean | undefined;
|
|
162
|
+
/** R15 D4: fires once when the lock axis is acquired. */
|
|
163
|
+
readonly onDirectionLock?: ((axis: DragAxis) => void) | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* R15 D5 (REQ-API-045): gates the release velocity seed. Default true (pin).
|
|
166
|
+
* `false` zeroes platform velocity BEFORE projection (settle-at-release / nearest-to-origin,
|
|
167
|
+
* never a projected slide — the pin's `velocity: dragMomentum ? v : 0`).
|
|
168
|
+
*/
|
|
169
|
+
readonly dragMomentum?: boolean | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* R15 D5 (REQ-API-045): release inertia customization. Pin spreads InertiaOptions;
|
|
172
|
+
* `bounceStiffness`/`bounceDamping` name the BOUNDARY spring the two-phase inertia generator
|
|
173
|
+
* (R16, REQ-GESTURE-023) switches to at a wall — their pin meaning. The R15 D5 mapping onto
|
|
174
|
+
* the shared release spring is superseded for free-drag (the snap/cancel spring path keeps it
|
|
175
|
+
* until the snap-curve rung).
|
|
176
|
+
*/
|
|
177
|
+
readonly dragTransition?: {
|
|
178
|
+
readonly bounceStiffness?: number;
|
|
179
|
+
readonly bounceDamping?: number;
|
|
180
|
+
} | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* R15 D5 (REQ-API-045): force release target to origin on the named axes.
|
|
183
|
+
* `true` → both dragged axes; `'x'`/`'y'` → that axis only.
|
|
184
|
+
*/
|
|
185
|
+
readonly dragSnapToOrigin?: boolean | 'x' | 'y' | undefined;
|
|
186
|
+
readonly onDragStart?: DragCallback | undefined;
|
|
187
|
+
readonly onDrag?: DragCallback | undefined;
|
|
188
|
+
readonly onDragEnd?: DragCallback | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* R15 D5 (REQ-API-046): consumer-supplied MotionValues the drag session writes.
|
|
191
|
+
* Runtime already accepts these on native; they were missing from the public union.
|
|
192
|
+
*/
|
|
193
|
+
readonly _dragX?: MotionValue<number> | undefined;
|
|
194
|
+
readonly _dragY?: MotionValue<number> | undefined;
|
|
195
|
+
}
|
|
196
|
+
interface DragMeasureHookProps {
|
|
197
|
+
readonly onMeasureDragConstraints?: MeasureDragConstraintsCallback | undefined;
|
|
198
|
+
}
|
|
199
|
+
interface DragNoMeasureHookProps {
|
|
200
|
+
readonly onMeasureDragConstraints?: undefined;
|
|
201
|
+
}
|
|
202
|
+
export type DragProps = {
|
|
203
|
+
readonly drag?: undefined;
|
|
204
|
+
readonly dragConstraints?: undefined;
|
|
205
|
+
readonly dragElastic?: undefined;
|
|
206
|
+
readonly dragSnapPoints?: undefined;
|
|
207
|
+
readonly dragPropagation?: undefined;
|
|
208
|
+
readonly dragControls?: undefined;
|
|
209
|
+
readonly dragListener?: undefined;
|
|
210
|
+
readonly onMeasureDragConstraints?: undefined;
|
|
211
|
+
readonly onDragStart?: undefined;
|
|
212
|
+
readonly onDrag?: undefined;
|
|
213
|
+
readonly onDragEnd?: undefined;
|
|
214
|
+
readonly _dragX?: undefined;
|
|
215
|
+
readonly _dragY?: undefined;
|
|
216
|
+
} | ({
|
|
217
|
+
readonly drag: 'x';
|
|
218
|
+
readonly dragSnapPoints?: undefined;
|
|
219
|
+
readonly dragConstraints: DragConstraintsRef;
|
|
220
|
+
} & DragCallbackProps & DragMeasureHookProps) | ({
|
|
221
|
+
readonly drag: 'x';
|
|
222
|
+
readonly dragSnapPoints?: DragSnapPointsX | undefined;
|
|
223
|
+
readonly dragConstraints?: DragConstraintsX | undefined;
|
|
224
|
+
} & DragCallbackProps & DragNoMeasureHookProps) | ({
|
|
225
|
+
readonly drag: 'y';
|
|
226
|
+
readonly dragSnapPoints?: undefined;
|
|
227
|
+
readonly dragConstraints: DragConstraintsRef;
|
|
228
|
+
} & DragCallbackProps & DragMeasureHookProps) | ({
|
|
229
|
+
readonly drag: 'y';
|
|
230
|
+
readonly dragSnapPoints?: DragSnapPointsY | undefined;
|
|
231
|
+
readonly dragConstraints?: DragConstraintsY | undefined;
|
|
232
|
+
} & DragCallbackProps & DragNoMeasureHookProps) | ({
|
|
233
|
+
readonly drag: true;
|
|
234
|
+
readonly dragSnapPoints?: undefined;
|
|
235
|
+
readonly dragConstraints: DragConstraintsRef;
|
|
236
|
+
} & DragCallbackProps & DragMeasureHookProps) | ({
|
|
237
|
+
readonly drag: true;
|
|
238
|
+
readonly dragSnapPoints?: undefined;
|
|
239
|
+
readonly dragConstraints?: DragConstraintsBoth | undefined;
|
|
240
|
+
} & DragCallbackProps & DragNoMeasureHookProps) | ({
|
|
241
|
+
readonly drag: false;
|
|
242
|
+
readonly dragSnapPoints?: undefined;
|
|
243
|
+
readonly dragConstraints?: undefined;
|
|
244
|
+
} & DragCallbackProps & DragNoMeasureHookProps);
|
|
245
|
+
export interface DragConfigInput {
|
|
246
|
+
readonly drag: unknown;
|
|
247
|
+
readonly dragConstraints?: unknown;
|
|
248
|
+
readonly dragElastic?: unknown;
|
|
249
|
+
readonly dragSnapPoints?: unknown;
|
|
250
|
+
readonly dragPropagation?: unknown;
|
|
251
|
+
readonly onMeasureDragConstraints?: unknown;
|
|
252
|
+
/** R15 D3 (REQ-API-043): structural hub — validated at the shared resolver boundary. */
|
|
253
|
+
readonly dragControls?: unknown;
|
|
254
|
+
/** R15 D3 (REQ-API-043): element-originated start gate — boolean only. */
|
|
255
|
+
readonly dragListener?: unknown;
|
|
256
|
+
/** R15 D4 (REQ-API-044): axis lock after pin 10px threshold. */
|
|
257
|
+
readonly dragDirectionLock?: unknown;
|
|
258
|
+
/** R15 D5 (REQ-API-045). */
|
|
259
|
+
readonly dragMomentum?: unknown;
|
|
260
|
+
readonly dragTransition?: unknown;
|
|
261
|
+
readonly dragSnapToOrigin?: unknown;
|
|
262
|
+
}
|
|
263
|
+
export interface ResolvedDragAxisConfig {
|
|
264
|
+
readonly constraints?: DragConstraints | undefined;
|
|
265
|
+
readonly snap?: SnapConfig | undefined;
|
|
266
|
+
readonly constraintsRef?: {
|
|
267
|
+
readonly ref: DragConstraintsRef;
|
|
268
|
+
readonly elastic: number;
|
|
269
|
+
} | undefined;
|
|
270
|
+
}
|
|
271
|
+
interface ResolvedDragHubFields {
|
|
272
|
+
readonly dragPropagation: boolean;
|
|
273
|
+
/** Canonical: omitted and true both resolve true (pin default element listener). */
|
|
274
|
+
readonly dragListener: boolean;
|
|
275
|
+
/** Process-local identity token for the hub object, or null when absent. */
|
|
276
|
+
readonly dragControlsToken: number | null;
|
|
277
|
+
/** R15 D4: omitted and false are identical (default off). */
|
|
278
|
+
readonly dragDirectionLock: boolean;
|
|
279
|
+
/** R15 D5: omitted and true are identical (pin default momentum on). */
|
|
280
|
+
readonly dragMomentum: boolean;
|
|
281
|
+
/** R15 D5: resolved bounce spring override (undefined → GESTURE_RELEASE_SPRING). */
|
|
282
|
+
readonly dragTransition: {
|
|
283
|
+
readonly bounceStiffness?: number;
|
|
284
|
+
readonly bounceDamping?: number;
|
|
285
|
+
} | null;
|
|
286
|
+
/** R15 D5: which axes force release target 0. */
|
|
287
|
+
readonly dragSnapToOrigin: false | true | 'x' | 'y';
|
|
288
|
+
}
|
|
289
|
+
export type ResolvedDragConfig = {
|
|
290
|
+
readonly x?: ResolvedDragAxisConfig | undefined;
|
|
291
|
+
readonly y?: ResolvedDragAxisConfig | undefined;
|
|
292
|
+
} & ResolvedDragHubFields;
|
|
293
|
+
export declare function resolvedDragAxes(config: ResolvedDragConfig): readonly DragAxis[];
|
|
294
|
+
export declare function dragConfigMountSignature(config: ResolvedDragConfig | null): string;
|
|
295
|
+
export declare function describeValue(value: unknown): string;
|
|
296
|
+
export declare function gateOrphanDragCallbacks(callbackName: string, severity: DragConfigSeverity, report: (error: Error) => void): void;
|
|
297
|
+
export declare function resolveDragConfig(input: DragConfigInput, severity: DragConfigSeverity, report: (error: Error) => void): ResolvedDragConfig | null;
|
|
298
|
+
export {};
|