Add documentation to the helpers module.

This commit is contained in:
Spencer Ofwiti
2021-05-11 14:34:23 +03:00
parent c9f73899c3
commit e0c045cdfa
37 changed files with 1403 additions and 585 deletions

File diff suppressed because one or more lines are too long

View File

@@ -68,6 +68,18 @@
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Custom provider that defines how form controls behave with regards to displaying error messages.</p>
</div>
<dl class="tsd-comment-tags">
<dt>implements</dt>
<dd><p>ErrorStateMatcher</p>
</dd>
</dl>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
@@ -131,19 +143,31 @@
<aside class="tsd-sources">
<p>Implementation of ErrorStateMatcher.isErrorState</p>
<ul>
<li>Defined in src/app/_helpers/custom-error-state-matcher.ts:5</li>
<li>Defined in src/app/_helpers/custom-error-state-matcher.ts:18</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Checks whether an invalid input has been made and an error should be made.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>control: <span class="tsd-signature-type">FormControl</span></h5>
<div class="tsd-comment tsd-typography">
<p>Tracks the value and validation status of an individual form control.</p>
</div>
</li>
<li>
<h5>form: <span class="tsd-signature-type">FormGroupDirective</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">NgForm</span></h5>
<div class="tsd-comment tsd-typography">
<p>Binding of an existing FormGroup to a DOM element.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
<p>true - If an invalid input has been made to the form control.</p>
</li>
</ul>
</section>

View File

@@ -68,6 +68,13 @@
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Provides methods to perform custom validation to form inputs.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
@@ -125,13 +132,21 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/custom.validator.ts:4</li>
<li>Defined in src/app/_helpers/custom.validator.ts:13</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Sets errors to the confirm password input field if it does not match with the value in the password input field.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>control: <span class="tsd-signature-type">AbstractControl</span></h5>
<div class="tsd-comment tsd-typography">
<p>The control object of the form being validated.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@@ -148,19 +163,31 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/custom.validator.ts:12</li>
<li>Defined in src/app/_helpers/custom.validator.ts:28</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Sets errors to a form field if it does not match with the regular expression given.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>regex: <span class="tsd-signature-type">RegExp</span></h5>
<div class="tsd-comment tsd-typography">
<p>The regular expression to match with the form field.</p>
</div>
</li>
<li>
<h5>error: <span class="tsd-signature-type">ValidationErrors</span></h5>
<div class="tsd-comment tsd-typography">
<p>Defines the map of errors to return from failed validation checks.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ValidationErrors</span></h4>
<p>The map of errors returned from failed validation checks.</p>
</li>
</ul>
</section>

View File

@@ -68,6 +68,13 @@
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Provides a hook for centralized exception handling.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
@@ -121,16 +128,27 @@
<aside class="tsd-sources">
<p>Overrides ErrorHandler.constructor</p>
<ul>
<li>Defined in src/app/_helpers/global-error-handler.ts:18</li>
<li>Defined in src/app/_helpers/global-error-handler.ts:42</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Initialization of the Global Error Handler.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>loggingService: <a href="app__services_logging_service.loggingservice.html" class="tsd-signature-type" data-tsd-kind="Class">LoggingService</a></h5>
<div class="tsd-comment tsd-typography">
<p>A service that provides logging capabilities.</p>
</div>
</li>
<li>
<h5>router: <span class="tsd-signature-type">Router</span></h5>
<div class="tsd-comment tsd-typography">
<p>A service that provides navigation among views and URL manipulation capabilities.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="app__helpers_global_error_handler.globalerrorhandler.html" class="tsd-signature-type" data-tsd-kind="Class">GlobalErrorHandler</a></h4>
@@ -146,9 +164,14 @@
<div class="tsd-signature tsd-kind-icon">sentences<wbr>For<wbr>Warning<wbr>Logging<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/global-error-handler.ts:18</li>
<li>Defined in src/app/_helpers/global-error-handler.ts:42</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>An array of sentence sections that denote warnings.</p>
</div>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
@@ -164,13 +187,21 @@
<aside class="tsd-sources">
<p>Overrides ErrorHandler.handleError</p>
<ul>
<li>Defined in src/app/_helpers/global-error-handler.ts:27</li>
<li>Defined in src/app/_helpers/global-error-handler.ts:62</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Handles different types of errors.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>error: <span class="tsd-signature-type">Error</span></h5>
<div class="tsd-comment tsd-typography">
<p>An error objects thrown when a runtime errors occurs.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@@ -187,16 +218,25 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/global-error-handler.ts:67</li>
<li>Defined in src/app/_helpers/global-error-handler.ts:89</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Checks if an error is of type warning.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>errorTraceString: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>A description of the error and it&#39;s stack trace.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
<p>true - If the error is of type warning.</p>
</li>
</ul>
</section>
@@ -210,13 +250,21 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/global-error-handler.ts:47</li>
<li>Defined in src/app/_helpers/global-error-handler.ts:109</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Write appropriate logs according to the type of error.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>error: <span class="tsd-signature-type">any</span></h5>
<div class="tsd-comment tsd-typography">
<p>An error objects thrown when a runtime errors occurs.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>

