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

declare var serial: any;

export interface SerialPermissionOptions {
  vid: string;
  pid: string;
  driver: string;
}

export interface SerialOpenOptions {
  baudRate: number;
}

/**
 * @name Serial
 * @description
 * This plugin provides functions for working with Serial connections
 *
 * @usage
 *
 * ```
 * import { Serial } from 'ionic-native';
 *
 * Serial.requestPermission({
 *   vid: '0403',
 *   pid: '6001',
 *   driver: 'FtdiSerialDriver'
 * }).then(() => {
 *   Serial.open({
 *     baudRate: 38400
 *   }).then(() => {
 *     console.log('Serial connection opened');
 *   });
 * }).catch((error: any) => console.log(error));
 *
 * ```
 */
@Plugin({
  pluginName: 'Serial',
  plugin: 'cordovarduino',
  pluginRef: 'serial',
  repo: 'https://github.com/xseignard/cordovarduino',
  platforms: ['Android']
})
export class Serial {

  /**
   * Request permission to connect to a serial device
   *
   * @param options {SerialPermissionOptions} Options used to request serial permissions
   * @return {Promise<any>} Returns a promise that resolves when permissions are granted
   */
  @Cordova()
  static requestPermission(options: SerialPermissionOptions): Promise<any> { return; }
<commit_msg>fix(serial): Serial.requestPermission() options are optional (#1128)<commit_after>import { Plugin, Cordova } from './plugin';
import { Observable } from 'rxjs/Observable';

declare var serial: any;

export interface SerialPermissionOptions {
  vid: string;
  pid: string;
  driver: string;
}

export interface SerialOpenOptions {
  baudRate: number;
}

/**
 * @name Serial
 * @description
 * This plugin provides functions for working with Serial connections
 *
 * @usage
 *
 * ```
 * import { Serial } from 'ionic-native';
 *
 * Serial.requestPermission().then(() => {
 *   Serial.open({
 *     baudRate: 9800
 *   }).then(() => {
 *     console.log('Serial connection opened');
 *   });
 * }).catch((error: any) => console.log(error));
 *
 * ```
 */
@Plugin({
  pluginName: 'Serial',
  plugin: 'cordovarduino',
  pluginRef: 'serial',
  repo: 'https://github.com/xseignard/cordovarduino',
  platforms: ['Android']
})
export class Serial {

  /**
   * Request permission to connect to a serial device
   *
   * @param options {SerialPermissionOptions} Options used to request serial permissions for an unknown device
   * @return {Promise<any>} Returns a promise that resolves when permissions are granted
   */
  @Cordova()
  static requestPermission(options?: SerialPermissionOptions): Promise<any> { return; }

{'fraction_non_alphanumeric': 0.14525352649637818, 'fraction_numerical': 0.008006099885627144, 'mean_word_length': 3.9696969696969697, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '7182478', 'n_tokens_mistral': 795, 'n_tokens_neox': 777, 'n_words': 222}