cic-internal-integration/apps/cic-staff-client/docs/compodoc/miscellaneous/functions.html

895 lines
30 KiB
HTML
Raw Normal View History

2021-08-12 03:00:57 +02:00
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>CICADA</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">CICADA</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<compodoc-menu mode="normal"></compodoc-menu>
</div>
<!-- START CONTENT -->
<div class="content miscellaneous-functions">
<div class="content-data">
<ol class="breadcrumb">
<li>Miscellaneous</li>
<li>Functions</li>
</ol>
<section>
<h3 id="index">Index</h3>
<table class="table table-sm table-bordered index-table">
<tbody>
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<a href="#arraySum" title="src/app/_helpers/array-sum.ts"><b>arraySum</b>&nbsp;&nbsp;&nbsp;(src/.../array-sum.ts)</a>
</li>
<li>
<a href="#copyToClipboard" title="src/app/_helpers/clipboard-copy.ts"><b>copyToClipboard</b>&nbsp;&nbsp;&nbsp;(src/.../clipboard-copy.ts)</a>
</li>
<li>
<a href="#exportCsv" title="src/app/_helpers/export-csv.ts"><b>exportCsv</b>&nbsp;&nbsp;&nbsp;(src/.../export-csv.ts)</a>
</li>
<li>
<a href="#HttpGetter" title="src/app/_helpers/http-getter.ts"><b>HttpGetter</b>&nbsp;&nbsp;&nbsp;(src/.../http-getter.ts)</a>
</li>
<li>
<a href="#parseData" title="src/app/_helpers/read-csv.ts"><b>parseData</b>&nbsp;&nbsp;&nbsp;(src/.../read-csv.ts)</a>
</li>
<li>
<a href="#personValidation" title="src/app/_helpers/schema-validation.ts"><b>personValidation</b>&nbsp;&nbsp;&nbsp;(src/.../schema-validation.ts)</a>
</li>
<li>
<a href="#readCsv" title="src/app/_helpers/read-csv.ts"><b>readCsv</b>&nbsp;&nbsp;&nbsp;(src/.../read-csv.ts)</a>
</li>
<li>
<a href="#rejectBody" title="src/app/_helpers/global-error-handler.ts"><b>rejectBody</b>&nbsp;&nbsp;&nbsp;(src/.../global-error-handler.ts)</a>
</li>
<li>
<a href="#updateSyncable" title="src/app/_helpers/sync.ts"><b>updateSyncable</b>&nbsp;&nbsp;&nbsp;(src/.../sync.ts)</a>
</li>
<li>
<a href="#vcardValidation" title="src/app/_helpers/schema-validation.ts"><b>vcardValidation</b>&nbsp;&nbsp;&nbsp;(src/.../schema-validation.ts)</a>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</section>
<h3>src/app/_helpers/array-sum.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="arraySum"></a>
<span class="name">
<b>
arraySum
</b>
<a href="#arraySum"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>arraySum(arr)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns the sum of all values in an array.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>arr</td>
<td>
No
</td>
<td>
<ul>
<li>An array of numbers.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<b>Example :</b>
<div>
<pre class="line-numbers"><code class="language-html">Prints 6 for the array [1, 2, 3]:&lt;/p&gt;
&lt;p&gt;```typescript&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;console.log(arraySum([1, 2, 3]));&lt;/li&gt;
&lt;li&gt;```&lt;/li&gt;
&lt;/ul&gt;</code></pre>
</div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
</div>
<div class="io-description">
<p>The sum of all values in the array.</p>
</div>
</td>
</tr>
</tbody>
</table>
</section> <h3>src/app/_helpers/clipboard-copy.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="copyToClipboard"></a>
<span class="name">
<b>
copyToClipboard
</b>
<a href="#copyToClipboard"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>copyToClipboard(text: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Copies set text to clipboard.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>text</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
<td>
<ul>
<li>The text to be copied to the clipboard.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<b>Example :</b>
<div>
<pre class="line-numbers"><code class="language-html">copies &amp;#39;Hello World!&amp;#39; to the clipboard and prints &amp;quot;true&amp;quot;:&lt;/p&gt;
&lt;p&gt;```typescript&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;console.log(copyToClipboard(&amp;#39;Hello World!&amp;#39;));&lt;/li&gt;
&lt;li&gt;```&lt;/li&gt;
&lt;/ul&gt;</code></pre>
</div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
</div>
<div class="io-description">
<p>true - If the copy operation is successful.</p>
</div>
</td>
</tr>
</tbody>
</table>
</section> <h3>src/app/_helpers/export-csv.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="exportCsv"></a>
<span class="name">
<b>
exportCsv
</b>
<a href="#exportCsv"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>exportCsv(arrayData, filename, delimiter)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Exports data to a CSV format and provides a download file.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>arrayData</td>
<td>
No
</td>
<td>
<ul>
<li>An array of data to be converted to CSV format.</li>
</ul>
</td>
</tr>
<tr>
<td>filename</td>
<td>
No
</td>
<td>
<ul>
<li>The name of the file to be downloaded.</li>
</ul>
</td>
</tr>
<tr>
<td>delimiter</td>
<td>
No
</td>
<td>
<ul>
<li>The delimiter to be used when converting to CSV format.
Defaults to commas.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
</section> <h3>src/app/_helpers/http-getter.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="HttpGetter"></a>
<span class="name">
<b>
HttpGetter
</b>
<a href="#HttpGetter"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>HttpGetter()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Provides an avenue of fetching resources via HTTP calls. </p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
</section> <h3>src/app/_helpers/read-csv.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="parseData"></a>
<span class="name">
<b>
parseData
</b>
<a href="#parseData"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>parseData(data: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Parses data to CSV format.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>data</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
<td>
<ul>
<li>The data to be parsed.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code>Array&lt;any&gt;</code>
</div>
<div class="io-description">
<p>An array of the parsed data.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="readCsv"></a>
<span class="name">
<b>
readCsv
</b>
<a href="#readCsv"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>readCsv(input: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Reads a csv file and converts it to an array.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>input</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
<td>
<ul>
<li>The file to be read.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code>Array | void</code>
</div>
<div class="io-description">
<p>An array of the read data.</p>
</div>
</td>
</tr>
</tbody>
</table>
</section> <h3>src/app/_helpers/schema-validation.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="personValidation"></a>
<span class="name">
<b>
personValidation
</b>
<a href="#personValidation"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>personValidation(person: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Validates a person object against the defined Person schema.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>person</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
<td>
<ul>
<li>A person object to be validated.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code>Promise&lt;void&gt;</code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="vcardValidation"></a>
<span class="name">
<b>
vcardValidation
</b>
<a href="#vcardValidation"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>vcardValidation(vcard: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Validates a vcard object against the defined Vcard schema.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>vcard</td>
<td>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
<td>
No
</td>
<td>
<ul>
<li>A vcard object to be validated.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code>Promise&lt;void&gt;</code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
</section> <h3>src/app/_helpers/global-error-handler.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="rejectBody"></a>
<span class="name">
<b>
rejectBody
</b>
<a href="#rejectBody"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>rejectBody(error)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>error</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code>literal type</code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
</section> <h3>src/app/_helpers/sync.ts</h3>
<section>
<h3></h3> <table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="updateSyncable"></a>
<span class="name">
<b>
updateSyncable
</b>
<a href="#updateSyncable"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>updateSyncable(changes, changesDescription, syncable)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>changes</td>
<td>
No
</td>
</tr>
<tr>
<td>changesDescription</td>
<td>
No
</td>
</tr>
<tr>
<td>syncable</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> result-matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
<!-- END CONTENT -->
</div>
</div>
<script>
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
var COMPODOC_CURRENT_PAGE_CONTEXT = 'miscellaneous-functions';
var COMPODOC_CURRENT_PAGE_URL = 'functions.html';
var MAX_SEARCH_RESULTS = 15;
</script>
<script src="../js/libs/custom-elements.min.js"></script>
<script src="../js/libs/lit-html.js"></script>
<!-- Required to polyfill modern browsers as code is ES5 for IE... -->
<script src="../js/libs/custom-elements-es5-adapter.js" charset="utf-8" defer></script>
<script src="../js/menu-wc.js" defer></script>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/tabs.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/clipboard.min.js"></script>
<script src="../js/libs/prism.js"></script>
<script src="../js/sourceCode.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/search/search_index.js"></script>
<script src="../js/lazy-load-graphs.js"></script>
</body>
</html>