import { Activity, ActivityLike, ConversationReference, InvokeResponse, SentActivity, TokenExchangeResource, TokenPostResource } from '@microsoft/teams.api';
import { ILogger } from '@microsoft/teams.common/logging';
import { IStorage } from '@microsoft/teams.common/storage';
import { ApiClient, GraphClient } from '../api';
import { IStreamer } from '../types';
import { IActivitySender } from '../types/plugin/sender';
/**
 * Constructor arguments for ActivityContext
 * Internal implementation details not exposed in public interface
 */
export interface IActivityContextConstructorArgs {
    /**
     * activity sender for sending activities and creating streams
     */
    activitySender: IActivitySender;
    /**
     * call the next event/middleware handler
     */
    next: (context?: IActivityContext) => (void | InvokeResponse) | Promise<void | InvokeResponse>;
}
/**
 * Base activity context options
 * These are the public properties exposed on the context
 */
export interface IBaseActivityContextOptions<T extends Activity = Activity> {
    /**
     * the app id of the bot
     */
    appId: string;
    /**
     * the inbound activity
     */
    activity: T;
    /**
     * the inbound activity conversation reference
     */
    ref: ConversationReference;
    /**
     * the app logger instance
     */
    log: ILogger;
    /**
     * the api client
     */
    api: ApiClient;
    /**
     * the app graph client
     */
    appGraph: GraphClient;
    /**
     * the user graph client
     */
    userGraph: GraphClient;
    /**
     * app storage instance
     */
    storage: IStorage;
    /**
     * whether the user has provided
     * their MSGraph credentials for use
     * via `api.user.*`
     */
    isSignedIn?: boolean;
    /**
     * the default connection name to use for the app
     * @default `graph`
     */
    connectionName: string;
    /**
     * the user token for the activity context
     */
    userToken?: string;
}
export type IActivityContextOptions<T extends Activity = Activity, TExtraCtx extends Record<string, any> = Record<string, any>> = IBaseActivityContextOptions<T> & TExtraCtx;
type SignInOptions = {
    /**
     * The text to display on the oauth card
     * @default `Please Sign In...`
     */
    oauthCardText: string;
    /**
     * The text to display on the sign in button
     * @default `Sign In`
     */
    signInButtonText: string;
    /**
     * The sign in link to use in the card
     */
    signInLink?: string;
    /**
     * The connection name to use
     */
    connectionName?: string;
    /**
     * Construct your own sign in activity
     * By default, we create a simple oauth card with a sign in button.
     * Only use this if you need to fully customize the sign in experience.
     */
    overrideSignInActivity?: (tokenExchangeResource?: TokenExchangeResource, tokenPostResource?: TokenPostResource, signInLink?: string) => ActivityLike;
};
export interface IBaseActivityContext<T extends Activity = Activity, TExtraCtx extends Record<string, any> = Record<string, any>> extends IBaseActivityContextOptions<T> {
    /**
     * a stream that can emit activity chunks
     */
    stream: IStreamer;
    /**
     * call the next event/middleware handler
     */
    next: (context?: IActivityContext & TExtraCtx) => (void | InvokeResponse) | Promise<void | InvokeResponse>;
    /**
     * send an activity to the conversation
     * @param activity activity to send
     * @param conversationRef optional conversation reference to send the activity to. By default, it will use the activity's conversation reference.
     */
    send: (activity: ActivityLike, conversationRef?: ConversationReference) => Promise<SentActivity>;
    /**
     * reply to the inbound activity
     * @param activity activity to send
     */
    reply: (activity: ActivityLike) => Promise<SentActivity>;
    /**
     * trigger user signin flow for the activity sender
     * @param options options for the signin flow
     */
    signin: (options?: Partial<SignInOptions>) => Promise<string | undefined>;
    /**
     * sign the activity sender out
     * @param name auth connection name, defaults to `graph`
     */
    signout: (name?: string) => Promise<void>;
}
export type IActivityContext<T extends Activity = Activity, TExtraContext = unknown> = IBaseActivityContext<T> & (TExtraContext extends Record<string, any> ? TExtraContext : {});
export declare class ActivityContext<T extends Activity = Activity, TExtraCtx extends {} = {}> implements IBaseActivityContext<T, TExtraCtx> {
    appId: string;
    activity: T;
    ref: ConversationReference;
    log: ILogger;
    api: ApiClient;
    appGraph: GraphClient;
    userGraph: GraphClient;
    storage: IStorage;
    stream: IStreamer;
    isSignedIn?: boolean;
    connectionName: string;
    next: (context?: IActivityContext) => (void | InvokeResponse) | Promise<void | InvokeResponse>;
    [key: string]: any;
    private activitySender;
    constructor(value: IBaseActivityContextOptions & IActivityContextConstructorArgs);
    /**
     * send an activity in the current conversation without quoting.
     *
     * In channels, sends to the current thread. In scopes that do not
     * support threading (group chat, meetings), sends as a normal message.
     * To send with a visual quote of the inbound message, use {@link reply}.
     *
     * @param activity the activity to send
     * @param conversationRef optional conversation reference to send to a different conversation or thread
     */
    send(activity: ActivityLike, conversationRef?: ConversationReference): Promise<SentActivity>;
    /**
     * send an activity in the current conversation with a visual quote
     * of the inbound message.
     *
     * In channels, sends to the current thread with a quoted reply.
     * In other scopes, sends with a quoted reply.
     * To send without quoting, use {@link send}.
     *
     * @param activity the activity to send
     */
    reply(activity: ActivityLike): Promise<SentActivity>;
    signin(options?: Partial<SignInOptions>): Promise<string | undefined>;
    signout(connectionName?: string): Promise<void>;
    toInterface(): IActivityContext;
    private buildBlockQuoteForActivity;
}
export {};
