fix global vars inside IDE (only cli to go)
parent
83d445c1a2
commit
45bd654eca
|
|
@ -1,5 +1,3 @@
|
||||||
"use strict";
|
|
||||||
exports.__esModule = true;
|
|
||||||
(function () {
|
(function () {
|
||||||
var icon = require('heatshrink').decompress(atob('ikggMAiEAgYIBmEAg4EB+EAh0AgPggEeCAIEBnwQBAgP+gEP//x///j//8f//k///H//4BYOP/4lBv4bDvwEB4EAvAEBwEAuA7DCAI7BgAQBhEAA'));
|
var icon = require('heatshrink').decompress(atob('ikggMAiEAgYIBmEAg4EB+EAh0AgPggEeCAIEBnwQBAgP+gEP//x///j//8f//k///H//4BYOP/4lBv4bDvwEB4EAvAEBwEAuA7DCAI7BgAQBhEAA'));
|
||||||
var iconWidth = 18;
|
var iconWidth = 18;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import { loadGlobals } from '../../typescript/types/globals'; // TODO find a nicer way to load ambient type definitions than this
|
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const icon = require('heatshrink').decompress(
|
const icon = require('heatshrink').decompress(
|
||||||
atob(
|
atob(
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,9 @@
|
||||||
"name": "Bangle.ts",
|
"name": "Bangle.ts",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "16.11.12",
|
|
||||||
"typescript": "4.5.2"
|
"typescript": "4.5.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
|
||||||
"version": "16.11.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.12.tgz",
|
|
||||||
"integrity": "sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.5.2",
|
"version": "4.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz",
|
||||||
|
|
@ -33,12 +26,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": {
|
|
||||||
"version": "16.11.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.12.tgz",
|
|
||||||
"integrity": "sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.5.2",
|
"version": "4.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
"author": "Sebastian Di Luzio <sebastian@diluz.io> (https://diluz.io)",
|
"author": "Sebastian Di Luzio <sebastian@diluz.io> (https://diluz.io)",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "16.11.12",
|
|
||||||
"typescript": "4.5.2"
|
"typescript": "4.5.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,6 @@
|
||||||
"module": "es2015",
|
"module": "es2015",
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"target": "es2015"
|
"target": "es2015"
|
||||||
}
|
},
|
||||||
|
"include": ["../apps/**/*", "./**/*"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,33 @@
|
||||||
// TODO all of these globals (copied from eslintrc need to be typed at some point)
|
// TODO all of these globals (copied from eslintrc need to be typed at some point)
|
||||||
/* "globals": {
|
/* {
|
||||||
// Methods and Fields at https://banglejs.com/reference
|
// Methods and Fields at https://banglejs.com/reference
|
||||||
|
"Array": "readonly",
|
||||||
|
"ArrayBuffer": "readonly",
|
||||||
|
"ArrayBufferView": "readonly",
|
||||||
|
"Bangle": "readonly",
|
||||||
"BluetoothDevice": "readonly",
|
"BluetoothDevice": "readonly",
|
||||||
"BluetoothRemoteGATTCharacteristic": "readonly",
|
"BluetoothRemoteGATTCharacteristic": "readonly",
|
||||||
"BluetoothRemoteGATTServer": "readonly",
|
"BluetoothRemoteGATTServer": "readonly",
|
||||||
"BluetoothRemoteGATTService": "readonly",
|
"BluetoothRemoteGATTService": "readonly",
|
||||||
|
"Boolean": "readonly",
|
||||||
|
"console": "readonly",
|
||||||
"DataView": "readonly",
|
"DataView": "readonly",
|
||||||
|
"Date": "readonly",
|
||||||
"E": "readonly",
|
"E": "readonly",
|
||||||
"Error": "readonly",
|
"Error": "readonly",
|
||||||
"Flash": "readonly",
|
"Flash": "readonly",
|
||||||
|
"Float32Array": "readonly",
|
||||||
|
"Float64Array": "readonly",
|
||||||
"fs": "readonly",
|
"fs": "readonly",
|
||||||
"Function": "readonly",
|
"Function": "readonly",
|
||||||
|
"Graphics": "readonly", // partly done
|
||||||
"heatshrink": "readonly",
|
"heatshrink": "readonly",
|
||||||
"I2C": "readonly",
|
"I2C": "readonly",
|
||||||
|
"Int16Array": "readonly",
|
||||||
|
"Int32Array": "readonly",
|
||||||
|
"Int8Array": "readonly",
|
||||||
"InternalError": "readonly",
|
"InternalError": "readonly",
|
||||||
|
"JSON": "readonly",
|
||||||
"Math": "readonly",
|
"Math": "readonly",
|
||||||
"Modules": "readonly",
|
"Modules": "readonly",
|
||||||
"NRF": "readonly",
|
"NRF": "readonly",
|
||||||
|
|
@ -108,12 +122,22 @@
|
||||||
"Terminal": "readonly",
|
"Terminal": "readonly",
|
||||||
"trace": "readonly",
|
"trace": "readonly",
|
||||||
"VIBRATE": "readonly",
|
"VIBRATE": "readonly",
|
||||||
|
// Aliases and not defined at https://banglejs.com/reference
|
||||||
|
"g": "readonly", // done
|
||||||
|
"WIDGETS": "readonly" // done
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export type loadGlobals = {};
|
// ambient JS definitions
|
||||||
|
|
||||||
declare global {
|
declare const require: ((module: 'heatshrink') => {
|
||||||
const Bangle: {
|
decompress: (compressedString: string) => string;
|
||||||
|
}) & // TODO add more
|
||||||
|
((module: 'otherString') => {});
|
||||||
|
|
||||||
|
// ambient bangle.js definitions
|
||||||
|
|
||||||
|
declare const Bangle: {
|
||||||
// functions
|
// functions
|
||||||
buzz: () => void;
|
buzz: () => void;
|
||||||
drawWidgets: () => void;
|
drawWidgets: () => void;
|
||||||
|
|
@ -123,7 +147,7 @@ declare global {
|
||||||
// TODO add more
|
// TODO add more
|
||||||
};
|
};
|
||||||
|
|
||||||
type Image = {
|
declare type Image = {
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
bpp?: number;
|
bpp?: number;
|
||||||
|
|
@ -132,7 +156,7 @@ declare global {
|
||||||
palette?: Uint16Array;
|
palette?: Uint16Array;
|
||||||
};
|
};
|
||||||
|
|
||||||
type GraphicsApi = {
|
declare type GraphicsApi = {
|
||||||
reset: () => void;
|
reset: () => void;
|
||||||
flip: () => void;
|
flip: () => void;
|
||||||
setColor: (color: string) => void; // TODO we can most likely type color more usefully than this
|
setColor: (color: string) => void; // TODO we can most likely type color more usefully than this
|
||||||
|
|
@ -148,13 +172,12 @@ declare global {
|
||||||
// TODO add more
|
// TODO add more
|
||||||
};
|
};
|
||||||
|
|
||||||
const Graphics: GraphicsApi;
|
declare const Graphics: GraphicsApi;
|
||||||
const g: GraphicsApi;
|
declare const g: GraphicsApi;
|
||||||
|
|
||||||
type Widget = {
|
declare type Widget = {
|
||||||
area: 'tr' | 'tl';
|
area: 'tr' | 'tl';
|
||||||
width: number;
|
width: number;
|
||||||
draw: () => void;
|
draw: () => void;
|
||||||
};
|
};
|
||||||
const WIDGETS: { [key: string]: Widget };
|
declare const WIDGETS: { [key: string]: Widget };
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue