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
38 changes: 20 additions & 18 deletions src/specs/NativeMapViewModule.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,71 @@
/* eslint-disable @typescript-eslint/ban-types */
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
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
5 changes: 2 additions & 3 deletions src/specs/NativeRNMBXCameraModule.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
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
17 changes: 8 additions & 9 deletions src/specs/NativeRNMBXChangeLineOffsetsShapeAnimatorModule.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
import { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
import type { TurboModule, CodegenTypes } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
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 @@ -22,13 +21,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
5 changes: 2 additions & 3 deletions src/specs/NativeRNMBXImageModule.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-disable @typescript-eslint/ban-types */
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
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');
43 changes: 21 additions & 22 deletions src/specs/NativeRNMBXLocationModule.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
import { TurboModule, TurboModuleRegistry} from "react-native";
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"
type: string; //"userlocationdupdated"
payload: {
coords: {
latitude: number
longitude: number
altitude: number
accuracy: number
speed: number
heading: number
}
timestamp: number
}
}
latitude: number;
longitude: number;
altitude: number;
accuracy: number;
speed: number;
heading: number;
};
timestamp: number;
};
};

export interface Spec extends TurboModule {
start(minDisplacement: number): void
stop(): void
setRequestsAlwaysUse(requestsAlwaysUse: boolean): void
setMinDisplacement(minDisplacement: number): void
getLastKnownLocation(): Promise<LocationEvent['payload']>
simulateHeading(changesPerSecond: number, increment: number): void
setLocationEventThrottle(throttle: number): void
start(minDisplacement: number): void;
stop(): void;
setRequestsAlwaysUse(requestsAlwaysUse: boolean): void;
setMinDisplacement(minDisplacement: number): void;
getLastKnownLocation(): Promise<LocationEvent['payload']>;
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');

14 changes: 8 additions & 6 deletions src/specs/NativeRNMBXMovePointShapeAnimatorModule.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
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
5 changes: 2 additions & 3 deletions src/specs/NativeRNMBXPointAnnotationModule.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-disable @typescript-eslint/ban-types */
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
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
13 changes: 6 additions & 7 deletions src/specs/NativeRNMBXShapeSourceModule.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
/* eslint-disable @typescript-eslint/ban-types */
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
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
5 changes: 2 additions & 3 deletions src/specs/NativeRNMBXTileStoreModule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
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/ban-types, @typescript-eslint/no-unused-vars
Expand All @@ -10,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
5 changes: 2 additions & 3 deletions src/specs/NativeRNMBXViewportModule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
import type { TurboModule, CodegenTypes } from 'react-native';
import { TurboModuleRegistry } from 'react-native';

type StateInfo =
Expand All @@ -26,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
11 changes: 5 additions & 6 deletions src/specs/RNMBXBackgroundLayerNativeComponent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { HostComponent, ViewProps } from 'react-native';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
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 @@ -15,11 +14,11 @@ 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>;
}

export default codegenNativeComponent<NativeProps>(
Expand Down
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';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface NativeProps extends ViewProps {}
Expand Down
27 changes: 11 additions & 16 deletions src/specs/RNMBXCameraNativeComponent.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import type { HostComponent, ViewProps } from 'react-native';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import {
DirectEventHandler,
Double,
Int32,
} 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 @@ -21,24 +16,24 @@ 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>;
}

export default codegenNativeComponent<NativeProps>(
Expand Down
Loading
Loading