@mdfriday/shortcode
Version:
A flexible component-based shortcode system for Markdown content with theme support
53 lines (52 loc) • 1.57 kB
TypeScript
import { ComponentVariant, Theme, ThemeComponent, ThemeComponents } from '../types';
/**
* Components registry implementation
*/
export declare class ThemeComponentsRegistry implements ThemeComponents {
/**
* Map of components, keyed by name
*/
private components;
/**
* Create a new ThemeComponentsRegistry
*/
constructor();
/**
* Register a component
* @param component The component to register
*/
registerComponent(component: ThemeComponent): void;
/**
* Get a component by name
* @param name The component name
* @returns The component
*/
getComponent(name: string): ThemeComponent;
/**
* Get all components
* @returns All components
*/
getAllComponents(): ThemeComponent[];
/**
* Generate CSS for all components
* @param theme The jsons
* @param prefix Optional prefix for CSS classes
* @returns The CSS string
*/
generateAllComponentsCSS(theme: Theme, prefix?: string): string;
/**
* Register default components
*/
private registerDefaultComponents;
/**
* Create a component from a jsons component variant
* @param name The component name
* @param variant The component variant
* @returns The component
*/
createComponentFromVariant(name: string, variant: ComponentVariant): ThemeComponent;
}
export { BaseComponent } from './base-component';
export { ButtonComponent } from './button';
export { CardComponent } from './card';
export { InputComponent } from './input';