mirror of
https://github.com/lune-org/lune.git
synced 2025-04-04 10:30:54 +01:00
Add missing types (#243)
This commit is contained in:
parent
de7029aa19
commit
37b55576ca
1 changed files with 33 additions and 13 deletions
|
@ -119,15 +119,15 @@ export type RefData = {
|
||||||
|
|
||||||
@param src The source data
|
@param src The source data
|
||||||
@param len The amount of data to copy, in bytes
|
@param len The amount of data to copy, in bytes
|
||||||
@param dst_offset The offset in the destination where the data will be pasted
|
@param dstOffset The offset in the destination where the data will be pasted
|
||||||
@param src_offset The offset in the source data from where the data will be copied
|
@param srcOffset The offset in the source data from where the data will be copied
|
||||||
]=]
|
]=]
|
||||||
copyFrom: (
|
copyFrom: (
|
||||||
self: RefData,
|
self: RefData,
|
||||||
src: BoxData | RefData,
|
src: BoxData | RefData,
|
||||||
length: number,
|
length: number,
|
||||||
dst_offset: number,
|
dstOffset: number,
|
||||||
src_offset: number
|
srcOffset: number
|
||||||
) -> (),
|
) -> (),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,15 +191,15 @@ export type BoxData = {
|
||||||
|
|
||||||
@param src The source data
|
@param src The source data
|
||||||
@param len The amount of data to copy, in bytes
|
@param len The amount of data to copy, in bytes
|
||||||
@param dst_offset The offset in the destination where the data will be pasted
|
@param dstOffset The offset in the destination where the data will be pasted
|
||||||
@param src_offset The offset in the source data from where the data will be copied
|
@param srcOffset The offset in the source data from where the data will be copied
|
||||||
]=]
|
]=]
|
||||||
copyFrom: (
|
copyFrom: (
|
||||||
self: BoxData,
|
self: BoxData,
|
||||||
src: BoxData | RefData,
|
src: BoxData | RefData,
|
||||||
length: number,
|
length: number,
|
||||||
dst_offset: number,
|
dstOffset: number,
|
||||||
src_offset: number
|
srcOffset: number
|
||||||
) -> (),
|
) -> (),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,6 +291,13 @@ export type CTypeInfo<T, R> = {
|
||||||
box: (self: CTypeInfo<T, R>, val: R) -> BoxData,
|
box: (self: CTypeInfo<T, R>, val: R) -> BoxData,
|
||||||
readData: (self: CTypeInfo<T, R>, target: RefData | BoxData, offset: number?) -> R,
|
readData: (self: CTypeInfo<T, R>, target: RefData | BoxData, offset: number?) -> R,
|
||||||
writeData: (self: CTypeInfo<T, R>, target: RefData | BoxData, value: R, offset: number?) -> (),
|
writeData: (self: CTypeInfo<T, R>, target: RefData | BoxData, value: R, offset: number?) -> (),
|
||||||
|
copyData: (
|
||||||
|
self: CTypeInfo<T, R>,
|
||||||
|
dst: RefData | BoxData,
|
||||||
|
src: RefData | BoxData,
|
||||||
|
dstOffset: number?,
|
||||||
|
srcOffset: number?
|
||||||
|
) -> (),
|
||||||
stringifyData: (self: CTypeInfo<T, R>, target: RefData | BoxData, offset: number?) -> string,
|
stringifyData: (self: CTypeInfo<T, R>, target: RefData | BoxData, offset: number?) -> string,
|
||||||
|
|
||||||
-- FIXME: recursive types; 'intoType' should be CTypes
|
-- FIXME: recursive types; 'intoType' should be CTypes
|
||||||
|
@ -298,7 +305,9 @@ export type CTypeInfo<T, R> = {
|
||||||
self: CTypeInfo<T, R>,
|
self: CTypeInfo<T, R>,
|
||||||
intoType: any,
|
intoType: any,
|
||||||
fromData: RefData | BoxData,
|
fromData: RefData | BoxData,
|
||||||
intoData: RefData | BoxData
|
intoData: RefData | BoxData,
|
||||||
|
fromOffset: number?,
|
||||||
|
intoOffset: number?
|
||||||
) -> (),
|
) -> (),
|
||||||
} & { ["__phantom"]: T }
|
} & { ["__phantom"]: T }
|
||||||
type NumCType<T> = CTypeInfo<T, (number | any)>
|
type NumCType<T> = CTypeInfo<T, (number | any)>
|
||||||
|
@ -385,8 +394,8 @@ export type CArrInfo<T, R> = {
|
||||||
self: CArrInfo<T, R>,
|
self: CArrInfo<T, R>,
|
||||||
dst: RefData | BoxData,
|
dst: RefData | BoxData,
|
||||||
src: RefData | BoxData,
|
src: RefData | BoxData,
|
||||||
dst_offset: number?,
|
dstOffset: number?,
|
||||||
src_offset: number?
|
srcOffset: number?
|
||||||
) -> (),
|
) -> (),
|
||||||
|
|
||||||
offset: (self: CArrInfo<T, R>, index: number) -> number,
|
offset: (self: CArrInfo<T, R>, index: number) -> number,
|
||||||
|
@ -490,6 +499,17 @@ export type CStructInfo = {
|
||||||
@return A table
|
@return A table
|
||||||
]=]
|
]=]
|
||||||
readData: (self: CStructInfo, target: RefData | BoxData, offset: number?) -> { any },
|
readData: (self: CStructInfo, target: RefData | BoxData, offset: number?) -> { any },
|
||||||
|
--[=[
|
||||||
|
@within CSturctInfo
|
||||||
|
@tag Method
|
||||||
|
@method writeData
|
||||||
|
|
||||||
|
Write a lua table into reference or box.
|
||||||
|
|
||||||
|
@param target Target to write data into
|
||||||
|
@param table Lua data to write
|
||||||
|
@param offset Offset to write data into
|
||||||
|
]=]
|
||||||
writeData: (
|
writeData: (
|
||||||
self: CStructInfo,
|
self: CStructInfo,
|
||||||
target: RefData | BoxData,
|
target: RefData | BoxData,
|
||||||
|
@ -500,8 +520,8 @@ export type CStructInfo = {
|
||||||
self: CStructInfo,
|
self: CStructInfo,
|
||||||
dst: RefData | BoxData,
|
dst: RefData | BoxData,
|
||||||
src: RefData | BoxData,
|
src: RefData | BoxData,
|
||||||
dst_offset: number?,
|
dstOffset: number?,
|
||||||
src_offset: number?
|
srcOffset: number?
|
||||||
) -> (),
|
) -> (),
|
||||||
|
|
||||||
offset: (self: CStructInfo, index: number) -> number,
|
offset: (self: CStructInfo, index: number) -> number,
|
||||||
|
|
Loading…
Add table
Reference in a new issue