@symbiote-native/engine 0.1.6 → 0.2.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/build/accessibility-info/index.android.js +1 -1
- package/build/accessibility-info/index.ios.js +1 -1
- package/build/action-sheet-ios/index.js +1 -1
- package/build/alert/index.android.js +1 -1
- package/build/alert/index.ios.js +11 -1
- package/build/animated/color.d.ts +2 -8
- package/build/animated/color.js +4 -45
- package/build/animated/easing.js +0 -8
- package/build/animated/graph.d.ts +13 -5
- package/build/animated/graph.js +85 -11
- package/build/animated/index.d.ts +2 -2
- package/build/animated/index.js +2 -2
- package/build/animated/interpolation.js +1 -1
- package/build/animated/leaf-lifecycle.d.ts +7 -0
- package/build/animated/leaf-lifecycle.js +185 -0
- package/build/animated/native/native-animated.js +2 -1
- package/build/animated/rgba.d.ts +8 -0
- package/build/animated/rgba.js +55 -0
- package/build/animated/value.js +12 -7
- package/build/app-registry/index.js +1 -1
- package/build/app-state/index.js +1 -1
- package/build/appearance/index.js +1 -1
- package/build/back-handler/index.js +1 -1
- package/build/commit.js +1 -5
- package/build/debug.d.ts +1 -1
- package/build/debug.js +10 -3
- package/build/dimensions/index.js +1 -1
- package/build/events/index.js +0 -2
- package/build/i18n-manager/index.js +1 -1
- package/build/image-loader.js +1 -1
- package/build/index.d.ts +4 -2
- package/build/index.js +3 -2
- package/build/keyboard/index.js +1 -1
- package/build/layout-animation/index.js +1 -2
- package/build/linking/shared.js +1 -1
- package/build/permissions-android/index.js +1 -1
- package/build/platform/shared.js +1 -1
- package/build/process-font-variant.js +0 -1
- package/build/process-transform/index.js +13 -19
- package/build/report-error.d.ts +5 -0
- package/build/report-error.js +60 -0
- package/build/settings/index.js +1 -1
- package/build/share/index.android.js +1 -1
- package/build/share/index.ios.js +1 -1
- package/build/status-bar/index.android.js +6 -7
- package/build/status-bar/index.ios.js +1 -1
- package/build/style-registry/index.js +95 -16
- package/build/style-sheet/index.js +5 -3
- package/build/surface.js +2 -1
- package/build/toast-android/index.js +1 -1
- package/build/vibration/index.android.js +2 -3
- package/build/vibration/shared.js +1 -1
- package/package.json +3 -2
- package/build/animated/interpolation-node.d.ts +0 -15
- package/build/animated/interpolation-node.js +0 -58
- package/build/image-loader/index.d.ts +0 -24
- package/build/image-loader/index.js +0 -175
- package/build/image-source-resolver/index.d.ts +0 -9
- package/build/image-source-resolver/index.js +0 -16
- package/build/native-modules.d.ts +0 -18
- package/build/native-modules.js +0 -120
- package/build/style-registry/scope/index.d.ts +0 -3
- package/build/style-registry/scope/index.js +0 -41
- package/build/touch-history/index.d.ts +0 -23
- package/build/touch-history/index.js +0 -150
- package/build/type-guards/index.d.ts +0 -4
- package/build/type-guards/index.js +0 -15
package/build/native-modules.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
// JS -> native: reaching a native (Turbo)Module. The New Architecture installs
|
|
2
|
-
// `global.__turboModuleProxy(name)`: a JSI function that returns the native
|
|
3
|
-
// module registered under `name` (a HostObject whose methods call into native),
|
|
4
|
-
// or null. React Native's own `TurboModuleRegistry.get` is just this call; we are
|
|
5
|
-
// one more client of the same global, exactly as `getSlot` is for the view tree.
|
|
6
|
-
//
|
|
7
|
-
// This is first-party access, for symbiote's own modules (StatusBarManager,
|
|
8
|
-
// KeyboardObserver, ...). Third-party RN packages import `TurboModuleRegistry` from
|
|
9
|
-
// `'react-native'` and read the same global themselves; they do not go through
|
|
10
|
-
// here.
|
|
11
|
-
import { dlog } from './debug.js';
|
|
12
|
-
import { installDeviceEventHub, NativeEventEmitter, } from './native-events.js';
|
|
13
|
-
import { isRecord } from './type-guards.js';
|
|
14
|
-
// The native module value crosses from an untyped HostObject into our types here;
|
|
15
|
-
// the caller vouches for its shape via T (the single trust-boundary narrowing, no
|
|
16
|
-
// per-call `as`). Native modules are always non-null objects.
|
|
17
|
-
function isNativeModule(value) {
|
|
18
|
-
return value !== null && value !== undefined;
|
|
19
|
-
}
|
|
20
|
-
// The native module `name`, typed as the caller's interface `T`, or null when no
|
|
21
|
-
// module by that name is registered in the binary (or the proxy is absent, e.g.
|
|
22
|
-
// running headless without a fake installed).
|
|
23
|
-
export function getNativeModule(name) {
|
|
24
|
-
// Non-bridgeless: the function proxy. Call it by name.
|
|
25
|
-
const turboProxy = globalThis.__turboModuleProxy;
|
|
26
|
-
if (typeof turboProxy === 'function') {
|
|
27
|
-
const module = turboProxy(name);
|
|
28
|
-
if (module !== null && module !== undefined)
|
|
29
|
-
return module;
|
|
30
|
-
}
|
|
31
|
-
// Bridgeless: the HostObject proxy, indexed by name. Guard the access: a
|
|
32
|
-
// HostObject may throw for an unlinked name, and a throw here would propagate
|
|
33
|
-
// into a render effect and blank the tree.
|
|
34
|
-
const bridgelessProxy = globalThis.nativeModuleProxy;
|
|
35
|
-
if (bridgelessProxy !== undefined) {
|
|
36
|
-
try {
|
|
37
|
-
const module = bridgelessProxy[name];
|
|
38
|
-
if (isNativeModule(module))
|
|
39
|
-
return module;
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
dlog(`nativeModuleProxy["${name}"] threw: ${String(error)}`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
dlog(`native module "${name}" not found ` +
|
|
46
|
-
`(turbo=${typeof turboProxy}, bridgeless=${typeof globalThis.nativeModuleProxy})`);
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
// Same, but throws when the module is missing, for modules a feature hard-depends
|
|
50
|
-
// on (StatusBar without StatusBarManager cannot function, so failing loud beats a
|
|
51
|
-
// silent no-op).
|
|
52
|
-
export function getEnforcingNativeModule(name) {
|
|
53
|
-
const module = getNativeModule(name);
|
|
54
|
-
if (module === null) {
|
|
55
|
-
throw new Error(`Native module "${name}" is not registered in the binary. ` +
|
|
56
|
-
'Verify it is linked (New Architecture / bridgeless host with __turboModuleProxy installed).');
|
|
57
|
-
}
|
|
58
|
-
return module;
|
|
59
|
-
}
|
|
60
|
-
// ---- device-event module factory ------------------------------------------
|
|
61
|
-
//
|
|
62
|
-
// AccessibilityInfo (iOS + Android), AppState, Appearance, BackHandler, Keyboard,
|
|
63
|
-
// and Dimensions each hand-rolled the identical plumbing: lazily resolve a native
|
|
64
|
-
// module, lazily build a NativeEventEmitter bound to it, install the device-event
|
|
65
|
-
// hub on first subscribe. `createLinking` (linking/shared.ts) proved this factors
|
|
66
|
-
// out safely for Linking's iOS/Android split; this is the general form for every
|
|
67
|
-
// other lazy-module + emitter pair in the runtime-module layer.
|
|
68
|
-
//
|
|
69
|
-
// Each caller's DEGRADE POLICY stays its own, via config - the factory owns only
|
|
70
|
-
// the plumbing:
|
|
71
|
-
// - `bindModuleToEmitter` (default true): whether the resolved module is wired
|
|
72
|
-
// into the emitter so its addListener/removeListeners observe-counters get
|
|
73
|
-
// pinged. Dimensions' DeviceInfo module has no observe-counters, so it opts out
|
|
74
|
-
// (matching its original `new NativeEventEmitter(undefined)`).
|
|
75
|
-
// - `onEmitterCreated`: runs exactly once, right after the emitter is built -
|
|
76
|
-
// the hook for a caller's own permanent self-subscription (AppState/Appearance/
|
|
77
|
-
// BackHandler/Keyboard each keep a cache fresh or dispatch a chain this way) or
|
|
78
|
-
// one-time hydration from the module's constants (AppState's initial state,
|
|
79
|
-
// Dimensions' initial metrics - the latter also relies on this hook running
|
|
80
|
-
// `addListener` BEFORE the constants read, preserving the original
|
|
81
|
-
// subscribe-before-resolve ordering that guards against missing an update).
|
|
82
|
-
// A structural check, not a cast: narrows an arbitrary resolved module down to
|
|
83
|
-
// IEventEmitterModule only when it actually carries both observe-counter methods.
|
|
84
|
-
// Needed because `TModule` is unconstrained (Dimensions' INativeDeviceInfo doesn't
|
|
85
|
-
// extend IEventEmitterModule at all) - NativeEventEmitter itself re-checks the same
|
|
86
|
-
// shape internally, so this exists to satisfy the type system, not to change
|
|
87
|
-
// behavior.
|
|
88
|
-
function hasEventEmitterShape(value) {
|
|
89
|
-
return (isRecord(value) &&
|
|
90
|
-
typeof value.addListener === 'function' &&
|
|
91
|
-
typeof value.removeListeners === 'function');
|
|
92
|
-
}
|
|
93
|
-
// Build one module's lazy-resolve + lazy-emitter pair. Each call owns its own
|
|
94
|
-
// cache, so two callers (or two platform builds loaded together in one smoke) stay
|
|
95
|
-
// independent - the same guarantee `createLinking` documents.
|
|
96
|
-
export function createDeviceEventModule(config) {
|
|
97
|
-
let module;
|
|
98
|
-
let emitter;
|
|
99
|
-
function getModule() {
|
|
100
|
-
if (module === undefined) {
|
|
101
|
-
module = getNativeModule(config.moduleName);
|
|
102
|
-
dlog(`${config.moduleLogPrefix} ${module ? 'resolved' : 'NOT resolved (null)'}`);
|
|
103
|
-
}
|
|
104
|
-
return module;
|
|
105
|
-
}
|
|
106
|
-
function getEmitter() {
|
|
107
|
-
if (emitter === undefined) {
|
|
108
|
-
// WHY lazy: install on first subscribe so the hub exists before native
|
|
109
|
-
// emits, without a hard bootstrap-order dependency. Idempotent.
|
|
110
|
-
installDeviceEventHub();
|
|
111
|
-
const resolved = getModule();
|
|
112
|
-
const bindModule = config.bindModuleToEmitter ?? true;
|
|
113
|
-
const boundModule = bindModule && resolved !== null && hasEventEmitterShape(resolved) ? resolved : undefined;
|
|
114
|
-
emitter = new NativeEventEmitter(boundModule);
|
|
115
|
-
config.onEmitterCreated?.(emitter, resolved);
|
|
116
|
-
}
|
|
117
|
-
return emitter;
|
|
118
|
-
}
|
|
119
|
-
return { getModule, getEmitter };
|
|
120
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type IClassToggleMap = Record<string, boolean | undefined>;
|
|
2
|
-
export type IScopableClassValue = string | IClassToggleMap | Array<string | IClassToggleMap> | undefined | null;
|
|
3
|
-
export declare function scopeClassName(value: IScopableClassValue, localNames: ReadonlySet<string>, scopeId: string): IScopableClassValue;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// Vue `<style scoped>` class-name rewriter. Distinct responsibility from the sibling
|
|
2
|
-
// ./index.ts (the CSS class -> style registry): this module does pure NAME rewriting,
|
|
3
|
-
// no registry lookup, no CSS parsing. It runs at the compiled call site of a Vue SFC's
|
|
4
|
-
// scoped-style template - `adapters/vue/metro-vue-transformer.cjs` emits calls to
|
|
5
|
-
// scopeClassName (imported there as `__scopeClass`) - BEFORE Vue's own normalizeClass()
|
|
6
|
-
// collapses string/object/array `class` values to a final string, so it must pre-process
|
|
7
|
-
// all three shapes normalizeClass understands. resolveClassName in ./index.ts still does
|
|
8
|
-
// the actual style lookup, unchanged, against the rewritten (possibly suffixed) name.
|
|
9
|
-
import { kebabToCamel } from '../index.js';
|
|
10
|
-
// Suffixes every class token that this file's scoped block locally defines with
|
|
11
|
-
// `__${scopeId}`, leaving unrecognized tokens (globals, external classes) untouched.
|
|
12
|
-
export function scopeClassName(value, localNames, scopeId) {
|
|
13
|
-
if (value === undefined || value === null)
|
|
14
|
-
return value;
|
|
15
|
-
if (Array.isArray(value)) {
|
|
16
|
-
return value.map(item => scopeClassEntry(item, localNames, scopeId));
|
|
17
|
-
}
|
|
18
|
-
return scopeClassEntry(value, localNames, scopeId);
|
|
19
|
-
}
|
|
20
|
-
// A token arrives as either the camelCase registry key (`sectionLabel`) or its kebab-case
|
|
21
|
-
// authoring form (`section-label`) - normalize to camelCase FIRST, then decide scoping, so
|
|
22
|
-
// `localNames` (always camelCase, built from the css-parser's registered keys) recognizes a
|
|
23
|
-
// kebab-written token. The emitted (possibly suffixed) name is always the camelCase form.
|
|
24
|
-
function scopeToken(token, localNames, scopeId) {
|
|
25
|
-
const camelToken = kebabToCamel(token);
|
|
26
|
-
return localNames.has(camelToken) ? `${camelToken}__${scopeId}` : camelToken;
|
|
27
|
-
}
|
|
28
|
-
function scopeClassEntry(value, localNames, scopeId) {
|
|
29
|
-
if (typeof value === 'object') {
|
|
30
|
-
const scoped = {};
|
|
31
|
-
for (const [name, enabled] of Object.entries(value)) {
|
|
32
|
-
scoped[scopeToken(name, localNames, scopeId)] = enabled;
|
|
33
|
-
}
|
|
34
|
-
return scoped;
|
|
35
|
-
}
|
|
36
|
-
return value
|
|
37
|
-
.split(/\s+/)
|
|
38
|
-
.filter(Boolean)
|
|
39
|
-
.map(token => scopeToken(token, localNames, scopeId))
|
|
40
|
-
.join(' ');
|
|
41
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
interface ITouchRecord {
|
|
2
|
-
touchActive: boolean;
|
|
3
|
-
startPageX: number;
|
|
4
|
-
startPageY: number;
|
|
5
|
-
startTimeStamp: number;
|
|
6
|
-
currentPageX: number;
|
|
7
|
-
currentPageY: number;
|
|
8
|
-
currentTimeStamp: number;
|
|
9
|
-
previousPageX: number;
|
|
10
|
-
previousPageY: number;
|
|
11
|
-
previousTimeStamp: number;
|
|
12
|
-
}
|
|
13
|
-
interface ITouchHistory {
|
|
14
|
-
touchBank: ITouchRecord[];
|
|
15
|
-
numberActiveTouches: number;
|
|
16
|
-
indexOfSingleActiveTouch: number;
|
|
17
|
-
mostRecentTimeStamp: number;
|
|
18
|
-
}
|
|
19
|
-
export declare const touchHistory: ITouchHistory;
|
|
20
|
-
export declare function recordTouchTrack(kind: 'start' | 'move' | 'end', nativeEvent: Record<string, unknown>): void;
|
|
21
|
-
export declare function resetTouchHistory(): void;
|
|
22
|
-
export declare function attachTouchHistory(nativeEvent: Record<string, unknown>): void;
|
|
23
|
-
export {};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
// Per-touch position/time tracking, ported from RN's
|
|
2
|
-
// react-native-renderer/.../legacy-events/ResponderTouchHistoryStore.js. PanResponder's
|
|
3
|
-
// multitouch dx/vx math needs each touch's own previous->current delta (RN counts only
|
|
4
|
-
// touches that moved since `_accountsForMovesUpTo`), which a grant-relative centroid of
|
|
5
|
-
// ALL live touches cannot reconstruct. We maintain the bank as touches flow and ATTACH
|
|
6
|
-
// `touchHistory` onto the nativeEvent reaching responder handlers, exactly how
|
|
7
|
-
// ResponderEventPlugin.js sets `*.touchHistory`.
|
|
8
|
-
//
|
|
9
|
-
// events/index.ts consumes only this file's public surface (recordTouchTrack,
|
|
10
|
-
// attachTouchHistory, resetTouchHistory, touchHistory); everything else here is a
|
|
11
|
-
// private implementation detail of the bank.
|
|
12
|
-
import { isRecord } from '../type-guards.js';
|
|
13
|
-
// RN's bank is indexed by touch identifier and warns above 20; we never warn (headless
|
|
14
|
-
// events may carry larger or absent ids), we just skip anything out of a sane range.
|
|
15
|
-
const MAX_TOUCH_BANK = 20;
|
|
16
|
-
const touchBank = [];
|
|
17
|
-
export const touchHistory = {
|
|
18
|
-
touchBank,
|
|
19
|
-
numberActiveTouches: 0,
|
|
20
|
-
indexOfSingleActiveTouch: -1,
|
|
21
|
-
mostRecentTimeStamp: 0,
|
|
22
|
-
};
|
|
23
|
-
function toFiniteNumber(value) {
|
|
24
|
-
return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
25
|
-
}
|
|
26
|
-
// Pull a recordable touch out of an untyped entry. RN's getTouchIdentifier throws on
|
|
27
|
-
// a null id; we skip instead, so events without touch geometry leave the bank untouched.
|
|
28
|
-
function normalizeTouch(raw) {
|
|
29
|
-
if (!isRecord(raw))
|
|
30
|
-
return undefined;
|
|
31
|
-
const identifier = toFiniteNumber(raw.identifier);
|
|
32
|
-
const pageX = toFiniteNumber(raw.pageX);
|
|
33
|
-
const pageY = toFiniteNumber(raw.pageY);
|
|
34
|
-
if (identifier === undefined || pageX === undefined || pageY === undefined)
|
|
35
|
-
return undefined;
|
|
36
|
-
if (identifier < 0 || identifier > MAX_TOUCH_BANK)
|
|
37
|
-
return undefined;
|
|
38
|
-
return { identifier, pageX, pageY, timestamp: toFiniteNumber(raw.timestamp) ?? 0 };
|
|
39
|
-
}
|
|
40
|
-
// The changed touches for this frame (start/move/end), defensively read.
|
|
41
|
-
function changedTouchesOf(nativeEvent) {
|
|
42
|
-
const raw = nativeEvent.changedTouches;
|
|
43
|
-
if (!Array.isArray(raw))
|
|
44
|
-
return [];
|
|
45
|
-
const out = [];
|
|
46
|
-
for (const entry of raw) {
|
|
47
|
-
const touch = normalizeTouch(entry);
|
|
48
|
-
if (touch !== undefined)
|
|
49
|
-
out.push(touch);
|
|
50
|
-
}
|
|
51
|
-
return out;
|
|
52
|
-
}
|
|
53
|
-
// Count of all touches still down (RN reads nativeEvent.touches.length directly).
|
|
54
|
-
function activeTouchCount(nativeEvent) {
|
|
55
|
-
const raw = nativeEvent.touches;
|
|
56
|
-
return Array.isArray(raw) ? raw.length : 0;
|
|
57
|
-
}
|
|
58
|
-
function recordTouchStart(touch) {
|
|
59
|
-
const record = touchBank[touch.identifier];
|
|
60
|
-
if (record) {
|
|
61
|
-
record.touchActive = true;
|
|
62
|
-
record.startPageX = touch.pageX;
|
|
63
|
-
record.startPageY = touch.pageY;
|
|
64
|
-
record.startTimeStamp = touch.timestamp;
|
|
65
|
-
record.currentPageX = touch.pageX;
|
|
66
|
-
record.currentPageY = touch.pageY;
|
|
67
|
-
record.currentTimeStamp = touch.timestamp;
|
|
68
|
-
record.previousPageX = touch.pageX;
|
|
69
|
-
record.previousPageY = touch.pageY;
|
|
70
|
-
record.previousTimeStamp = touch.timestamp;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
touchBank[touch.identifier] = {
|
|
74
|
-
touchActive: true,
|
|
75
|
-
startPageX: touch.pageX,
|
|
76
|
-
startPageY: touch.pageY,
|
|
77
|
-
startTimeStamp: touch.timestamp,
|
|
78
|
-
currentPageX: touch.pageX,
|
|
79
|
-
currentPageY: touch.pageY,
|
|
80
|
-
currentTimeStamp: touch.timestamp,
|
|
81
|
-
previousPageX: touch.pageX,
|
|
82
|
-
previousPageY: touch.pageY,
|
|
83
|
-
previousTimeStamp: touch.timestamp,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
touchHistory.mostRecentTimeStamp = touch.timestamp;
|
|
87
|
-
}
|
|
88
|
-
// Move and end share the previous<-current shift; only `touchActive` differs.
|
|
89
|
-
function shiftTouchRecord(touch, active) {
|
|
90
|
-
const record = touchBank[touch.identifier];
|
|
91
|
-
if (!record)
|
|
92
|
-
return;
|
|
93
|
-
record.touchActive = active;
|
|
94
|
-
record.previousPageX = record.currentPageX;
|
|
95
|
-
record.previousPageY = record.currentPageY;
|
|
96
|
-
record.previousTimeStamp = record.currentTimeStamp;
|
|
97
|
-
record.currentPageX = touch.pageX;
|
|
98
|
-
record.currentPageY = touch.pageY;
|
|
99
|
-
record.currentTimeStamp = touch.timestamp;
|
|
100
|
-
touchHistory.mostRecentTimeStamp = touch.timestamp;
|
|
101
|
-
}
|
|
102
|
-
function arrayFirst(value) {
|
|
103
|
-
return Array.isArray(value) ? value[0] : undefined;
|
|
104
|
-
}
|
|
105
|
-
// Maintain the bank as a touch frame flows. Mirrors RN's recordTouchTrack: moveish
|
|
106
|
-
// shifts records, startish records + recomputes numberActiveTouches, endish marks the
|
|
107
|
-
// record inactive + rescans for the single remaining touch. `kind` is the touch phase.
|
|
108
|
-
export function recordTouchTrack(kind, nativeEvent) {
|
|
109
|
-
if (kind === 'move') {
|
|
110
|
-
for (const touch of changedTouchesOf(nativeEvent))
|
|
111
|
-
shiftTouchRecord(touch, true);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (kind === 'start') {
|
|
115
|
-
for (const touch of changedTouchesOf(nativeEvent))
|
|
116
|
-
recordTouchStart(touch);
|
|
117
|
-
touchHistory.numberActiveTouches = activeTouchCount(nativeEvent);
|
|
118
|
-
if (touchHistory.numberActiveTouches === 1) {
|
|
119
|
-
const first = normalizeTouch(arrayFirst(nativeEvent.touches));
|
|
120
|
-
touchHistory.indexOfSingleActiveTouch = first?.identifier ?? -1;
|
|
121
|
-
}
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
for (const touch of changedTouchesOf(nativeEvent))
|
|
125
|
-
shiftTouchRecord(touch, false);
|
|
126
|
-
touchHistory.numberActiveTouches = activeTouchCount(nativeEvent);
|
|
127
|
-
if (touchHistory.numberActiveTouches === 1) {
|
|
128
|
-
for (let i = 0; i < touchBank.length; i++) {
|
|
129
|
-
const record = touchBank[i];
|
|
130
|
-
if (record !== undefined && record.touchActive) {
|
|
131
|
-
touchHistory.indexOfSingleActiveTouch = i;
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
// Drop all touch state. Called on a fully-released / cancelled gesture so a stale bank
|
|
138
|
-
// never leaks geometry into the next gesture's first frame.
|
|
139
|
-
export function resetTouchHistory() {
|
|
140
|
-
touchBank.length = 0;
|
|
141
|
-
touchHistory.numberActiveTouches = 0;
|
|
142
|
-
touchHistory.indexOfSingleActiveTouch = -1;
|
|
143
|
-
touchHistory.mostRecentTimeStamp = 0;
|
|
144
|
-
}
|
|
145
|
-
// Attach the live touch history onto the event the responder handlers receive, matching
|
|
146
|
-
// ResponderEventPlugin.js (`grantEvent.touchHistory = ...`, etc.). PanResponder reads
|
|
147
|
-
// it for the per-touch dx/vx math; handlers that ignore it are unaffected.
|
|
148
|
-
export function attachTouchHistory(nativeEvent) {
|
|
149
|
-
nativeEvent.touchHistory = touchHistory;
|
|
150
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
2
|
-
export declare function isBoolean(value: unknown): value is boolean;
|
|
3
|
-
export declare function isNumber(value: unknown): value is number;
|
|
4
|
-
export declare function isString(value: unknown): value is string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Runtime guards to narrow `unknown` at trust boundaries (native payloads, ViewConfig
|
|
2
|
-
// attributes, style values) without an `as` cast. `isRecord` excludes arrays - most
|
|
3
|
-
// call sites mean "a native payload keyed by string," never a list.
|
|
4
|
-
export function isRecord(value) {
|
|
5
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
6
|
-
}
|
|
7
|
-
export function isBoolean(value) {
|
|
8
|
-
return typeof value === 'boolean';
|
|
9
|
-
}
|
|
10
|
-
export function isNumber(value) {
|
|
11
|
-
return typeof value === 'number';
|
|
12
|
-
}
|
|
13
|
-
export function isString(value) {
|
|
14
|
-
return typeof value === 'string';
|
|
15
|
-
}
|