Skip to content

Commit 8b316f0

Browse files
committed
simplify barrels
1 parent 4a5bf6e commit 8b316f0

File tree

5 files changed

+17
-42
lines changed

5 files changed

+17
-42
lines changed

src/core/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import type { Fiber, FiberRoot } from 'react-reconciler';
2-
import * as React from 'react';
2+
import type * as React from 'react';
33
import { instrument, type Render } from './instrumentation/index';
4+
import { playGeigerClickSound } from './web/geiger';
5+
import { createStore } from './utils';
46

5-
import { createOverlay } from './web/index';
7+
import { createPerfObserver } from './web/perf-observer';
8+
import { createOverlay } from './web';
69
import { logIntro } from './web/log';
710
import { createToolbar } from './web/toolbar';
8-
import { playGeigerClickSound } from './web/geiger';
9-
import { createPerfObserver } from './web/perf-observer';
10-
import { createStore } from './utils';
1111
import {
12+
PendingOutline,
1213
ActiveOutline,
13-
flushOutlines,
1414
getOutline,
15-
PendingOutline,
15+
flushOutlines,
1616
} from './web/outline';
1717

1818
interface Options {
@@ -112,14 +112,14 @@ interface Internals {
112112
>;
113113
}
114114

115-
export type MeasurementValue = {
115+
export interface MeasurementValue {
116116
width: number;
117117
height: number;
118118
pageX: number;
119119
pageY: number;
120120
x: number;
121121
y: number;
122-
};
122+
}
123123
export type Measurement =
124124
| { kind: 'dom'; value: DOMRect }
125125
| {

src/core/instrumentation/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Fiber, FiberRoot } from 'react-reconciler';
22
import * as React from 'react';
3-
import { type NO_OP } from '../utils';
43
import { ReactScanInternals } from '../index';
54
import { getDisplayName, fastSerialize, getType } from './utils';
65
import {

src/core/native/index.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/core/native/scan.tsx renamed to src/core/native/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import {
33
PanResponder,
44
Pressable,
55
Text as RNText,
6-
ScaledSize,
76
View,
7+
Dimensions,
8+
Platform,
89
} from 'react-native';
9-
import { Measurement, MeasurementValue, ReactScanInternals } from '../../index';
10-
1110
import {
1211
Canvas,
1312
Group,
@@ -21,8 +20,8 @@ import React, {
2120
useState,
2221
useSyncExternalStore,
2322
} from 'react';
24-
import { Dimensions, Platform } from 'react-native';
2523
// import { useDerivedValue, useSharedValue } from 'react-native-reanimated';
24+
import { ReactScanInternals } from '..';
2625
import { assertNative, instrumentNative } from './instrument';
2726

2827
// can't use useSyncExternalStore for compat
@@ -56,9 +55,9 @@ export const ReactNativeScanEntryPoint = () => {
5655
onMoveShouldSetPanResponder: () => true,
5756
onPanResponderGrant: () => {
5857
pan.setOffset({
59-
// @ts-expect-error
58+
// @ts-expect-error its fine...
6059
x: pan.x._value,
61-
// @ts-expect-error
60+
// @ts-expect-error its fine...
6261
y: pan.y._value,
6362
});
6463
},
@@ -161,7 +160,7 @@ const ReactNativeScan = ({ id: _ }: { id: string }) => {
161160
// todo: polly fill
162161
const outlines = useSyncExternalStore(
163162
(listener) =>
164-
ReactScanInternals.subscribe('activeOutlines', (value) => {
163+
ReactScanInternals.subscribe('activeOutlines', (_) => {
165164
// animations destroy UI thread on heavy updates, probably not worth it
166165
// opacity.value = 1;
167166
// opacity.value = withTiming(0, {
@@ -244,6 +243,7 @@ const ReactNativeScan = ({ id: _ }: { id: string }) => {
244243
assertNative(render.outline.latestMeasurement).value.pageY -
245244
5
246245
}
246+
// eslint-disable-next-line
247247
text={render.text || 'unknown'}
248248
font={font}
249249
color="#FFFFFF"

src/native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "./core/native/scan"
1+
export * from "./core/native"

0 commit comments

Comments
 (0)