Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions src/specs/NativeMapViewModule.ts
Original file line number Diff line number Diff line change
@@ -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<Object>;
takeSnap: (
viewRef: CodegenTypes.Int32 | null,
writeToDisk: boolean,
) => Promise<Object>;
queryTerrainElevation: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
coordinates: ReadonlyArray<number>,
) => Promise<Object>;
setSourceVisibility: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
visible: boolean,
sourceId: string,
sourceLayerId: string,
) => Promise<Object>;
getCenter: (viewRef: Int32 | null) => Promise<Object>;
getCenter: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
getCoordinateFromView: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
atPoint: ReadonlyArray<number>,
) => Promise<Object>;
getPointInView: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
atCoordinate: ReadonlyArray<number>,
) => Promise<Object>;
getZoom: (viewRef: Int32 | null) => Promise<Object>;
getVisibleBounds: (viewRef: Int32 | null) => Promise<Object>;
getZoom: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
getVisibleBounds: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
queryRenderedFeaturesAtPoint: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
atPoint: ReadonlyArray<number>,
withFilter: ReadonlyArray<Object>,
withLayerIDs: ReadonlyArray<string>,
) => Promise<Object>;
queryRenderedFeaturesInRect: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
withBBox: ReadonlyArray<number>,
withFilter: ReadonlyArray<Object>,
withLayerIDs: ReadonlyArray<string>,
) => Promise<Object>;
setHandledMapChangedEvents: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
events: ReadonlyArray<string>,
) => Promise<Object>;
clearData: (viewRef: Int32 | null) => Promise<Object>;
clearData: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
querySourceFeatures: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
sourceId: string,
withFilter: ReadonlyArray<Object>,
withSourceLayerIDs: ReadonlyArray<string>,
) => Promise<Object>;
setFeatureState: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
featureId: string,
state: Object,
sourceId: string,
sourceLayerId: string | null,
) => Promise<Object>;
getFeatureState: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
featureId: string,
sourceId: string,
sourceLayerId: string | null,
) => Promise<Object>;
removeFeatureState: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
featureId: string,
stateKey: string | null,
sourceId: string,
Expand Down
6 changes: 2 additions & 4 deletions src/specs/NativeRNMBXCameraModule.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
18 changes: 8 additions & 10 deletions src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts
Original file line number Diff line number Diff line change
@@ -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<void>;
setLineString(
tag: AnimatorTag,
Expand All @@ -24,13 +22,13 @@ export interface Spec extends TurboModule {
): Promise<void>;
setStartOffset(
tag: AnimatorTag,
offset: Double,
duration: Double,
offset: CodegenTypes.Double,
duration: CodegenTypes.Double,
): Promise<void>;
setEndOffset(
tag: AnimatorTag,
offset: Double,
duration: Double,
offset: CodegenTypes.Double,
duration: CodegenTypes.Double,
): Promise<void>;
}

Expand Down
6 changes: 2 additions & 4 deletions src/specs/NativeRNMBXImageModule.ts
Original file line number Diff line number Diff line change
@@ -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<Object>;
refresh: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
}

export default TurboModuleRegistry.getEnforcing<Spec>('RNMBXImageModule');
7 changes: 3 additions & 4 deletions src/specs/NativeRNMBXLocationModule.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -26,7 +25,7 @@ export interface Spec extends TurboModule {
simulateHeading(changesPerSecond: number, increment: number): void;
setLocationEventThrottle(throttle: number): void;

readonly onLocationUpdate: EventEmitter<LocationEvent>;
readonly onLocationUpdate: CodegenTypes.EventEmitter<LocationEvent>;
}

export default TurboModuleRegistry.getEnforcing<Spec>('RNMBXLocationModule');
15 changes: 8 additions & 7 deletions src/specs/NativeRNMBXMovePointShapeAnimatorModule.ts
Original file line number Diff line number Diff line change
@@ -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<Double>): Promise<void>;
generate(
tag: AnimatorTag,
coordinate: ReadonlyArray<CodegenTypes.Double>,
): Promise<void>;
moveTo(
tag: AnimatorTag,
coordinate: ReadonlyArray<Double>,
duration: Double,
coordinate: ReadonlyArray<CodegenTypes.Double>,
duration: CodegenTypes.Double,
): Promise<void>;
}

Expand Down
6 changes: 2 additions & 4 deletions src/specs/NativeRNMBXPointAnnotationModule.ts
Original file line number Diff line number Diff line change
@@ -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<Object>;
refresh: (viewRef: CodegenTypes.Int32 | null) => Promise<Object>;
}

