import { ActivityLike, ApiClientSettings, ChannelID, CloudEnvironment, InvokeResponse, StripMentionsTextOptions, TokenCredentials } from '@microsoft/teams.api';
import { EventEmitter } from '@microsoft/teams.common/events';
import * as http from '@microsoft/teams.common/http';
import { ILogger } from '@microsoft/teams.common/logging';
import { IStorage, LocalStorage } from '@microsoft/teams.common/storage';
import { ActivitySender } from './activity-sender';
import { ApiClient, GraphClient } from './api';
import { configTab, func, tab } from './app.embed';
import { event, onActivityResponse, onActivitySent, onError } from './app.events';
import { onSignInFailure, onTokenExchange, onVerifyState } from './app.oauth';
import { getPlugin, inject, plugin } from './app.plugins';
import { $process } from './app.process';
import { message, on, use } from './app.routing';
import { Container } from './container';
import { IActivityEvent } from './events';
import { IHttpServerAdapter } from './http';
import { HttpServer } from './http/http-server';
import * as manifest from './manifest';
import * as middleware from './middleware';
import { OAuthSettings } from './oauth';
import { HttpPlugin } from './plugins';
import { Router } from './router';
import { TokenManager } from './token-manager';
import { IPlugin, AppEvents } from './types';
import { PluginAdditionalContext } from './types/app-routing';
/**
 * App initialization options
 */
export type AppOptions<TPlugin extends IPlugin> = {
    /**
     * client id - Your application's client identifier
     * Uses environment variable CLIENT_ID if not explicitly provided
     */
    readonly clientId?: string;
    /**
     * client secret - Your application's secret to be able to send messages
     * as your bot.
     * Uses environment variable CLIENT_SECRET if not explicitly provided
     * If not available, uses ManagedIdentity to authenticate
     */
    readonly clientSecret?: string;
    /**
     * Application ID URI from the Azure portal. Used for user authentication.
     * Matches webApplicationInfo.resource in the app manifest.
     */
    readonly applicationIdUri?: string;
    /**
     * tenantId - The tenantId where your app is registered
     * Uses environment variable TENANT_ID if not explicitly provided
     * If your app has MultiTenant auth enabled (this value should not be provided).
     * (Note: That MultiTenant auth has been deprecated, so only legacy apps will have this
     * value enabled)
     */
    readonly tenantId?: string;
    /**
     * token - An override to perform token fetching.
     */
    readonly token?: TokenCredentials['token'];
    /**
     * managed identity client id - A managed identity client id.
     * Uses environment variable MANAGED_IDENTITY_CLIENT_ID if not explicitly provided
     * If:
     *   - Same as client id, uses User Managed Identity for auth
     *   - "system", uses System Managed Identity in a Federated Identity Credentials
     *   - Different from client id or system, uses UMI in a Federated Identity Credentials
     */
    managedIdentityClientId?: 'system' | (string & {});
    /**
     * http client or client options used to make api requests
     */
    readonly client?: http.Client | http.ClientOptions | (() => http.Client);
    /**
     * logger instance to use
     */
    readonly logger?: ILogger;
    /**
     * storage instance to use
     */
    readonly storage?: IStorage;
    /**
     * plugins to extend the apps functionality
     */
    readonly plugins?: Array<TPlugin>;
    /**
     * HTTP server adapter for handling bot requests
     */
    readonly httpServerAdapter?: IHttpServerAdapter;
    /**
     * OAuth Settings
     */
    readonly oauth?: OAuthSettings;
    /**
     * The apps manifest
     */
    readonly manifest?: Partial<manifest.Manifest>;
    /**
     * Activity Options
     */
    readonly activity?: AppActivityOptions;
    /**
     * Skip authentication for HTTP requests
     */
    readonly skipAuth?: boolean;
    /**
     * URL path for the Teams messaging endpoint
     * @default '/api/messages'
     */
    readonly messagingEndpoint?: `/${string}`;
    /**
     * Base Service URL for BotBackend
     * Uses environment variable SERVICE_URL  if not provided
     * and defaults to https://smba.trafficmanager.net/teams
     */
    readonly serviceUrl?: string;
    /**
     * API client settings used for overriding.
     */
    readonly apiClientSettings?: ApiClientSettings;
    /**
     * Cloud environment for sovereign cloud support.
     * Accepts a CloudEnvironment object or uses CLOUD environment variable.
     * Valid env var values: "Public", "USGov", "USGovDoD", "China".
     * Defaults to PUBLIC (commercial cloud).
     */
    readonly cloud?: CloudEnvironment;
};
export type AppActivityOptions = {
    readonly mentions?: {
        /**
         * Automatically remove `<at>...</at>` mention
         * from inbound activity `text`
         */
        readonly stripText?: boolean | StripMentionsTextOptions;
    };
};
/**
 * The orchestrator for receiving/sending activities
 */
