@rshirohara/repixe-rekurke
Version:
repixe plugin that turns pixiv novel format into kakuyomu novel format to support rekurke.
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 kkast tree.
* Discards result.
*/
type TransformBridge = (tree: PxastRoot, file: VFile) => Promise<undefined>;
/**
* Mutate-mode.
*
* Further transformers run on the kkast tree.
*/
type TransformMutate = (tree: PxastRoot, file: VFile) => KkastRoot;
/**
* Turn pixiv novel format into Kakuyomu novel format.
*
* ##### Notes
*
* ###### Signature
*
* - 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 repixeRekurke(destination?: Readonly<Options> | Processor | null, options?: Readonly<Options> | null): TransformBridge | TransformMutate;
export {};
//# sourceMappingURL=index.d.ts.map