fake-geolocation
    Preparing search index...

    Function createUser

    • Create a virtual user that can affect geolocation and permissions.

      Parameters

      • params: {
            createCoordinates?: (
                params: Partial<
                    {
                        accuracy: number;
                        altitude: null
                        | number;
                        altitudeAccuracy: null | number;
                        heading: null | number;
                        latitude: number;
                        longitude: number;
                        speed: null | number;
                    },
                >,
            ) => GeolocationCoordinates;
            handleAccessRequest?: HandleAccessRequest;
            locationServices: MutableLocationServices;
            lowAccuracyTransform?: (
                coords: GeolocationCoordinates,
            ) => GeolocationCoordinates;
            permissionStore: PermissionStore;
        }

        The parameters for creating the user.

        • OptionalcreateCoordinates?: (
              params: Partial<
                  {
                      accuracy: number;
                      altitude: null
                      | number;
                      altitudeAccuracy: null | number;
                      heading: null | number;
                      latitude: number;
                      longitude: number;
                      speed: null | number;
                  },
              >,
          ) => GeolocationCoordinates

          A factory function to create coordinates objects.

          A function that behaves like createCoordinates, except that accuracy defaults to 10 meters.

        • OptionalhandleAccessRequest?: HandleAccessRequest

          The handler to use for permission access requests.

          If omitted, permission access requests will be immediately dismissed.

          async () => {}

        • locationServices: MutableLocationServices

          The location services to use.

        • OptionallowAccuracyTransform?: (coords: GeolocationCoordinates) => GeolocationCoordinates

          A function to transform high accuracy coordinates to low accuracy coordinates.

          (coords) => coords

        • permissionStore: PermissionStore

          The permission store to use.

      Returns User

      A virtual user.