@mdfriday/shortcode
Version:
A flexible component-based shortcode system for Markdown content with theme support
29 lines (28 loc) • 953 B
TypeScript
import { ThemeManager } from '../themes';
/**
* Parameter extraction helper
* @param params Array of parameter strings in format "name=value"
* @param name Parameter name to extract
* @returns The extracted parameter value or undefined
*/
export declare const getParam: (params: string[], name: string) => string | undefined;
/**
* Common data provider interface
*/
export interface CommonDataProviderOptions {
componentName: string;
defaultValues?: Record<string, any>;
additionalProps?: string[];
}
/**
* Creates a common data provider function for shortcode components
* @param theme Theme manager instance
* @param options Component options
* @returns Data provider function
*/
export declare function createDataProvider(theme: ThemeManager, options: CommonDataProviderOptions): (params: string[], content?: string) => {
id: string | undefined;
classes: string;
content: string | undefined;
disabled: any;
};