Rewrite store JSDoc, split quote/order into modules, and generate typed API docs
- Rewrite JSDoc across all store methods to document the actual async methods (real params, returns, throws) instead of the internal wrappers - Split quote/order into individual module files backed by shared manifestDoc helpers; remove the createStore factory and thin wrappers - Deduplicate manifest line helpers into src/store/manifestLines.js - Extend generate-api-doc.js to render parameter/return/throws types and emit per-namespace API.<module>.md files with an API.md index - Regenerate all API docs
This commit is contained in:
40
API.pic.md
40
API.pic.md
@@ -8,9 +8,25 @@ This document is auto-generated from the JSDoc comments in `src/store` by runnin
|
||||
|
||||
Returns the full-size image (AVIF) for a given hash.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `fullHash` | `string` | The full image hash. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{buffer: Buffer, w: number, h: number, size: number, contentType: string}>` — The full image.
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the image is not found.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = getImageByHash(pool);
|
||||
const image = await fn(42, 'abc123');
|
||||
const image = await store.pic.getImageByHash(42, 'abc123');
|
||||
// => { buffer, w, h, size, contentType: 'image/avif' }
|
||||
```
|
||||
|
||||
@@ -20,8 +36,24 @@ const image = await fn(42, 'abc123');
|
||||
|
||||
Returns the thumbnail image (AVIF) for a given hash.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `fullHash` | `string` | The full image hash. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{buffer: Buffer, w: number, h: number, contentType: string}>` — The thumbnail image.
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the image is not found.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = getThumbByHash(pool);
|
||||
const thumb = await fn(42, 'abc123');
|
||||
const thumb = await store.pic.getThumbByHash(42, 'abc123');
|
||||
// => { buffer, w, h, contentType: 'image/avif' }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user