mirror of
https://github.com/sern-handler/website
synced 2026-06-28 02:32:23 +00:00
feat: migrate to starlight
This commit is contained in:
24
node_modules/rehype-stringify/lib/index.d.ts
generated
vendored
Normal file
24
node_modules/rehype-stringify/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Plugin to add support for serializing as HTML.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration (optional).
|
||||
* @returns {undefined}
|
||||
* Nothing.
|
||||
*/
|
||||
export default function rehypeStringify(options?: Options | null | undefined): undefined;
|
||||
export default class rehypeStringify {
|
||||
/**
|
||||
* Plugin to add support for serializing as HTML.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration (optional).
|
||||
* @returns {undefined}
|
||||
* Nothing.
|
||||
*/
|
||||
constructor(options?: Options | null | undefined);
|
||||
compiler: (tree: import("hast").Root, file: import("vfile").VFile) => string;
|
||||
}
|
||||
export type Root = import('hast').Root;
|
||||
export type Options = import('hast-util-to-html').Options;
|
||||
export type Compiler = import('unified').Compiler<Root, string>;
|
||||
31
node_modules/rehype-stringify/lib/index.js
generated
vendored
Normal file
31
node_modules/rehype-stringify/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @typedef {import('hast').Root} Root
|
||||
* @typedef {import('hast-util-to-html').Options} Options
|
||||
* @typedef {import('unified').Compiler<Root, string>} Compiler
|
||||
*/
|
||||
|
||||
import {toHtml} from 'hast-util-to-html'
|
||||
|
||||
/**
|
||||
* Plugin to add support for serializing as HTML.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration (optional).
|
||||
* @returns {undefined}
|
||||
* Nothing.
|
||||
*/
|
||||
export default function rehypeStringify(options) {
|
||||
/** @type {import('unified').Processor<undefined, undefined, undefined, Root, string>} */
|
||||
// @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.
|
||||
const self = this
|
||||
const settings = {...self.data('settings'), ...options}
|
||||
|
||||
self.compiler = compiler
|
||||
|
||||
/**
|
||||
* @type {Compiler}
|
||||
*/
|
||||
function compiler(tree) {
|
||||
return toHtml(tree, settings)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user