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

export interface SafariViewControllerOptions {
  url?: string;
  hidden?: boolean;
  toolbarColor?: string;
  animated?: boolean;
  showDefaultShareMenuItem?: boolean;
  enterReaderModeIfAvailable?: boolean;
  tintColor?: string;
  transition?: string;
}

/**
 * @name SafariViewController
 * @description
 * @usage
 * ```
 * import { SafariViewController } from 'ionic-native';
 *
 *
 * SafariViewController.isAvailable()
 *   .then(
 *     (available: boolean) => {
 *       if(available){
 *
 *         SafariViewController.show({
 *           url: 'http://ionic.io',
 *           hidden: false,
 *           animated: false,
 *           transition: 'curl',
 *           enterReaderModeIfAvailable: true,
 *           tintColor: '#ff0000'
 *         })
 *         .then(
 *           (result: any) => {
 *             if(result.event === 'opened') console.log('Opened');
 *             else if(result.event === 'loaded') console.log('Loaded');
 *             else if(result.event === 'closed') console.log('Closed');
 *           },
 *           (error: any) => console.error(error)
 *         );
 *
 *       } else {
 *         // use fallback browser, example InAppBrowser
 *       }
 *     }
 *   );
 * ```
 * @interfaces
 * SafariViewControllerOptions
 */
@Plugin({
  pluginName: 'SafariViewController',
  plugin: 'cordova-plugin-safariviewcontroller',
  pluginRef: 'SafariViewController',
  platforms: ['iOS', 'Android'],
  repo: 'https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller'
})
export class SafariViewController {

  /**
   * Checks if SafariViewController is available
   * @returns {Promise<boolean>}
   */
  @Cordova()
  static isAvailable(): Promise<boolean> { return; }

  /**
   * Shows Safari View Controller
   * @param options {SafariViewControllerOptions} optional
   * @returns {Promise<any>}
   */
  @Cordova({
    successIndex: 1,
    errorIndex: 2
  })
  static show(options?: SafariViewControllerOptions): Promise<any> { return; }

  /**
   * Hides Safari View Controller
   */
  @Cordova()
  static hide(): void { }

  /**
   * Tries to connect to the  Chrome's custom tabs service. you must call this method before calling any of the other methods listed below.
   * @returns {Promise<any>}
   */
  @Cordova()
  static connectToService(): Promise<any> { return; }

  /**
   * Call this method whenever there's a chance the user will open an external url.
   * @returns {Promise<any>}
   */
  @Cordova()
  static warmUp(): Promise<any> { return; }

  /**
   * For even better performance optimization, call this methods if there's more than a 50% chance the user will open a certain URL.
   * @param url{string}
   * @returns {Promise<any>}
   */
  @Cordova()
  static mayLaunchUrl(url: string): Promise<any> { return; }

}<commit_msg>refactor(safari-view-controller): hide returns promise<commit_after>import { Cordova, Plugin } from './plugin';

export interface SafariViewControllerOptions {
  url?: string;
  hidden?: boolean;
  toolbarColor?: string;
  animated?: boolean;
  showDefaultShareMenuItem?: boolean;
  enterReaderModeIfAvailable?: boolean;
  tintColor?: string;
  transition?: string;
}

/**
 * @name SafariViewController
 * @description
 * @usage
 * ```
 * import { SafariViewController } from 'ionic-native';
 *
 *
 * SafariViewController.isAvailable()
 *   .then(
 *     (available: boolean) => {
 *       if(available){
 *
 *         SafariViewController.show({
 *           url: 'http://ionic.io',
 *           hidden: false,
 *           animated: false,
 *           transition: 'curl',
 *           enterReaderModeIfAvailable: true,
 *           tintColor: '#ff0000'
 *         })
 *         .then(
 *           (result: any) => {
 *             if(result.event === 'opened') console.log('Opened');
 *             else if(result.event === 'loaded') console.log('Loaded');
 *             else if(result.event === 'closed') console.log('Closed');
 *           },
 *           (error: any) => console.error(error)
 *         );
 *
 *       } else {
 *         // use fallback browser, example InAppBrowser
 *       }
 *     }
 *   );
 * ```
 * @interfaces
 * SafariViewControllerOptions
 */
@Plugin({
  pluginName: 'SafariViewController',
  plugin: 'cordova-plugin-safariviewcontroller',
  pluginRef: 'SafariViewController',
  platforms: ['iOS', 'Android'],
  repo: 'https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller'
})
export class SafariViewController {

  /**
   * Checks if SafariViewController is available
   * @returns {Promise<boolean>}
   */
  @Cordova()
  static isAvailable(): Promise<boolean> { return; }

  /**
   * Shows Safari View Controller
   * @param options {SafariViewControllerOptions} optional
   * @returns {Promise<any>}
   */
  @Cordova({
    successIndex: 1,
    errorIndex: 2
  })
  static show(options?: SafariViewControllerOptions): Promise<any> { return; }

  /**
   * Hides Safari View Controller
   */
  @Cordova()
  static hide(): Promise<any> { return; }

  /**
   * Tries to connect to the  Chrome's custom tabs service. you must call this method before calling any of the other methods listed below.
   * @returns {Promise<any>}
   */
  @Cordova()
  static connectToService(): Promise<any> { return; }

  /**
   * Call this method whenever there's a chance the user will open an external url.
   * @returns {Promise<any>}
   */
  @Cordova()
  static warmUp(): Promise<any> { return; }

  /**
   * For even better performance optimization, call this methods if there's more than a 50% chance the user will open a certain URL.
   * @param url{string}
   * @returns {Promise<any>}
   */
  @Cordova()
  static mayLaunchUrl(url: string): Promise<any> { return; }

}
{'fraction_non_alphanumeric': 0.1411928360285168, 'fraction_numerical': 0.0027821248478525473, 'mean_word_length': 2.8891142663962137, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 30, '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': '2872836', 'n_tokens_mistral': 1775, 'n_tokens_neox': 1693, 'n_words': 430}