@admooh-app/core
v1.0.5
Published
<div style="text-align:center"><img src="logo.png" /></div>
Downloads
12
Readme
adMooH App ·
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:
|Function|Description|Return| |-|-|-| |download|Download file and save to local storage. |Local file path.| |setData|Insert or update data in app local db with the key.|Operation success (true/false).| |getData|Get data with the key.|Data saved or null.| |convertXml|Convert 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>;
};