export declare class App<TPlugin extends IPlugin = IPlugin> {
    readonly options: AppOptions<TPlugin>;
    readonly api: ApiClient;
    readonly cloud: CloudEnvironment;
    readonly graph: GraphClient;
    readonly log: ILogger;
    readonly server: HttpServer;
    readonly http?: HttpPlugin;
    readonly client: http.Client;
    readonly storage: IStorage;
    readonly entraTokenValidator?: middleware.JwtValidator;
    readonly tokenManager: TokenManager;
    /**
     * Graph API base URL derived from the configured cloud's `graphScope`.
     * Undefined when the scope isn't a URL — `GraphClient` then uses its public-cloud default.
     * Shared across every `GraphClient` the app constructs (`app.graph`, `ctx.appGraph`, `ctx.userGraph`)
     * so sovereign customers get consistent routing.
     */
    readonly graphBaseUrl?: string;
    /**
     * the apps credentials
     */
    get credentials(): import("@microsoft/teams.api").Credentials | undefined;
    /**
     * the apps id
     */
    get id(): string | undefined;
    /**
     * the apps name
     * @deprecated Name will be removed in the near future. Please remove dependencies from it.
     */
    get name(): string | undefined;
    get oauth(): {
        defaultConnectionName: string;
    };
    /**
     * the apps manifest
     */
    get manifest(): Partial<manifest.Manifest>;
    protected readonly _manifest: Partial<manifest.Manifest>;
    protected container: Container;
    protected plugins: Array<TPlugin>;
    protected router: Router<PluginAdditionalContext<TPlugin>>;
    protected tenantTokens: LocalStorage<string>;
    protected events: EventEmitter<AppEvents<TPlugin>>;
    protected isInitialized: boolean;
    protected port?: number | string;
    protected activitySender: ActivitySender;
    private readonly _userAgent;
    constructor(options?: AppOptions<TPlugin>);
    /**
     * initialize the app.
     */
    initialize(): Promise<void>;
    /**
     * start the server after initialization
     * @param port port to listen on
     */
    start(port?: number | string): Promise<void>;
    /**
     * stop the app
     */
    stop(): Promise<void>;
    /**
     * send an activity proactively to a conversation.
     *
     * Sends to the exact conversation ID provided. For channel threads,
     * the conversation ID must include `;messageid=` - use {@link toThreadedConversationId}
     * to construct it, or use {@link reply} which handles this automatically.
     *
     * @param conversationId the conversation to send to
     * @param activity the activity to send
     */
    send(conversationId: string, activity: ActivityLike): Promise<import("@microsoft/teams.api").SentActivity>;
    /**
     * send an activity proactively as a threaded reply.
     *
     * Constructs a threaded conversation ID from the conversation ID
     * and message ID via {@link toThreadedConversationId}, then sends
     * to that thread. The service determines whether threading is
     * supported for the given conversation type.
     *
     * @param conversationId the conversation ID
     * @param messageId the thread root message ID
     * @param activity the activity to send
     */
    reply(conversationId: string, messageId: string, activity: ActivityLike): Promise<any>;
    /**
     * send an activity proactively to a conversation.
     *
     * Sends to the exact conversation ID provided - threaded if
     * it contains `;messageid=`, flat otherwise.
     *
     * @param conversationId the conversation to send to
     * @param activity the activity to send
     */
    reply(conversationId: string, activity: ActivityLike): Promise<any>;
    /**
     * subscribe to an event
     * @param name event to subscribe to
     * @param cb callback to invoke
     */
    on: typeof on;
    /**
     * subscribe to a message event for a specific pattern
     * @param pattern pattern to match against message text
     * @param cb callback to invoke
     */
    message: typeof message;
    /**
     * register a middleware
     * @param cb callback to invoke
     */
    use: typeof use;
    /**
     * subscribe to an event
     * @param name the event to subscribe to
     * @param cb the callback to invoke
     */
    event: typeof event;
    /**
     * add a plugin
     * @param plugin plugin to add
     */
    plugin: typeof plugin;
    /**
     * get a plugin
     */
    getPlugin: typeof getPlugin;
    /**
     * add/update a function that can be called remotely
     * @param name The unique function name
     * @param cb The callback to handle the function
     */
    function: typeof func;
    /**
     * add/update a static tab.
     * the tab will be hosted at
     * `http://localhost:{{PORT}}/tabs/{{name}}` or `https://{{BOT_DOMAIN}}/tabs/{{name}}`
     * @remark scopes default to `personal`
     * @param name A unique identifier for the entity which the tab displays.
     * @param path The path to the web `dist` folder.
     */
    tab: typeof tab;
    /**
     * add a configurable tab
     * @remark scopes defaults to `team`
     * @param url The url to use when configuring the tab.
     */
    configTab: typeof configTab;
    /**
     * activity handler called when an inbound activity is received
     * @param sender the plugin to use for sending activities
     * @param event the received activity event
     */
    process: typeof $process;
    protected onTokenExchange: typeof onTokenExchange;
    protected onVerifyState: typeof onVerifyState;
    protected onSignInFailure: typeof onSignInFailure;
    protected inject: typeof inject;
    protected onError: typeof onError;
    protected onActivitySent: typeof onActivitySent;
    protected onActivityResponse: typeof onActivityResponse;
    onActivity(event: IActivityEvent): Promise<InvokeResponse>;
    protected getBotToken(): Promise<import("@microsoft/teams.api").IToken | null | undefined>;
    protected getUserToken(channelId: ChannelID, userId: string): Promise<string>;
    protected getAppGraphToken(tenantId?: string): Promise<import("@microsoft/teams.api").IToken | null | undefined>;
}
