1.0.2 • Published 5 years ago

@admooh-app/dev-tools v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

adMooH App · GitHub license npm version

Installation

using npm:

npm install admooh-app

using yarn:

yarn add admooh-app

Creating a adMooH App

Just need extends a AppComponent on class, its a similar to extends a React.Component. view more about React.

import React from 'react';
import { AppComponent } from 'admooh-app';

export default class AwesomeApp extends AppComponent<TMyState> { 
    // your code
}

Thus, functions necessary for the functioning of the app in signage player will be implemented and properties will be inferred as:

interface AppComponentProps {
    context: IAdmoohContext;
    data: any;
    //...
}

Read more about adMooH Apps here.

adMooH Context

The adMooH context is an interface that provides the main functions used to integrate the app with the signage player:

FunctionDescriptionReturn
downloadDownload file and save to local storage.Local file path.
setDataInsert or update data in app local db with the key.Operation success (true/false).
getDataGet data with the key.Data saved or null.
convertXmlConvert XML to normalized JavaScrit Object, read more x2js.Object
interface IAdmoohContext {
  download: (fileUrl: string) => Promise<string | null>;
  setData:  <TData>(key: string, value: TData) => Promise<boolean>;
  getData:  <TData>(key: string) => Promise<TData | null>;
  convertXml: (xml: string) => Promise<object>;
};

App Player

App Pre?View

Resources

License

MIT