Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ObnizApi

Hierarchy

  • ObnizApi

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Parameters

    Returns ObnizApi

Properties

options

options: any

urlBase

urlBase: any

Accessors

apiVersion

  • get apiVersion(): string
  • obniz.js major version string

    Returns string

Methods

getState

  • getState(callback: (val: { state: "online" | "offline" }) => void): Promise<unknown>
  • Get device is online or offline

    Parameters

    • callback: (val: { state: "online" | "offline" }) => void

      with result

        • (val: { state: "online" | "offline" }): void
        • Parameters

          • val: { state: "online" | "offline" }
            • state: "online" | "offline"

          Returns void

    Returns Promise<unknown>

postJson

  • postJson(json: any, callback: (result: any) => void): Promise<unknown>
  • post data via obniz REST api

    Parameters

    • json: any
    • callback: (result: any) => void
        • (result: any): void
        • Parameters

          • result: any

          Returns void

    Returns Promise<unknown>

Generated using TypeDoc