import * as GitHubApi from '@octokit/rest';
import { LoggerWithTarget } from './wrap-logger';
/**
 * Helpers for extracting information from the webhook event, which can be
 * passed to GitHub API calls.
 *
 * @property {github} github - An authenticated GitHub API client
 * @property {payload} payload - The webhook event payload
 * @property {logger} log - A logger
 */
export declare class Context {
    id: string;
    github: GitHubApi;
    log: LoggerWithTarget;
    payload: WebhookPayloadWithRepository;
    constructor(event: any, github: GitHubApi, log: LoggerWithTarget);
    /**
     * Return the `owner` and `repo` params for making API requests against a
     * repository.
     *
     * @param {object} [object] - Params to be merged with the repo params.
     *
     * @example
     *
     * const params = context.repo({path: '.github/config.yml'})
     * // Returns: {owner: 'username', repo: 'reponame', path: '.github/config.yml'}
     *
     */
    repo<T>(object?: T): {
        owner: string;
        repo: string;
    } & T;
    /**
     * Return the `owner`, `repo`, and `number` params for making API requests
     * against an issue or pull request. The object passed in will be merged with
     * the repo params.
     *
     * @example
     *
     * const params = context.issue({body: 'Hello World!'})
     * // Returns: {owner: 'username', repo: 'reponame', number: 123, body: 'Hello World!'}
     *
     * @param {object} [object] - Params to be merged with the issue params.
     */
    issue<T>(object?: T): {
        number: number;
    } & {
        owner: string;
        repo: string;
    } & T;
    /**
     * Returns a boolean if the actor on the event was a bot.
     * @type {boolean}
     */
    readonly isBot: boolean;
    /**
     * Reads the app configuration from the given YAML file in the `.github`
     * directory of the repository.
     *
     * @example <caption>Contents of <code>.github/config.yml</code>.</caption>
     *
     * close: true
     * comment: Check the specs on the rotary girder.
     *
     * @example <caption>App that reads from <code>.github/config.yml</code>.</caption>
     *
     * // Load config from .github/config.yml in the repository
     * const config = await context.config('config.yml')
     *
     * if (config.close) {
     *   context.github.issues.comment(context.issue({body: config.comment}))
     *   context.github.issues.edit(context.issue({state: 'closed'}))
     * }
     *
     * @example <caption>Using a <code>defaultConfig</code> object.</caption>
     *
     * // Load config from .github/config.yml in the repository and combine with default config
     * const config = await context.config('config.yml', {comment: 'Make sure to check all the specs.'})
     *
     * if (config.close) {
     *   context.github.issues.comment(context.issue({body: config.comment}));
     *   context.github.issues.edit(context.issue({state: 'closed'}))
     * }
     *
     * @param {string} fileName - Name of the YAML file in the `.github` directory
     * @param {object} [defaultConfig] - An object of default config options
     * @return {Promise<Object>} - Configuration object read from the file
     */
    config<T>(fileName: string, defaultConfig: T): Promise<T | null>;
}
export interface PayloadRepository {
    full_name: string;
    name: string;
    owner: {
        login: string;
        name: string;
    };
}
export interface WebhookPayloadWithRepository {
    repository: PayloadRepository;
    issue: {
        number: number;
    };
    pull_request: {
        number: number;
    };
    sender: {
        type: string;
    };
    action: string;
    installation: {
        id: string;
    };
}
