-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
19 lines (19 loc) · 12.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>newdesigns</title><meta name="description" content="Documentation for newdesigns"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">newdesigns</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>newdesigns</h2></div><div class="tsd-panel tsd-typography"><p><a href="https://github.com/r0wanda/nd/actions/workflows/eslint.yml"><img src="https://github.com/r0wanda/nd/actions/workflows/eslint.yml/badge.svg" alt="ESLint"></a></p>
<a id="md:nd" class="tsd-anchor"></a><h1><a href="#md:nd">ND</a></h1><p><strong>New Design</strong> aims to replace <a href="https://github.com/chjj/blessed">blessed</a> with a maintained, <strong>new</strong>, Typescript-based program. It tries to stay close to the blessed api, to avoid the need to change too much user-code.</p>
<p>TODO: add gif</p>
<a id="md:documentation" class="tsd-anchor"></a><h1><a href="#md:documentation">Documentation</a></h1><a id="md:install" class="tsd-anchor"></a><h1><a href="#md:install">Install</a></h1><p>Npm:</p>
<pre><code class="language-sh"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">i</span><span class="hl-1"> </span><span class="hl-2">git+https://github.com/r0wanda/nd.git</span><span class="hl-1"> </span><span class="hl-3"># todo: publish to npm</span>
</code><button>Copy</button></pre>
<p>Yarn:</p>
<pre><code class="language-sh"><span class="hl-0">yarn</span><span class="hl-1"> </span><span class="hl-2">add</span><span class="hl-1"> </span><span class="hl-2">git+https://github.com/r0wanda/nd.git</span>
</code><button>Copy</button></pre>
<a id="md:example" class="tsd-anchor"></a><h1><a href="#md:example">Example</a></h1><pre><code class="language-js"><span class="hl-4">import</span><span class="hl-1"> </span><span class="hl-5">nd</span><span class="hl-1"> </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'nd'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">// Instantiate a screen class</span><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">screen</span><span class="hl-1"> = </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-5">nd</span><span class="hl-1">.</span><span class="hl-0">Screen</span><span class="hl-1">();</span><br/><br/><span class="hl-3">// Set window title (on some terminal emulators, may do nothing)</span><br/><span class="hl-5">screen</span><span class="hl-1">.</span><span class="hl-5">title</span><span class="hl-1"> = </span><span class="hl-2">'my window title'</span><span class="hl-1">;</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">box</span><span class="hl-1"> = </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-5">nd</span><span class="hl-1">.</span><span class="hl-0">Element</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">screen:</span><span class="hl-1"> </span><span class="hl-5">screen</span><span class="hl-1">, </span><span class="hl-3">// One difference from blessed, screen is set at creation</span><br/><br/><span class="hl-1"> </span><span class="hl-5">top:</span><span class="hl-1"> </span><span class="hl-2">'center'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">left:</span><span class="hl-1"> </span><span class="hl-2">'center'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">width:</span><span class="hl-1"> </span><span class="hl-2">'50%'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">height:</span><span class="hl-1"> </span><span class="hl-2">'50%'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">content:</span><span class="hl-1"> </span><span class="hl-2">'Hello {bold}world{/bold}!'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">border:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">type:</span><span class="hl-1"> </span><span class="hl-2">'line'</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-5">style:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">fg:</span><span class="hl-1"> </span><span class="hl-2">'white'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">bg:</span><span class="hl-1"> </span><span class="hl-2">'magenta'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">border:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">fg:</span><span class="hl-1"> </span><span class="hl-2">'#f0f0f0'</span><span class="hl-1"> </span><span class="hl-3">// Unlike blessed, this will be truecolor if supported!</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-5">hover:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">bg:</span><span class="hl-1"> </span><span class="hl-2">'green'</span><span class="hl-1">,</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-3">// Quit on escape (using blob!), q, or Control-C</span><br/><span class="hl-5">screen</span><span class="hl-1">.</span><span class="hl-0">key</span><span class="hl-1">([</span><span class="hl-2">'esc*'</span><span class="hl-1">, </span><span class="hl-2">'q'</span><span class="hl-1">, </span><span class="hl-2">'C-c'</span><span class="hl-1">], (</span><span class="hl-5">ch</span><span class="hl-1">, </span><span class="hl-5">key</span><span class="hl-1">) </span><span class="hl-6">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">process</span><span class="hl-1">.</span><span class="hl-0">exit</span><span class="hl-1">(</span><span class="hl-8">0</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">screen</span><span class="hl-1">.</span><span class="hl-0">render</span><span class="hl-1">();</span>
</code><button>Copy</button></pre>
<a id="md:goals" class="tsd-anchor"></a><h2><a href="#md:goals">Goals</a></h2><ul>
<li>Implement almost all parts of the blessed api (not including redundant/useless features)</li>
<li>Implement all or most of blessed-contrib</li>
<li>Have benchmark times at or below blessed</li>
<li>Have a minimal amount of dependencies</li>
</ul>
<a id="md:related-projects" class="tsd-anchor"></a><h2><a href="#md:related-projects">Related projects</a></h2><p><a href="https://github.com/r0wanda/nd-docs">https://github.com/r0wanda/nd-docs</a></p>
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:nd"><span>ND</span></a><a href="#md:documentation"><span>Documentation</span></a><a href="#md:install"><span>Install</span></a><a href="#md:example"><span>Example</span></a><ul><li><a href="#md:goals"><span>Goals</span></a></li><li><a href="#md:related-projects"><span>Related projects</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="index.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>newdesigns</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>