export default TurboModuleRegistry.getEnforcing<Spec>(
Expand Down
14 changes: 6 additions & 8 deletions src/specs/NativeRNMBXShapeSourceModule.ts
Original file line number Diff line number Diff line change
@@ -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<Object>;
getClusterLeaves: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
featureJSON: string,
number: Int32,
offset: Int32,
number: CodegenTypes.Int32,
offset: CodegenTypes.Int32,
) => Promise<Object>;
getClusterChildren: (
viewRef: Int32 | null,
viewRef: CodegenTypes.Int32 | null,
featureJSON: string,
) => Promise<Object>;
}
Expand Down
6 changes: 2 additions & 4 deletions src/specs/NativeRNMBXTileStoreModule.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 };

Expand Down
6 changes: 2 additions & 4 deletions src/specs/NativeRNMBXViewportModule.ts
Original file line number Diff line number Diff line change
@@ -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 =
Expand All @@ -27,7 +25,7 @@ type TransitionReal =
| { kind: 'default'; options: { maxDurationMs?: number } };
type Transition = ObjectOr<TransitionReal>;

type ViewRef = Int32 | null;
type ViewRef = CodegenTypes.Int32 | null;

export interface Spec extends TurboModule {
getState(viewRef: ViewRef): Promise<StateInfo>;
Expand Down
2 changes: 1 addition & 1 deletion src/specs/RNMBXAtmosphereNativeComponent.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
13 changes: 5 additions & 8 deletions src/specs/RNMBXBackgroundLayerNativeComponent.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -16,14 +14,13 @@ export interface NativeProps extends ViewProps {

aboveLayerID?: OptionalProp<string>;
belowLayerID?: OptionalProp<string>;
layerIndex?: OptionalProp<Int32>;
layerIndex?: OptionalProp<CodegenTypes.Int32>;
reactStyle: UnsafeMixed<any>;

maxZoomLevel?: OptionalProp<Double>;
minZoomLevel?: OptionalProp<Double>;
maxZoomLevel?: OptionalProp<CodegenTypes.Double>;
minZoomLevel?: OptionalProp<CodegenTypes.Double>;
}

// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast
export default codegenNativeComponent<NativeProps>(
'RNMBXBackgroundLayer',
) as HostComponent<NativeProps>;
2 changes: 1 addition & 1 deletion src/specs/RNMBXCalloutNativeComponent.ts
Original file line number Diff line number Diff line change
@@ -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 {}

Expand Down
29 changes: 11 additions & 18 deletions src/specs/RNMBXCameraNativeComponent.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -22,27 +16,26 @@ type UserTrackingModeChangeEventType = {

export interface NativeProps extends ViewProps {
maxBounds?: UnsafeMixed<string | null>;
animationDuration?: OptionalProp<Double>;
animationDuration?: OptionalProp<CodegenTypes.Double>;
animationMode?: OptionalProp<string>;
defaultStop?: UnsafeMixed<NativeCameraStop>;
userTrackingMode?: OptionalProp<Int32>;
userTrackingMode?: OptionalProp<CodegenTypes.Int32>;

followUserLocation?: OptionalProp<boolean>;
followUserMode?: OptionalProp<string>;
followZoomLevel?: OptionalProp<Double>;
followPitch?: OptionalProp<Double>;
followHeading?: OptionalProp<Double>;
followZoomLevel?: OptionalProp<CodegenTypes.Double>;
followPitch?: OptionalProp<CodegenTypes.Double>;
followHeading?: OptionalProp<CodegenTypes.Double>;
followPadding?: UnsafeMixed<any>;

zoomLevel?: OptionalProp<Double>;
maxZoomLevel?: OptionalProp<Double>;
minZoomLevel?: OptionalProp<Double>;
zoomLevel?: OptionalProp<CodegenTypes.Double>;
maxZoomLevel?: OptionalProp<CodegenTypes.Double>;
minZoomLevel?: OptionalProp<CodegenTypes.Double>;
stop?: UnsafeMixed<NativeCameraStop>;

onUserTrackingModeChange?: DirectEventHandler<UserTrackingModeChangeEventType>;
onUserTrackingModeChange?: CodegenTypes.DirectEventHandler<UserTrackingModeChangeEventType>;
}

// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast
export default codegenNativeComponent<NativeProps>(
'RNMBXCamera',
) as HostComponent<NativeProps>;
Loading
Loading