Skip to content

Commit ab41e7c

Browse files
committed
fix(reactnative): fix deprecated codegen imports
1 parent dbfb2f4 commit ab41e7c

42 files changed

Lines changed: 192 additions & 286 deletions

Some content is hidden

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

src/specs/NativeMapViewModule.ts

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,71 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
/* eslint-disable @typescript-eslint/ban-types */
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: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
42
import { TurboModuleRegistry } from 'react-native';
53

6-
type ViewRef = Int32 | null;
4+
type ViewRef = CodegenTypes.Int32 | null;
75

86
interface NativeCameraStop {
97
centerCoordinate?: string;
@@ -25,8 +23,8 @@ type Stop =
2523
}
2624
| NativeCameraStop;
2725

28-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
29-
type ObjectOr<_T> = Object;
26+
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-unused-vars
27+
type ObjectOr<T> = Object;
3028

3129
export interface Spec extends TurboModule {
3230
updateCameraStop(viewRef: ViewRef, stop: ObjectOr<Stop>): Promise<void>;

src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
42
import { TurboModuleRegistry } from 'react-native';
5-
// @ts-expect-error - @turf packages have type resolution issues with package.json exports
63
import { Position } from '@turf/helpers';
74

85
//import type { UnsafeMixed } from './codegenUtils';
96

10-
type AnimatorTag = Int32;
7+
type AnimatorTag = CodegenTypes.Int32;
118

129
export interface Spec extends TurboModule {
1310
generate(
1411
tag: AnimatorTag,
1512
coordinates: Position[],
16-
startOffset: Double,
17-
endOffset: Double,
13+
startOffset: CodegenTypes.Double,
14+
endOffset: CodegenTypes.Double,
1815
): Promise<void>;
1916
setLineString(
2017
tag: AnimatorTag,
@@ -24,13 +21,13 @@ export interface Spec extends TurboModule {
2421
): Promise<void>;
2522
setStartOffset(
2623
tag: AnimatorTag,
27-
offset: Double,
28-
duration: Double,
24+
offset: CodegenTypes.Double,
25+
duration: CodegenTypes.Double,
2926
): Promise<void>;
3027
setEndOffset(
3128
tag: AnimatorTag,
32-
offset: Double,
33-
duration: Double,
29+
offset: CodegenTypes.Double,
30+
duration: CodegenTypes.Double,
3431
): Promise<void>;
3532
}
3633

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
/* eslint-disable @typescript-eslint/ban-types */
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');

src/specs/NativeRNMBXLocationModule.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { type TurboModule, TurboModuleRegistry } from 'react-native';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
2+
import { TurboModuleRegistry } from 'react-native';
43

54
type LocationEvent = {
65
type: string; //"userlocationdupdated"
@@ -26,7 +25,7 @@ export interface Spec extends TurboModule {
2625
simulateHeading(changesPerSecond: number, increment: number): void;
2726
setLocationEventThrottle(throttle: number): void;
2827

29-
readonly onLocationUpdate: EventEmitter<LocationEvent>;
28+
readonly onLocationUpdate: CodegenTypes.EventEmitter<LocationEvent>;
3029
}
3130

3231
export default TurboModuleRegistry.getEnforcing<Spec>('RNMBXLocationModule');

src/specs/NativeRNMBXMovePointShapeAnimatorModule.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
42
import { TurboModuleRegistry } from 'react-native';
53

64
//import type { UnsafeMixed } from './codegenUtils';
75

8-
type AnimatorTag = Int32;
6+
type AnimatorTag = CodegenTypes.Int32;
97

108
export interface Spec extends TurboModule {
11-
generate(tag: AnimatorTag, coordinate: ReadonlyArray<Double>): Promise<void>;
9+
generate(
10+
tag: AnimatorTag,
11+
coordinate: ReadonlyArray<CodegenTypes.Double>,
12+
): Promise<void>;
1213
moveTo(
1314
tag: AnimatorTag,
14-
coordinate: ReadonlyArray<Double>,
15-
duration: Double,
15+
coordinate: ReadonlyArray<CodegenTypes.Double>,
16+
duration: CodegenTypes.Double,
1617
): Promise<void>;
1718
}
1819

src/specs/NativeRNMBXPointAnnotationModule.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
/* eslint-disable @typescript-eslint/ban-types */
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: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
/* eslint-disable @typescript-eslint/ban-types */
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: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
42
import { TurboModuleRegistry } from 'react-native';
53

6-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7-
type ObjectOr<_T> = Object;
4+
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-unused-vars
5+
type ObjectOr<T> = Object;
86

97
// eslint-disable-next-line @typescript-eslint/no-unused-vars
108
type StringOr<_T> = string;
119

1210
type Domain = 'Maps' | 'Navigation' | 'Search' | 'ADAS';
1311

14-
type Tag = Int32;
12+
type Tag = CodegenTypes.Int32;
1513

1614
type Value = { value: string | number };
1715

src/specs/NativeRNMBXViewportModule.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
2-
// @ts-ignore - CI environment type resolution issue for CodegenTypes
3-
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
1+
import type { TurboModule, CodegenTypes } from 'react-native';
42
import { TurboModuleRegistry } from 'react-native';
53

64
type StateInfo =
@@ -17,8 +15,8 @@ type StateInfo =
1715
transition: string;
1816
};
1917

20-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
21-
type ObjectOr<_T> = Object;
18+
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-unused-vars
19+
type ObjectOr<T> = Object;
2220

2321
type StateReal = { kind: 'followPuck' } /* | { kind: 'overview' } */;
2422
type State = ObjectOr<StateReal>;
@@ -27,7 +25,7 @@ type TransitionReal =
2725
| { kind: 'default'; options: { maxDurationMs?: number } };
2826
type Transition = ObjectOr<TransitionReal>;
2927

30-
type ViewRef = Int32 | null;
28+
type ViewRef = CodegenTypes.Int32 | null;
3129

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

0 commit comments

Comments
 (0)