1 | import { Router } from "express";
|
2 | import Redis from "ioredis";
|
3 | import LRUCache from "lru-cache";
|
4 | import { Webhooks } from "@octokit/webhooks";
|
5 | import { Logger } from "pino";
|
6 | import { Context } from "./context";
|
7 | import { ProbotOctokit } from "./octokit/probot-octokit";
|
8 | import { DeprecatedLogger, ProbotWebhooks, ApplicationFunction } from "./types";
|
9 | export interface Options {
|
10 | privateKey?: string;
|
11 | githubToken?: string;
|
12 | id?: number;
|
13 | Octokit?: typeof ProbotOctokit;
|
14 | log?: Logger;
|
15 | redisConfig?: Redis.RedisOptions;
|
16 | secret?: string;
|
17 | webhookPath?: string;
|
18 | cache?: LRUCache<number, string>;
|
19 | octokit?: InstanceType<typeof ProbotOctokit>;
|
20 | webhooks?: Webhooks;
|
21 | |
22 |
|
23 |
|
24 | router?: Router;
|
25 | |
26 |
|
27 |
|
28 | throttleOptions?: any;
|
29 | }
|
30 | export declare type OnCallback<T> = (context: Context<T>) => Promise<void>;
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export declare class Application {
|
37 | log: DeprecatedLogger;
|
38 | on: ProbotWebhooks["on"];
|
39 | receive: ProbotWebhooks["receive"];
|
40 | load: (appFn: ApplicationFunction | ApplicationFunction[]) => Application;
|
41 | auth: (installationId?: number, log?: Logger) => Promise<InstanceType<typeof ProbotOctokit>>;
|
42 | private webhooks;
|
43 | private state;
|
44 | private internalRouter;
|
45 | constructor(options: Options);
|
46 | /**
|
47 | * @deprecated "app.router" is deprecated, use "getRouter()" from the app function instead: "({ app, getRouter }) => { ... }"
|
48 | */
|
49 | get router(): Router;
|
50 | |
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | route(path?: string): Router;
|
74 | }
|