<commit_before>import { Cordova, Plugin } from './plugin';

/**
 * @name Diagnostic
 * @description
 * Checks whether device hardware features are enabled or available to the app, e.g. camera, GPS, wifi
 *
 * @usage
 * ```typescript
 * import { Diagnostic } from 'ionic-native';
 * ```
 */
@Plugin({
  plugin: 'cordova.plugins.diagnostic',
  pluginRef: 'cordova.plugins.diagnostic',
  repo: 'https://github.com/dpa99c/cordova-diagnostic-plugin'
})
export class Diagnostic {
  /**
   * Checks if app is able to access device location.
   */
  @Cordova()
  static isLocationEnabled(): Promise<any> { return; }

  /**
   * Checks if Wifi is connected/enabled. On iOS this returns true if the device is connected to a network by WiFi. On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled.
   * On Android this requires permission. `<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />`
   */
  @Cordova()
  static isWifiEnabled(): Promise<any> { return; }

  /**
   * Checks if the device has a camera. On Android this returns true if the device has a camera. On iOS this returns true if both the device has a camera AND the application is authorized to use it. On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the
   * application is authorized to use it.
   */
  @Cordova()
  static isCameraEnabled(): Promise<any> { return; }

  /**
   * Checks if the device has Bluetooth capabilities and if so that Bluetooth is switched on (same on Android, iOS and Windows 10 Mobile)
   * On Android this requires permission <uses-permission android:name="android.permission.BLUETOOTH" />
   */
  @Cordova()
  static isBluetoothEnabled(): Promise<any> { return; }

  /**
   * Returns the location authorization status for the application.
   * Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
   *
   * mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
   */
  @Cordova()
  static requestLocationAuthorization(mode?: string): Promise<any> { return; }

  /**
   * Checks if the application is authorized to use location.
   * Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
   */
  @Cordova()
  static isLocationAuthorized(): Promise<any> { return; }

  /**
   * Checks if camera hardware is present on device.
   */
  @Cordova()
  static isCameraPresent(): Promise<any> { return; }

  /**
   * Checks if the application is authorized to use the camera.<commit_msg>fix(diagnostics): Corrects isEnabled functions to isAvailable (#373)<commit_after>import { Cordova, Plugin } from './plugin';

/**
 * @name Diagnostic
 * @description
 * Checks whether device hardware features are enabled or available to the app, e.g. camera, GPS, wifi
 *
 * @usage
 * ```typescript
 * import { Diagnostic } from 'ionic-native';
 * ```
 */
@Plugin({
  plugin: 'cordova.plugins.diagnostic',
  pluginRef: 'cordova.plugins.diagnostic',
  repo: 'https://github.com/dpa99c/cordova-diagnostic-plugin'
})
export class Diagnostic {
  /**
   * Checks if app is able to access device location.
   */
  @Cordova()
  static isLocationAvailable(): Promise<any> { return; }

  /**
   * Checks if Wifi is connected/enabled. On iOS this returns true if the device is connected to a network by WiFi. On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled.
   * On Android this requires permission. `<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />`
   */
  @Cordova()
  static isWifiAvailable(): Promise<any> { return; }

  /**
   * Checks if the device has a camera. On Android this returns true if the device has a camera. On iOS this returns true if both the device has a camera AND the application is authorized to use it. On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the
   * application is authorized to use it.
   */
  @Cordova()
  static isCameraAvailable(): Promise<any> { return; }

  /**
   * Checks if the device has Bluetooth capabilities and if so that Bluetooth is switched on (same on Android, iOS and Windows 10 Mobile)
   * On Android this requires permission <uses-permission android:name="android.permission.BLUETOOTH" />
   */
  @Cordova()
  static isBluetoothAvailable(): Promise<any> { return; }

  /**
   * Returns the location authorization status for the application.
   * Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
   *
   * mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
   */
  @Cordova()
  static requestLocationAuthorization(mode?: string): Promise<any> { return; }

  /**
   * Checks if the application is authorized to use location.
   * Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
   */
  @Cordova()
  static isLocationAuthorized(): Promise<any> { return; }

  /**
   * Checks if camera hardware is present on device.
   */
  @Cordova()
  static isCameraPresent(): Promise<any> { return; }

  /**
   * Checks if the application is authorized to use the camera.
{'fraction_non_alphanumeric': 0.09553805774278215, 'fraction_numerical': 0.00752405949256343, 'mean_word_length': 3.6737530662305806, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2980116', 'n_tokens_mistral': 1629, 'n_tokens_neox': 1541, 'n_words': 681}