Deployed 901748f to 5.4 with MkDocs 1.1.2 and mike 0.5.5
[GitHub/WoltLab/woltlab.github.io.git] / 5.4 / javascript / new-api_core / index.html
index b1e2acfdf9aa7538a9bc1278c12a1853a8e8c0a7..6c84a468a6aa6b779bb5b5dcbf4b28636639fecf 100644 (file)
@@ -9,8 +9,8 @@
       
       
       
-      <link rel="shortcut icon" href="../../assets/default.favicon.ico">
-      <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-7.0.3">
+      <link rel="icon" href="../../assets/default.favicon.ico">
+      <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-7.1.0">
     
     
       
       
     
     
-      <link rel="stylesheet" href="../../assets/stylesheets/main.1655a90d.min.css">
+      <link rel="stylesheet" href="../../assets/stylesheets/main.33e2939f.min.css">
       
         
-        <link rel="stylesheet" href="../../assets/stylesheets/palette.7fa14f5b.min.css">
+        <link rel="stylesheet" href="../../assets/stylesheets/palette.ef6f36e2.min.css">
         
           
           
@@ -31,7 +31,8 @@
     
     
     
-
+      
+    
     
     
       <link rel="stylesheet" href="../../stylesheets/extra.css">
     
     
     <body dir="ltr" data-md-color-scheme="" data-md-color-primary="teal" data-md-color-accent="">
-      
   
     
+    <script>function __prefix(e){return new URL("../..",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script>
+    
     <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
     <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
     <label class="md-overlay" for="__drawer"></label>
       
     </div>
     
-      
-
-<header class="md-header" data-md-component="header">
+      <header class="md-header" data-md-component="header">
   <nav class="md-header__inner md-grid" aria-label="Header">
-    <a href="../.." title="WoltLab Suite Documentation" class="md-header__button md-logo" aria-label="WoltLab Suite Documentation">
+    <a href="../.." title="WoltLab Suite Documentation" class="md-header__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
       
   <img src="../../assets/logo.png" alt="logo">
 
         </div>
       </div>
     </div>
-    <div class="md-header__options">
-      
-    </div>
+    
+    
     
       <label class="md-header__button md-icon" for="__search">
         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
       </label>
       <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
+        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
       </button>
     </form>
     <div class="md-search__output">
 </div>
     
     
+      <div class="md-header__source">
+        
+<a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
+  <div class="md-source__icon md-icon">
+    
+    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
+  </div>
+  <div class="md-source__repository">
+    GitHub
+  </div>
+</a>
+      </div>
+    
   </nav>
 </header>
     
                     
 
 
-
-
 <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
   <label class="md-nav__title" for="__drawer">
-    <a href="../.." title="WoltLab Suite Documentation" class="md-nav__button md-logo" aria-label="WoltLab Suite Documentation">
+    <a href="../.." title="WoltLab Suite Documentation" class="md-nav__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
       
   <img src="../../assets/logo.png" alt="logo">
 
     WoltLab Suite Documentation
   </label>
   
+    <div class="md-nav__source">
+      
+<a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
+  <div class="md-source__icon md-icon">
+    
+    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
+  </div>
+  <div class="md-source__repository">
+    GitHub
+  </div>
+</a>
+    </div>
+  
   <ul class="md-nav__list" data-md-scrollfix>
     
       
         <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" checked>
       
       <label class="md-nav__link" for="__nav_4">
-        JavaScript API
+        TypeScript and JavaScript API
         <span class="md-nav__icon md-icon"></span>
       </label>
-      <nav class="md-nav" aria-label="JavaScript API" data-md-level="1">
+      <nav class="md-nav" aria-label="TypeScript and JavaScript API" data-md-level="1">
         <label class="md-nav__title" for="__nav_4">
           <span class="md-nav__icon md-icon"></span>
-          JavaScript API
+          TypeScript and JavaScript API
         </label>
         <ul class="md-nav__list" data-md-scrollfix>
           
             
   
   
+  
+    <li class="md-nav__item">
+      <a href="../typescript/" class="md-nav__link">
+        TypeScript
+      </a>
+    </li>
+  
+
+          
+            
+  
+  
     
   
   
     <li class="md-nav__item md-nav__item--active md-nav__item--nested">
       
       
-        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_2" type="checkbox" id="__nav_4_2" checked>
+        <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_3" type="checkbox" id="__nav_4_3" checked>
       
-      <label class="md-nav__link" for="__nav_4_2">
+      <label class="md-nav__link" for="__nav_4_3">
         New API
         <span class="md-nav__icon md-icon"></span>
       </label>
       <nav class="md-nav" aria-label="New API" data-md-level="2">
-        <label class="md-nav__title" for="__nav_4_2">
+        <label class="md-nav__title" for="__nav_4_3">
           <span class="md-nav__icon md-icon"></span>
           New API
         </label>
   
     <li class="md-nav__item">
       <a href="../../migration/wsc53/javascript/" class="md-nav__link">
-        JavaScript
+        TypeScript and JavaScript
       </a>
     </li>
   
             <article class="md-content__inner md-typeset">
               
                 
+                  <a href="https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/javascript/new-api_core.md" title="Edit this page" class="md-content__button md-icon">
+                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
+                  </a>
+                
                 
                 <h1 id="core-modules-and-functions-javascript-api">Core Modules and Functions - JavaScript API<a class="headerlink" href="#core-modules-and-functions-javascript-api" title="Permanent link">#</a></h1>
 <p>A brief overview of common methods that may be useful when writing any module.</p>
@@ -2087,7 +2126,6 @@ to non-plain objects, these instances will be copied by reference.</p>
   <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">obj2</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="s2">&quot;a&quot;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">obj2</span><span class="p">.</span><span class="nx">a</span> <span class="o">===</span> <span class="mf">1</span><span class="p">);</span> <span class="c1">// output: true</span>
 <span class="p">});</span>
 </code></pre></div>
