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", "ns.ts",
"control.cpp", "control.cpp",
"control.ts", "control.ts",
"eventcontext.ts",
"serial.cpp", "serial.cpp",
"serial.ts", "serial.ts",
"fieldeditors.ts" "fieldeditors.ts"

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

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

View File

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

View File

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

View File

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