Skip to content

Commit

Permalink
v2.0.0 doc: update document. ac39e72
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 11, 2024
1 parent f7263d0 commit 790defe
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 45 deletions.
8 changes: 4 additions & 4 deletions badges.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 24 additions & 31 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -481,42 +481,35 @@ <h3 id="key-changes"><a aria-hidden="true" tabindex="-1" href="#key-changes" cla
</ul>
<p><strong>Example:</strong></p>
<pre class="language-ts"><code class="language-ts code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">export</span> <span class="token keyword">type</span> <span class="token class-name">LoaderFunc<span class="token operator">&#x3C;</span><span class="token constant">T</span><span class="token operator">></span></span> <span class="token operator">=</span> <span class="token punctuation">(</span>
</span><span class="code-line line-number" line="2"> filepath<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="3"> content<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4"> jsOption<span class="token operator">?</span><span class="token operator">:</span> LoadConfOption
</span><span class="code-line line-number" line="2"> filepath<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="3"> content<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4"> jsOption<span class="token operator">?</span><span class="token operator">:</span> LoadConfOption
</span><span class="code-line line-number" line="5"><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token constant">T</span> <span class="token operator">|</span> <span class="token builtin">Promise</span><span class="token operator">&#x3C;</span><span class="token constant">T</span><span class="token operator">></span><span class="token punctuation">;</span>
</span></code><input type="hidden" value="export type LoaderFunc<T> = (
filepath: string,
content: string,
jsOption?: LoadConfOption
filepath: string,
content: string,
jsOption?: LoadConfOption
) => T | Promise<T>;
"><div onclick="copied(this)" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
</li>
</ol>
<p>) => T | Promise
<t>;</t>
</p>
<pre><code class="code-highlight"><span class="code-line line-number" line="1">
</span><span class="code-line line-number" line="2">2. **`autoConf` Returns a Promise**
</span><span class="code-line line-number" line="3">- The `autoConf` function now returns a `Promise` instead of a synchronous result.
</span><span class="code-line line-number" line="4">- Update your code to handle asynchronous calls.
</span><span class="code-line line-number" line="5">
</span><span class="code-line line-number" line="6">**Example:**
</span><span class="code-line line-number" line="7">```ts
</span><span class="code-line line-number" line="8">export declare function autoConf&#x3C;T>(
</span><span class="code-line line-number" line="9"> namespace?: string,
</span><span class="code-line line-number" line="10"> option?: AutoConfOption&#x3C;T>
</span><span class="code-line line-number" line="11">): Promise&#x3C;{} &#x26; T>;
</span></code><input type="hidden" value="
2. **&#x60;autoConf&#x60; Returns a Promise**
- The &#x60;autoConf&#x60; function now returns a &#x60;Promise&#x60; instead of a synchronous result.
- Update your code to handle asynchronous calls.
**Example:**
&#x60;&#x60;&#x60;ts
export declare function autoConf<T>(
namespace?: string,
option?: AutoConfOption<T>
<li>
<p><strong><code>autoConf</code> Returns a Promise</strong></p>
<ul>
<li>The <code>autoConf</code> function now returns a <code>Promise</code> instead of a synchronous result.</li>
<li>Update your code to handle asynchronous calls.</li>
</ul>
<p><strong>Example:</strong></p>
<pre class="language-ts"><code class="language-ts code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">export</span> <span class="token keyword">declare</span> <span class="token keyword">function</span> <span class="token generic-function"><span class="token function">autoConf</span><span class="token generic class-name"><span class="token operator">&#x3C;</span><span class="token constant">T</span><span class="token operator">></span></span></span><span class="token punctuation">(</span>
</span><span class="code-line line-number" line="2"> namespace<span class="token operator">?</span><span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="3"> option<span class="token operator">?</span><span class="token operator">:</span> AutoConfOption<span class="token operator">&#x3C;</span><span class="token constant">T</span><span class="token operator">></span>
</span><span class="code-line line-number" line="4"><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">Promise</span><span class="token operator">&#x3C;</span><span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token operator">&#x26;</span> <span class="token constant">T</span><span class="token operator">></span><span class="token punctuation">;</span>
</span></code><input type="hidden" value="export declare function autoConf<T>(
namespace?: string,
option?: AutoConfOption<T>
): Promise<{} &#x26; T>;
"><div onclick="copied(this)" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
</li>
</ol>
<h3 id="migration-steps"><a aria-hidden="true" tabindex="-1" href="#migration-steps" class="anchor"><span class="icon icon-link"></span></a>Migration Steps</h3>
<h4 id="1-update-custom-loader-functions"><a aria-hidden="true" tabindex="-1" href="#1-update-custom-loader-functions" class="anchor"><span class="icon icon-link"></span></a>1. Update Custom Loader Functions</h4>
<p>If you have custom loaders, update their return types to support asynchronous operations:</p>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1>All files</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1><a href="../index.html">All files</a> src</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/index.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> index.t
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/loader/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h1><a href="../../index.html">All files</a> src/loader</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/loader/ini.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/loader</
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/loader/js.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/loader</
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/loader/json.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/loader</
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/loader/toml.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/loader</
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/loader/yaml.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/loader</
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/src/utils.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> utils.t
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-12-11T07:46:17.292Z
at 2024-12-11T07:53:40.949Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down

0 comments on commit 790defe

Please sign in to comment.