remark-textr
Version:
remark plugin to improve typography with Textr
34 lines • 1.14 kB
TypeScript
/**
* Improve typography with Textr.
*
* @param {Readonly<Options> | null | undefined} [options]
* Configuration (optional).
* @returns
* Transform.
*/
export default function remarkTextr(options?: Readonly<Options> | null | undefined): ((tree: Root) => undefined) | ((tree: Root) => Promise<undefined>);
export type Root = import('mdast').Root;
/**
* Configuration.
*/
export type Options = {
/**
* Configuration passed to `textr`;
* for example, you may want to set the ISO 639-1 locale code of the content,
* which is important for stuff like the correct primary and secondary quotes
*/
options?: object | null | undefined;
/**
* Textr plugins;
* if strings are passed in, those are loaded with `import`.
*/
plugins?: ReadonlyArray<TextrPlugin | string> | null | undefined;
};
/**
* Textr plugin.
*
* Textr plugins are available on npm labelled with a `textr` keyword.
* You can also create them yourself, as shown in the example above.
*/
export type TextrPlugin = (value: string, options: object) => string | null | undefined | void;
//# sourceMappingURL=index.d.ts.map