Skip to content

Commit ce38983

Browse files
committed
fix dataview docs
1 parent 4800337 commit ce38983

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/jswrap_dataview.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
121121
["byteOffset","int","The offset in bytes to read from"],
122122
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
123123
],
124-
"return" : ["JsVar","the index of the value in the array, or -1"],
124+
"return" : ["JsVar","The value of the 4 bytes in the array at `byteOffset` when interpreted as a `float`"],
125125
"ifndef" : "SAVE_ON_FLASH",
126126
"typescript" : "getFloat32(byteOffset: number, littleEndian?: boolean): number;"
127127
}
@@ -135,7 +135,7 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
135135
["byteOffset","int","The offset in bytes to read from"],
136136
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
137137
],
138-
"return" : ["JsVar","the index of the value in the array, or -1"],
138+
"return" : ["JsVar","The value of the 8 bytes in the array at `byteOffset` when interpreted as a `double`"],
139139
"ifndef" : "SAVE_ON_FLASH",
140140
"typescript" : "getFloat64(byteOffset: number, littleEndian?: boolean): number;"
141141
}
@@ -149,7 +149,7 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
149149
["byteOffset","int","The offset in bytes to read from"],
150150
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
151151
],
152-
"return" : ["JsVar","the index of the value in the array, or -1"],
152+
"return" : ["JsVar","The value of the 1 byte in the array at `byteOffset` when interpreted as `int8`"],
153153
"ifndef" : "SAVE_ON_FLASH",
154154
"typescript" : "getInt8(byteOffset: number, littleEndian?: boolean): number;"
155155
}
@@ -163,7 +163,7 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
163163
["byteOffset","int","The offset in bytes to read from"],
164164
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
165165
],
166-
"return" : ["JsVar","the index of the value in the array, or -1"],
166+
"return" : ["JsVar","The value of the 2 bytes in the array at `byteOffset` when interpreted as `int16`"],
167167
"ifndef" : "SAVE_ON_FLASH",
168168
"typescript" : "getInt16(byteOffset: number, littleEndian?: boolean): number;"
169169
}
@@ -177,7 +177,7 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
177177
["byteOffset","int","The offset in bytes to read from"],
178178
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
179179
],
180-
"return" : ["JsVar","the index of the value in the array, or -1"],
180+
"return" : ["JsVar","The value of the 4 bytes in the array at `byteOffset` when interpreted as `int32`"],
181181
"ifndef" : "SAVE_ON_FLASH",
182182
"typescript" : "getInt32(byteOffset: number, littleEndian?: boolean): number;"
183183
}
@@ -191,7 +191,7 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
191191
["byteOffset","int","The offset in bytes to read from"],
192192
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
193193
],
194-
"return" : ["JsVar","the index of the value in the array, or -1"],
194+
"return" : ["JsVar","The value of the 1 byte in the array at `byteOffset` when interpreted as `uint8`"],
195195
"ifndef" : "SAVE_ON_FLASH",
196196
"typescript" : "getUint8(byteOffset: number, littleEndian?: boolean): number;"
197197
}
@@ -205,7 +205,7 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
205205
["byteOffset","int","The offset in bytes to read from"],
206206
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
207207
],
208-
"return" : ["JsVar","the index of the value in the array, or -1"],
208+
"return" : ["JsVar","The value of the 2 bytes in the array at `byteOffset` when interpreted as `uint16`"],
209209
"ifndef" : "SAVE_ON_FLASH",
210210
"typescript" : "getUint16(byteOffset: number, littleEndian?: boolean): number;"
211211
}
@@ -219,7 +219,7 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
219219
["byteOffset","int","The offset in bytes to read from"],
220220
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
221221
],
222-
"return" : ["JsVar","the index of the value in the array, or -1"],
222+
"return" : ["JsVar","The value of the 4 bytes in the array at `byteOffset` when interpreted as `uint32`"],
223223
"ifndef" : "SAVE_ON_FLASH",
224224
"typescript" : "getUint32(byteOffset: number, littleEndian?: boolean): number;"
225225
}
@@ -233,9 +233,9 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
233233
"name" : "setFloat32",
234234
"generate_full" : "jswrap_dataview_set(parent, ARRAYBUFFERVIEW_FLOAT32, byteOffset, value, littleEndian)",
235235
"params" : [
236-
["byteOffset","int","The offset in bytes to read from"],
236+
["byteOffset","int","The offset in bytes to write to"],
237237
["value","JsVar","The value to write"],
238-
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
238+
["littleEndian","bool","[optional] Whether to write in little endian - if false or undefined data is written as big endian"]
239239
],
240240
"ifndef" : "SAVE_ON_FLASH",
241241
"typescript" : "setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;"
@@ -247,9 +247,9 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
247247
"name" : "setFloat64",
248248
"generate_full" : "jswrap_dataview_set(parent, ARRAYBUFFERVIEW_FLOAT64, byteOffset, value, littleEndian)",
249249
"params" : [
250-
["byteOffset","int","The offset in bytes to read from"],
250+
["byteOffset","int","The offset in bytes to write to"],
251251
["value","JsVar","The value to write"],
252-
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
252+
["littleEndian","bool","[optional] Whether to write in little endian - if false or undefined data is written as big endian"]
253253
],
254254
"ifndef" : "SAVE_ON_FLASH",
255255
"typescript" : "setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;"
@@ -261,9 +261,9 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
261261
"name" : "setInt8",
262262
"generate_full" : "jswrap_dataview_set(parent, ARRAYBUFFERVIEW_INT8, byteOffset, value, littleEndian)",
263263
"params" : [
264-
["byteOffset","int","The offset in bytes to read from"],
264+
["byteOffset","int","The offset in bytes to write to"],
265265
["value","JsVar","The value to write"],
266-
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
266+
["littleEndian","bool","[optional] Whether to write in little endian - if false or undefined data is written as big endian"]
267267
],
268268
"ifndef" : "SAVE_ON_FLASH",
269269
"typescript" : "setInt8(byteOffset: number, value: number, littleEndian?: boolean): void;"
@@ -275,9 +275,9 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
275275
"name" : "setInt16",
276276
"generate_full" : "jswrap_dataview_set(parent, ARRAYBUFFERVIEW_INT16, byteOffset, value, littleEndian)",
277277
"params" : [
278-
["byteOffset","int","The offset in bytes to read from"],
278+
["byteOffset","int","The offset in bytes to write to"],
279279
["value","JsVar","The value to write"],
280-
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
280+
["littleEndian","bool","[optional] Whether to write in little endian - if false or undefined data is written as big endian"]
281281
],
282282
"ifndef" : "SAVE_ON_FLASH",
283283
"typescript" : "setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;"
@@ -289,9 +289,9 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
289289
"name" : "setInt32",
290290
"generate_full" : "jswrap_dataview_set(parent, ARRAYBUFFERVIEW_INT32, byteOffset, value, littleEndian)",
291291
"params" : [
292-
["byteOffset","int","The offset in bytes to read from"],
292+
["byteOffset","int","The offset in bytes to write to"],
293293
["value","JsVar","The value to write"],
294-
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
294+
["littleEndian","bool","[optional] Whether to write in little endian - if false or undefined data is written as big endian"]
295295
],
296296
"ifndef" : "SAVE_ON_FLASH",
297297
"typescript" : "setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;"
@@ -303,9 +303,9 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
303303
"name" : "setUint8",
304304
"generate_full" : "jswrap_dataview_set(parent, ARRAYBUFFERVIEW_UINT8, byteOffset, value, littleEndian)",
305305
"params" : [
306-
["byteOffset","int","The offset in bytes to read from"],
306+
["byteOffset","int","The offset in bytes to write to"],
307307
["value","JsVar","The value to write"],
308-
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
308+
["littleEndian","bool","[optional] Whether to write in little endian - if false or undefined data is written as big endian"]
309309
],
310310
"ifndef" : "SAVE_ON_FLASH",
311311
"typescript" : "setUint8(byteOffset: number, value: number, littleEndian?: boolean): void;"
@@ -317,9 +317,9 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
317317
"name" : "setUint16",
318318
"generate_full" : "jswrap_dataview_set(parent, ARRAYBUFFERVIEW_UINT16, byteOffset, value, littleEndian)",
319319
"params" : [
320-
["byteOffset","int","The offset in bytes to read from"],
320+
["byteOffset","int","The offset in bytes to write to"],
321321
["value","JsVar","The value to write"],
322-
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
322+
["littleEndian","bool","[optional] Whether to write in little endian - if false or undefined data is written as big endian"]
323323
],
324324
"ifndef" : "SAVE_ON_FLASH",
325325
"typescript" : "setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;"
@@ -331,9 +331,9 @@ void jswrap_dataview_set(JsVar *dataview, JsVarDataArrayBufferViewType type, int
331331
"name" : "setUint32",
332332
"generate_full" : "jswrap_dataview_set(parent, ARRAYBUFFERVIEW_UINT32, byteOffset, value, littleEndian)",
333333
"params" : [
334-
["byteOffset","int","The offset in bytes to read from"],
334+
["byteOffset","int","The offset in bytes to write to"],
335335
["value","JsVar","The value to write"],
336-
["littleEndian","bool","[optional] Whether to read in little endian - if false or undefined data is read as big endian"]
336+
["littleEndian","bool","[optional] Whether to write in little endian - if false or undefined data is written as big endian"]
337337
],
338338
"ifndef" : "SAVE_ON_FLASH",
339339
"typescript" : "setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;"

0 commit comments

Comments
 (0)