Skip to content

Commit 18c41fa

Browse files
committed
fix(reactnative): fix deprecated codegen imports
1 parent eada77d commit 18c41fa

File tree

42 files changed

+193
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+193
-234
lines changed

src/specs/NativeMapViewModule.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,71 @@
11
/* eslint-disable @typescript-eslint/ban-types */
2-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
2+
import type { TurboModule, CodegenTypes } from 'react-native';
43
import { TurboModuleRegistry } from 'react-native';
54

65
export interface Spec extends TurboModule {
7-
takeSnap: (viewRef: Int32 | null, writeToDisk: boolean) => Promise<Object>;
6+
takeSnap: (
7+
viewRef: CodegenTypes.Int32 | null,
8+
writeToDisk: boolean,
9+
) => Promise<Object>;
810
queryTerrainElevation: (
9-
viewRef: Int32 | null,
11+
viewRef: CodegenTypes.Int32 | null,
1012
coordinates: ReadonlyArray<number>,
1113
) => Promise<Object>;
1214
setSourceVisibility: (
13-
viewRef: Int32 | null,
15+
viewRef: CodegenTypes.Int32 | null,
1416
visible: boolean,
1517
sourceId: string,
1618
sourceLayerId: string,
1719
) => Promise<Object>;
18-
getCenter: (viewRef: Int32 | null) => Promise<Object>;
20+
getCenter: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
1921
getCoordinateFromView: (
20-
viewRef: Int32 | null,
22+
viewRef: CodegenTypes.Int32 | null,
2123
atPoint: ReadonlyArray<number>,
2224
) => Promise<Object>;
2325
getPointInView: (
24-
viewRef: Int32 | null,
26+
viewRef: CodegenTypes.Int32 | null,
2527
atCoordinate: ReadonlyArray<number>,
2628
) => Promise<Object>;
27-
getZoom: (viewRef: Int32 | null) => Promise<Object>;
28-
getVisibleBounds: (viewRef: Int32 | null) => Promise<Object>;
29+
getZoom: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
30+
getVisibleBounds: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
2931
queryRenderedFeaturesAtPoint: (
30-
viewRef: Int32 | null,
32+
viewRef: CodegenTypes.Int32 | null,
3133
atPoint: ReadonlyArray<number>,
3234
withFilter: ReadonlyArray<Object>,
3335
withLayerIDs: ReadonlyArray<string>,
3436
) => Promise<Object>;
3537
queryRenderedFeaturesInRect: (
36-
viewRef: Int32 | null,
38+
viewRef: CodegenTypes.Int32 | null,
3739
withBBox: ReadonlyArray<number>,
3840
withFilter: ReadonlyArray<Object>,
3941
withLayerIDs: ReadonlyArray<string>,
4042
) => Promise<Object>;
4143
setHandledMapChangedEvents: (
42-
viewRef: Int32 | null,
44+
viewRef: CodegenTypes.Int32 | null,
4345
events: ReadonlyArray<string>,
4446
) => Promise<Object>;
45-
clearData: (viewRef: Int32 | null) => Promise<Object>;
47+
clearData: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
4648
querySourceFeatures: (
47-
viewRef: Int32 | null,
49+
viewRef: CodegenTypes.Int32 | null,
4850
sourceId: string,
4951
withFilter: ReadonlyArray<Object>,
5052
withSourceLayerIDs: ReadonlyArray<string>,
5153
) => Promise<Object>;
5254
setFeatureState: (
53-
viewRef: Int32 | null,
55+
viewRef: CodegenTypes.Int32 | null,
5456
featureId: string,
5557
state: Object,
5658
sourceId: string,
5759
sourceLayerId: string | null,
5860
) => Promise<Object>;
5961
getFeatureState: (
60-
viewRef: Int32 | null,
62+
viewRef: CodegenTypes.Int32 | null,
6163
featureId: string,
6264
sourceId: string,
6365
sourceLayerId: string | null,
6466
) => Promise<Object>;
6567
removeFeatureState: (
66-
viewRef: Int32 | null,
68+
viewRef: CodegenTypes.Int32 | null,
6769
featureId: string,
6870
stateKey: string | null,
6971
sourceId: string,

src/specs/NativeRNMBXCameraModule.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
32
import { TurboModuleRegistry } from 'react-native';
43

5-
type ViewRef = Int32 | null;
4+
type ViewRef = CodegenTypes.Int32 | null;
65

76
interface NativeCameraStop {
87
centerCoordinate?: string;

src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
import { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
32
import { TurboModuleRegistry } from 'react-native';
43
import { Position } from '@turf/helpers';
54

65
//import type { UnsafeMixed } from './codegenUtils';
76

8-
type AnimatorTag = Int32;
7+
type AnimatorTag = CodegenTypes.Int32;
98

109
export interface Spec extends TurboModule {
1110
generate(
1211
tag: AnimatorTag,
1312
coordinates: Position[],
14-
startOffset: Double,
15-
endOffset: Double,
13+
startOffset: CodegenTypes.Double,
14+
endOffset: CodegenTypes.Double,
1615
): Promise<void>;
1716
setLineString(
1817
tag: AnimatorTag,
@@ -22,13 +21,13 @@ export interface Spec extends TurboModule {
2221
): Promise<void>;
2322
setStartOffset(
2423
tag: AnimatorTag,
25-
offset: Double,
26-
duration: Double,
24+
offset: CodegenTypes.Double,
25+
duration: CodegenTypes.Double,
2726
): Promise<void>;
2827
setEndOffset(
2928
tag: AnimatorTag,
30-
offset: Double,
31-
duration: Double,
29+
offset: CodegenTypes.Double,
30+
duration: CodegenTypes.Double,
3231
): Promise<void>;
3332
}
3433

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/* eslint-disable @typescript-eslint/ban-types */
2-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
2+
import type { TurboModule, CodegenTypes } from 'react-native';
43
import { TurboModuleRegistry } from 'react-native';
54

65
export interface Spec extends TurboModule {
7-
refresh: (viewRef: Int32 | null) => Promise<Object>;
6+
refresh: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
87
}
98

109
export default TurboModuleRegistry.getEnforcing<Spec>('RNMBXImageModule');
Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1-
import { TurboModule, TurboModuleRegistry} from "react-native";
2-
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
2+
import { TurboModuleRegistry } from 'react-native';
33

44
type LocationEvent = {
5-
type: string //"userlocationdupdated"
5+
type: string; //"userlocationdupdated"
66
payload: {
77
coords: {
8-
latitude: number
9-
longitude: number
10-
altitude: number
11-
accuracy: number
12-
speed: number
13-
heading: number
14-
}
15-
timestamp: number
16-
}
17-
}
8+
latitude: number;
9+
longitude: number;
10+
altitude: number;
11+
accuracy: number;
12+
speed: number;
13+
heading: number;
14+
};
15+
timestamp: number;
16+
};
17+
};
1818

1919
export interface Spec extends TurboModule {
20-
start(minDisplacement: number): void
21-
stop(): void
22-
setRequestsAlwaysUse(requestsAlwaysUse: boolean): void
23-
setMinDisplacement(minDisplacement: number): void
24-
getLastKnownLocation(): Promise<LocationEvent['payload']>
25-
simulateHeading(changesPerSecond: number, increment: number): void
26-
setLocationEventThrottle(throttle: number): void
20+
start(minDisplacement: number): void;
21+
stop(): void;
22+
setRequestsAlwaysUse(requestsAlwaysUse: boolean): void;
23+
setMinDisplacement(minDisplacement: number): void;
24+
getLastKnownLocation(): Promise<LocationEvent['payload']>;
25+
simulateHeading(changesPerSecond: number, increment: number): void;
26+
setLocationEventThrottle(throttle: number): void;
2727

28-
readonly onLocationUpdate: EventEmitter<LocationEvent>
28+
readonly onLocationUpdate: CodegenTypes.EventEmitter<LocationEvent>;
2929
}
3030

3131
export default TurboModuleRegistry.getEnforcing<Spec>('RNMBXLocationModule');
32-

src/specs/NativeRNMBXMovePointShapeAnimatorModule.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
import { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
32
import { TurboModuleRegistry } from 'react-native';
43

54
//import type { UnsafeMixed } from './codegenUtils';
65

7-
type AnimatorTag = Int32;
6+
type AnimatorTag = CodegenTypes.Int32;
87

98
export interface Spec extends TurboModule {
10-
generate(tag: AnimatorTag, coordinate: ReadonlyArray<Double>): Promise<void>;
9+
generate(
10+
tag: AnimatorTag,
11+
coordinate: ReadonlyArray<CodegenTypes.Double>,
12+
): Promise<void>;
1113
moveTo(
1214
tag: AnimatorTag,
13-
coordinate: ReadonlyArray<Double>,
14-
duration: Double,
15+
coordinate: ReadonlyArray<CodegenTypes.Double>,
16+
duration: CodegenTypes.Double,
1517
): Promise<void>;
1618
}
1719

src/specs/NativeRNMBXPointAnnotationModule.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/* eslint-disable @typescript-eslint/ban-types */
2-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
2+
import type { TurboModule, CodegenTypes } from 'react-native';
43
import { TurboModuleRegistry } from 'react-native';
54

65
export interface Spec extends TurboModule {
7-
refresh: (viewRef: Int32 | null) => Promise<Object>;
6+
refresh: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
87
}
98

109
export default TurboModuleRegistry.getEnforcing<Spec>(

src/specs/NativeRNMBXShapeSourceModule.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
/* eslint-disable @typescript-eslint/ban-types */
2-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
2+
import type { TurboModule, CodegenTypes } from 'react-native';
43
import { TurboModuleRegistry } from 'react-native';
54

65
export interface Spec extends TurboModule {
76
getClusterExpansionZoom: (
8-
viewRef: Int32 | null,
7+
viewRef: CodegenTypes.Int32 | null,
98
featureJSON: string,
109
) => Promise<Object>;
1110
getClusterLeaves: (
12-
viewRef: Int32 | null,
11+
viewRef: CodegenTypes.Int32 | null,
1312
featureJSON: string,
14-
number: Int32,
15-
offset: Int32,
13+
number: CodegenTypes.Int32,
14+
offset: CodegenTypes.Int32,
1615
) => Promise<Object>;
1716
getClusterChildren: (
18-
viewRef: Int32 | null,
17+
viewRef: CodegenTypes.Int32 | null,
1918
featureJSON: string,
2019
) => Promise<Object>;
2120
}

src/specs/NativeRNMBXTileStoreModule.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
32
import { TurboModuleRegistry } from 'react-native';
43

54
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-unused-vars
@@ -10,7 +9,7 @@ type StringOr<_T> = string;
109

1110
type Domain = 'Maps' | 'Navigation' | 'Search' | 'ADAS';
1211

13-
type Tag = Int32;
12+
type Tag = CodegenTypes.Int32;
1413

1514
type Value = { value: string | number };
1615

src/specs/NativeRNMBXViewportModule.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
32
import { TurboModuleRegistry } from 'react-native';
43

54
type StateInfo =
@@ -26,7 +25,7 @@ type TransitionReal =
2625
| { kind: 'default'; options: { maxDurationMs?: number } };
2726
type Transition = ObjectOr<TransitionReal>;
2827

29-
type ViewRef = Int32 | null;
28+
type ViewRef = CodegenTypes.Int32 | null;
3029

3130
export interface Spec extends TurboModule {
3231
getState(viewRef: ViewRef): Promise<StateInfo>;

0 commit comments

Comments
 (0)