<commit_before>import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';

declare const navigator: any;

export interface MediaFile {
  /**
   * The name of the file, without path information.
   */
  name: string;
  /**
   * The full path of the file, including the name.
   */
  fullPath: string;
  /**
   * The file's mime type
   */
  type: string;

  /**
   * The date and time when the file was last modified.
   */
  lastModifiedDate: Date;

  /**
   * The size of the file, in bytes.
   */
  size: number;

  /**
   * Retrieves the format information of the media file.
   * @param {Function} successCallback
   * @param {Function} errorCallback
   */
  getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any): void;
}

export interface MediaFileData {
  /**
   * The actual format of the audio and video content.
   */
  codecs: string;
  /**
   * The average bitrate of the content. The value is zero for images.
   */
  bitrate: number;
  /**
   * The height of the image or video in pixels. The value is zero for audio clips.
   */
  height: number;
  /**
   * The width of the image or video in pixels. The value is zero for audio clips.
   */
  width: number;
  /**
   * The length of the video or sound clip in seconds. The value is zero for images.
   */
  duration: number;
}

export interface CaptureError {
  code: string;
}

export interface CaptureAudioOptions {
  /**
   * Maximum number of audio clips. Defaults to 1.
   * On iOS you can only record one file.
   */
  limit?: number;
  /**
   * Maximum duration of an audio sound clip, in seconds. This does not work on Android devices.
   */
  duration?: number;
}

export interface CaptureImageOptions {
  /**
   * Maximum number of images to capture. This limit is not supported on iOS, only one image will be taken per invocation.
   */
  limit?: number;
}

export interface CaptureVideoOptions {
  /**
   * Maximum number of video clips to record. This value is ignored on iOS, only one video clip can be taken per invocation.
   */
  limit?: number;
  /**
   * Maximum duration per video clip. This will be ignored on BlackBerry.
   */
  duration?: number;
  /**
   * Quality of the video. This parameter can only be used with Android.
   */
  quality?: number;
}

export interface ConfigurationData {
  /**
   * The ASCII-encoded lowercase string representing the media type.
   */
    type: string;
  /**
   * The height of the image or video in pixels. The value is zero for sound clips.
   */
  height: number;
  /**
   * The width of the image or video in pixels. The value is zero for sound clips.
   */
  width: number;
}

/**
 * @name Media Capture
 * @description
 * @usage
 * ```typescript
 * import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions } from '@ionic-native/media-capture';
 *
 *
 * constructor(private mediaCapture: MediaCapture) { }
 *
 * ...
 *
 *
 * let options: CaptureImageOptions = { limit: 3 };
 * this.mediaCapture.captureImage(options)
 *   .then(
 *     (data: MediaFile[]) => console.log(data),
 *     (err: CaptureError) => console.error(err)
 *   );
 *
 * ```
 * @interfaces
 * MediaFile
 * MediaFileData
 * CaptureError
 * CaptureAudioOptions
 * CaptureImageOptions
 * CaptureVideoOptions
 * ConfigurationData
 */
@Plugin({
  pluginName: 'MediaCapture',
  plugin: 'cordova-plugin-media-capture',
  pluginRef: 'navigator.device.capture',
  repo: 'https://github.com/apache/cordova-plugin-media-capture',
  platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
})
@Injectable()
export class MediaCapture extends IonicNativePlugin {
  /**<commit_msg>docs(media-capture): remove unsupported platforms (#2229)<commit_after>import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';

declare const navigator: any;

export interface MediaFile {
  /**
   * The name of the file, without path information.
   */
  name: string;
  /**
   * The full path of the file, including the name.
   */
  fullPath: string;
  /**
   * The file's mime type
   */
  type: string;

  /**
   * The date and time when the file was last modified.
   */
  lastModifiedDate: Date;

  /**
   * The size of the file, in bytes.
   */
  size: number;

  /**
   * Retrieves the format information of the media file.
   * @param {Function} successCallback
   * @param {Function} errorCallback
   */
  getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any): void;
}

export interface MediaFileData {
  /**
   * The actual format of the audio and video content.
   */
  codecs: string;
  /**
   * The average bitrate of the content. The value is zero for images.
   */
  bitrate: number;
  /**
   * The height of the image or video in pixels. The value is zero for audio clips.
   */
  height: number;
  /**
   * The width of the image or video in pixels. The value is zero for audio clips.
   */
  width: number;
  /**
   * The length of the video or sound clip in seconds. The value is zero for images.
   */
  duration: number;
}

export interface CaptureError {
  code: string;
}

export interface CaptureAudioOptions {
  /**
   * Maximum number of audio clips. Defaults to 1.
   * On iOS you can only record one file.
   */
  limit?: number;
  /**
   * Maximum duration of an audio sound clip, in seconds. This does not work on Android devices.
   */
  duration?: number;
}

export interface CaptureImageOptions {
  /**
   * Maximum number of images to capture. This limit is not supported on iOS, only one image will be taken per invocation.
   */
  limit?: number;
}

export interface CaptureVideoOptions {
  /**
   * Maximum number of video clips to record. This value is ignored on iOS, only one video clip can be taken per invocation.
   */
  limit?: number;
  /**
   * Maximum duration per video clip. This will be ignored on BlackBerry.
   */
  duration?: number;
  /**
   * Quality of the video. This parameter can only be used with Android.
   */
  quality?: number;
}

export interface ConfigurationData {
  /**
   * The ASCII-encoded lowercase string representing the media type.
   */
    type: string;
  /**
   * The height of the image or video in pixels. The value is zero for sound clips.
   */
  height: number;
  /**
   * The width of the image or video in pixels. The value is zero for sound clips.
   */
  width: number;
}

/**
 * @name Media Capture
 * @description
 * @usage
 * ```typescript
 * import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions } from '@ionic-native/media-capture';
 *
 *
 * constructor(private mediaCapture: MediaCapture) { }
 *
 * ...
 *
 *
 * let options: CaptureImageOptions = { limit: 3 };
 * this.mediaCapture.captureImage(options)
 *   .then(
 *     (data: MediaFile[]) => console.log(data),
 *     (err: CaptureError) => console.error(err)
 *   );
 *
 * ```
 * @interfaces
 * MediaFile
 * MediaFileData
 * CaptureError
 * CaptureAudioOptions
 * CaptureImageOptions
 * CaptureVideoOptions
 * ConfigurationData
 */
@Plugin({
  pluginName: 'MediaCapture',
  plugin: 'cordova-plugin-media-capture',
  pluginRef: 'navigator.device.capture',
  repo: 'https://github.com/apache/cordova-plugin-media-capture',
  platforms: ['Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
export class MediaCapture extends IonicNativePlugin {
  /**
{'fraction_non_alphanumeric': 0.11534391534391535, 'fraction_numerical': 0.0013227513227513227, 'mean_word_length': 3.102550189907759, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2552122', 'n_tokens_mistral': 2277, 'n_tokens_neox': 2219, 'n_words': 819}