Skip to content

Commit c6eed60

Browse files
committed
Update API documentation coverage
1 parent f06b4f8 commit c6eed60

6 files changed

Lines changed: 265 additions & 21 deletions

File tree

docs/api/system/FileLoader.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,12 @@ <h3 id="methods">Methods</h3>
175175
<td>Resolves files or directories.</td>
176176

177177
</tr><tr>
178-
<td><code>resolveFile(pathname, pwd = cwd, exists = false)</code>
178+
<td><code>resolveFile(pathname, extnames = ['.js', '.json'], pwd = cwd, exists = false)</code>
179179
</td>
180180
<td>`Promise&lt;string \</td>
181181
<td>null&gt;`</td>
182-
<td>File-oriented resolution.</td>
182+
<td>File-oriented resolution. Checks the path directly, then tries each extension and <code>index</code>
183+
file.</td>
183184

184185
</tr>
185186
</table>
@@ -217,6 +218,7 @@ <h2 id="example">Example</h2>
217218

218219
const source = await loader.absolute('@/src/index.ts');
219220
const relative = loader.relative('/project/src/a.ts', '/project/src/utils/b.ts');
221+
const resolved = await loader.resolveFile('./plugin/foo', ['.ts', '.js']);
220222
const config = await loader.import&lt;Record&lt;string, unknown&gt;&gt;('./package.json');</code></pre>
221223

222224
<h2 id="related">Related</h2>

docs/api/types/index.html

Lines changed: 163 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<meta content="Public type families exported from @stackpress/lib/types. ## Import ``ts import type { CallableMap, CallableNest, CallableSet, CookieOptions, ErrorResponse, Event, EventD" name="description">
5+
<meta content="Public type families exported from @stackpress/lib/types. ## Import ``ts import type { CallableMap, CallableNest, CallableSet, Constructor, CookieOptions, CookieParseOpti" name="description">
66
<meta content="width=device-width, initial-scale=1" name="viewport">
77
<meta content="Types | @stackpress/lib" property="og:title">
8-
<meta content="Public type families exported from @stackpress/lib/types. ## Import ``ts import type { CallableMap, CallableNest, CallableSet, CookieOptions, ErrorResponse, Event, EventD" property="og:description">
8+
<meta content="Public type families exported from @stackpress/lib/types. ## Import ``ts import type { CallableMap, CallableNest, CallableSet, Constructor, CookieOptions, CookieParseOpti" property="og:description">
99
<meta content="website" property="og:type">
1010
<meta content="summary" name="twitter:card">
1111
<title>Types | @stackpress/lib</title>
@@ -59,7 +59,7 @@ <h2>Pages</h2>
5959
<div class="page-inner">
6060
<p class="eyebrow">API reference</p>
6161
<h1>Types</h1>
62-
<p class="lede">Public type families exported from @stackpress/lib/types. ## Import ``ts import type { CallableMap, CallableNest, CallableSet, CookieOptions, ErrorResponse, Event, EventD</p>
62+
<p class="lede">Public type families exported from @stackpress/lib/types. ## Import ``ts import type { CallableMap, CallableNest, CallableSet, Constructor, CookieOptions, CookieParseOpti</p>
6363
<div class="article-card markdown-body">
6464
<h1 id="types">Types</h1>
6565

@@ -72,33 +72,89 @@ <h2 id="import">Import</h2>
7272
CallableMap,
7373
CallableNest,
7474
CallableSet,
75+
Constructor,
7576
CookieOptions,
77+
CookieParseOptions,
78+
CookieSerializeOptions,
79+
Data,
80+
DataMapFilter,
81+
DataMapIterator,
82+
DataSetFilter,
83+
DataSetIterator,
7684
ErrorResponse,
7785
Event,
7886
EventData,
87+
EventExpression,
7988
EventHook,
8089
EventMap,
8190
EventMatch,
91+
EventName,
92+
ExtendsType,
93+
FileMeta,
94+
FileRecursiveOption,
95+
FileStat,
96+
FileStream,
8297
FileSystem,
98+
Hash,
99+
Headers,
100+
Infer,
101+
Item,
102+
Key,
103+
KeyPath,
104+
LoaderResults,
105+
Merge,
106+
Method,
83107
NestedObject,
108+
PathObject,
109+
PathValue,
110+
Post,
111+
Query,
112+
Body,
113+
CallSite,
114+
CallableSession,
115+
ResponseDispatcher,
116+
RequestLoader,
84117
RequestOptions,
118+
Revision,
85119
ResponseOptions,
86120
ResponseStatus,
87121
Route,
88122
RouteAction,
89123
RouteMap,
124+
RouterArgs,
90125
RouterAction,
126+
RouterContext,
91127
RouterMap,
128+
Scalar,
129+
ScalarInput,
130+
Session,
131+
SetInputResult,
132+
SetResult,
92133
StatusResponse,
93134
SuccessResponse,
135+
TaskAction,
136+
TaskItem,
137+
TaskResult,
138+
TemplateHelper,
139+
TemplateHelperOptions,
94140
TemplateOptions,
141+
TemplateResolver,
95142
TerminalInputConfig,
96-
TypeOf
143+
TerminalInputContext,
144+
TerminalInputTheme,
145+
TerminalPromptState,
146+
TerminalTTYInput,
147+
TerminalTTYOutput,
148+
Trace,
149+
UnknownNest,
150+
TypeOf,
151+
ValueAt,
152+
Widen
97153
} from '@stackpress/lib/types';</code></pre>
98154

