import { Router } from "express"; import Redis from "ioredis"; import LRUCache from "lru-cache"; import { Webhooks } from "@octokit/webhooks"; import { Logger } from "pino"; import { Context } from "./context"; import { ProbotOctokit } from "./octokit/probot-octokit"; import { DeprecatedLogger, ProbotWebhooks, ApplicationFunction } from "./types"; export interface Options { privateKey?: string; githubToken?: string; id?: number; Octokit?: typeof ProbotOctokit; log?: Logger; redisConfig?: Redis.RedisOptions; secret?: string; webhookPath?: string; cache?: LRUCache; octokit?: InstanceType; webhooks?: Webhooks; /** * @deprecated "app.router" is deprecated, use "getRouter()" from the app function instead: "({ app, getRouter }) => { ... }" */ router?: Router; /** * @deprecated set `Octokit` to `ProbotOctokit.defaults({ throttle })` instead */ throttleOptions?: any; } export declare type OnCallback = (context: Context) => Promise; /** * The `app` parameter available to `ApplicationFunction`s * * @property {logger} log - A logger */ export declare class Application { log: DeprecatedLogger; on: ProbotWebhooks["on"]; receive: ProbotWebhooks["receive"]; load: (appFn: ApplicationFunction | ApplicationFunction[]) => Application; auth: (installationId?: number, log?: Logger) => Promise>; private webhooks; private state; private internalRouter; constructor(options: Options); /** * @deprecated "app.router" is deprecated, use "getRouter()" from the app function instead: "({ app, getRouter }) => { ... }" */ get router(): Router; /** * Get an {@link http://expressjs.com|express} router that can be used to * expose HTTP endpoints * * ``` * module.exports = ({ app, getRouter }) => { * // Get an express router to expose new HTTP endpoints * const router = getRouter('/my-app'); * * // Use any middleware * router.use(require('express').static(__dirname + '/public')); * * // Add a new route * router.get('/hello-world', (req, res) => { * res.end('Hello World'); * }); * }; * ``` * * @param path - the prefix for the routes* @param path * * @deprecated "app.route()" is deprecated, use the "getRouter()" argument from the app function instead: "({ app, getRouter }) => { ... }" */ route(path?: string): Router; }