-
 <h3 id="extendbase-object-merge-object-object"><code>extend(base: Object, ...merge: Object[]): Object</code><a class="headerlink" href="#extendbase-object-merge-object-object" title="Permanent link">#</a></h3>
 <p>Accepts an infinite amount of plain objects as parameters, values will be copied
 from the 2nd...nth object into the first object. The first parameter will be
@@ -2103,7 +2141,6 @@ cloned and the resulting object is returned.</p>
   <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">obj</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="s2">&quot;a&quot;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">a</span> <span class="o">===</span> <span class="mf">2</span><span class="p">);</span> <span class="c1">// output: false</span>
 <span class="p">});</span>
 </code></pre></div>
-
 <h3 id="inheritbase-object-target-object-merge-object"><code>inherit(base: Object, target: Object, merge?: Object)</code><a class="headerlink" href="#inheritbase-object-target-object-merge-object" title="Permanent link">#</a></h3>
 <p>Derives the second object's prototype from the first object, afterwards the
 derived class will pass the <code>instanceof</code> check against the original class.</p>
@@ -2142,7 +2179,6 @@ derived class will pass the <code>instanceof</code> check against the original c
   <span class="k">return</span> <span class="nx">Baz</span><span class="p">;</span>
 <span class="p">});</span>
 </code></pre></div>
-
 <h3 id="isplainobjectobject-object-boolean"><code>isPlainObject(object: Object): boolean</code><a class="headerlink" href="#isplainobjectobject-object-boolean" title="Permanent link">#</a></h3>
 <p>Verifies if an object is a plain JavaScript object and not an object instance.</p>
 <div class="highlight"><pre><span></span><code><span class="nx">require</span><span class="p">([</span><span class="s2">&quot;Core&quot;</span><span class="p">],</span> <span class="kd">function</span><span class="p">(</span><span class="nx">Core</span><span class="p">)</span> <span class="p">{</span>
@@ -2159,7 +2195,6 @@ derived class will pass the <code>instanceof</code> check against the original c
   <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">Core</span><span class="p">.</span><span class="nx">isPlainObject</span><span class="p">(</span><span class="nx">obj2</span><span class="p">));</span> <span class="c1">// output: false</span>
 <span class="p">});</span>
 </code></pre></div>
