import type { IUnifiedEmailServerOptions } from '@push.rocks/smartmta';
import * as plugins from '../plugins.js';
import type * as interfaces from '../../dist_ts_interfaces/index.js';
type TSyncRequest = {
    ownership: interfaces.data.IWorkAppMailOwnership;
    localPart: string;
    domain: string;
    displayName?: string;
    inbound?: interfaces.data.IWorkAppMailInboundRoute;
    enabled?: boolean;
    smtpEnabled?: boolean;
    resetSmtpPassword?: boolean;
    delete?: boolean;
};
type TMailResourceOwner = plugins.servezoneInterfaces.data.IMailResourceOwner;
type TMailAddressBinding = plugins.servezoneInterfaces.data.IMailAddressBinding;
type TMailAddressBindingSync = plugins.servezoneInterfaces.requests.mail.TMailAddressBindingSync;
type TMailAddressBindingSyncResponse = plugins.servezoneInterfaces.requests.mail.IReq_SyncMailAddressBinding['response'];
type TMailAddressBindingDeleteResponse = plugins.servezoneInterfaces.requests.mail.IReq_DeleteMailAddressBinding['response'];
type TWorkAppMailBinding = plugins.servezoneInterfaces.data.IWorkAppMailBinding;
interface IStoredWorkAppMailIdentity extends interfaces.data.IWorkAppMailIdentity {
    smtpPassword: string;
}
export declare class WorkAppMailManager {
    private dcRouterRef;
    private readonly storageKey;
    constructor(dcRouterRef: any);
    listMailIdentities(ownership?: Partial<interfaces.data.IWorkAppMailOwnership>): Promise<interfaces.data.IWorkAppMailIdentity[]>;
    syncMailIdentity(request: TSyncRequest, createdBy: string): Promise<interfaces.data.IWorkAppMailIdentitySyncResult>;
    listMailAddressBindings(options?: {
        owner?: Partial<TMailResourceOwner>;
        domain?: string;
        address?: string;
    }): Promise<TMailAddressBinding[]>;
    listWorkAppMailBindings(owner?: Partial<TMailResourceOwner>): Promise<TWorkAppMailBinding[]>;
    syncMailAddressBinding(binding: TMailAddressBindingSync, createdBy: string): Promise<TMailAddressBindingSyncResponse>;
    deleteMailAddressBinding(id: string, createdBy: string): Promise<TMailAddressBindingDeleteResponse>;
    applyStoredIdentitiesToEmailConfig<TConfig extends IUnifiedEmailServerOptions>(emailConfig: TConfig): Promise<TConfig>;
    applyStoredIdentitiesToRuntime(identities?: IStoredWorkAppMailIdentity[] | undefined): Promise<void>;
    private readStoredIdentities;
    private writeStoredIdentities;
    private mergeIdentitiesIntoEmailConfig;
    private buildInboundRoute;
    private ensureEmailDomainConfigured;
    private normalizeOwnership;
    private normalizeDomain;
    private normalizeLocalPart;
    private normalizeAddress;
    private normalizeMailResourceOwner;
    private normalizeMailAddressParts;
    private toLegacyInboundRoute;
    private normalizeInboundRoute;
    private matchesOwnership;
    private matchesMailOwner;
    private buildExternalKey;
    private buildSmtpUsername;
    private buildMailOwnerKey;
    private buildRouteName;
    private hashExternalKey;
    private generateSmtpPassword;
    private isManagedMailRouteName;
    private isManagedSmtpUsername;
    private buildSmtpCredentials;
    private toMailOwner;
    private toMailInboundTarget;
    private toMailAddressBinding;
    private toWorkAppMailBinding;
    private toPublicIdentity;
}
export {};
