forked from espruino/BangleApps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prepare for using with widChargingStatus
global types are not yet received correctly, but we're close! - use widChargerStatus as first example to make setup work - add github action to compile supplied types/globals on pushes
- Loading branch information
1 parent
3cd9c39
commit 61cc93b
Showing
9 changed files
with
176 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Node CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: go to typescript directory | ||
run: cd typescript | ||
- name: npm ci | ||
run: npm ci | ||
- name: build types | ||
run: npm run build:types |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
// TODO all of these globals (copied from eslintrc need to be typed at some point) | ||
/* "globals": { | ||
// Methods and Fields at https://banglejs.com/reference | ||
"Array": "readonly", | ||
"ArrayBuffer": "readonly", | ||
"ArrayBufferView": "readonly", | ||
"Bangle": "readonly", | ||
"BluetoothDevice": "readonly", | ||
"BluetoothRemoteGATTCharacteristic": "readonly", | ||
"BluetoothRemoteGATTServer": "readonly", | ||
"BluetoothRemoteGATTService": "readonly", | ||
"Boolean": "readonly", | ||
"console": "readonly", | ||
"DataView": "readonly", | ||
"Date": "readonly", | ||
"E": "readonly", | ||
"Error": "readonly", | ||
"Flash": "readonly", | ||
"Float32Array": "readonly", | ||
"Float64Array": "readonly", | ||
"fs": "readonly", | ||
"Function": "readonly", | ||
"Graphics": "readonly", | ||
"heatshrink": "readonly", | ||
"I2C": "readonly", | ||
"Int16Array": "readonly", | ||
"Int32Array": "readonly", | ||
"Int8Array": "readonly", | ||
"InternalError": "readonly", | ||
"JSON": "readonly", | ||
"Math": "readonly", | ||
"Modules": "readonly", | ||
"NRF": "readonly", | ||
"Number": "readonly", | ||
"Object": "readonly", | ||
"OneWire": "readonly", | ||
"Pin": "readonly", | ||
"process": "readonly", | ||
"Promise": "readonly", | ||
"ReferenceError": "readonly", | ||
"RegExp": "readonly", | ||
"Serial": "readonly", | ||
"SPI": "readonly", | ||
"Storage": "readonly", | ||
"StorageFile": "readonly", | ||
"String": "readonly", | ||
"SyntaxError": "readonly", | ||
"tensorflow": "readonly", | ||
"TFMicroInterpreter": "readonly", | ||
"TypeError": "readonly", | ||
"Uint16Array": "readonly", | ||
"Uint24Array": "readonly", | ||
"Uint32Array": "readonly", | ||
"Uint8Array": "readonly", | ||
"Uint8ClampedArray": "readonly", | ||
"Waveform": "readonly", | ||
// Methods and Fields at https://banglejs.com/reference | ||
"analogRead": "readonly", | ||
"analogWrite": "readonly", | ||
"arguments": "readonly", | ||
"atob": "readonly", | ||
"Bluetooth": "readonly", | ||
"BTN": "readonly", | ||
"BTN1": "readonly", | ||
"BTN2": "readonly", | ||
"BTN3": "readonly", | ||
"BTN4": "readonly", | ||
"BTN5": "readonly", | ||
"btoa": "readonly", | ||
"changeInterval": "readonly", | ||
"clearInterval": "readonly", | ||
"clearTimeout": "readonly", | ||
"clearWatch": "readonly", | ||
"decodeURIComponent": "readonly", | ||
"digitalPulse": "readonly", | ||
"digitalRead": "readonly", | ||
"digitalWrite": "readonly", | ||
"dump": "readonly", | ||
"echo": "readonly", | ||
"edit": "readonly", | ||
"encodeURIComponent": "readonly", | ||
"eval": "readonly", | ||
"getPinMode": "readonly", | ||
"getSerial": "readonly", | ||
"getTime": "readonly", | ||
"global": "readonly", | ||
"HIGH": "readonly", | ||
"I2C1": "readonly", | ||
"Infinity": "readonly", | ||
"isFinite": "readonly", | ||
"isNaN": "readonly", | ||
"LED": "readonly", | ||
"LED1": "readonly", | ||
"LED2": "readonly", | ||
"load": "readonly", | ||
"LoopbackA": "readonly", | ||
"LoopbackB": "readonly", | ||
"LOW": "readonly", | ||
"NaN": "readonly", | ||
"parseFloat": "readonly", | ||
"parseInt": "readonly", | ||
"peek16": "readonly", | ||
"peek32": "readonly", | ||
"peek8": "readonly", | ||
"pinMode": "readonly", | ||
"poke16": "readonly", | ||
"poke32": "readonly", | ||
"poke8": "readonly", | ||
"print": "readonly", | ||
"require": "readonly", | ||
"reset": "readonly", | ||
"save": "readonly", | ||
"Serial1": "readonly", | ||
"setBusyIndicator": "readonly", | ||
"setInterval": "readonly", | ||
"setSleepIndicator": "readonly", | ||
"setTime": "readonly", | ||
"setTimeout": "readonly", | ||
"setWatch": "readonly", | ||
"shiftOut": "readonly", | ||
"SPI1": "readonly", | ||
"Terminal": "readonly", | ||
"trace": "readonly", | ||
"VIBRATE": "readonly", | ||
// Aliases and not defined at https://banglejs.com/reference | ||
"g": "readonly", | ||
*/ | ||
|
||
declare const Bangle: { | ||
// functions | ||
buzz: () => void; | ||
drawWidgets: () => void; | ||
isCharging: () => boolean; | ||
// events | ||
on(event: 'charging', listener: (charging: boolean) => void): void; | ||
// TODO add more | ||
}; | ||
|
||
type Widget = { | ||
area: 'tr' | 'tl'; | ||
width: number; | ||
draw: () => void; | ||
}; | ||
|
||
declare const WIDGETS: { [key: string]: Widget }; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters