• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript core.CordovaCheck函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript core.CordovaInstance函数代码示例发布时间:2022-05-28
下一篇:
TypeScript core.Cordova函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap