unified

Project: unified-doc/unified-doc

Package: unified-doc-types@2.0.3

  1. Dependencies: 0·Dependents: 5
  2. unified-doc typescript typings.
  1. unified 168
  2. unist 120
  3. hast 62
  4. file 32
  5. content 17
  6. document 11
  7. doc 8
  8. typescript 3

unified-doc-types

unified-doc typescript typings.


Install

npm install unified-doc-types

Use

import { FileData, Mark, SearchResult } from 'unified-doc-types';

const fileData: FileData = {
  content: '> **some** markdown content',
  extension: '.md',
  name: 'doc.md',
  stem: 'name',
  type: 'text/markdown'
};

const marks: Mark[] = [
  { id: 'a', start: 0, end: 5, classNames: ['class-a', 'class-b'] },
  { id: 'b', start: 0, end: 5, style: { background: 'red' }, data: { custom: true } },
];

const results: SearchResult[] = [
  { start: 0, end: 2, value: 'so', data: { weight: 2 } },
  { start: 6, end: 8, value: 'rk', data: { weight: 5 } },
];