View File

@@ -68,6 +68,13 @@
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A generalized http response error.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
@@ -124,16 +131,27 @@
<aside class="tsd-sources">
<p>Overrides Error.constructor</p>
<ul>
<li>Defined in src/app/_helpers/global-error-handler.ts:8</li>
<li>Defined in src/app/_helpers/global-error-handler.ts:16</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Initialize the HttpError class.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>message: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The message given by the error.</p>
</div>
</li>
<li>
<h5>status: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<p>The status code given by the error.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="app__helpers_global_error_handler.httperror.html" class="tsd-signature-type" data-tsd-kind="Class">HttpError</a></h4>
@@ -182,9 +200,14 @@
<div class="tsd-signature tsd-kind-icon">status<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/global-error-handler.ts:8</li>
<li>Defined in src/app/_helpers/global-error-handler.ts:16</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The error&#39;s status code.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external">
<a name="preparestacktrace" class="tsd-anchor"></a>

View File

@@ -68,6 +68,19 @@
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Intercepts HTTP requests and handles some specified requests internally.
Provides a backend that can handle requests for certain data items.</p>
</div>
<dl class="tsd-comment-tags">
<dt>implements</dt>
<dd><p>HttpInterceptor</p>
</dd>
</dl>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
@@ -131,19 +144,31 @@
<aside class="tsd-sources">
<p>Implementation of HttpInterceptor.intercept</p>
<ul>
<li>Defined in src/app/_helpers/mock-backend.ts:240</li>
<li>Defined in src/app/_helpers/mock-backend.ts:268</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Intercepts HTTP requests.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>request: <span class="tsd-signature-type">HttpRequest</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h5>
<div class="tsd-comment tsd-typography">
<p>An outgoing HTTP request with an optional typed body.</p>
</div>
</li>
<li>
<h5>next: <span class="tsd-signature-type">HttpHandler</span></h5>
<div class="tsd-comment tsd-typography">
<p>The next HTTP handler or the outgoing request dispatcher.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Observable</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">HttpEvent</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></h4>
<p>The response from the resolved request.</p>
</li>
</ul>
</section>

View File

@@ -90,16 +90,32 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/array-sum.ts:1</li>
<li>Defined in src/app/_helpers/array-sum.ts:13</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the sum of all values in an array.</p>
</div>
<dl class="tsd-comment-tags">
<dt>example</dt>
<dd><p>Prints 6 for the array [1, 2, 3]:</p>
<pre><code class="language-typescript"><span style="color: #001080">console</span><span style="color: #000000">.</span><span style="color: #795E26">log</span><span style="color: #000000">(</span><span style="color: #795E26">arraySum</span><span style="color: #000000">([</span><span style="color: #098658">1</span><span style="color: #000000">, </span><span style="color: #098658">2</span><span style="color: #000000">, </span><span style="color: #098658">3</span><span style="color: #000000">]));</span>
</code></pre>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>arr: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5>
<div class="tsd-comment tsd-typography">
<p>An array of numbers.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
<p>The sum of all values in the array.</p>
</li>
</ul>
</section>

