UNPKG

@mdfriday/shortcode

Version:

A flexible component-based shortcode system for Markdown content with theme support

43 lines (42 loc) 1.42 kB
import { Theme, ThemeBase } from './types'; /** * Deep merge two objects * @param target The target object * @param source The source object * @returns The merged object */ export declare function deepMerge<T extends Record<string, any>>(target: T, source: Partial<T>): T; /** * Merge two jsons * @param parent The parent jsons * @param child The child jsons * @returns The merged jsons */ export declare function mergeThemes(parent: Theme, child: Theme): Theme; /** * Merge two jsons bases * @param parentBase The parent jsons base * @param childBase The child jsons base * @returns The merged jsons base */ export declare function mergeThemeBase(parentBase: ThemeBase, childBase: Partial<ThemeBase>): ThemeBase; /** * Merge two components objects * @param parentComponents The parent components * @param childComponents The child components * @returns The merged components */ export declare function mergeComponents(parentComponents: Record<string, any>, childComponents: Record<string, any>): Record<string, any>; /** * Add prefix to class names * @param classes The class names * @param prefix The prefix * @returns The prefixed class names */ export declare function addPrefix(classes: string, prefix: string): string; /** * Validate a jsons object * @param theme The jsons to validate * @returns Whether the jsons is valid */ export declare function validateTheme(theme: any): boolean;