@irwinproject/storybook-addon-tsdoc
Version:
Generate mdx documentation from your typescript!
63 lines (62 loc) • 2.09 kB
TypeScript
import { Node } from "ts-morph";
import { Nodely } from "./types";
/**
* Creates a kind decorator
* @param kind
* @returns
*/
export declare const $kind: (kind: string) => string;
/**
* Creates a type decorator
* @param type
* @returns
*/
export declare const $type: (type: string) => string;
/**
* Creates a literal decorator
* @param lit
* @returns
*/
export declare const $literal: (lit: string) => string;
/**
* Creates a link to a reference.
* @param text
* @param href
* @returns
*/
export declare const $href: (text: string, href: string) => string;
/**
* Just a convenience that can be used anywhere.
*
* My new traversal method of types may prevent expressions from being handled however if not this is a good point to add support that does not directly effect the signature process.
*/
export declare const $link: (node: Node) => string;
/**
* Creates a name decorator
* @param text
* @returns
*/
export declare const $name: (text: string) => string;
/**
* Because types are often just a string a template string array is a convenience.
* @param strings
* @param args
* @returns
*/
export declare const $kd: (strings: TemplateStringsArray, ...args: unknown[]) => string;
export declare const $reg: (...strings: unknown[]) => string;
export type Headings = 1 | 2 | 3 | 4 | 5 | 6;
/**
* Create a title section that allows for a more dynamic naming then what .mdx typically supports.
*
* This is accomplished by visibly hiding the default header and positioning a new header elements over the original header. this will replicate the scroll effect while allowing a more descriptive title.
* @param s
* @param node
* @param content
* @returns
*/
export declare const $h: (s: Headings, node: Nodely, ...content: unknown[]) => string;
export declare const $doc: (data: string, title: string) => string;
export declare const $s: (s: Headings, kind: string, node: Node) => string;
export declare const $t: (s: Headings) => (strings: TemplateStringsArray, ...args: unknown[]) => string;
export declare const $section: (...content: string[]) => string;