UNPKG

@curvenote/schema

Version:

Schema and markdown parser for @curvenote/editor

24 lines (23 loc) 1.09 kB
import type { GenericNode } from 'mystjs'; import type { MarkSpec } from 'prosemirror-model'; import type { MystNode, Abbreviation, Emphasis, InlineCode, Link, Strong, Subscript, Superscript, Underline, Strikethrough } from './spec'; import type { Props } from './nodes/types'; import type { MdastOptions } from './serialize/types'; export interface MyMarkSpec<N extends MystNode> extends MarkSpec { attrsFromMyst: (t: GenericNode) => Record<string, any>; toMyst: (props: Props, opts: MdastOptions) => N; } export declare type LinkAttrs = { href: string; title: string | null; kind: string; }; export declare const link: MyMarkSpec<Link>; export declare const code: MyMarkSpec<InlineCode>; export declare const em: MyMarkSpec<Emphasis>; export declare const strong: MyMarkSpec<Strong>; export declare const superscript: MyMarkSpec<Superscript>; export declare const subscript: MyMarkSpec<Subscript>; export declare const strikethrough: MyMarkSpec<Strikethrough>; export declare const underline: MyMarkSpec<Underline>; export declare const abbr: MyMarkSpec<Abbreviation>;