import { Type, ViewContainerRef, ComponentRef, EmbeddedViewRef } from "@angular/core"; import { SlotValue, RenderSlotOptions, SlotRegistryEntry } from "./slot.types"; /** * Renders a slot value into a ViewContainerRef. * This is the core utility for slot rendering. * * @param viewContainer - The ViewContainerRef to render into * @param options - Options for rendering the slot * @returns The created component or embedded view reference * * @example * ```typescript * export class MyComponent { * @ViewChild('container', { read: ViewContainerRef }) container!: ViewContainerRef; * * renderButton() { * renderSlot(this.container, { * slot: this.buttonOverride, * defaultComponent: DefaultButton, * props: { text: 'Click me' }, * outputs: { click: (event) => this.handleClick(event) } * }); * } * } * ``` */ export declare function renderSlot(viewContainer: ViewContainerRef, options: RenderSlotOptions): ComponentRef | EmbeddedViewRef | null; /** * Checks if a value is a component type. * Simplified check - rely on try/catch for actual validation. */ export declare function isComponentType(value: any): boolean; /** * Checks if a value is a valid slot value. */ export declare function isSlotValue(value: any): value is SlotValue; /** * Normalizes a slot value to a consistent format. */ export declare function normalizeSlotValue(value: SlotValue | undefined, defaultComponent: Type | undefined): SlotRegistryEntry; /** * Creates a slot configuration map for a component. * * @example * ```typescript * const slots = createSlotConfig({ standalone: true, * sendButton: CustomSendButton, * toolbar: 'custom-toolbar-class', * footer: footerTemplate * }, { * sendButton: DefaultSendButton, * toolbar: DefaultToolbar, * footer: DefaultFooter * }); * ``` */ export declare function createSlotConfig>>(overrides: Partial>, defaults: T): Map; /** * Provides slot configuration to child components via DI. * * @example * ```typescript * @Component({ standalone: true, * providers: [ * provideSlots({ * sendButton: CustomSendButton, * toolbar: CustomToolbar * }) * ] * }) * ``` */ export declare function provideSlots(slots: Record>): { provide: import("@angular/core").InjectionToken>>; useValue: Map>; }; /** * Gets slot configuration from DI. * Must be called within an injection context. * * @example * ```typescript * export class MyComponent { * slots = getSlotConfig(); * * ngOnInit() { * const sendButton = this.slots?.get('sendButton'); * } * } * ``` */ export declare function getSlotConfig(): ReadonlyMap | null; /** * Creates a render function for a specific slot. * Useful for creating reusable slot renderers. * * @example * ```typescript * const renderSendButton = createSlotRenderer( * DefaultSendButton, * 'sendButton' * ); * * // Later in template * renderSendButton(this.viewContainer, this.sendButtonOverride); * ``` */ export declare function createSlotRenderer(defaultComponent: Type, slotName?: string): (viewContainer: ViewContainerRef, slot?: SlotValue, props?: Partial, outputs?: Record void>) => ComponentRef | EmbeddedViewRef;