@rshirohara/rekurke-repixe
Version:
rekurke plugin that turns kakuyomu novel format into pixiv novel format to support repixe.
42 lines • 1.37 kB
TypeScript
import type { Root as KkastRoot } from "@rshirohara/kkast";
import type { Root as PxastRoot } from "@rshirohara/pxast";
import type { Processor } from "unified";
import type { VFile } from "vfile";
import type { Options } from "./lib/options.js";
/**
* Bridge-mode.
*
* Runs the destination with the new pxast tree.
* Discards result.
*/
type TransformBridge = (tree: KkastRoot, file: VFile) => Promise<undefined>;
/**
* Mutate-mode.
*
* Further transformers run on the pxast tree.
*/
type TransformMutate = (tree: KkastRoot, file: VFile) => PxastRoot;
/**
* Turn Kakuyomu novel format into Pixiv novel format.
*
* ##### Notes
*
* ###### Sigunature
*
* - if a processor is given, runs the (rekurke) plugins used on it with a
* kkast tree, then discards the result. (*bridge mode*)
* - otherwise, returns a kkast tree, the plugins used after `repixeRekurke`
* are rekurke plugins. (*mutate mode*)
*
* @overload
* @param {Processor} processor
* @param {Readonly<Options> | null | undefined} options
* @returns {TransformBridge}
*
* @overload
* @param {Readonly<Options> | null | undefined} options
* @returns {TransformMutate}
*/
export declare function rekurkeRepixe(destination?: Readonly<Options> | Processor | null, options?: Readonly<Options> | null): TransformBridge | TransformMutate;
export {};
//# sourceMappingURL=index.d.ts.map