docs: add JSDoc headers to all externally exported store functions
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
import { GET_FULL_BY_HASH } from '../../sql/pic.js';
|
||||
import resolvePicAccess from './resolvePicAccess.js';
|
||||
|
||||
/**
|
||||
* Returns the full-size image (AVIF) for a given hash.
|
||||
*
|
||||
* @param {object} pool - The mssql connection pool.
|
||||
* @returns {Function} An async function that fetches a full image by hash.
|
||||
*
|
||||
* @example
|
||||
* const fn = getImageByHash(pool);
|
||||
* const image = await fn(42, 'abc123');
|
||||
* // => { buffer, w, h, size, contentType: 'image/avif' }
|
||||
*/
|
||||
export default function getImageByHash(pool) {
|
||||
const authorize = resolvePicAccess(pool);
|
||||
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
import { GET_THUMB_BY_HASH } from '../../sql/pic.js';
|
||||
import resolvePicAccess from './resolvePicAccess.js';
|
||||
|
||||
/**
|
||||
* Returns the thumbnail image (AVIF) for a given hash.
|
||||
*
|
||||
* @param {object} pool - The mssql connection pool.
|
||||
* @returns {Function} An async function that fetches a thumbnail by hash.
|
||||
*
|
||||
* @example
|
||||
* const fn = getThumbByHash(pool);
|
||||
* const thumb = await fn(42, 'abc123');
|
||||
* // => { buffer, w, h, contentType: 'image/avif' }
|
||||
*/
|
||||
export default function getThumbByHash(pool) {
|
||||
const authorize = resolvePicAccess(pool);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user