doc: add JSDoc annotations in the core folder

start documenting a bit, mostly inconsequential changes
This commit is contained in:
2024-02-19 19:12:42 +01:00
parent 4f869252a2
commit ce5ca1875b
7 changed files with 600 additions and 12 deletions

View File

@ -6,20 +6,37 @@ let g_calls = {};
let gSessionIndex = 0;
/**
* TODOC
* @returns
*/
function makeSessionId() {
return (gSessionIndex++).toString();
}
/**
* TODOC
* @returns
*/
function App() {
this._on_output = null;
this._send_queue = [];
return this;
}
/**
* TODOC
* @param {*} callback
*/
App.prototype.readOutput = function(callback) {
this._on_output = callback;
}
/**
* TODOC
* @param {*} api
* @returns
*/
App.prototype.makeFunction = function(api) {
let self = this;
let result = function() {
@ -43,6 +60,10 @@ App.prototype.makeFunction = function(api) {
return result;
}
/**
* TODOC
* @param {*} message
*/
App.prototype.send = function(message) {
if (this._send_queue) {
if (this._on_output) {
@ -57,11 +78,17 @@ App.prototype.send = function(message) {
}
}
/**
* TODOC
* @param {*} request
* @param {*} response
* @param {*} client
*/
function socket(request, response, client) {
let process;
let options = {};
let credentials = auth.query(request.headers);
let refresh = auth.make_refresh(credentials);
let refresh = auth.makeRefresh(credentials);
response.onClose = async function() {
if (process && process.task) {