import { CallerType } from './caller.js';

/**
 * any authorized token
 */
interface IToken {
    /**
     * the app id
     */
    appId: string;
    /**
     * the app display name
     */
    appDisplayName?: string;
    /**
     * the tenant id
     */
    tenantId?: string;
    /**
     * the service url to send responses to
     */
    serviceUrl: string;
    /**
     * where the activity originated from
     */
    from: CallerType;
    /**
     * the id of the activity sender
     */
    fromId: string;
    /**
     * the expiration of the token since epoch
     * in milliseconds
     */
    expiration?: number;
    /**
     * check if the token is expired
     * @param bufferMs default 5min
     */
    isExpired(bufferMs?: number): boolean;
    /**
     * string form of the token
     */
    toString(): string;
}

export type { IToken };
