UNPKG

@muban/muban

Version:

Writing components for server-rendered HTML

11 lines (10 loc) 887 B
import type { RefElementType, ResolvedComponentRefItem, TypedRefs } from '../refs/refDefinitions.types'; import type { PropTypeDefinition, PropTypeInfo } from './propDefinitions.types'; export declare type PropertySource = (componentElement: RefElementType) => { sourceName: string; hasProp: (info: PropTypeInfo) => boolean; getProp: (info: PropTypeInfo) => unknown; }; export declare function getValueFromMultipleSources(propInfo: Array<PropTypeInfo>, sources: Array<ReturnType<PropertySource>>): unknown; export declare function getValueFromSource(propInfo: PropTypeInfo, sources: Array<ReturnType<PropertySource>>): unknown; export declare function getComponentProps(props: Record<string, PropTypeDefinition> | undefined, element: RefElementType, propertySources: Array<PropertySource>, refs: TypedRefs<Record<string, ResolvedComponentRefItem>>): Record<string, unknown>;