2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
import{_ as r,a as t,b as a,ag as o}from"./chunks/framework.BcrMLAmg.js";const h=JSON.parse('{"title":"PropertySystem","description":"","frontmatter":{},"headers":[],"relativePath":"references/propertySystem.md","filePath":"references/propertySystem.md","lastUpdated":1757840145000}'),s={name:"references/propertySystem.md"};function l(n,e,p,d,i,m){return a(),t("div",null,e[0]||(e[0]=[o('<h1 id="propertysystem" tabindex="-1">PropertySystem <a class="header-anchor" href="#propertysystem" aria-label="Permalink to "PropertySystem""></a></h1><p><em>PropertySystem is a class that allows Elements to have properties that can be observed and updated.</em><em>It also allows for properties to have custom getters and setters. This is the base system for all Elements.</em></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><table tabindex="0"><thead><tr><th>Method</th><th>Returns</th><th>Description</th></tr></thead><tbody><tr><td><a href="#propertysystem-addsetterhook-hook">PropertySystem.addSetterHook</a></td><td>-</td><td>Adds a setter hook to the PropertySystem</td></tr><tr><td><a href="#propertysystem-defineproperty-class-name-config">PropertySystem.defineProperty</a></td><td>-</td><td>Defines a property for an element class</td></tr><tr><td><a href="#propertysystem-combineproperties-class-name">PropertySystem.combineProperties</a></td><td>-</td><td>Combines multiple properties</td></tr><tr><td><a href="#propertysystem-blueprint-elementclass">PropertySystem.blueprint</a></td><td>table</td><td>Creates a blueprint of an element class</td></tr><tr><td><a href="#propertysystem-createfromblueprint-elementclass-blueprint">PropertySystem.createFromBlueprint</a></td><td>table</td><td>Creates an element from a blueprint</td></tr><tr><td><a href="#propertysystem---init">PropertySystem:__init</a></td><td>table</td><td>Initializes the PropertySystem</td></tr><tr><td><a href="#propertysystem--updateproperty-name-value">PropertySystem:_updateProperty</a></td><td>table</td><td>Update call for a property</td></tr><tr><td><a href="#propertysystem-observe-name-callback">PropertySystem:observe</a></td><td>table</td><td>Observers a property</td></tr><tr><td><a href="#propertysystem-removeobserver-name-callback">PropertySystem:removeObserver</a></td><td>table</td><td>Removes an observer from a property</td></tr><tr><td><a href="#propertysystem-removeallobservers-name">PropertySystem:removeAllObservers</a></td><td>table</td><td>Removes all observers from a property</td></tr><tr><td><a href="#propertysystem-instanceproperty-name-config">PropertySystem:instanceProperty</a></td><td>table</td><td>Adds a property to the PropertySystem on instance level</td></tr><tr><td><a href="#propertysystem-removeproperty-name">PropertySystem:removeProperty</a></td><td>table</td><td>Removes a property from the PropertySystem</td></tr><tr><td><a href="#propertysystem-getpropertyconfig-name">PropertySystem:getPropertyConfig</a></td><td>table</td><td>Gets a property configuration</td></tr></tbody></table><h2 id="propertysystem-addsetterhook-hook" tabindex="-1">PropertySystem.addSetterHook(hook) <a class="header-anchor" href="#propertysystem-addsetterhook-hook" aria-label="Permalink to "PropertySystem.addSetterHook(hook)""></a></h2><p>Adds a setter hook to the PropertySystem. Setter hooks are functions that are called before a property is set.</p><h3 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>hook</code> <code>function</code> The hook function to add</li></ul><h2 id="propertysystem-defineproperty-class-name-config" tabindex="-1">PropertySystem.defineProperty(class, name, config) <a class="header-anchor" href="#propertysystem-defineproperty-class-name-config" aria-label="Permalink to "PropertySystem.defineProperty(class, name, config)""></a></h2><p>Defines a property for an element class</p><h3 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>class</code> <code>table</code> The element class to define the property for</li><li><code>name</code> <code>string</code> The name of the property</li><li><code>config</code> <code>table</code> The configuration of the property</li></ul><h2 id="propertysystem-combineproperties-class-name" tabindex="-1">PropertySystem.combineProperties(class, name) <a class="header-anchor" href="#propertysystem-combineproperties-class-name" aria-label="Permalink to "PropertySystem.combineProperties(class, name)""></a></h2><p>Combines multiple properties into a single getter and setter</p><h3 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>class</code> <code>table</code> The element class to combine the properties for</li><li><code>name</code> <code>string</code> The name of the combined property</li></ul><h2 id="propertysystem-blueprint-elementclass" tabindex="-1">PropertySystem.blueprint(elementClass) <a class="header-anchor" href="#propertysystem-blueprint-elementclass" aria-label="Permalink to "PropertySystem.blueprint(elementClass)""></a></h2><p>Creates a blueprint of an element class with all its properties</p><h3 id="parameters-3" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-3" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>elementClass</code> <code>table</code> The element class to create a blueprint from</li></ul><h3 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>blueprint</code> A table containing all property definitions</li></ul><h2 id="propertysystem-createfromblueprint-elementclass-blueprint" tabindex="-1">PropertySystem.createFromBlueprint(elementClass, blueprint) <a class="header-anchor" href="#propertysystem-createfromblueprint-elementclass-blueprint" aria-label="Permalink to "PropertySystem.createFromBlueprint(elementClass, blueprint)""></a></h2><p>Creates an element from a blueprint</p><h3 id="parameters-4" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-4" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>elementClass</code> <code>table</code> The element class to create from the blueprint</li><li><code>blueprint</code> <code>table</code> The blueprint to create the element from</li></ul><h3 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>element</code> The created element</li></ul><h2 id="propertysystem-init" tabindex="-1">PropertySystem:__init() <a class="header-anchor" href="#propertysystem-init" aria-label="Permalink to "PropertySystem:__init()""></a></h2><p>Initializes the PropertySystem IS USED INTERNALLY</p><h3 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>self</code> The PropertySystem</li></ul><h2 id="propertysystem-updateproperty-name-value" tabindex="-1">PropertySystem:_updateProperty(name, value) <a class="header-anchor" href="#propertysystem-updateproperty-name-value" aria-label="Permalink to "PropertySystem:_updateProperty(name, value)""></a></h2><p>Update call for a property IS USED INTERNALLY</p><h3 id="parameters-5" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-5" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the property</li><li><code>value</code> <code>any</code> The value of the property</li></ul><h3 id="returns-3" tabindex="-1">Returns <a class="header-anchor" href="#returns-3" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>self</code> The PropertySystem</li></ul><h2 id="propertysystem-observe-name-callback" tabindex="-1">PropertySystem:observe(name, callback) <a class="header-anchor" href="#propertysystem-observe-name-callback" aria-label="Permalink to "PropertySystem:observe(name, callback)""></a></h2><p>Observers a property</p><h3 id="parameters-6" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-6" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the property</li><li><code>callback</code> <code>function</code> The callback function to call when the property changes</li></ul><h3 id="returns-4" tabindex="-1">Returns <a class="header-anchor" href="#returns-4" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>self</code> The PropertySystem</li></ul><h2 id="propertysystem-removeobserver-name-callback" tabindex="-1">PropertySystem:removeObserver(name, callback) <a class="header-anchor" href="#propertysystem-removeobserver-name-callback" aria-label="Permalink to "PropertySystem:removeObserver(name, callback)""></a></h2><p>Removes an observer from a property</p><h3 id="parameters-7" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-7" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the property</li><li><code>callback</code> <code>function</code> The callback function to remove</li></ul><h3 id="returns-5" tabindex="-1">Returns <a class="header-anchor" href="#returns-5" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>self</code> The PropertySystem</li></ul><h2 id="propertysystem-removeallobservers-name" tabindex="-1">PropertySystem:removeAllObservers(name?) <a class="header-anchor" href="#propertysystem-removeallobservers-name" aria-label="Permalink to "PropertySystem:removeAllObservers(name?)""></a></h2><p>Removes all observers from a property</p><h3 id="parameters-8" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-8" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <em>(optional)</em> <code>string</code> The name of the property</li></ul><h3 id="returns-6" tabindex="-1">Returns <a class="header-anchor" href="#returns-6" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>self</code> The PropertySystem</li></ul><h2 id="propertysystem-instanceproperty-name-config" tabindex="-1">PropertySystem:instanceProperty(name, config) <a class="header-anchor" href="#propertysystem-instanceproperty-name-config" aria-label="Permalink to "PropertySystem:instanceProperty(name, config)""></a></h2><p>Adds a property to the PropertySystem on instance level</p><h3 id="parameters-9" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-9" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the property</li><li><code>config</code> <code>table</code> The configuration of the property</li></ul><h3 id="returns-7" tabindex="-1">Returns <a class="header-anchor" href="#returns-7" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>self</code> The PropertySystem</li></ul><h2 id="propertysystem-removeproperty-name" tabindex="-1">PropertySystem:removeProperty(name) <a class="header-anchor" href="#propertysystem-removeproperty-name" aria-label="Permalink to "PropertySystem:removeProperty(name)""></a></h2><p>Removes a property from the PropertySystem on instance level</p><h3 id="parameters-10" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-10" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the property</li></ul><h3 id="returns-8" tabindex="-1">Returns <a class="header-anchor" href="#returns-8" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>self</code> The PropertySystem</li></ul><h2 id="propertysystem-getpropertyconfig-name" tabindex="-1">PropertySystem:getPropertyConfig(name) <a class="header-anchor" href="#propertysystem-getpropertyconfig-name" aria-label="Permalink to "PropertySystem:getPropertyConfig(name)""></a></h2><p>Gets a property configuration</p><h3 id="parameters-11" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-11" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>name</code> <code>string</code> The name of the property</li></ul><h3 id="returns-9" tabindex="-1">Returns <a class="header-anchor" href="#returns-9" aria-label="Permalink to "Returns""></a></h3><ul><li><code>table</code> <code>config</code> The configuration of the property</li></ul>',74)]))}const y=r(s,[["render",l]]);export{h as __pageData,y as default};
|