99155
<p>Use <code>@stackpress/lib/types</code>
100-
when you want a dedicated import path for the public type surface. Many of these types are also re-exported from the root barrel, but the <code>types</code>
101-
subpath is the clearest stable reference point.</p>
156+
when you want a dedicated import path for the public type surface. The root barrel re-exports the most commonly consumed type names, but <code>@stackpress/lib/types</code>
157+
is the stable import path for the full type module.</p>
102158

103159
<h2 id="data-types">Data Types</h2>
104160

@@ -148,6 +204,11 @@ <h2 id="data-types">Data Types</h2>
148204
</td>
149205
<td>Scalar, scalar array, or hash.</td>
150206

207+
</tr><tr>
208+
<td><code>FileMeta</code>
209+
</td>
210+
<td>File wrapper metadata used by multipart parsing.</td>
211+
151212
</tr><tr>
152213
<td><code>CallableNest&lt;M&gt;</code>
153214
</td>
@@ -166,6 +227,101 @@ <h2 id="data-types">Data Types</h2>
166227
<td>Callable wrapper returned by <code>set()</code>
167228
.</td>
168229

230+
</tr><tr>
231+
<td><code>DataSetIterator</code>
232+
</td>
233+
<td>Callback shape for <code>DataSet#map()</code>
234+
.</td>
235+
236+
</tr><tr>
237+
<td><code>DataSetFilter</code>
238+
</td>
239+
<td>Callback shape for <code>DataSet#filter()</code>
240+
and find helpers.</td>
241+
242+
</tr><tr>
243+
<td><code>DataMapIterator</code>
244+
</td>
245+
<td>Callback shape for <code>DataMap#map()</code>
246+
.</td>
247+
248+
</tr><tr>
249+
<td><code>DataMapFilter</code>
250+
</td>
251+
<td>Callback shape for <code>DataMap#filter()</code>
252+
and find helpers.</td>
253+
254+
</tr>
255+
</table>
256+
</div>
257+
258+
<h2 id="lower-level-utility-types">Lower-Level Utility Types</h2>
259+
260+
<p>These types support the generic return values used by the data helpers. Most callers do not need to import them directly unless they are extending the library's typed path behavior.</p>
261+
262+
<div class="table-wrap">
263+
<table>
264+
<tr>
265+
<th>Type</th>
266+
<th>Purpose</th>
267+
268+
</tr><tr>
269+
<td><code>ExtendsType&lt;T, U&gt;</code>
270+
</td>
271+
<td>Combines an override shape with the remaining keys from another type.</td>
272+
273+
</tr><tr>
274+
<td><code>Constructor&lt;T, U&gt;</code>
275+
</td>
276+
<td>Constructor contract with optional static fields.</td>
277+
278+
</tr><tr>
279+
<td><code>KeyPath</code>
280+
</td>
281+
<td>Readonly array of nested path segments.</td>
282+
283+
</tr><tr>
284+
<td><code>Infer</code>
285+
</td>
286+
<td>Internal marker used by callable generic defaults.</td>
287+
288+
</tr><tr>
289+
<td><code>Widen&lt;T&gt;</code>
290+
</td>
291+
<td>Widens literal values to their primitive or object shapes.</td>
292+
293+
</tr><tr>
294+
<td><code>ValueAt&lt;T, K&gt;</code>
295+
</td>
296+
<td>Resolves the value type at one path segment.</td>
297+
298+
</tr><tr>
299+
<td><code>PathValue&lt;T, P&gt;</code>
300+
</td>
301+
<td>Resolves the value type at a nested path.</td>
302+
303+
</tr><tr>
304+
<td><code>PathObject&lt;P, V&gt;</code>
305+
</td>
306+
<td>Builds an object shape from a path and value type.</td>
307+
308+
</tr><tr>
309+
<td><code>Merge&lt;A, B&gt;</code>
310+
</td>
311+
<td>Merges object shapes for nested writes.</td>
312+
313+
</tr><tr>
314+
<td><code>SetResult&lt;M, P, V&gt;</code>
315+
</td>
316+
<td>Result type for one path-based <code>set()</code>
317+
operation.</td>
318+
319+
</tr><tr>
320+
<td><code>SetInputResult&lt;M, I&gt;</code>
321+
</td>
322+
<td>Result type for callable <code>set()</code>
323+
input overloads.</td>
324+
169325
</tr>
170326
</table>
171327
</div>
@@ -536,7 +692,7 @@ <h2 id="related">Related</h2>
536692
</article>
537693
<aside class="article-toc">
538694
<strong>On this page</strong>
539-
<a href="#import" title="Import">Import</a><a href="#data-types" title="Data Types">Data Types</a><a href="#status-and-error-types" title="Status And Error Types">Status And Error Types</a><a href="#queue-and-event-types" title="Queue And Event Types">Queue And Event Types</a><a href="#router-types" title="Router Types">Router Types</a><a href="#filesystem-types" title="Filesystem Types">Filesystem Types</a><a href="#terminal-and-template-types" title="Terminal And Template Types">Terminal And Template Types</a><a href="#related" title="Related">Related</a>
695+
<a href="#import" title="Import">Import</a><a href="#data-types" title="Data Types">Data Types</a><a href="#lower-level-utility-types" title="Lower-Level Utility Types">Lower-Level Utility Types</a><a href="#status-and-error-types" title="Status And Error Types">Status And Error Types</a><a href="#queue-and-event-types" title="Queue And Event Types">Queue And Event Types</a><a href="#router-types" title="Router Types">Router Types</a><a href="#filesystem-types" title="Filesystem Types">Filesystem Types</a><a href="#terminal-and-template-types" title="Terminal And Template Types">Terminal And Template Types</a><a href="#related" title="Related">Related</a>
540696
</aside>
541697
</div>
542698
</main>