View File

@@ -90,16 +90,32 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/clipboard-copy.ts:1</li>
<li>Defined in src/app/_helpers/clipboard-copy.ts:13</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Copies set text to clipboard.</p>
</div>
<dl class="tsd-comment-tags">
<dt>example</dt>
<dd><p>copies &#39;Hello World!&#39; to the clipboard and prints &quot;true&quot;:</p>
<pre><code class="language-typescript"><span style="color: #001080">console</span><span style="color: #000000">.</span><span style="color: #795E26">log</span><span style="color: #000000">(</span><span style="color: #795E26">copyToClipboard</span><span style="color: #000000">(</span><span style="color: #A31515">&#039;Hello World!&#039;</span><span style="color: #000000">));</span>
</code></pre>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>text: <span class="tsd-signature-type">any</span></h5>
<div class="tsd-comment tsd-typography">
<p>The text to be copied to the clipboard.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
<p>true - If the copy operation is successful.</p>
</li>
</ul>
</section>

View File

@@ -90,19 +90,34 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/export-csv.ts:1</li>
<li>Defined in src/app/_helpers/export-csv.ts:9</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Exports data to a CSV format and provides a download file.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>arrayData: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5>
<div class="tsd-comment tsd-typography">
<p>An array of data to be converted to CSV format.</p>
</div>
</li>
<li>
<h5>filename: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The name of the file to be downloaded.</p>
</div>
</li>
<li>
<h5>delimiter: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &#x27;,&#x27;</span></h5>
<div class="tsd-comment tsd-typography">
<p>The delimiter to be used when converting to CSV format.
Defaults to commas.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>

View File

@@ -90,9 +90,14 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/http-getter.ts:1</li>
<li>Defined in src/app/_helpers/http-getter.ts:2</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Provides an avenue of fetching resources via HTTP calls.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>

View File

@@ -92,9 +92,18 @@
<div class="tsd-signature tsd-kind-icon">Mock<wbr>Backend<wbr>Provider<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>multi<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>provide<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">InjectionToken</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">HttpInterceptor</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">; </span>useClass<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><a href="../classes/app__helpers_mock_backend.mockbackendinterceptor.html" class="tsd-signature-type" data-tsd-kind="Class">MockBackendInterceptor</a><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/mock-backend.ts:378</li>
<li>Defined in src/app/_helpers/mock-backend.ts:412</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Exports the MockBackendInterceptor as an Angular provider.</p>
</div>
<dl class="tsd-comment-tags">
<dt>exports</dt>
<dd></dd>
</dl>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">

View File

@@ -90,16 +90,25 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/read-csv.ts:6</li>
<li>Defined in src/app/_helpers/read-csv.ts:13</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Reads a csv file and converts it to an array.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>input: <span class="tsd-signature-type">any</span></h5>
<div class="tsd-comment tsd-typography">
<p>The file to be read.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">void</span></h4>
<p>An array of the read data.</p>
</li>
</ul>
</section>

View File

@@ -91,13 +91,21 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/schema-validation.ts:3</li>
<li>Defined in src/app/_helpers/schema-validation.ts:9</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Validates a person object against the defined Person schema.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>person: <span class="tsd-signature-type">any</span></h5>
<div class="tsd-comment tsd-typography">
<p>A person object to be validated.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4>
@@ -114,13 +122,21 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in src/app/_helpers/schema-validation.ts:11</li>
<li>Defined in src/app/_helpers/schema-validation.ts:22</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Validates a vcard object against the defined Vcard schema.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>vcard: <span class="tsd-signature-type">any</span></h5>
<div class="tsd-comment tsd-typography">
<p>A vcard object to be validated.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4>