UNPKG

nativescript-particle

Version:

Control your Particle.io devices from a NativeScript app!

25 lines (24 loc) 1.05 kB
import { TNSParticleAPI, TNSParticleDevice, TNSParticleEvent, TNSParticleLoginOptions } from "./particle.common"; export declare class Particle implements TNSParticleAPI { eventIds: Map<string, (event: TNSParticleEvent) => void>; constructor(); private initWorkerIfNeeded; private initEventWorkerIfNeeded; login(options: TNSParticleLoginOptions): Promise<void>; loginWithToken(token: string): void; setOAuthConfig(id: string, secret: string): void; logout(): void; publish(name: string, data: string, isPrivate: boolean, ttl?: number): Promise<void>; subscribe(prefix: string, eventHandler: (event: TNSParticleEvent) => void): void; unsubscribe(prefix: string): void; listDevices(): Promise<Array<TNSParticleDevice>>; isAuthenticated(): boolean; accessToken(): string; startDeviceSetupWizard(): Promise<boolean>; getDeviceSetupCustomizer(): any; private renameDevice; private callFunction; private getVariable; private subscribeDevice; private unsubscribeDevice; }