當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript core.CordovaCheck函數代碼示例

本文整理匯總了TypeScript中@ionic-native/core.CordovaCheck函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript CordovaCheck函數的具體用法?TypeScript CordovaCheck怎麽用?TypeScript CordovaCheck使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CordovaCheck函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getPromise

 /**
  * Search for contacts in the Contacts list.
  * @param fields {ContactFieldType[]}  Contact fields to be used as a search qualifier
  * @param options {IContactFindOptions} Optional options for the query
  * @returns {Promise<Contact[]>} Returns a Promise that resolves with the search results (an array of Contact objects)
  */
 @CordovaCheck()
 find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
   return getPromise((resolve: Function, reject: Function) => {
     navigator.contacts.find(fields, (contacts: any[]) => {
       resolve(contacts.map(processContact));
     }, reject, options);
   });
 }
開發者ID:gunsteaeuy,項目名稱:ionic-native,代碼行數:14,代碼來源:index.ts

示例2: connect

 /**
  * Establishes connection to JINS MEME.
  * @param {string} target
  * @returns {Observable<any>}
  */
 @CordovaCheck({
   observable: true
 })
 connect(target: string): Observable<any> {
   return new Observable<any>((observer: any) => {
     let data = cordova.plugins.JinsMemePlugin.connect(target, observer.next.bind(observer), observer.complete.bind(observer), observer.error.bind(observer));
     return () => console.log(data);
   });
 }
開發者ID:clintj42,項目名稱:ionic-native,代碼行數:14,代碼來源:index.ts

示例3: check

 /**
  * Checks if the printer service is available (iOS) or if printer services are installed and enabled (Android).
  * @return {Promise<any>} returns a promise that resolve with an object indicating whether printing is available, and providing the number of printers available
  */
 @CordovaCheck()
 check(): Promise<any> {
   return new Promise<any>((resolve: Function) => {
     Printer.getPlugin()
       .check((avail: boolean, count: any) => {
         resolve({ avail, count });
       });
   });
 }
開發者ID:clintj42,項目名稱:ionic-native,代碼行數:13,代碼來源:index.ts

示例4: deploy

 /**
  * Ionic Pro Deploy .js API.
  */
 @CordovaCheck({ sync: true })
 deploy(): ProDeploy {
   if (this._deploy) {
     return this._deploy;
   } else {
     this._deploy = new ProDeploy(Pro.getPlugin().deploy);
     return this._deploy;
   }
 }
開發者ID:clintj42,項目名稱:ionic-native,代碼行數:12,代碼來源:index.ts

示例5: isAvailable

 /**
  * Verifies if sending emails is supported on the device.
  *
  * @param [app] {string} App id or uri scheme.
  * @returns {Promise<any>} Resolves if available, rejects if not available
  */
 @CordovaCheck()
 isAvailable(app?: string): Promise<any> {
   return new Promise<boolean>((resolve, reject) => {
     if (app) {
       EmailComposer.getPlugin().isAvailable(app, (isAvailable: boolean) => {
         if (isAvailable) {
           resolve();
         } else {
           reject();
         }
       });
     } else {
       EmailComposer.getPlugin().isAvailable((isAvailable: boolean) => {
         if (isAvailable) {
           resolve();
         } else {
           reject();
         }
       });
     }
   });
 }
開發者ID:clintj42,項目名稱:ionic-native,代碼行數:28,代碼來源:index.ts

示例6: Promise

 /**
  * Creates a namespaced storage.
  * @param store {string}
  * @returns {Promise<SecureStorageObject>}
  */
 @CordovaCheck()
 create(store: string): Promise<SecureStorageObject> {
   return new Promise((res: Function, rej: Function) => {
     const instance = new (SecureStorage.getPlugin())(() => res(new SecureStorageObject(instance)), rej, store);
   });
 }
開發者ID:clintj42,項目名稱:ionic-native,代碼行數:11,代碼來源:index.ts

示例7: BeaconRegion

 /**
  * Creates a new BeaconRegion
  *
  * @param {String} identifier @see {CLRegion}
  * @param {String} uuid The proximity ID of the beacon being targeted.
  * This value must not be blank nor invalid as a UUID.
  * @param {Number} major The major value that you use to identify one or more beacons.
  * @param {Number} minor The minor value that you use to identify a specific beacon.
  * @param {BOOL} notifyEntryStateOnDisplay
  *
  * @returns {BeaconRegion} Returns the BeaconRegion that was created
  */
 @CordovaCheck({ sync: true })
 BeaconRegion(identifer: string, uuid: string, major?: number, minor?: number, notifyEntryStateOnDisplay?: boolean): BeaconRegion {
   return new cordova.plugins.locationManager.BeaconRegion(identifer, uuid, major, minor, notifyEntryStateOnDisplay);
 }
