1.0.12 • Published 5 years ago

ts-pwaapi v1.0.12

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Simple Progressive Web App API

Github: https://github.com/bixybixy2/TS-PWAAPI

  • Download pwa.js from dist folder and add to your project

NPM: https://www.npmjs.com/package/ts-pwaapi

  • From the command line, run npm i ts-pwaapi

Example Importing the library:

import * as pwa from './pwa.js'

Functions:

createSecondaryTile(tileId, options)

Options group includes title, activationArguments, logoUri, foregroundText, backgroundColorWin, and backgroundColor{a,r,g,b}

Example:

pwa.createSecondaryTile(12345,{
    title: SecondaryTile,
    activationArguments: Args,
    logoUri: URI,
    foregroundText: light,
    backgroundColorWin: '',
    backgroundColor: {a: 255, r: 255, g: 255, b: 255}
    })

updateSecondaryTile(tileId, options)

Options group includes displayName, showNameOnSquare, foregroundText, squareMedUri, backgroundColorWin, and backgroundColor{a,r,g,b}

Example:

pwa.updateSecondaryTile(12345,{
    displayName: SecondaryTile,
    showNameOnSquare: 1, 
    foregroundText: light, 
    backgroundColorWin: '', 
    backgroundColor: {a: 255, r: 255, g: 255, b: 255}
    })n

removeSecondaryTile(tileId)

Unpins secondary tile from the start menu. Example:

pwa.removeSecondaryTile(12345)

checkForDarkTheme()

Returns true or false if system theme is dark Example:

let isDarkTheme = pwa.checkForDarkTheme();

changeAppTitleBarColor(colorOptions)

Options group includes backgroundColor, foregroundColor, buttonBackgroundColor, buttonForegroundColor, buttonHoverBackgroundColor, buttonHoverForegroundColor, buttonPressedBackgroundColor, buttonPressedForegroundColor, inactiveBackgroundColor, inactiveForegroundColor, buttonInactiveBackgroundColor, buttonInactiveForegroundColor. All use {a,r,g,b} settings that accept 0-255 decimal or 0x## hexadecimal

Example:

pwa.changeAppTitleBarColor({
    backgroundColor: {a: 255,r: 100,g: 200,b: 225},
    foregroundColor: {a: 255,r: 125,g: 225,b: 250},
    inactiveBackgroundColor: {a: 100,r: 100,g: 200,b: 225},
    inactiveForegroundColor: {a: 100,r: 125,g: 225,b: 250}  
})

toggleCompactOverlayMode()

toggle window between default and shrunken overlay Example:

pwa.toggleCompactOverlayMode()

addTimelineActivity(options)

Options group includes id, title, bodytext, imagepath, and activationUri. Example:

pwa.addTimelineActivity({id: 12345, title: 'Title!', bodytext: 'Information!', imagepath: 'Uri', activationUri: 'Uri'})

changeDesktopBackgroundImage(localImagePath)

Change desktop background to provided image Example:

pwa.changeDesktopBackgroundImage('Uri')
1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago