@types/markdown-magic
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Installation

npm install --save @types/markdown-magic

Summary

This package contains type definitions for markdown-magic (https://github.com/DavidWells/markdown-magic#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/markdown-magic.

index.d.ts

/**
 * @param path Path or glob pattern
 * @param config See configuration options below
 * @param callback callback to run after markdown updates
 */
declare function markdownMagic(
    path: string | readonly string[],
    config?: markdownMagic.Configuration,
    callback?: markdownMagic.Callback,
): void;

declare namespace markdownMagic {
    interface Configuration {
        /**
         * Custom commands to transform block contents, see transforms & custom transforms sections below.
         */
        transforms?: {
            [name: string]: TransformFunction;
        } | undefined;
        /**
         * Change output path of new content. Default behavior is replacing the original file
         */
        outputDir?: string | undefined;
        /**
         * Comment pattern to look for & replace inner contents. Default AUTO-GENERATED-CONTENT
         */
        matchWord?: string | undefined;
        /**
         * set debug flag to true to inspect the process
         */
        DEBUG?: boolean | undefined;
    }

    /**
     *  transform function
     */
    interface TransformFunction {
        (content: string, options: any): string;
    }

    interface ProcessedConfig extends Configuration {
        readonly outputFilePath: string;
        readonly originalPath: string;
        readonly outputDir: string;
        readonly outputContent: string;
    }

    interface Callback {
        (error: Error | undefined, output: readonly ProcessedConfig[]): void;
    }
}

export = markdownMagic;

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by Piotr Błażejewicz (Peter Blazejewicz).

Readme

Keywords

none

Package Sidebar

Install

npm i @types/markdown-magic

Weekly Downloads

214

Version

1.0.4

License

MIT

Unpacked Size

5.72 kB

Total Files

5

Last publish

Collaborators

  • types