開發者ID:clintj42,項目名稱:ionic-native,代碼行數:16,代碼來源:index.ts

示例8: Delegate

  /**
   * Instances of this class are delegates between the {@link LocationManager} and
   * the code that consumes the messages generated on in the native layer.
   *
   * @returns {IBeaconDelegate} An instance of the type {@type Delegate}.
   */
  @CordovaCheck({ sync: true })
  Delegate(): IBeaconDelegate {
    let delegate = new cordova.plugins.locationManager.Delegate();

    delegate.didChangeAuthorizationStatus = (pluginResult?: IBeaconPluginResult) => {
      return new Observable<IBeaconPluginResult>(
        (observer: any) => {
          let cb = (data: IBeaconPluginResult) => observer.next(data);
          return delegate.didChangeAuthorizationStatus = cb;
        }
      );
    };

    delegate.didDetermineStateForRegion = (pluginResult?: IBeaconPluginResult) => {
      return new Observable<IBeaconPluginResult>(
        (observer: any) => {
          let cb = (data: IBeaconPluginResult) => observer.next(data);
          return delegate.didDetermineStateForRegion = cb;
        }
      );
    };

    delegate.didEnterRegion = (pluginResult?: IBeaconPluginResult) => {
      return new Observable<IBeaconPluginResult>(
        (observer: any) => {
          let cb = (data: IBeaconPluginResult) => observer.next(data);
          return delegate.didEnterRegion = cb;
        }
      );
    };

    delegate.didExitRegion = (pluginResult?: IBeaconPluginResult) => {
      return new Observable<IBeaconPluginResult>(
        (observer: any) => {
          let cb = (data: IBeaconPluginResult) => observer.next(data);
          return delegate.didExitRegion = cb;
        }
      );
    };

    delegate.didRangeBeaconsInRegion = (pluginResult?: IBeaconPluginResult) => {
      return new Observable<IBeaconPluginResult>(
        (observer: any) => {
          let cb = (data: IBeaconPluginResult) => observer.next(data);
          return delegate.didRangeBeaconsInRegion = cb;
        }
      );
    };

    delegate.didStartMonitoringForRegion = (pluginResult?: IBeaconPluginResult) => {
      return new Observable<IBeaconPluginResult>(
        (observer: any) => {
          let cb = (data: IBeaconPluginResult) => observer.next(data);
          return delegate.didStartMonitoringForRegion = cb;
        }
      );
    };

    delegate.monitoringDidFailForRegionWithError = (pluginResult?: IBeaconPluginResult) => {
      return new Observable<IBeaconPluginResult>(
        (observer: any) => {
          let cb = (data: IBeaconPluginResult) => observer.next(data);
          return delegate.monitoringDidFailForRegionWithError = cb;
        }
      );
    };

    delegate.peripheralManagerDidStartAdvertising = (pluginResult?: IBeaconPluginResult) => {
      return new Observable<IBeaconPluginResult>(
        (observer: any) => {
          let cb = (data: IBeaconPluginResult) => observer.next(data);
          return delegate.peripheralManagerDidStartAdvertising = cb;
        }
      );
    };

    delegate.peripheralManagerDidUpdateState = (pluginResult?: IBeaconPluginResult) => {
      return new Observable<IBeaconPluginResult>(
        (observer: any) => {
          let cb = (data: IBeaconPluginResult) => observer.next(data);
          return delegate.peripheralManagerDidUpdateState = cb;
        }
      );
    };

    cordova.plugins.locationManager.setDelegate(delegate);
    return delegate;
  }
開發者ID:clintj42,項目名稱:ionic-native,代碼行數:94,代碼來源:index.ts

示例9: Promise

 /**
  * Open or create a SQLite database file.
  *
  * See the plugin docs for an explanation of all options: https://github.com/litehelpers/Cordova-sqlite-storage#opening-a-database
  *
  * @param config {SQLiteDatabaseConfig} database configuration
  * @return Promise<SQLiteObject>
  */
 @CordovaCheck()
 create(config: SQLiteDatabaseConfig): Promise<SQLiteObject> {
   return new Promise((resolve, reject) => {
     sqlitePlugin.openDatabase(config, (db: any) => resolve(new SQLiteObject(db)), reject);
   });
 }
開發者ID:gunsteaeuy,項目名稱:ionic-native,代碼行數:14,代碼來源:index.ts


注:本文中的@ionic-native/core.CordovaCheck函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。