@ngneat/overview
Version:
The Template for Success in Template Management
35 lines (34 loc) • 1.73 kB
TypeScript
import { EnvironmentInjector, InjectionToken, Injector, Signal, TemplateRef, Type, ViewContainerRef } from '@angular/core';
import { Content, ViewRef } from './types';
import { TplRef } from './template-ref';
import { StringRef } from './string-ref';
import { CompRef } from './comp-ref';
import * as i0 from "@angular/core";
interface _ViewOptions {
vcr?: ViewContainerRef | undefined;
injector?: Injector | undefined;
}
interface TemplateViewOptions extends _ViewOptions {
context?: Record<string, any> | undefined;
}
interface CompViewOptions<Context = any> extends _ViewOptions {
environmentInjector?: EnvironmentInjector | undefined;
context?: Context | undefined;
}
export type ViewOptions<Context = any> = _ViewOptions & CompViewOptions<Context> & TemplateViewOptions;
export declare const VIEW_CONTEXT: InjectionToken<Signal<unknown>>;
export declare class ViewService {
private injector;
private appRef;
private environmentInjector;
createComponent<Comp, Context>(component: Type<Comp>, options?: CompViewOptions<Context>): CompRef<Comp, Context>;
createTemplate<Context>(tpl: TemplateRef<Context>, options?: TemplateViewOptions): TplRef<Record<string, any>>;
createView<Comp, Context>(content: Type<Comp>, viewOptions: CompViewOptions<Context>): CompRef<Comp, Context>;
createView<T>(content: TemplateRef<T>, viewOptions: TemplateViewOptions): TplRef<T>;
createView(content: string): StringRef;
createView(content: Content, viewOptions?: ViewOptions): ViewRef;
static ɵfac: i0.ɵɵFactoryDeclaration<ViewService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ViewService>;
}
export declare function injectViewContext<T>(): Signal<T>;
export {};