Repository: expo/expo
File: packages/expo-location/src/Location.types.ts (TypeScript)

Code before:
// @needsAudit
/**
 * Represents subscription object returned by methods watching for new locations or headings.
 */
export type LocationSubscription = {
  /**
   * Call this function with no arguments to remove this subscription. The callback will no longer
   * be called for location updates.
   */
  remove: () => void;
};

// @needsAudit
export type PermissionDetailsLocationIOS = {
  /**
   * The scope of granted permission. Indicates when it's possible to use location.
   */
  scope: 'whenInUse' | 'always' | 'none';
  /**
   * The accuracy authorization granted by the user.
   * `'full'` means the user has granted precise location access, `'reduced'` means the app
   * can only access approximate location. Check this to detect when a user has disabled
   * "Precise Location" in Settings.
   * @platform ios 14+
   */
  accuracy?: 'full' | 'reduced';
};

// @needsAudit
export type PermissionDetailsLocationAndroid = {
  /**
   * Indicates the type of location provider.
   */
  accuracy: 'fine' | 'coarse' | 'none';
};

// @needsAudit
/**
 * `LocationPermissionResponse` extends [`PermissionResponse`](#permissionresponse)
 * type exported by `expo-modules-core` and contains additional platform-specific fields.
 */
export type LocationPermissionResponse = PermissionResponse & {
  ios?: PermissionDetailsLocationIOS;
  android?: PermissionDetailsLocationAndroid;
};

export type { PermissionResponse };


Review comment (security):
```suggestion
  /**
   * The accuracy authorization granted by the user.
   * `'full'` means the user has granted precise location access, `'reduced'` means the app
   * can only access approximate location. Below iOS 14 always returns `'full'`.
   * @platform ios 14+
   */
  accuracy: 'full' | 'reduced';
```

Code after:
// @needsAudit
/**
 * Represents subscription object returned by methods watching for new locations or headings.
 */
export type LocationSubscription = {
  /**
   * Call this function with no arguments to remove this subscription. The callback will no longer
   * be called for location updates.
   */
  remove: () => void;
};

// @needsAudit
export type PermissionDetailsLocationIOS = {
  /**
   * The scope of granted permission. Indicates when it's possible to use location.
   */
  scope: 'whenInUse' | 'always' | 'none';
  /**
   * The accuracy authorization granted by the user.
   * `'full'` means the user has granted precise location access, `'reduced'` means the app
   * can only access approximate location. Below iOS 14 always returns `'full'`.
   * @platform ios 14+
   */
  accuracy: 'full' | 'reduced';
};

// @needsAudit
export type PermissionDetailsLocationAndroid = {
  /**
   * Indicates the type of location provider.
   */
  accuracy: 'fine' | 'coarse' | 'none';
};

// @needsAudit
/**
 * `LocationPermissionResponse` extends [`PermissionResponse`](#permissionresponse)
 * type exported by `expo-modules-core` and contains additional platform-specific fields.
 */
export type LocationPermissionResponse = PermissionResponse & {
  ios?: PermissionDetailsLocationIOS;
  android?: PermissionDetailsLocationAndroid;
};

export type { PermissionResponse };