adding namespace to api categories (#330)

* adding namespace to api categories

* add icon for led

* adding icons for control, game, images, pins and serial.
This commit is contained in:
Peli de Halleux
2017-01-05 07:01:50 -08:00
committed by GitHub
parent c713fe9bf4
commit 5d8ccd1d6d
19 changed files with 71 additions and 71 deletions

56
libs/core/shims.d.ts vendored
View File

@ -4,7 +4,7 @@
/**
* Creation, manipulation and display of LED images.
*/
//% color=#5C2D91 weight=31
//% color=#5C2D91 weight=31 icon="\uf03e"
//% advanced=true
declare namespace images {
@ -126,7 +126,7 @@ declare interface Image {
/**
* Provides access to basic micro:bit functionality.
*/
//% color=#0078D7 weight=100
//% color=#0078D7 weight=100 icon="\uf00a"
declare namespace basic {
/**
@ -135,7 +135,7 @@ declare namespace basic {
*/
//% help=basic/show-number
//% weight=96
//% blockId=device_show_number block="show|number %number" blockGap=8 icon="\uf1ec"
//% blockId=device_show_number block="show|number %number" blockGap=8
//% async
//% parts="ledmatrix" interval.defl=150 shim=basic::showNumber
function showNumber(value: number, interval?: number): void;
@ -160,7 +160,7 @@ declare namespace basic {
*/
//% help=basic/show-string
//% weight=87 blockGap=8
//% block="show|string %text" icon="\uf031"
//% block="show|string %text"
//% async
//% blockId=device_print_message
//% parts="ledmatrix" interval.defl=150 shim=basic::showString
@ -170,7 +170,7 @@ declare namespace basic {
* Turn off all LEDs
*/
//% help=basic/clear-screen weight=79
//% blockId=device_clear_display block="clear screen" icon="\uf12d"
//% blockId=device_clear_display block="clear screen"
//% parts="ledmatrix" shim=basic::clearScreen
function clearScreen(): void;
@ -211,7 +211,7 @@ declare namespace basic {
//% color=300 weight=99
//% color=300 weight=99 icon="\uf192"
declare namespace input {
/**
@ -220,7 +220,7 @@ declare namespace input {
* @param body code to run when event is raised
*/
//% help=input/on-button-pressed weight=85 blockGap=8
//% blockId=device_button_event block="on button|%NAME|pressed" icon="\uf192"
//% blockId=device_button_event block="on button|%NAME|pressed"
//% parts="buttonpair" shim=input::onButtonPressed
function onButtonPressed(button: Button, body: () => void): void;
@ -230,7 +230,7 @@ declare namespace input {
* @param body code to run when gesture is raised
*/
//% help=input/on-gesture weight=84 blockGap=8
//% blockId=device_gesture_event block="on |%NAME" icon="\uf135"
//% blockId=device_gesture_event block="on |%NAME"
//% parts="accelerometer" shim=input::onGesture
function onGesture(gesture: Gesture, body: () => void): void;
@ -240,7 +240,7 @@ declare namespace input {
* @param body the code to run when the pin is pressed
*/
//% help=input/on-pin-pressed weight=83
//% blockId=device_pin_event block="on pin %name|pressed" icon="\uf094" shim=input::onPinPressed
//% blockId=device_pin_event block="on pin %name|pressed" shim=input::onPinPressed
function onPinPressed(name: TouchPin, body: () => void): void;
/**
@ -249,7 +249,7 @@ declare namespace input {
* @param body the code to run when the pin is released
*/
//% help=input/on-pin-released weight=6 blockGap=8
//% blockId=device_pin_released block="on pin %NAME|released" icon="\uf094"
//% blockId=device_pin_released block="on pin %NAME|released"
//% advanced=true shim=input::onPinReleased
function onPinReleased(name: TouchPin, body: () => void): void;
@ -269,7 +269,7 @@ declare namespace input {
* @param name pin used to detect the touch, eg: TouchPin.P0
*/
//% help=input/pin-is-pressed weight=58
//% blockId="device_pin_is_pressed" block="pin %NAME|is pressed" icon="\uf094"
//% blockId="device_pin_is_pressed" block="pin %NAME|is pressed"
//% blockGap=8 shim=input::pinIsPressed
function pinIsPressed(name: TouchPin): boolean;
@ -277,7 +277,7 @@ declare namespace input {
* Get the acceleration value in milli-gravitys (when the board is laying flat with the screen up, x=0, y=0 and z=-1024)
* @param dimension TODO
*/
//% help=input/acceleration weight=58 icon="\uf135"
//% help=input/acceleration weight=58
//% blockId=device_acceleration block="acceleration (mg)|%NAME" blockGap=8
//% parts="accelerometer" shim=input::acceleration
function acceleration(dimension: Dimension): number;
@ -286,7 +286,7 @@ declare namespace input {
* Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright.
*/
//% help=input/light-level weight=57
//% blockId=device_get_light_level block="light level" blockGap=8 icon="\uf185"
//% blockId=device_get_light_level block="light level" blockGap=8
//% parts="ledmatrix" shim=input::lightLevel
function lightLevel(): number;
@ -294,7 +294,7 @@ declare namespace input {
* Get the current compass heading in degrees.
*/
//% help=input/compass-heading
//% weight=56 icon="\uf14e"
//% weight=56
//% blockId=device_heading block="compass heading (°)" blockGap=8
//% parts="compass" shim=input::compassHeading
function compassHeading(): number;
@ -302,7 +302,7 @@ declare namespace input {
/**
* Gets the temperature in Celsius degrees (°C).
*/
//% weight=55 icon="\uf06d"
//% weight=55
//% help=input/temperature
//% blockId=device_temperature block="temperature (°C)" blockGap=8
//% parts="thermometer" shim=input::temperature
@ -313,7 +313,7 @@ declare namespace input {
* @param kind TODO
*/
//% help=input/rotation weight=52
//% blockId=device_get_rotation block="rotation (°)|%NAME" blockGap=8 icon="\uf197"
//% blockId=device_get_rotation block="rotation (°)|%NAME" blockGap=8
//% parts="accelerometer" advanced=true shim=input::rotation
function rotation(kind: Rotation): number;
@ -322,7 +322,7 @@ declare namespace input {
* @param dimension TODO
*/
//% help=input/magnetic-force weight=51
//% blockId=device_get_magnetic_force block="magnetic force (µT)|%NAME" blockGap=8 icon="\uf076"
//% blockId=device_get_magnetic_force block="magnetic force (µT)|%NAME" blockGap=8
//% parts="compass"
//% advanced=true shim=input::magneticForce
function magneticForce(dimension: Dimension): number;
@ -331,7 +331,7 @@ declare namespace input {
* Gets the number of milliseconds elapsed since power on.
*/
//% help=input/running-time weight=50
//% blockId=device_get_running_time block="running time (ms)" icon="\uf017"
//% blockId=device_get_running_time block="running time (ms)"
//% advanced=true shim=input::runningTime
function runningTime(): number;
@ -346,7 +346,7 @@ declare namespace input {
* @param range a value describe the maximum strengh of acceleration measured
*/
//% help=input/set-accelerometer-range
//% blockId=device_set_accelerometer_range block="set accelerometer|range %range" icon="\uf135"
//% blockId=device_set_accelerometer_range block="set accelerometer|range %range"
//% weight=5
//% parts="accelerometer"
//% advanced=true shim=input::setAccelerometerRange
@ -427,7 +427,7 @@ declare namespace control {
//% color=3 weight=35
//% color=3 weight=35 icon="\uf205"
declare namespace led {
/**
@ -436,7 +436,7 @@ declare namespace led {
* @param y TODO
*/
//% help=led/plot weight=78
//% blockId=device_plot block="plot|x %x|y %y" icon="\uf205" blockGap=8
//% blockId=device_plot block="plot|x %x|y %y" blockGap=8
//% parts="ledmatrix" shim=led::plot
function plot(x: number, y: number): void;
@ -446,7 +446,7 @@ declare namespace led {
* @param y TODO
*/
//% help=led/unplot weight=77
//% blockId=device_unplot block="unplot|x %x|y %y" icon="\uf204" blockGap=8
//% blockId=device_unplot block="unplot|x %x|y %y" blockGap=8
//% parts="ledmatrix" shim=led::unplot
function unplot(x: number, y: number): void;
@ -456,7 +456,7 @@ declare namespace led {
* @param y TODO
*/
//% help=led/point weight=76
//% blockId=device_point block="point|x %x|y %y" icon="\uf10c"
//% blockId=device_point block="point|x %x|y %y"
//% parts="ledmatrix" shim=led::point
function point(x: number, y: number): boolean;
@ -464,7 +464,7 @@ declare namespace led {
* Get the screen brightness from 0 (off) to 255 (full bright).
*/
//% help=led/brightness weight=60
//% blockId=device_get_brightness block="brightness" icon="\uf042" blockGap=8
//% blockId=device_get_brightness block="brightness" blockGap=8
//% parts="ledmatrix"
//% advanced=true shim=led::brightness
function brightness(): number;
@ -474,7 +474,7 @@ declare namespace led {
* @param value the brightness value, eg:255, 127, 0
*/
//% help=led/set-brightness weight=59
//% blockId=device_set_brightness block="set brightness %value" icon="\uf042"
//% blockId=device_set_brightness block="set brightness %value"
//% parts="ledmatrix"
//% advanced=true shim=led::setBrightness
function setBrightness(value: number): void;
@ -483,7 +483,7 @@ declare namespace led {
* Cancels the current animation and clears other pending animations.
*/
//% weight=50 help=led/stop-animation
//% blockId=device_stop_animation block="stop animation" icon="\uf04d"
//% blockId=device_stop_animation block="stop animation"
//% parts="ledmatrix"
//% advanced=true shim=led::stopAnimation
function stopAnimation(): void;
@ -499,7 +499,7 @@ declare namespace led {
/**
* Turns on or off the display
*/
//% help=led/enable blockId=device_led_enable block="led enable %on" icon="\uf04d"
//% help=led/enable blockId=device_led_enable block="led enable %on"
//% advanced=true parts="ledmatrix" shim=led::enable
function enable(on: boolean): void;
@ -658,7 +658,7 @@ declare namespace pins {
//% weight=2 color=30
//% weight=2 color=30 icon="\uf287"
//% advanced=true
declare namespace serial {