refresh shims (#2134)

This commit is contained in:
Peli de Halleux 2019-06-05 13:34:07 -07:00 committed by GitHub
parent 180a1942fc
commit c56df20d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -52,12 +52,14 @@
"Boolean.toString": "Returns a string representation of an object.",
"Buffer.fill": "Fill (a fragment) of the buffer with given value.",
"Buffer.getNumber": "Read a number in specified format from the buffer.",
"Buffer.getUint8": "Reads an unsigned byte at a particular location",
"Buffer.length": "Returns the length of a Buffer object.",
"Buffer.rotate": "Rotate buffer left in place.\n\n\n\nstart. eg: -1",
"Buffer.rotate|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus",
"Buffer.rotate|param|offset": "number of bytes to shift; use negative value to shift right",
"Buffer.rotate|param|start": "start offset in buffer. Default is 0.",
"Buffer.setNumber": "Write a number in specified format in the buffer.",
"Buffer.setUint8": "Writes an unsigned byte at a particular location",
"Buffer.shift": "Shift buffer left in place, with zero padding.\n\n\n\nstart. eg: -1",
"Buffer.shift|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus",
"Buffer.shift|param|offset": "number of bytes to shift; use negative value to shift right",

View File

@ -233,6 +233,7 @@
"String.charAt|block": "char from %this=text|at %pos",
"String.compare|block": "compare %this=text| to %that",
"String.fromCharCode|block": "text from char code %code",
"String.isEmpty|block": "%this=text| is empty",
"String.length|block": "length of %VALUE",
"String.substr|block": "substring of %this=text|from %start|of length %length",
"String|block": "String",

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

@ -884,6 +884,18 @@ declare namespace serial {
//% indexerGet=BufferMethods::getByte indexerSet=BufferMethods::setByte
declare interface Buffer {
/**
* Reads an unsigned byte at a particular location
*/
//% shim=BufferMethods::getUint8
getUint8(off: int32): int32;
/**
* Writes an unsigned byte at a particular location
*/
//% shim=BufferMethods::setUint8
setUint8(off: int32, v: int32): void;
/**
* Write a number in specified format in the buffer.
*/