pxt-ev3/libs/core/shims.d.ts

145 lines
3.9 KiB
TypeScript
Raw Normal View History

2017-07-05 02:17:26 +02:00
// Auto-generated. Do not edit.
2017-07-07 19:26:49 +02:00
declare namespace control {
/** Create new file mapping in memory */
//% shim=control::mmap
function mmap(filename: string, size: int32, offset: int32): MMap;
}
declare interface MMap {
/**
* Write a number in specified format in the buffer.
*/
//% shim=MMapMethods::setNumber
setNumber(format: NumberFormat, offset: int32, value: number): void;
/**
* Read a number in specified format from the buffer.
*/
//% shim=MMapMethods::getNumber
getNumber(format: NumberFormat, offset: int32): number;
/**
* Read a range of bytes into a buffer.
*/
//% offset.defl=0 length.defl=-1 shim=MMapMethods::slice
slice(offset?: int32, length?: int32): Buffer;
2017-07-07 19:26:49 +02:00
/** Returns the length of a Buffer object. */
//% property shim=MMapMethods::length
length: int32;
2017-07-08 12:16:12 +02:00
/** Perform ioctl(2) on the underlaying file */
//% shim=MMapMethods::ioctl
2017-07-10 15:16:31 +02:00
ioctl(id: uint32, data: Buffer): int32;
/** Perform write(2) on the underlaying file */
//% shim=MMapMethods::write
write(data: Buffer): int32;
/** Perform read(2) on the underlaying file */
//% shim=MMapMethods::read
read(data: Buffer): int32;
/** Set pointer on the underlaying file. */
//% shim=MMapMethods::lseek
lseek(offset: int32, whence: SeekWhence): int32;
2017-07-07 19:26:49 +02:00
}
2017-07-07 12:44:34 +02:00
declare namespace control {
/**
* Announce that an event happened to registered handlers.
* @param src ID of the Component that generated the event
* @param value Component specific code indicating the cause of the event.
* @param mode optional definition of how the event should be processed after construction.
*/
//% weight=21 blockGap=12 blockId="control_raise_event"
2017-08-08 02:39:37 +02:00
//% block="raise event|from %src|with value %value" blockExternalInputs=1 shim=control::raiseEvent
2017-07-07 12:44:34 +02:00
function raiseEvent(src: int32, value: int32): void;
/**
* Allocates the next user notification event
*/
//% help=control/allocate-notify-event shim=control::allocateNotifyEvent
function allocateNotifyEvent(): int32;
2017-07-10 12:42:30 +02:00
/** Write data to DMESG debugging buffer. */
//% shim=control::dmesg
function dmesg(s: string): void;
2017-07-07 12:44:34 +02:00
}
2017-07-10 13:47:00 +02:00
declare namespace serial {
/** Send DMESG debug buffer over serial. */
//% shim=serial::writeDmesg
function writeDmesg(): void;
}
2017-10-30 13:45:37 +01:00
declare namespace screen {
2017-10-30 14:28:01 +01:00
/** Decompresses a 1-bit gray scale PNG image to image format. */
2017-10-30 13:45:37 +01:00
//% shim=screen::unpackPNG
2017-10-30 14:28:01 +01:00
function unpackPNG(png: Buffer): Image;
2017-10-30 13:45:37 +01:00
}
2017-07-05 14:06:58 +02:00
declare namespace screen {
2017-07-05 14:56:13 +02:00
/** Clear screen and reset font to normal. */
//% shim=screen::clear
function clear(): void;
2017-10-30 14:28:01 +01:00
/** Makes an image bound to a buffer. */
//% shim=screen::imageOf
function imageOf(buf: Buffer): Image;
}
2017-10-30 14:28:01 +01:00
//% fixedInstances
declare interface Image {
/** Returns the underlaying Buffer object. */
2017-10-30 14:28:01 +01:00
//% property shim=ImageMethods::buffer
buffer: Buffer;
2017-10-30 14:28:01 +01:00
/** Returns the width of an image. */
//% property shim=ImageMethods::width
width: int32;
2017-10-30 14:28:01 +01:00
/** Returns the height of an image. */
//% property shim=ImageMethods::height
height: int32;
2017-10-30 14:28:01 +01:00
/** Double size of an image. */
//% shim=ImageMethods::doubled
doubled(): Image;
2017-10-30 14:28:01 +01:00
/** Draw an image on the screen. */
//% shim=ImageMethods::draw
draw(x: int32, y: int32, mode: Draw): void;
2017-07-05 14:06:58 +02:00
}
2017-07-07 16:15:36 +02:00
declare namespace output {
/**
* Create a new zero-initialized buffer.
* @param size number of bytes in the buffer
*/
//% shim=output::createBuffer
function createBuffer(size: int32): Buffer;
}
2017-12-18 22:04:17 +01:00
declare namespace motors {
/**
* Mark a motor as used
*/
//% shim=motors::__motorUsed
function __motorUsed(port: int32, large: boolean): void;
}
declare namespace sensors {
/**
* Mark a sensor as used
*/
//% shim=sensors::__sensorUsed
function __sensorUsed(port: int32, type: int32): void;
}
2017-07-05 02:17:26 +02:00
// Auto-generated. Do not edit. Really.