diff --git a/src/specs/NativeMapViewModule.ts b/src/specs/NativeMapViewModule.ts index c00887666c..526b6ef2e8 100644 --- a/src/specs/NativeMapViewModule.ts +++ b/src/specs/NativeMapViewModule.ts @@ -1,69 +1,70 @@ -import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { - takeSnap: (viewRef: Int32 | null, writeToDisk: boolean) => Promise; + takeSnap: ( + viewRef: CodegenTypes.Int32 | null, + writeToDisk: boolean, + ) => Promise; queryTerrainElevation: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, coordinates: ReadonlyArray, ) => Promise; setSourceVisibility: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, visible: boolean, sourceId: string, sourceLayerId: string, ) => Promise; - getCenter: (viewRef: Int32 | null) => Promise; + getCenter: (viewRef: CodegenTypes.Int32 | null) => Promise; getCoordinateFromView: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, atPoint: ReadonlyArray, ) => Promise; getPointInView: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, atCoordinate: ReadonlyArray, ) => Promise; - getZoom: (viewRef: Int32 | null) => Promise; - getVisibleBounds: (viewRef: Int32 | null) => Promise; + getZoom: (viewRef: CodegenTypes.Int32 | null) => Promise; + getVisibleBounds: (viewRef: CodegenTypes.Int32 | null) => Promise; queryRenderedFeaturesAtPoint: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, atPoint: ReadonlyArray, withFilter: ReadonlyArray, withLayerIDs: ReadonlyArray, ) => Promise; queryRenderedFeaturesInRect: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, withBBox: ReadonlyArray, withFilter: ReadonlyArray, withLayerIDs: ReadonlyArray, ) => Promise; setHandledMapChangedEvents: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, events: ReadonlyArray, ) => Promise; - clearData: (viewRef: Int32 | null) => Promise; + clearData: (viewRef: CodegenTypes.Int32 | null) => Promise; querySourceFeatures: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, sourceId: string, withFilter: ReadonlyArray, withSourceLayerIDs: ReadonlyArray, ) => Promise; setFeatureState: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, featureId: string, state: Object, sourceId: string, sourceLayerId: string | null, ) => Promise; getFeatureState: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, featureId: string, sourceId: string, sourceLayerId: string | null, ) => Promise; removeFeatureState: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, featureId: string, stateKey: string | null, sourceId: string, diff --git a/src/specs/NativeRNMBXCameraModule.ts b/src/specs/NativeRNMBXCameraModule.ts index 51e22647de..3ea7e66e5c 100644 --- a/src/specs/NativeRNMBXCameraModule.ts +++ b/src/specs/NativeRNMBXCameraModule.ts @@ -1,9 +1,7 @@ -import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; -type ViewRef = Int32 | null; +type ViewRef = CodegenTypes.Int32 | null; interface NativeCameraStop { centerCoordinate?: string; diff --git a/src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts b/src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts index 8c0bf5adae..985789b74c 100644 --- a/src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts +++ b/src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts @@ -1,20 +1,18 @@ -import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; // @ts-expect-error - @turf packages have type resolution issues with package.json exports import { Position } from '@turf/helpers'; //import type { UnsafeMixed } from './codegenUtils'; -type AnimatorTag = Int32; +type AnimatorTag = CodegenTypes.Int32; export interface Spec extends TurboModule { generate( tag: AnimatorTag, coordinates: Position[], - startOffset: Double, - endOffset: Double, + startOffset: CodegenTypes.Double, + endOffset: CodegenTypes.Double, ): Promise; setLineString( tag: AnimatorTag, @@ -24,13 +22,13 @@ export interface Spec extends TurboModule { ): Promise; setStartOffset( tag: AnimatorTag, - offset: Double, - duration: Double, + offset: CodegenTypes.Double, + duration: CodegenTypes.Double, ): Promise; setEndOffset( tag: AnimatorTag, - offset: Double, - duration: Double, + offset: CodegenTypes.Double, + duration: CodegenTypes.Double, ): Promise; } diff --git a/src/specs/NativeRNMBXImageModule.ts b/src/specs/NativeRNMBXImageModule.ts index cbdfd61b40..e71fe04139 100644 --- a/src/specs/NativeRNMBXImageModule.ts +++ b/src/specs/NativeRNMBXImageModule.ts @@ -1,10 +1,8 @@ -import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { - refresh: (viewRef: Int32 | null) => Promise; + refresh: (viewRef: CodegenTypes.Int32 | null) => Promise; } export default TurboModuleRegistry.getEnforcing('RNMBXImageModule'); diff --git a/src/specs/NativeRNMBXLocationModule.ts b/src/specs/NativeRNMBXLocationModule.ts index 9b36cebfea..4478eac623 100644 --- a/src/specs/NativeRNMBXLocationModule.ts +++ b/src/specs/NativeRNMBXLocationModule.ts @@ -1,6 +1,5 @@ -import { type TurboModule, TurboModuleRegistry } from 'react-native'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; +import { TurboModuleRegistry } from 'react-native'; type LocationEvent = { type: string; //"userlocationdupdated" @@ -26,7 +25,7 @@ export interface Spec extends TurboModule { simulateHeading(changesPerSecond: number, increment: number): void; setLocationEventThrottle(throttle: number): void; - readonly onLocationUpdate: EventEmitter; + readonly onLocationUpdate: CodegenTypes.EventEmitter; } export default TurboModuleRegistry.getEnforcing('RNMBXLocationModule'); diff --git a/src/specs/NativeRNMBXMovePointShapeAnimatorModule.ts b/src/specs/NativeRNMBXMovePointShapeAnimatorModule.ts index a5fb397ec9..1f4ded8c65 100644 --- a/src/specs/NativeRNMBXMovePointShapeAnimatorModule.ts +++ b/src/specs/NativeRNMBXMovePointShapeAnimatorModule.ts @@ -1,18 +1,19 @@ -import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; //import type { UnsafeMixed } from './codegenUtils'; -type AnimatorTag = Int32; +type AnimatorTag = CodegenTypes.Int32; export interface Spec extends TurboModule { - generate(tag: AnimatorTag, coordinate: ReadonlyArray): Promise; + generate( + tag: AnimatorTag, + coordinate: ReadonlyArray, + ): Promise; moveTo( tag: AnimatorTag, - coordinate: ReadonlyArray, - duration: Double, + coordinate: ReadonlyArray, + duration: CodegenTypes.Double, ): Promise; } diff --git a/src/specs/NativeRNMBXPointAnnotationModule.ts b/src/specs/NativeRNMBXPointAnnotationModule.ts index 33088c6fe9..7f7276faf5 100644 --- a/src/specs/NativeRNMBXPointAnnotationModule.ts +++ b/src/specs/NativeRNMBXPointAnnotationModule.ts @@ -1,10 +1,8 @@ -import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { - refresh: (viewRef: Int32 | null) => Promise; + refresh: (viewRef: CodegenTypes.Int32 | null) => Promise; } export default TurboModuleRegistry.getEnforcing( diff --git a/src/specs/NativeRNMBXShapeSourceModule.ts b/src/specs/NativeRNMBXShapeSourceModule.ts index cd921a86c0..fe2b4ab581 100644 --- a/src/specs/NativeRNMBXShapeSourceModule.ts +++ b/src/specs/NativeRNMBXShapeSourceModule.ts @@ -1,21 +1,19 @@ -import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { getClusterExpansionZoom: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, featureJSON: string, ) => Promise; getClusterLeaves: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, featureJSON: string, - number: Int32, - offset: Int32, + number: CodegenTypes.Int32, + offset: CodegenTypes.Int32, ) => Promise; getClusterChildren: ( - viewRef: Int32 | null, + viewRef: CodegenTypes.Int32 | null, featureJSON: string, ) => Promise; } diff --git a/src/specs/NativeRNMBXTileStoreModule.ts b/src/specs/NativeRNMBXTileStoreModule.ts index 03867d72c4..50a85a7699 100644 --- a/src/specs/NativeRNMBXTileStoreModule.ts +++ b/src/specs/NativeRNMBXTileStoreModule.ts @@ -1,6 +1,4 @@ -import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -11,7 +9,7 @@ type StringOr<_T> = string; type Domain = 'Maps' | 'Navigation' | 'Search' | 'ADAS'; -type Tag = Int32; +type Tag = CodegenTypes.Int32; type Value = { value: string | number }; diff --git a/src/specs/NativeRNMBXViewportModule.ts b/src/specs/NativeRNMBXViewportModule.ts index 721a8a7b9a..141ffba5a1 100644 --- a/src/specs/NativeRNMBXViewportModule.ts +++ b/src/specs/NativeRNMBXViewportModule.ts @@ -1,6 +1,4 @@ -import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { TurboModule, CodegenTypes } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; type StateInfo = @@ -27,7 +25,7 @@ type TransitionReal = | { kind: 'default'; options: { maxDurationMs?: number } }; type Transition = ObjectOr; -type ViewRef = Int32 | null; +type ViewRef = CodegenTypes.Int32 | null; export interface Spec extends TurboModule { getState(viewRef: ViewRef): Promise; diff --git a/src/specs/RNMBXAtmosphereNativeComponent.ts b/src/specs/RNMBXAtmosphereNativeComponent.ts index 51c84a732a..0fa6ed50e9 100644 --- a/src/specs/RNMBXAtmosphereNativeComponent.ts +++ b/src/specs/RNMBXAtmosphereNativeComponent.ts @@ -1,5 +1,5 @@ import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; diff --git a/src/specs/RNMBXBackgroundLayerNativeComponent.ts b/src/specs/RNMBXBackgroundLayerNativeComponent.ts index fb1bcc8c05..6a5a622c63 100644 --- a/src/specs/RNMBXBackgroundLayerNativeComponent.ts +++ b/src/specs/RNMBXBackgroundLayerNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; @@ -16,14 +14,13 @@ export interface NativeProps extends ViewProps { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; reactStyle: UnsafeMixed; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXBackgroundLayer', ) as HostComponent; diff --git a/src/specs/RNMBXCalloutNativeComponent.ts b/src/specs/RNMBXCalloutNativeComponent.ts index 09f469b962..0cb457bd5d 100644 --- a/src/specs/RNMBXCalloutNativeComponent.ts +++ b/src/specs/RNMBXCalloutNativeComponent.ts @@ -1,5 +1,5 @@ import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { codegenNativeComponent } from 'react-native'; export interface NativeProps extends ViewProps {} diff --git a/src/specs/RNMBXCameraNativeComponent.ts b/src/specs/RNMBXCameraNativeComponent.ts index 04aa0b43e2..126f423649 100644 --- a/src/specs/RNMBXCameraNativeComponent.ts +++ b/src/specs/RNMBXCameraNativeComponent.ts @@ -1,11 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -import { - DirectEventHandler, - Double, - Int32, - // @ts-ignore - CI environment type resolution issue for CodegenTypes -} from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { NativeCameraStop, UnsafeMixed } from './codegenUtils'; @@ -22,27 +16,26 @@ type UserTrackingModeChangeEventType = { export interface NativeProps extends ViewProps { maxBounds?: UnsafeMixed; - animationDuration?: OptionalProp; + animationDuration?: OptionalProp; animationMode?: OptionalProp; defaultStop?: UnsafeMixed; - userTrackingMode?: OptionalProp; + userTrackingMode?: OptionalProp; followUserLocation?: OptionalProp; followUserMode?: OptionalProp; - followZoomLevel?: OptionalProp; - followPitch?: OptionalProp; - followHeading?: OptionalProp; + followZoomLevel?: OptionalProp; + followPitch?: OptionalProp; + followHeading?: OptionalProp; followPadding?: UnsafeMixed; - zoomLevel?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + zoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; stop?: UnsafeMixed; - onUserTrackingModeChange?: DirectEventHandler; + onUserTrackingModeChange?: CodegenTypes.DirectEventHandler; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXCamera', ) as HostComponent; diff --git a/src/specs/RNMBXCircleLayerNativeComponent.ts b/src/specs/RNMBXCircleLayerNativeComponent.ts index 93d153f5b0..86d987f1af 100644 --- a/src/specs/RNMBXCircleLayerNativeComponent.ts +++ b/src/specs/RNMBXCircleLayerNativeComponent.ts @@ -1,9 +1,7 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; -import type { FilterExpression } from '../utils/MapboxStyles'; +import { FilterExpression } from '../utils/MapboxStyles'; import type { UnsafeMixed } from './codegenUtils'; @@ -19,10 +17,10 @@ type CommonProps = { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; slot?: OptionalProp; }; @@ -33,7 +31,6 @@ export interface NativeProps extends ViewProps, CommonProps { reactStyle: UnsafeMixed; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXCircleLayer', ) as HostComponent; diff --git a/src/specs/RNMBXCustomLocationProviderNativeComponent.ts b/src/specs/RNMBXCustomLocationProviderNativeComponent.ts index b63f95c418..b8fffd86a9 100644 --- a/src/specs/RNMBXCustomLocationProviderNativeComponent.ts +++ b/src/specs/RNMBXCustomLocationProviderNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { Position } from '../types/Position'; @@ -12,10 +10,9 @@ type OptionalProp = UnsafeMixed; export interface NativeProps extends ViewProps { coordinate?: OptionalProp; - heading?: OptionalProp; + heading?: OptionalProp; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXCustomLocationProvider', ) as HostComponent; diff --git a/src/specs/RNMBXFillExtrusionLayerNativeComponent.ts b/src/specs/RNMBXFillExtrusionLayerNativeComponent.ts index 9cced9ed5c..c651bd237e 100644 --- a/src/specs/RNMBXFillExtrusionLayerNativeComponent.ts +++ b/src/specs/RNMBXFillExtrusionLayerNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; @@ -16,15 +14,14 @@ export interface NativeProps extends ViewProps { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; reactStyle: UnsafeMixed; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXFillExtrusionLayer', ) as HostComponent; diff --git a/src/specs/RNMBXFillLayerNativeComponent.ts b/src/specs/RNMBXFillLayerNativeComponent.ts index 35af74677e..ff7af6fa21 100644 --- a/src/specs/RNMBXFillLayerNativeComponent.ts +++ b/src/specs/RNMBXFillLayerNativeComponent.ts @@ -1,9 +1,7 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; -import type { FilterExpression } from '../utils/MapboxStyles'; +import { FilterExpression } from '../utils/MapboxStyles'; import type { UnsafeMixed } from './codegenUtils'; @@ -19,10 +17,10 @@ type CommonProps = { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; slot?: OptionalProp; }; @@ -33,7 +31,6 @@ export interface NativeProps extends ViewProps, CommonProps { reactStyle: UnsafeMixed; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXFillLayer', ) as HostComponent; diff --git a/src/specs/RNMBXHeatmapLayerNativeComponent.ts b/src/specs/RNMBXHeatmapLayerNativeComponent.ts index b0bceec22d..bd260e408c 100644 --- a/src/specs/RNMBXHeatmapLayerNativeComponent.ts +++ b/src/specs/RNMBXHeatmapLayerNativeComponent.ts @@ -1,9 +1,7 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; -import type { FilterExpression } from '../utils/MapboxStyles'; +import { FilterExpression } from '../utils/MapboxStyles'; import type { UnsafeMixed } from './codegenUtils'; @@ -19,10 +17,10 @@ type CommonProps = { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; slot?: OptionalProp; }; @@ -33,7 +31,6 @@ export interface NativeProps extends ViewProps, CommonProps { reactStyle: UnsafeMixed; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXHeatmapLayer', ) as HostComponent; diff --git a/src/specs/RNMBXImageNativeComponent.ts b/src/specs/RNMBXImageNativeComponent.ts index e0fcc23130..d8d6550a62 100644 --- a/src/specs/RNMBXImageNativeComponent.ts +++ b/src/specs/RNMBXImageNativeComponent.ts @@ -1,20 +1,17 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import type { Double } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; export interface NativeProps extends ViewProps { stretchX: UnsafeMixed>; // Array inside UnsafeMixed stretchY: UnsafeMixed>; // Array inside UnsafeMixed - content: UnsafeMixed>; + content: UnsafeMixed>; sdf: UnsafeMixed; name: UnsafeMixed; scale?: UnsafeMixed; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXImage', ) as HostComponent; diff --git a/src/specs/RNMBXImageSourceNativeComponent.ts b/src/specs/RNMBXImageSourceNativeComponent.ts index 888ae76f21..56aacd7f5d 100644 --- a/src/specs/RNMBXImageSourceNativeComponent.ts +++ b/src/specs/RNMBXImageSourceNativeComponent.ts @@ -1,5 +1,5 @@ import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { codegenNativeComponent } from 'react-native'; import { UnsafeMixed } from './codegenUtils'; diff --git a/src/specs/RNMBXImagesNativeComponent.ts b/src/specs/RNMBXImagesNativeComponent.ts index 1df5d7910c..bf6ec1b081 100644 --- a/src/specs/RNMBXImagesNativeComponent.ts +++ b/src/specs/RNMBXImagesNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; @@ -14,10 +12,9 @@ export interface NativeProps extends ViewProps { images: UnsafeMixed; nativeImages: UnsafeMixed>; hasOnImageMissing: UnsafeMixed; - onImageMissing: DirectEventHandler; + onImageMissing: CodegenTypes.DirectEventHandler; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXImages', ) as HostComponent; diff --git a/src/specs/RNMBXLightNativeComponent.ts b/src/specs/RNMBXLightNativeComponent.ts index d3877ba47e..bd862ca500 100644 --- a/src/specs/RNMBXLightNativeComponent.ts +++ b/src/specs/RNMBXLightNativeComponent.ts @@ -1,5 +1,5 @@ import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; diff --git a/src/specs/RNMBXLineLayerNativeComponent.ts b/src/specs/RNMBXLineLayerNativeComponent.ts index 9fe13b8dc2..21b0162378 100644 --- a/src/specs/RNMBXLineLayerNativeComponent.ts +++ b/src/specs/RNMBXLineLayerNativeComponent.ts @@ -1,9 +1,7 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; -import type { FilterExpression } from '../utils/MapboxStyles'; +import { FilterExpression } from '../utils/MapboxStyles'; import type { UnsafeMixed } from './codegenUtils'; @@ -19,10 +17,10 @@ type CommonProps = { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; slot?: OptionalProp; }; @@ -33,7 +31,6 @@ export interface NativeProps extends ViewProps, CommonProps { reactStyle: UnsafeMixed; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXLineLayer', ) as HostComponent; diff --git a/src/specs/RNMBXMapViewNativeComponent.ts b/src/specs/RNMBXMapViewNativeComponent.ts index 57d92e7c37..c881ee806f 100644 --- a/src/specs/RNMBXMapViewNativeComponent.ts +++ b/src/specs/RNMBXMapViewNativeComponent.ts @@ -1,12 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -import { - BubblingEventHandler, - DirectEventHandler, - Int32, - Double, - // @ts-ignore - CI environment type resolution issue for CodegenTypes -} from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { Point, UnsafeMixed } from './codegenUtils'; @@ -44,7 +37,7 @@ export interface NativeProps extends ViewProps { compassEnabled?: OptionalProp; compassFadeWhenNorth?: OptionalProp; compassPosition?: UnsafeMixed; - compassViewPosition?: OptionalProp; + compassViewPosition?: OptionalProp; compassViewMargins?: OptionalProp; scaleBarEnabled?: OptionalProp; @@ -54,7 +47,6 @@ export interface NativeProps extends ViewProps { scrollEnabled?: OptionalProp; rotateEnabled?: OptionalProp; pitchEnabled?: OptionalProp; - maxPitch?: OptionalProp; deselectAnnotationOnTap?: OptionalProp; @@ -76,16 +68,15 @@ export interface NativeProps extends ViewProps { // iOS only compassImage?: OptionalProp; - onPress?: BubblingEventHandler; - onLongPress?: DirectEventHandler; - onMapChange?: DirectEventHandler; - onCameraChanged?: DirectEventHandler; + onPress?: CodegenTypes.BubblingEventHandler; + onLongPress?: CodegenTypes.DirectEventHandler; + onMapChange?: CodegenTypes.DirectEventHandler; + onCameraChanged?: CodegenTypes.DirectEventHandler; mapViewImpl?: OptionalProp; - preferredFramesPerSecond?: OptionalProp; + preferredFramesPerSecond?: OptionalProp; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXMapView', ) as HostComponent; @@ -137,9 +128,9 @@ type OnMapChangeEventTypeActual = { export type NativeMapViewActual = HostComponent< Omit & { - onCameraChanged?: DirectEventHandler; - onLongPress?: DirectEventHandler; - onPress?: DirectEventHandler; - onMapChange?: DirectEventHandler; + onCameraChanged?: CodegenTypes.DirectEventHandler; + onLongPress?: CodegenTypes.DirectEventHandler; + onPress?: CodegenTypes.DirectEventHandler; + onMapChange?: CodegenTypes.DirectEventHandler; } >; diff --git a/src/specs/RNMBXMarkerViewContentNativeComponent.ts b/src/specs/RNMBXMarkerViewContentNativeComponent.ts index bdb9547181..40cd67af3a 100644 --- a/src/specs/RNMBXMarkerViewContentNativeComponent.ts +++ b/src/specs/RNMBXMarkerViewContentNativeComponent.ts @@ -1,5 +1,5 @@ import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { codegenNativeComponent } from 'react-native'; export interface NativeProps extends ViewProps {} diff --git a/src/specs/RNMBXMarkerViewNativeComponent.ts b/src/specs/RNMBXMarkerViewNativeComponent.ts index 71ec5308df..48b10fda3b 100644 --- a/src/specs/RNMBXMarkerViewNativeComponent.ts +++ b/src/specs/RNMBXMarkerViewNativeComponent.ts @@ -1,15 +1,13 @@ -import type { HostComponent, ViewProps } from 'react-native'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import { Position } from '../types/Position'; import { UnsafeMixed } from './codegenUtils'; type Point = { - x: Int32; - y: Int32; + x: CodegenTypes.Int32; + y: CodegenTypes.Int32; }; export interface NativeProps extends ViewProps { @@ -20,7 +18,6 @@ export interface NativeProps extends ViewProps { isSelected: UnsafeMixed; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXMarkerView', ) as HostComponent; diff --git a/src/specs/RNMBXModelLayerNativeComponent.ts b/src/specs/RNMBXModelLayerNativeComponent.ts index 3199d1480f..35f85a979e 100644 --- a/src/specs/RNMBXModelLayerNativeComponent.ts +++ b/src/specs/RNMBXModelLayerNativeComponent.ts @@ -1,9 +1,7 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; -import type { FilterExpression } from '../utils/MapboxStyles'; +import { FilterExpression } from '../utils/MapboxStyles'; import { StyleValue } from '../utils/StyleValue'; import { UnsafeMixed } from './codegenUtils'; @@ -20,10 +18,10 @@ type CommonProps = { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; slot?: OptionalProp; }; @@ -34,7 +32,6 @@ export interface NativeProps extends ViewProps, CommonProps { reactStyle?: UnsafeMixed<{ [key: string]: StyleValue }>; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXModelLayer', ) as HostComponent; diff --git a/src/specs/RNMBXModelsNativeComponent.ts b/src/specs/RNMBXModelsNativeComponent.ts index 3f66dc3c61..1968890d2a 100644 --- a/src/specs/RNMBXModelsNativeComponent.ts +++ b/src/specs/RNMBXModelsNativeComponent.ts @@ -1,5 +1,5 @@ import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { codegenNativeComponent } from 'react-native'; import { UnsafeMixed } from './codegenUtils'; diff --git a/src/specs/RNMBXNativeUserLocationNativeComponent.ts b/src/specs/RNMBXNativeUserLocationNativeComponent.ts index d2259b959f..215819c419 100644 --- a/src/specs/RNMBXNativeUserLocationNativeComponent.ts +++ b/src/specs/RNMBXNativeUserLocationNativeComponent.ts @@ -3,7 +3,7 @@ import type { ProcessedColorValue, ViewProps, } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { codegenNativeComponent } from 'react-native'; import type { Expression } from '../utils/MapboxStyles'; diff --git a/src/specs/RNMBXPointAnnotationNativeComponent.ts b/src/specs/RNMBXPointAnnotationNativeComponent.ts index be373c4716..dcd09ea421 100644 --- a/src/specs/RNMBXPointAnnotationNativeComponent.ts +++ b/src/specs/RNMBXPointAnnotationNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; @@ -29,14 +27,13 @@ export interface NativeProps extends ViewProps { id: UnsafeMixed; anchor: UnsafeMixed; - onMapboxPointAnnotationDeselected: DirectEventHandler; - onMapboxPointAnnotationDrag: DirectEventHandler; - onMapboxPointAnnotationDragEnd: DirectEventHandler; - onMapboxPointAnnotationDragStart: DirectEventHandler; - onMapboxPointAnnotationSelected: DirectEventHandler; + onMapboxPointAnnotationDeselected: CodegenTypes.DirectEventHandler; + onMapboxPointAnnotationDrag: CodegenTypes.DirectEventHandler; + onMapboxPointAnnotationDragEnd: CodegenTypes.DirectEventHandler; + onMapboxPointAnnotationDragStart: CodegenTypes.DirectEventHandler; + onMapboxPointAnnotationSelected: CodegenTypes.DirectEventHandler; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXPointAnnotation', ) as HostComponent; diff --git a/src/specs/RNMBXRasterDemSourceNativeComponent.ts b/src/specs/RNMBXRasterDemSourceNativeComponent.ts index 5f0a3f075a..46691a4989 100644 --- a/src/specs/RNMBXRasterDemSourceNativeComponent.ts +++ b/src/specs/RNMBXRasterDemSourceNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double } from 'react-native/Libraries/Types/CodegenTypes'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import { UnsafeMixed } from './codegenUtils'; @@ -10,12 +8,11 @@ export interface NativeProps extends ViewProps { existing: UnsafeMixed; url: UnsafeMixed; tileUrlTemplates: UnsafeMixed>; - minZoomLevel: UnsafeMixed; - maxZoomLevel: UnsafeMixed; - tileSize: UnsafeMixed; + minZoomLevel: UnsafeMixed; + maxZoomLevel: UnsafeMixed; + tileSize: UnsafeMixed; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXRasterDemSource', ) as HostComponent; diff --git a/src/specs/RNMBXRasterLayerNativeComponent.ts b/src/specs/RNMBXRasterLayerNativeComponent.ts index 496f5a4a9f..828eebd0c9 100644 --- a/src/specs/RNMBXRasterLayerNativeComponent.ts +++ b/src/specs/RNMBXRasterLayerNativeComponent.ts @@ -1,9 +1,7 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; -import type { FilterExpression } from '../utils/MapboxStyles'; +import { FilterExpression } from '../utils/MapboxStyles'; import type { UnsafeMixed } from './codegenUtils'; @@ -19,10 +17,10 @@ type CommonProps = { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; slot?: OptionalProp; }; @@ -33,7 +31,6 @@ export interface NativeProps extends ViewProps, CommonProps { reactStyle: UnsafeMixed; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXRasterLayer', ) as HostComponent; diff --git a/src/specs/RNMBXRasterParticleLayerNativeComponent.ts b/src/specs/RNMBXRasterParticleLayerNativeComponent.ts index 344ea1dd6b..388f7a81dc 100644 --- a/src/specs/RNMBXRasterParticleLayerNativeComponent.ts +++ b/src/specs/RNMBXRasterParticleLayerNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; import type { FilterExpression } from '../utils/MapboxStyles'; @@ -19,10 +17,10 @@ type CommonProps = { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; slot?: OptionalProp; }; diff --git a/src/specs/RNMBXRasterSourceNativeComponent.ts b/src/specs/RNMBXRasterSourceNativeComponent.ts index c45834553a..f04f54fae3 100644 --- a/src/specs/RNMBXRasterSourceNativeComponent.ts +++ b/src/specs/RNMBXRasterSourceNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import { UnsafeMixed } from './codegenUtils'; @@ -10,15 +8,14 @@ export interface NativeProps extends ViewProps { existing: UnsafeMixed; url: UnsafeMixed; tileUrlTemplates: UnsafeMixed>; - minZoomLevel: UnsafeMixed; - maxZoomLevel: UnsafeMixed; - tileSize: UnsafeMixed; + minZoomLevel: UnsafeMixed; + maxZoomLevel: UnsafeMixed; + tileSize: UnsafeMixed; tms: UnsafeMixed; attribution: UnsafeMixed; sourceBounds: UnsafeMixed>; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXRasterSource', ) as HostComponent; diff --git a/src/specs/RNMBXShapeSourceNativeComponent.ts b/src/specs/RNMBXShapeSourceNativeComponent.ts index 581c4ee6ed..6b47ffba4e 100644 --- a/src/specs/RNMBXShapeSourceNativeComponent.ts +++ b/src/specs/RNMBXShapeSourceNativeComponent.ts @@ -1,11 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -import { - DirectEventHandler, - Double, - Int32, - // @ts-ignore - CI environment type resolution issue for CodegenTypes -} from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; @@ -16,20 +10,19 @@ export interface NativeProps extends ViewProps { existing: UnsafeMixed; url: UnsafeMixed; shape: UnsafeMixed; - cluster: UnsafeMixed; - clusterRadius: UnsafeMixed; - clusterMaxZoomLevel: UnsafeMixed; + cluster: UnsafeMixed; + clusterRadius: UnsafeMixed; + clusterMaxZoomLevel: UnsafeMixed; clusterProperties: UnsafeMixed; - maxZoomLevel: UnsafeMixed; - buffer: UnsafeMixed; - tolerance: UnsafeMixed; + maxZoomLevel: UnsafeMixed; + buffer: UnsafeMixed; + tolerance: UnsafeMixed; lineMetrics: UnsafeMixed; hasPressListener: UnsafeMixed; hitbox: UnsafeMixed; - onMapboxShapeSourcePress: DirectEventHandler; + onMapboxShapeSourcePress: CodegenTypes.DirectEventHandler; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXShapeSource', ) as HostComponent; diff --git a/src/specs/RNMBXSkyLayerNativeComponent.ts b/src/specs/RNMBXSkyLayerNativeComponent.ts index 27f7e2fb9d..520c0b3179 100644 --- a/src/specs/RNMBXSkyLayerNativeComponent.ts +++ b/src/specs/RNMBXSkyLayerNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; @@ -16,14 +14,13 @@ export interface NativeProps extends ViewProps { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; reactStyle?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXSkyLayer', ) as HostComponent; diff --git a/src/specs/RNMBXStyleImportNativeComponent.ts b/src/specs/RNMBXStyleImportNativeComponent.ts index 38fbffe739..683406604f 100644 --- a/src/specs/RNMBXStyleImportNativeComponent.ts +++ b/src/specs/RNMBXStyleImportNativeComponent.ts @@ -1,5 +1,5 @@ import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; diff --git a/src/specs/RNMBXSymbolLayerNativeComponent.ts b/src/specs/RNMBXSymbolLayerNativeComponent.ts index 4741f21bc5..6c02301ffc 100644 --- a/src/specs/RNMBXSymbolLayerNativeComponent.ts +++ b/src/specs/RNMBXSymbolLayerNativeComponent.ts @@ -1,9 +1,7 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; -import type { FilterExpression } from '../utils/MapboxStyles'; +import { FilterExpression } from '../utils/MapboxStyles'; import type { UnsafeMixed } from './codegenUtils'; @@ -19,10 +17,10 @@ type CommonProps = { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; slot?: OptionalProp; }; @@ -33,7 +31,6 @@ export interface NativeProps extends ViewProps, CommonProps { reactStyle: UnsafeMixed; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXSymbolLayer', ) as HostComponent; diff --git a/src/specs/RNMBXTerrainNativeComponent.ts b/src/specs/RNMBXTerrainNativeComponent.ts index 91b59c6def..de88176732 100644 --- a/src/specs/RNMBXTerrainNativeComponent.ts +++ b/src/specs/RNMBXTerrainNativeComponent.ts @@ -1,5 +1,5 @@ import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; diff --git a/src/specs/RNMBXVectorSourceNativeComponent.ts b/src/specs/RNMBXVectorSourceNativeComponent.ts index f7aa0eed4d..0f2a6633e7 100644 --- a/src/specs/RNMBXVectorSourceNativeComponent.ts +++ b/src/specs/RNMBXVectorSourceNativeComponent.ts @@ -1,10 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -import { - DirectEventHandler, - Double, - // @ts-ignore - CI environment type resolution issue for CodegenTypes -} from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; @@ -16,15 +11,14 @@ export interface NativeProps extends ViewProps { url: UnsafeMixed; tileUrlTemplates: UnsafeMixed>; attribution: UnsafeMixed; - maxZoomLevel: UnsafeMixed; - minZoomLevel: UnsafeMixed; + maxZoomLevel: UnsafeMixed; + minZoomLevel: UnsafeMixed; tms: UnsafeMixed; hasPressListener: UnsafeMixed; hitbox: UnsafeMixed; - onMapboxVectorSourcePress: DirectEventHandler; + onMapboxVectorSourcePress: CodegenTypes.DirectEventHandler; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXVectorSource', ) as HostComponent; diff --git a/src/specs/RNMBXViewportNativeComponent.ts b/src/specs/RNMBXViewportNativeComponent.ts index 20160aceeb..6bd9e112fd 100644 --- a/src/specs/RNMBXViewportNativeComponent.ts +++ b/src/specs/RNMBXViewportNativeComponent.ts @@ -1,7 +1,5 @@ -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes'; +import type { HostComponent, ViewProps, CodegenTypes } from 'react-native'; +import { codegenNativeComponent } from 'react-native'; import type { UnsafeMixed } from './codegenUtils'; @@ -104,16 +102,15 @@ export type OnStatusChangedEventTypeReal = { export interface NativeProps extends ViewProps { transitionsToIdleUponUserInteraction?: OptionalProp; hasStatusChanged: boolean; - onStatusChanged?: DirectEventHandler; + onStatusChanged?: CodegenTypes.DirectEventHandler; } -// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast export default codegenNativeComponent( 'RNMBXViewport', ) as HostComponent; export type NativeViewportReal = HostComponent< Omit & { - onStatusChanged?: DirectEventHandler; + onStatusChanged?: CodegenTypes.DirectEventHandler; } >; diff --git a/src/specs/codegenUtils.ts b/src/specs/codegenUtils.ts index cc5872949d..fd82a28090 100644 --- a/src/specs/codegenUtils.ts +++ b/src/specs/codegenUtils.ts @@ -7,24 +7,23 @@ export type UnsafeMixed = T; // https://github.com/rnmapbox/maps/pull/3082#discussion_r1339858750 export type OptionalProp = UnsafeMixed; -// @ts-ignore - CI environment type resolution issue for CodegenTypes -import { Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes'; +import type { CodegenTypes } from 'react-native'; export type Point = { - x: Int32; - y: Int32; + x: CodegenTypes.Int32; + y: CodegenTypes.Int32; }; export type NativeCameraStop = { centerCoordinate?: string; bounds?: string; - heading?: Double; - pitch?: Double; - zoom?: Double; - paddingLeft?: Double; - paddingRight?: Double; - paddingTop?: Double; - paddingBottom?: Double; - duration?: Double; + heading?: CodegenTypes.Double; + pitch?: CodegenTypes.Double; + zoom?: CodegenTypes.Double; + paddingLeft?: CodegenTypes.Double; + paddingRight?: CodegenTypes.Double; + paddingTop?: CodegenTypes.Double; + paddingBottom?: CodegenTypes.Double; + duration?: CodegenTypes.Double; mode?: number; } | null; diff --git a/src/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts b/src/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts index 7717d27578..1d26434352 100644 --- a/src/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts +++ b/src/specs/codeparts/CommonLayerNativeComponentsProps.codepart-ts @@ -9,10 +9,10 @@ type CommonProps = { aboveLayerID?: OptionalProp; belowLayerID?: OptionalProp; - layerIndex?: OptionalProp; + layerIndex?: OptionalProp; - maxZoomLevel?: OptionalProp; - minZoomLevel?: OptionalProp; + maxZoomLevel?: OptionalProp; + minZoomLevel?: OptionalProp; sourceLayerID?: OptionalProp; slot?: OptionalProp; };