import * as i0 from '@angular/core'; import { Injector, Type, OnChanges, OnDestroy, ElementRef, ChangeDetectorRef, OnInit, ViewContainerRef, ComponentRef, ComponentFactoryResolver, SimpleChanges, EventEmitter, PipeTransform } from '@angular/core'; import { GetSchemes, ClassicPreset, NodeId, BaseSchemes, Scope, CanAssignSignal, ConnectionId } from 'rete'; import { SocketPositionWatcher } from 'rete-render-utils'; import { NgElement as NgElement$1, NgElementStrategy } from '@angular/elements'; import * as i1 from '@angular/common'; import { KeyValue } from '@angular/common'; type NgElement = NgElement$1 & { ngElementStrategy: NgElementStrategy & { setInputValue(key: string, value: any): void; }; }; type Position$1 = { x: number; y: number; }; type RenderSignal = { type: 'render'; data: { element: HTMLElement; filled?: boolean; type: Type; } & Data; } | { type: 'rendered'; data: { element: HTMLElement; type: Type; } & Data; }; type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; type GetControls> = Intersection[keyof Intersection] extends ClassicPreset.Control ? Intersection[keyof Intersection] : ClassicPreset.Control; type GetSockets, Union = Exclude> = Union extends { socket: any; } ? Union['socket'] : ClassicPreset.Socket; type Side = 'input' | 'output'; type ExtractPayload = Extract, { type: 'render'; data: { type: K; }; }>['data']; type AngularArea2D = RenderSignal<'node', { payload: T['Node']; }> | RenderSignal<'connection', { payload: T['Connection']; start?: Position$1; end?: Position$1; }> | RenderSignal<'socket', { payload: GetSockets; nodeId: NodeId; side: Side; key: string; }> | RenderSignal<'control', { payload: GetControls; }> | { type: 'unmount'; data: { element: HTMLElement; }; }; type ClassicScheme = GetSchemes & { isLoop?: boolean; }>; type Item$1 = { key: string; ngElement: NgElement; }; type Renderer = { get(element: HTMLElement): Item$1 | undefined; mount(element: HTMLElement, key: string, component: any, injector: Injector, props: Record): void; update(item: Item$1, props: Record): void; unmount(element: HTMLElement): void; }; /** * Signals that can be emitted by the plugin * @priority 10 */ type Produces = { type: 'connectionpath'; data: { payload: Schemes['Connection']; path?: string; points: Position$1[]; }; }; type Requires = RenderSignal<'node', { payload: Schemes['Node']; }> | RenderSignal<'connection', { payload: Schemes['Connection']; start?: Position$1; end?: Position$1; }> | { type: 'unmount'; data: { element: HTMLElement; }; }; /** * Angular plugin. Renders nodes, connections and other elements using React. * @priority 9 * @emits connectionpath * @listens render * @listens unmount */ declare class AngularPlugin> extends Scope, [Requires | T]> { private params; presets: RenderPreset[]; renderer: Renderer; owners: WeakMap>; /** * @constructor * @param params Plugin properties * @param params.injector Angular's Injector instance */ constructor(params: { injector: Injector; }); setParent(scope: Scope | T>): void; private unmount; private mount; /** * Adds a preset to the plugin. * @param preset Preset that can render nodes, connections and other elements. */ addPreset(preset: RenderPreset extends true ? K : 'Cannot apply preset. Provided signals are not compatible'>): void; } type RenderPreset = { attach?: (plugin: AngularPlugin) => void; update: (context: Extract, plugin: AngularPlugin) => Record | undefined | null | void; mount: (context: Extract, plugin: AngularPlugin) => { key: string; component: any; props: Record; } | undefined | null | void; }; type AngularComponent = Type; type CustomizationProps = { node?: (data: ExtractPayload) => AngularComponent | null; connection?: (data: ExtractPayload) => AngularComponent | null; socket?: (data: ExtractPayload) => AngularComponent | null; control?: (data: ExtractPayload) => AngularComponent | null; }; type ClassicProps = { socketPositionWatcher?: SocketPositionWatcher>; customize?: CustomizationProps; }; /** * Classic preset for rendering nodes, connections, controls and sockets. */ declare function setup$3>(props?: ClassicProps): RenderPreset; declare namespace index_d$4 { export { setup$3 as setup, }; } type Item = { label: string; key: string; handler(): void; subitems?: Item[]; }; type ContextMenuRender = RenderSignal<'contextmenu', { items: Item[]; onHide(): void; searchBar?: boolean; }>; /** * Preset for rendering context menu. */ declare function setup$2(props?: { delay?: number; }): RenderPreset; declare namespace index_d$3 { export { setup$2 as setup, }; } type Rect = { width: number; height: number; left: number; top: number; }; type Transform = { x: number; y: number; k: number; }; type Translate = (dx: number, dy: number) => void; type MinimapData = { ratio: number; nodes: Rect[]; viewport: Rect; start(): Transform; translate: Translate; point(x: number, y: number): void; }; type MinimapRender = RenderSignal<'minimap', MinimapData>; /** * Preset for rendering minimap. */ declare function setup$1(props?: { size?: number; }): RenderPreset; declare namespace index_d$2 { export { setup$1 as setup, }; } type Position = { x: number; y: number; }; type Pin = { id: string; position: Position; selected?: boolean; }; type PinData = { id: ConnectionId; pins: Pin[]; }; type PinsRender = RenderSignal<'reroute-pins', { data: PinData; }>; type Props = { translate?: (id: string, dx: number, dy: number) => void; contextMenu?: (id: string) => void; pointerdown?: (id: string) => void; }; /** * Preset for rendering pins. */ declare function setup(props?: Props): RenderPreset; declare const index_d$1_setup: typeof setup; declare namespace index_d$1 { export { index_d$1_setup as setup, }; } /** * Built-in presets, responsible for rendering different parts of the editor. * @module */ declare namespace index_d { export { index_d$4 as classic, index_d$3 as contextMenu, index_d$2 as minimap, index_d$1 as reroute, }; } declare class RefDirective implements OnChanges, OnDestroy { private el; data: any; emit: any; constructor(el: ElementRef); ngOnChanges(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } type NodeExtraData = { width?: number; height?: number; }; type SortValue = (N['controls'] | N['inputs'] | N['outputs'])[string]; declare class NodeComponent implements OnChanges { private cdr; data: ClassicPreset.Node & NodeExtraData; emit: (data: any) => void; rendered: () => void; seed: number; get width(): number; get height(): number; get selected(): boolean; constructor(cdr: ChangeDetectorRef); ngOnChanges(): void; sortByIndex>>(a: I, b: I): number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ConnectionComponent { data: ClassicPreset.Connection; start: Position$1; end: Position$1; path: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } type PositionWatcher = (cb: (value: Position$1) => void) => (() => void); declare class ConnectionWrapperComponent implements OnInit, OnChanges { private cdr; viewContainerRef: ViewContainerRef; private componentFactoryResolver; data: ClassicPreset.Connection; start: Position$1 | PositionWatcher; end: Position$1 | PositionWatcher; path: (start: Position$1, end: Position$1) => Promise; rendered: any; connectionComponent: any; ref: ComponentRef; startOb: Position$1 | null; get _start(): Position$1 | null; endOb: Position$1 | null; get _end(): Position$1 | null; _path: string; constructor(cdr: ChangeDetectorRef, viewContainerRef: ViewContainerRef, componentFactoryResolver: ComponentFactoryResolver); ngOnChanges(): Promise; updatePath(): Promise; ngOnInit(): void; update(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SocketComponent implements OnChanges { private cdr; data: any; rendered: any; get title(): any; constructor(cdr: ChangeDetectorRef); ngOnChanges(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ControlComponent implements OnChanges { private cdr; data: ClassicPreset.InputControl; rendered: any; pointerdown(event: any): void; constructor(cdr: ChangeDetectorRef); ngOnChanges(changes: SimpleChanges): void; onChange(e: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "ng-component", never, { "data": { "alias": "data"; "required": false; }; "rendered": { "alias": "rendered"; "required": false; }; }, {}, never, never, true, never>; } declare class ReteModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class ContextMenuComponent implements OnChanges, OnDestroy { private cdr; items: Item[]; delay: number; searchBar?: boolean; onHide: () => void; rendered: () => void; filter: string; hide: { timeout: null | number; cancel(): void; call(delay: number): void; }; customAttribute: string; pointerover(): void; pointerleave(): void; constructor(cdr: ChangeDetectorRef); ngOnChanges(): void; setFilter(value: string): void; getItems(): Item[]; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ContextMenuSearchComponent { value: string; update: EventEmitter; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ContextMenuItemComponent { private cdr; subitems?: Item[]; delay: number; select: EventEmitter; hide: EventEmitter; get block(): boolean; get hasSubitems(): Item[]; click(event: MouseEvent): void; pointerdown(event: PointerEvent): void; wheel(event: MouseEvent): void; hideSubitems: { timeout: null | number; cancel(): void; call(delay: number): void; }; visibleSubitems: boolean; pointerover(): void; pointerleave(): void; constructor(cdr: ChangeDetectorRef); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ReteContextMenuModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class MinimapComponent implements OnChanges { el: ElementRef; private cdr; rendered: () => void; size: number; ratio: MinimapData['ratio']; nodes: MinimapData['nodes']; viewport: MinimapData['viewport']; translate: MinimapData['translate']; point: MinimapData['point']; get width(): string; get height(): string; pointerdown(event: PointerEvent): void; dblclick(event: MouseEvent): void; constructor(el: ElementRef, cdr: ChangeDetectorRef); ngOnChanges(): void; px(value: number): string; scale(value: number): number; identifyMiniNode(_: number, item: MinimapData['nodes'][number]): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class MiniViewportComponent { left: number; top: number; width: number; height: number; containerWidth: number; translate: MinimapData['translate']; drag: { start(e: { pageX: number; pageY: number; }): void; }; get styleLeft(): string; get styleTop(): string; get styleWidth(): string; get styleHeight(): string; pointerdown(event: PointerEvent): void; px(value: number): string; scale(v: number): number; invert(v: number): number; onDrag(dx: number, dy: number): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class MiniNodeComponent { left: number; top: number; width: number; height: number; get styleLeft(): string; get styleTop(): string; get styleWidth(): string; get styleHeight(): string; px(value: number): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ReteMinimapModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class PinsComponent implements OnChanges { private cdr; rendered: () => void; pins: PinData['pins']; down?: (id: string) => void; translate?: (id: string, dx: number, dy: number) => void; menu?: (id: string) => void; getPointer?: () => Position; constructor(cdr: ChangeDetectorRef); ngOnChanges(): void; track(_: number, item: Pin): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class PinComponent implements OnChanges { private cdr; position: Position; selected?: boolean; getPointer: () => Position; menu: EventEmitter; translate: EventEmitter<{ dx: number; dy: number; }>; down: EventEmitter; drag: { start(e: { pageX: number; pageY: number; }): void; }; get _selected(): boolean; get top(): string; get left(): string; pointerdown(event: PointerEvent): void; contextmenu(event: MouseEvent): void; constructor(cdr: ChangeDetectorRef); ngOnChanges(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ReteRerouteModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class ImpureKeyvaluePipe implements PipeTransform { transform(value: { [key: string]: any; } | null | undefined, compareFn?: (a: any, b: any) => number): Array<{ key: string; value: any; }>; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } export { AngularPlugin, ConnectionComponent, ConnectionWrapperComponent, ContextMenuComponent, ContextMenuItemComponent, ContextMenuSearchComponent, ControlComponent, ImpureKeyvaluePipe, MiniNodeComponent, MiniViewportComponent, MinimapComponent, NodeComponent, PinComponent, PinsComponent, index_d as Presets, RefDirective, ReteContextMenuModule, ReteMinimapModule, ReteModule, ReteRerouteModule, SocketComponent }; export type { AngularArea2D, Produces, RenderPreset };