This commit is contained in:
jusax23 2022-11-12 14:45:05 +01:00
parent a63421b675
commit 18e3b13fdc

20
main.js
View file

@ -70,7 +70,7 @@ export class Stear{
* Access an Element from the Frame Store
*
* @param {string} id
* @returns
* @returns {SFrame}
*/
getElement (id) {
return this.g(id);
@ -86,7 +86,7 @@ export class Stear{
* @param {SFrame} elem
* @param {*} args
* @param {number} layer
* @returns
* @returns {callPromise}
*/
async call (elem, args, layer = 1){
return await elem.call(this, args, this.#frames, layer);
@ -99,7 +99,7 @@ export class Stear{
* @param {*} args
* @param {HTMLElement} renderParent
* @param {number} layer
* @returns
* @returns {callPromise}
*/
include(elem, args, renderParent, layer = 1){
return elem.call(this, args, this.#frames, layer, renderParent);
@ -109,11 +109,11 @@ export class Stear{
* Rernder everthing.
*
* @param {*} arg
* @returns
* @returns {Promise}
*/
rerenderGlobal(arg){
if(this.#frames.length == 0)return;
return new Promise((res,rej)=>{
if(this.#frames.length == 0)return void res();
let running = this.#frames.length;
for (let i = 0; i < this.#frames.length; i++) {
const element = this.#frames[i];
@ -498,7 +498,7 @@ export class class_ {
* Generate a new Stear render Node.
*
* @param {renderNodeSettings} settings
* @param {(LanguagePoolString|string|class_)[]} childs
* @param {Array} childs
* @param {boolean} doBuild
*/
constructor(settings,childs,doBuild = true){
@ -529,7 +529,7 @@ export class class_ {
}
/**
* @param {(LanguagePoolString|string|class_)[]} childs
* @param {Array} childs
*/
set childs(childs){
if (!this.#doBuild) return;
@ -626,8 +626,8 @@ export class class_ {
/**
*
* @param {renderNodeSettings} [settings]
* @param {(LanguagePoolString|string|class_)[]} [childs]
* @returns
* @param {Array} [childs]
* @returns {class_}
*/
export const _ = (settings = {}, childs = []) => new class_(settings, Array.isArray(childs) ? childs : [childs]);
export const s = (type,settings,...childs)=>{
@ -679,7 +679,7 @@ class includeFrame{
* Trigger onParentRender event
*
* @param {*} settings
* @returns
* @returns {HTMLElement}
*/
render(settings={}){
this.#elem.settings = settings;