@irwinproject/storybook-addon-tsdoc
Version:
Generate mdx documentation from your typescript!
13 lines (12 loc) • 633 B
TypeScript
import { SyntaxKindDelegateAction, SyntaxKindMap } from "./SyntaxKindDelegator.types";
import { SyntaxKindTypeMap } from "./SyntaxKindMap";
import { Nodely } from "./types";
/**
* Uses a syntax kind to delegate actions to allow for automatic type based on syntax kind.
* @param node
* @param skMap
* @param defaultFN
* @returns
*/
export declare const bySyntax: <T>(node: Nodely, skMap: Partial<SyntaxKindMap<T>>, defaultFN: (node: Nodely) => T) => T;
export declare const combineSyntax: <K extends keyof SyntaxKindTypeMap, T>(keys: K[], action: SyntaxKindDelegateAction<SyntaxKindTypeMap[K], T>) => Partial<SyntaxKindMap<T>>;