import { ChangeDetectorRef, EventEmitter, Injector, OnChanges, OnInit, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core';
import { BaseRemoteMethod, BaseRemoteMethodMetadata, RemoteMethodLoader } from '@rxap/remote-method';
import { IdOrInstanceOrToken } from '@rxap/definition';
import { ToggleSubject } from '@rxap/rxjs';
import * as i0 from "@angular/core";
export interface RemoteMethodTemplateDirectiveContext<ReturnType = any> {
    $implicit: ReturnType;
}
export interface RemoteMethodTemplateDirectiveErrorContext {
    $implicit: Error;
    message: string;
}
export declare class RemoteMethodTemplateDirective<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata> implements OnChanges, OnInit {
    private readonly template;
    protected readonly remoteMethodLoader: RemoteMethodLoader;
    private readonly injector;
    private readonly viewContainerRef;
    protected readonly cdr: ChangeDetectorRef;
    private readonly remoteMethodToken?;
    executed$: EventEmitter<any>;
    failure$: EventEmitter<Error>;
    successful$: EventEmitter<ReturnType>;
    metadata?: Metadata;
    /**
     * true - a remote method call is in progress
     */
    executing$: ToggleSubject;
    parameters?: Parameters;
    errorTemplate?: TemplateRef<RemoteMethodTemplateDirectiveErrorContext>;
    loadingTemplate?: TemplateRef<void>;
    withoutParameters: boolean;
    embedded: EventEmitter<any>;
    constructor(template: TemplateRef<RemoteMethodTemplateDirectiveContext<ReturnType>>, remoteMethodLoader: RemoteMethodLoader, injector: Injector, viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef, remoteMethodToken?: any | undefined);
    protected _remoteMethodOrIdOrToken: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>;
    set remoteMethodOrIdOrToken(value: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>);
    static ngTemplateContextGuard<T>(dir: RemoteMethodTemplateDirective<T>, ctx: any): ctx is RemoteMethodTemplateDirectiveContext<T>;
    ngOnChanges(changes: SimpleChanges): void;
    ngOnInit(): void;
    execute(parameters?: Parameters | undefined): Promise<void>;
    /**
     * @deprecated removed
     * @protected
     */
    call(parameters?: Parameters): void;
    setParameter<Key extends keyof Parameters>(parameterKey: Key, value: Parameters[Key]): void;
    updateParameters(parameters: Partial<Parameters>): void;
    protected executed(result: any): void;
    protected failure(error: Error): void;
    protected successful(result: ReturnType): void;
    protected renderTemplate(result: ReturnType): void;
    private renderLoadingTemplate;
    static ɵfac: i0.ɵɵFactoryDeclaration<RemoteMethodTemplateDirective<any, any, any>, [null, null, null, null, null, { optional: true; self: true; }]>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<RemoteMethodTemplateDirective<any, any, any>, "[rxapRemoteMethod]", ["rxapRemoteMethod"], { "metadata": { "alias": "rxapRemoteMethodMetadata"; "required": false; }; "parameters": { "alias": "rxapRemoteMethodParameters"; "required": false; }; "errorTemplate": { "alias": "rxapRemoteMethodError"; "required": false; }; "loadingTemplate": { "alias": "rxapRemoteMethodLoading"; "required": false; }; "withoutParameters": { "alias": "rxapRemoteMethodWithoutParameters"; "required": false; }; "remoteMethodOrIdOrToken": { "alias": "rxapRemoteMethodCall"; "required": false; }; }, { "executed$": "executed"; "failure$": "failure"; "successful$": "successful"; "embedded": "embedded"; }, never, never, true, never>;
}
