UNPKG

@muban/muban

Version:

Writing components for server-rendered HTML

24 lines (23 loc) 1 kB
import type { InternalComponentInstance } from '../Component.types'; import type { ComponentRefItem, ComponentRefItemShortcuts, ResolvedComponentRefItem, TypedRefs } from './refDefinitions.types'; /** * Checks if a passed ref is a shortcut or not * TODO: also support Component shortcuts? * * @param refDefinition */ export declare function isRefItemShortcut(refDefinition: ComponentRefItem): refDefinition is ComponentRefItemShortcuts; /** * Convert "string" and "queryFn" shortcut refs to refElements * @param refs */ export declare function normalizeRefs<R extends Record<string, ComponentRefItem>>(refs: R): { [P in keyof R]: ResolvedComponentRefItem; }; /** * Turns `refDefinitions` passed to the component definitions into "objects" that * are passed as `refs` to the setup function * @param refs * @param instance */ export declare function createComponentRefs<R extends Record<string, ComponentRefItem>>(refs: R | undefined, instance: InternalComponentInstance): TypedRefs<R>;