-
 <h3 id="triggereventelement-element-eventname-string"><code>triggerEvent(element: Element, eventName: string)</code><a class="headerlink" href="#triggereventelement-element-eventname-string" title="Permanent link">#</a></h3>
 <p>Creates and dispatches a synthetic JavaScript event on an element.</p>
 <div class="highlight"><pre><span></span><code><span class="nx">require</span><span class="p">([</span><span class="s2">&quot;Core&quot;</span><span class="p">],</span> <span class="kd">function</span><span class="p">(</span><span class="nx">Core</span><span class="p">)</span> <span class="p">{</span>
@@ -2167,7 +2202,6 @@ derived class will pass the <code>instanceof</code> check against the original c
   <span class="nx">Core</span><span class="p">.</span><span class="nx">triggerEvent</span><span class="p">(</span><span class="nx">element</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">);</span>
 <span class="p">});</span>
 </code></pre></div>
-
 <h2 id="language"><code>Language</code><a class="headerlink" href="#language" title="Permanent link">#</a></h2>
 <h3 id="addkey-string-value-string"><code>add(key: string, value: string)</code><a class="headerlink" href="#addkey-string-value-string" title="Permanent link">#</a></h3>
 <p>Registers a new phrase.</p>
@@ -2177,7 +2211,6 @@ derived class will pass the <code>instanceof</code> check against the original c
   <span class="p">});</span>
 <span class="p">&lt;/</span><span class="nt">script</span><span class="p">&gt;</span>
 </code></pre></div>
-
 <h3 id="addobjectobject-object"><code>addObject(object: Object)</code><a class="headerlink" href="#addobjectobject-object" title="Permanent link">#</a></h3>
 <p>Registers a list of phrases using a plain object.</p>
 <div class="highlight"><pre><span></span><code><span class="p">&lt;</span><span class="nt">script</span> <span class="na">data-relocate</span><span class="o">=</span><span class="s">&quot;true&quot;</span><span class="p">&gt;</span>
@@ -2188,7 +2221,6 @@ derived class will pass the <code>instanceof</code> check against the original c
   <span class="p">});</span>
 <span class="p">&lt;/</span><span class="nt">script</span><span class="p">&gt;</span>
 </code></pre></div>
-
 <h3 id="getkey-string-parameters-object-string"><code>get(key: string, parameters?: Object): string</code><a class="headerlink" href="#getkey-string-parameters-object-string" title="Permanent link">#</a></h3>
 <p>Retrieves a phrase by its key, optionally supporting basic template scripting
 with dynamic variables passed using the <code>parameters</code> object.</p>
@@ -2199,7 +2231,6 @@ with dynamic variables passed using the <code>parameters</code> object.</p>
   <span class="p">});</span>
 <span class="p">});</span>
 </code></pre></div>
-
 <h2 id="stringutil"><code>StringUtil</code><a class="headerlink" href="#stringutil" title="Permanent link">#</a></h2>
 <h3 id="escapehtmlstr-string-string"><code>escapeHTML(str: string): string</code><a class="headerlink" href="#escapehtmlstr-string-string" title="Permanent link">#</a></h3>
 <p>Escapes special HTML characters by converting them into an HTML entity.</p>
@@ -2240,6 +2271,19 @@ and could alter the behavior when embedded into regular expressions.</p>
 <p>Converts some HTML entities into their original character. This is the reverse
 function of <code>escapeHTML()</code>.</p>
                 
+                  
+                    
+
+<hr>
+<div class="md-source-date">
+  <small>
+    
+      Last update: 2021-01-08
+    
+  </small>
+</div>
+                  
+                
               
               
                 
@@ -2249,6 +2293,7 @@ function of <code>escapeHTML()</code>.</p>
             </article>
           </div>
         </div>
+        
       </main>
       
         
@@ -2299,6 +2344,7 @@ function of <code>escapeHTML()</code>.</p>
         <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
           Material for MkDocs
         </a>
+        
       </div>
       <div class="md-footer-copyright">
        <a href="https://www.woltlab.com/legal-notice/">Legal Notice</a> 
@@ -2312,10 +2358,10 @@ function of <code>escapeHTML()</code>.</p>
     <div class="md-dialog" data-md-component="dialog">
       <div class="md-dialog__inner md-typeset"></div>
     </div>
-    <script id="__config" type="application/json">{"base": "../..", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}, "search": "../../assets/javascripts/workers/search.fb4a9340.min.js", "version": {"provider": "mike"}}</script>
+    <script id="__config" type="application/json">{"base": "../..", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}, "search": "../../assets/javascripts/workers/search.fe42c31b.min.js", "version": {"provider": "mike"}}</script>
     
     
-      <script src="../../assets/javascripts/bundle.ca5457b8.min.js"></script>
+      <script src="../../assets/javascripts/bundle.d892486b.min.js"></script>
       
     
   </body>