@mdit-vue/types
Shared types definition of mdit-vue
Last updated 18 days ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @mdit-vue/types 
SYNC missed versions from official npm registry.

@mdit-vue/types

npm

Shared types definition of mdit-vue.

Install

npm i @mdit-vue/types

Usage

Define a markdown-it plugin with optional typed options:

import type { MarkdownItPlugin } from '@mdit-vue/types';

interface PluginOptions {
  breaks?: boolean;
}

const plugin: MarkdownItPlugin<PluginOptions> = (
  md,
  { breaks = false } = {},
) => {
  md.set({ breaks });
};

Use MarkdownItBlockRule and MarkdownItInlineRule for block and inline parser rules. Both types are derived from markdown-it's native ruler signatures.

Add more properties to env via TypeScript module augmentation:

import type { Env } from 'markdown-it';
import MarkdownIt from 'markdown-it';

declare module 'markdown-it' {
  interface Env {
    foo?: string[];
  }
}

const md = MarkdownIt({ html: true });
const env: Env = {};
const rendered = md.render('raw markdown text', env);

Current Tags

  • 4.0.0                                ...           latest (18 days ago)

17 Versions

  • 4.0.0                                ...           18 days ago
  • 3.0.2                                ...           a year ago
  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.1.4                                ...           2 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.12.0                                ...           4 years ago
  • 0.11.0                                ...           4 years ago
  • 0.10.0                                ...           4 years ago
  • 0.9.2                                ...           4 years ago
  • 0.9.0                                ...           4 years ago
  • 0.8.0                                ...           4 years ago
  • 0.7.1                                ...           4 years ago
  • 0.7.0                                ...           4 years ago
  • 0.6.0                                ...           4 years ago
Maintainers (1)
Downloads
Total 56
Today 0
This Week 0
This Month 44
Last Day 0
Last Week 36
Last Month 10
Dependencies (1)
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE