Skip to content

Commit 2309e67

Browse files
author
Exeteres
authored
Merge pull request #7 from roobscoob/master
2 parents 5783379 + bc53977 commit 2309e67

File tree

16 files changed

+79
-148
lines changed

16 files changed

+79
-148
lines changed

packages/common/components/debug.d.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ declare namespace OC.Components {
9393
* The final value returned is a serialized or table representation of the entity or block scanned at the location.
9494
* The following code snippet can be used to debug what is possibly blocking
9595
* the robot from moving forward, if the robot is facing in the negative x direction.
96-
* @tupleReturn
9796
*/
98-
scanContentsAt(x: number, y: number, z: number, worldId?: number): [boolean, string, any];
97+
scanContentsAt(x: number, y: number, z: number, worldId?: number): LuaMultiReturn<[boolean, string, any]>;
9998
}
10099

101100
interface World {
@@ -215,9 +214,8 @@ declare namespace OC.Components {
215214

216215
/**
217216
* Get the current spawn point coordinates.
218-
* @tupleReturn
219217
*/
220-
getSpawnPoint(): [number, number, number];
218+
getSpawnPoint(): LuaMultiReturn<[number, number, number]>;
221219

222220
/**
223221
* Set the spawn point coordinates.
@@ -293,9 +291,8 @@ declare namespace OC.Components {
293291

294292
/**
295293
* Get the player's position.
296-
* @tupleReturn
297294
*/
298-
getPosition(): [number, number, number];
295+
getPosition(): LuaMultiReturn<[number, number, number]>;
299296

300297
/**
301298
* Set the player's position.

packages/common/components/drone.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ declare namespace OC.Components {
5555
* Lets the robot use the currently equipped item in the tool slot against the block or space directly in front of the robot.
5656
* Returns `true` if successful (may take time depending on block being interacted with - e.g.. Obsidian takes time to mine).
5757
* Returns `false` if the operation fails with a description of why it failed.
58-
* @tupleReturn
5958
*/
60-
swing(side: number): [boolean, string | null];
59+
swing(side: number): LuaMultiReturn<[boolean, string | null]>;
6160

6261
/**
6362
* Returns the size of the device's internal inventory.

packages/common/components/generator.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ declare namespace OC.Components {
2121
* * “selected slot does not contain fuel” if the selected slot has no item which can be burnt
2222
* * “different fuel type already queued” if there is already another type of item in the generator
2323
* * “queue is full” if there already are 64 items of that type in the generator
24-
* @tupleReturn
2524
*/
26-
insert(count?: number): [boolean, string | null];
25+
insert(count?: number): LuaMultiReturn<[boolean, string | null]>;
2726

2827
/**
2928
* Removes up to the specified number of fuel items from the generator

packages/common/components/gpu.d.ts

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ declare namespace OC.Components {
1414
* A GPU can only be bound to one screen at a time.
1515
* All operations on it will work on the bound screen.
1616
* If you wish to control multiple screens at once, you'll need to put more than one graphics card into your computer.
17-
* @tupleReturn
1817
*/
19-
bind(address: string, reset?: boolean): [boolean, string | null];
18+
bind(address: string, reset?: boolean): LuaMultiReturn<[boolean, string | null]>;
2019

2120
/**
2221
* Get the address of the screen the GPU is bound to. Since 1.3.2.
@@ -28,9 +27,8 @@ declare namespace OC.Components {
2827
* This background color is applied to all “pixels” that get changed by other operations.
2928
* Note that the returned number is either an RGB value in hexadecimal format, i.e. `0xRRGGBB`, or a palette index.
3029
* The second returned value indicates which of the two it is (`true` for palette color, `false` for RGB value).
31-
* @tupleReturn
3230
*/
33-
getBackground(): [number, boolean];
31+
getBackground(): LuaMultiReturn<[number, boolean]>;
3432

3533
/**
3634
* Sets the background color to apply to “pixels” modified by other operations from now on.
@@ -40,21 +38,18 @@ declare namespace OC.Components {
4038
* If the color was from the palette, the second value will be the index in the palette.
4139
* Otherwise it will be `nil`. Note that the color is expected to be specified in hexadecimal RGB format, i.e. `0xRRGGBB`.
4240
* This is to allow uniform color operations regardless of the color depth supported by the screen and GPU.
43-
* @tupleReturn
4441
*/
45-
setBackground(color: number, isPaletteIndex?: boolean): [number, number | null];
42+
setBackground(color: number, isPaletteIndex?: boolean): LuaMultiReturn<[number, number | null]>;
4643

4744
/**
4845
* Like `getBackground`, but for the foreground color.
49-
* @tupleReturn
5046
*/
51-
getForeground(): [number, boolean];
47+
getForeground(): LuaMultiReturn<[number, boolean]>;
5248

5349
/**
5450
* Like `setBackground`, but for the foreground color.
55-
* @tupleReturn
5651
*/
57-
setForeground(color: number, isPaletteIndex?: boolean): [number, number | null];
52+
setForeground(color: number, isPaletteIndex?: boolean): LuaMultiReturn<[number, number | null]>;
5853

5954
/**
6055
* Gets the RGB value of the color in the palette at the specified index.
@@ -86,15 +81,13 @@ declare namespace OC.Components {
8681

8782
/**
8883
* Gets the maximum resolution supported by the GPU and the screen it is bound to (minimum of the two).
89-
* @tupleReturn
9084
*/
91-
maxResolution(): [number, number];
85+
maxResolution(): LuaMultiReturn<[number, number]>;
9286

9387
/**
9488
* Gets the currently set resolution.
95-
* @tupleReturn
9689
*/
97-
getResolution(): [number, number];
90+
getResolution(): LuaMultiReturn<[number, number]>;
9891

9992
/**
10093
* Sets the specified resolution.
@@ -107,9 +100,8 @@ declare namespace OC.Components {
107100

108101
/**
109102
* Get the current viewport resolution.
110-
* @tupleReturn
111103
*/
112-
getViewport(): [number, number];
104+
getViewport(): LuaMultiReturn<[number, number]>;
113105

114106
/**
115107
* Set the current viewport resolution.
@@ -126,9 +118,8 @@ declare namespace OC.Components {
126118
* The second and third returned values are the fore- and background color, as hexvalues.
127119
* If the colors are from the palette, the fourth
128120
* and fifth values specify the palette index of the color, otherwise they are nil.
129-
* @tupleReturn
130121
*/
131-
get(x: number, y: number): [string, number, number, number | null, number | null];
122+
get(x: number, y: number): LuaMultiReturn<[string, number, number, number | null, number | null]>;
132123

133124
/**
134125
* Writes a string to the screen, starting at the specified coordinates.

packages/common/components/internet.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ declare namespace OC.Components {
6161

6262
/**
6363
* Get response code, message and headers.
64-
* @tupleReturn
6564
*/
66-
response(): [number, string, any];
65+
response(): LuaMultiReturn<[number, string, any]>;
6766

6867
/**
6968
* Closes an open socket stream.

packages/common/components/inventory_controller.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ declare namespace OC.Components {
88
/**
99
* Get the size of the inventory at the specified side.
1010
* @returns the size of the inventory, or null followed by a description why this function failed (usually no inventory).
11-
* @tupleReturn
1211
*/
13-
getInventorySize(side: number): number | [boolean, string];
12+
getInventorySize(side: number): LuaMultiReturn<[number] | [boolean, string]>;
1413

1514
/**
1615
* Get a table describing the item in the specified slot or nil. Deprecated for getting info about robot's own inventory, see getStackInInternalSlot.

packages/common/computer.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,8 @@ declare namespace OC {
115115
* Tries to pull a signal from the queue, waiting up to the specified amount of time before failing and returning nil.
116116
* If no timeout is specified waits forever.
117117
* The first returned result is the signal name, following results correspond to what was pushed in pushSignal, for example.
118-
* @tupleReturn
119118
*/
120-
pullSignal<T extends any[]>(timeout?: number): [string, ...T];
119+
pullSignal<T extends any[]>(timeout?: number): LuaMultiReturn<[string, ...T]>;
121120

122121
/**
123122
* Causes the computer to produce a beep sound at frequency Hz for duration seconds.

packages/dbuf/DoubleBuffering.d.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ declare module "doubleBuffering" {
77
/**
88
* Get screen buffer resolution.
99
* There's also `buffer.getWidth()` and `buffer.getHeight()` methods for your comfort.
10-
* @tupleReturn
1110
*/
12-
function getResolution(): [number, number];
11+
function getResolution(): LuaMultiReturn<[number, number]>;
1312

1413
/**
1514
* Set screen buffer and GPU resolution.
@@ -51,9 +50,8 @@ declare module "doubleBuffering" {
5150

5251
/**
5352
* Get currently set draw limit
54-
* @tupleReturn
5553
*/
56-
function getDrawLimit(): [number, number, number, number];
54+
function getDrawLimit(): LuaMultiReturn<[number, number, number, number]>;
5755

5856
/**
5957
* Copy content of specified area from screen buffer and return it as a table.
@@ -80,9 +78,8 @@ declare module "doubleBuffering" {
8078

8179
/**
8280
* Get value of specified pixel on screen.
83-
* @tupleReturn
8481
*/
85-
function get(x: number, y: number): [number, number, string];
82+
function get(x: number, y: number): LuaMultiReturn<[number, number, string]>;
8683

8784
/**
8885
* Fill the rectangular area with the specified pixel data.
@@ -196,9 +193,8 @@ declare module "doubleBuffering" {
196193

197194
/**
198195
* Get data values of pixel with specified index.
199-
* @tupleReturn
200196
*/
201-
function rawGet(index: number): [number, number, string];
197+
function rawGet(index: number): LuaMultiReturn<[number, number, string]>;
202198
}
203199

204200
type PixelData = number[][];

packages/gui/GUI.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,8 @@ declare namespace GUI {
360360

361361
/**
362362
* Get current margins in pixels of specified cell
363-
* @tupleReturn
364363
*/
365-
getMargin(column: number, row: number): [number, number, number];
364+
getMargin(column: number, row: number): LuaMultiReturn<[number, number, number]>;
366365

367366
/**
368367
* Assign the specified grid cell automatic resizing of child objects by horizonal, vertical or both directions.
@@ -426,9 +425,8 @@ declare namespace GUI {
426425

427426
/**
428427
* Get current margins in pixels of List
429-
* @tupleReturn
430428
*/
431-
getMargin(): [number, number, number];
429+
getMargin(): LuaMultiReturn<[number, number, number]>;
432430
}
433431

434432
interface Menu extends GUI.Layout {

packages/mineos/System.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ declare module "System" {
3333
* since multiple characters following a single - will be interpreted as multiple options.
3434
* Options specified with 2 dashes are not split and can have multiple letters.
3535
* Also, 2-dash options can be given values by using an equal sign.
36-
* @tupleReturn
3736
*/
38-
export function parseArguments(): [string[], Option[]];
37+
export function parseArguments(): LuaMultiReturn<[string[], Option[]]>;
3938

4039
/**
4140
* Creates an shortcut with .lnk extension by given where path.
@@ -102,10 +101,9 @@ declare module "System" {
102101
* Adds instance of `GUI.window` object to MineOS windows container, adds corresponding icon to dock and adds window menu data.
103102
* If `keepCoordinates` argument is set, window coordinates will be kept, otherwise window will be centered.
104103
* Returns pointer to main system `GUI.workspace` object, a pointer to given window object and a pointer to system `GUI.menu` object.
105-
* @tupleReturn
106104
*/
107105
export function addWindow(
108106
window: GUI.Window,
109107
keepCoordinates?: boolean
110-
): [GUI.Workspace, GUI.Window, GUI.Menu];
108+
): LuaMultiReturn<[GUI.Workspace, GUI.Window, GUI.Menu]>;
111109
}

0 commit comments

Comments
 (0)