import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { ResourceData, MJCommunicationProviderEntity, MJCommunicationProviderMessageTypeEntity } from '@memberjunction/core-entities';
import type { AudienceSource } from '@memberjunction/lists-base';
import { MJNotificationService } from '@memberjunction/ng-notifications';
import * as i0 from "@angular/core";
/**
 * "New Communication" — implements mockup 21. Composes an outbound
 * message against an `AudienceSource` (List / View / ad-hoc filter):
 *
 *   - Channel = MJ Communication Provider + Provider Message Type
 *   - Audience = picked via `<mj-audience-source-picker>`
 *   - Field mapping = which entity field carries the recipient address
 *
 * Server work happens via two existing Actions (no new GraphQL endpoint
 * needed):
 *
 *   - "Resolve Audience" — used by the "Preview" panel to show counts
 *      (TotalAudienceSize / WillReceive / Skipped) before sending.
 *   - "Send To Audience" — actually sends. Supports `PreviewOnly: true`
 *      to re-resolve + report counts with field-mapping applied without
 *      dispatching.
 *
 * Action invocation goes through the `RunAction` mutation (same path the
 * Action Test Harness uses).
 */
interface AudienceSummary {
    TotalAudienceSize: number;
    WillReceiveCount: number;
    SkippedCount: number;
    EntityName: string;
}
export declare class CommunicationsNewMessageResource extends BaseResourceComponent implements OnInit, OnDestroy {
    private cdr;
    private notificationService;
    loadingProviders: boolean;
    providers: MJCommunicationProviderEntity[];
    messageTypes: MJCommunicationProviderMessageTypeEntity[];
    selectedProviderID: string | null;
    selectedMessageTypeID: string | null;
    fromAddress: string;
    subject: string;
    body: string;
    audienceSource: AudienceSource | null;
    recipientField: string;
    audienceSummary: AudienceSummary | null;
    private resolveAudienceActionID;
    private sendToAudienceActionID;
    isResolvingAudience: boolean;
    isSending: boolean;
    constructor(cdr: ChangeDetectorRef, notificationService: MJNotificationService);
    ngOnInit(): Promise<void>;
    ngOnDestroy(): void;
    get filteredMessageTypes(): MJCommunicationProviderMessageTypeEntity[];
    get selectedProvider(): MJCommunicationProviderEntity | null;
    get selectedMessageType(): MJCommunicationProviderMessageTypeEntity | null;
    get canPreview(): boolean;
    get canSend(): boolean;
    onProviderChange(): void;
    onAudienceSourceChange(source: AudienceSource | null): void;
    /**
     * Preview the audience without sending — calls "Send To Audience" with
     * PreviewOnly=true. Surfaces the same total/will-receive/skipped tile
     * mockup 21 shows. Cheaper than `Resolve Audience` for our purposes
     * because it also evaluates the recipient-field skip rule.
     */
    onPreviewAudience(): Promise<void>;
    onSend(): Promise<void>;
    /**
     * One RunView pair on init: providers + their message types. Cached on
     * the component for the session — we don't go back to the DB on every
     * channel selection. Use RunViews (plural) so it's a single round trip.
     */
    private loadChannelMetadata;
    private getSendToAudienceActionID;
    /**
     * Invoke an Action via the RunAction GraphQL mutation. Same pattern as
     * the Action Test Harness — kept inline here so the resource component
     * stays self-contained.
     */
    private invokeAction;
    private parseResultData;
    private coerceNumber;
    private describeSource;
    GetResourceDisplayName(_data: ResourceData): Promise<string>;
    GetResourceIconClass(_data: ResourceData): Promise<string>;
    static ɵfac: i0.ɵɵFactoryDeclaration<CommunicationsNewMessageResource, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<CommunicationsNewMessageResource, "mj-communications-new-message-resource", never, {}, {}, never, never, false, never>;
}
/** Tree-shaking prevention */
export declare function LoadCommunicationsNewMessageResource(): void;
export {};
//# sourceMappingURL=communication-new-message-resource.component.d.ts.map