38 lines
1004 B
JavaScript
38 lines
1004 B
JavaScript
import Login from "./Login"
|
|
/**
|
|
* @typedef {Object} LoginRequest a request for a login
|
|
* @property {Login} Login user login info
|
|
*/
|
|
class LoginRequest {
|
|
/**
|
|
* user login info
|
|
* @return {Login} gets the value of Login
|
|
*/
|
|
get Login() {
|
|
return new Login({}, new Uint8Array(this._ptr.slice(0, 320)));
|
|
}
|
|
/**
|
|
* user login info
|
|
* @param {Login} sets the value of Login
|
|
*/
|
|
set Login(v) {
|
|
this._ptr.set(v._ptr, 0);
|
|
}
|
|
/**
|
|
* Constructs a new LoginRequest
|
|
*
|
|
* @param {{Login: Login, }} init The arguments to construct the object.
|
|
* @param {Uint8Array} ptr The pointer to the C struct.
|
|
*/
|
|
constructor(init = {}, ptr = undefined) {
|
|
this._size = 320;
|
|
this._ptr = ptr || new Uint8Array(this._size);
|
|
this._data = new DataView(this._ptr.buffer);
|
|
|
|
for (const key of Object.keys(init)) {
|
|
this[key] = init[key];
|
|
}
|
|
}
|
|
}
|
|
|
|
export default LoginRequest |