docs/types.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ <h2>Choose by job</h2>
6868
</div>
6969
</div>
7070
<div class="doc-grid two">
71-
<a class="doc-card" href="./api/types/index.html" title="Types"><h3>Types</h3><p>Public type families exported from @stackpress/lib/types. ## Import ``ts import type { CallableMap, CallableNest, CallableSet, CookieOptions, ErrorResponse, Event, EventD</p></a>
71+
<a class="doc-card" href="./api/types/index.html" title="Types"><h3>Types</h3><p>Public type families exported from @stackpress/lib/types. ## Import ``ts import type { CallableMap, CallableNest, CallableSet, Constructor, CookieOptions, CookieParseOpti</p></a>
7272
</div>
7373
</section>
7474
<section class="section article-card">

specs/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
# API Reference
22

3-
- [Data](./api/data/Nest.md)
3+
Public API reference for the shared low-level utilities exported by `@stackpress/lib`.
4+
5+
The category links below open the main API page for each area.
6+
7+
- [Data APIs](./api/data/Nest.md)
48
`Nest`, readonly wrappers, map and set helpers, parsers, and cookie helpers.
5-
- [Events](./api/events/EventEmitter.md)
9+
- [Event APIs](./api/events/EventEmitter.md)
610
`EventEmitter`, `ExpressEmitter`, and `RouteEmitter`.
7-
- [Queues](./api/queue/ItemQueue.md)
11+
- [Queue APIs](./api/queue/ItemQueue.md)
812
`ItemQueue` and `TaskQueue`.
9-
- [Routing](./api/router/Router.md)
13+
- [Routing APIs](./api/router/Router.md)
1014
`Router`, `Request`, `Response`, and `Session`.
11-
- [System](./api/system/FileLoader.md)
15+
- [System APIs](./api/system/FileLoader.md)
1216
`FileLoader` and `NodeFS`.
13-
- [Runtime](./api/runtime/Exception.md)
17+
- [Runtime APIs](./api/runtime/Exception.md)
1418
`Exception`, `Reflection`, `Status`, `Template`, and terminal helpers.
15-
- [Types](./api/types/README.md)
19+
- [Type APIs](./api/types/README.md)
1620
Public type families from `@stackpress/lib/types`.
1721

1822
## Data

specs/api/system/FileLoader.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ You can pass a custom `cwd` as the second argument.
4040
| `modules(pathname, pwd = cwd, meta = true)` | `Promise<string>` | Resolves the `node_modules` directory containing a package. |
4141
| `relative(pathname, require, withExtname = false)` | `string` | Relative import path from one file to another. |
4242
| `resolve(pathname, pwd = cwd, exists = false)` | `Promise<string \| null>` | Resolves files or directories. |
43-
| `resolveFile(pathname, pwd = cwd, exists = false)` | `Promise<string \| null>` | File-oriented resolution. |
43+
| `resolveFile(pathname, extnames = ['.js', '.json'], pwd = cwd, exists = false)` | `Promise<string \| null>` | File-oriented resolution. Checks the path directly, then tries each extension and `index` file. |
4444

4545
### Exported Helpers
4646

@@ -58,6 +58,7 @@ const loader = new FileLoader(new NodeFS());
5858

5959
const source = await loader.absolute('@/src/index.ts');
6060
const relative = loader.relative('/project/src/a.ts', '/project/src/utils/b.ts');
61+
const resolved = await loader.resolveFile('./plugin/foo', ['.ts', '.js']);
6162
const config = await loader.import<Record<string, unknown>>('./package.json');
6263
```
6364

0 commit comments

Comments
 (0)