upgrading to latest common packages (#383)

This commit is contained in:
Peli de Halleux 2018-03-28 09:04:49 -07:00 committed by GitHub
parent 8536126e23
commit 31f91d4e24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 17 deletions

View File

@ -16,6 +16,7 @@
"ns.ts",
"control.cpp",
"control.ts",
"eventcontext.ts",
"serial.cpp",
"serial.ts",
"fieldeditors.ts"

10
libs/base/shims.d.ts vendored
View File

@ -102,14 +102,10 @@ declare namespace control {
function millis(): int32;
/**
* Run code when a registered event happens.
* @param id the event compoent id
* @param value the event value to match
* Used internally
*/
//% weight=20 blockGap=8 blockId="control_on_event" block="on event|from %src|with value %value"
//% blockExternalInputs=1
//% help="control/on-event" flags.defl=16 shim=control::onEvent
function onEvent(src: int32, value: int32, handler: () => void, flags?: int32): void;
//% flags.defl=16 shim=control::internalOnEvent
function internalOnEvent(src: int32, value: int32, handler: () => void, flags?: int32): void;
/**
* Reset the device.

View File

@ -23,14 +23,14 @@ declare interface Image {
/**
* Set pixel color
*/
//% shim=ImageMethods::set
set(x: int32, y: int32, c: int32): void;
//% shim=ImageMethods::setPixel
setPixel(x: int32, y: int32, c: int32): void;
/**
* Get a pixel color
*/
//% shim=ImageMethods::get
get(x: int32, y: int32): int32;
//% shim=ImageMethods::getPixel
getPixel(x: int32, y: int32): int32;
/**
* Fill entire image with a given color

View File

@ -5,7 +5,7 @@
//% groups=["0.,","1#*"]
function img(lits: any, ...args: any[]): Image { return null }
let screen = image.create(DAL.LCD_WIDTH, DAL.LCD_HEIGHT)
const screen = image.create(DAL.LCD_WIDTH, DAL.LCD_HEIGHT)
namespace _screen_internal {
//% shim=pxt::updateScreen
@ -13,10 +13,9 @@ namespace _screen_internal {
//% shim=pxt::updateStats
function updateStats(msg: string): void { }
control.setupScreenRefresh(() => updateScreen(screen))
export function _stats(msg: string) {
updateStats(msg)
control.__screen.setupUpdate(() => updateScreen(screen))
control.EventContext.onStats = function(msg: string) {
updateStats(msg);
}
}

View File

@ -45,7 +45,7 @@
"webfonts-generator": "^0.4.0"
},
"dependencies": {
"pxt-common-packages": "0.20.14",
"pxt-common-packages": "0.20.28",
"pxt-core": "3.5.11"
},
"scripts": {