piral-core
Version:
The core library for creating a Piral instance.
17 lines (16 loc) • 760 B
TypeScript
import * as React from 'react';
import type { ExtensionComponentProps, WrappedComponent } from '../types';
/**
* Transforms the given component to an extension component.
* @param Component The component to transform.
* @returns The extension component (receiving its props via params).
*/
export declare function toExtension<T>(Component: React.ComponentType<T>): WrappedComponent<ExtensionComponentProps<T>>;
/**
* Reactifies the list of child nodes to a React Node by removing the
* nodes from the DOM and carrying it in a React Node, where it would be
* attached at a slot.
* @param childNodes The child nodes to reactify.
* @returns The React Node.
*/
export declare function reactifyContent(childNodes: NodeListOf<ChildNode>): React.ReactNode;