UNPKG

2.49 kBTypeScriptView Raw
1import express from "express";
2import { WebhookEvent, Webhooks } from "@octokit/webhooks";
3import LRUCache from "lru-cache";
4import Redis from "ioredis";
5import { Probot } from "./index";
6import { Context } from "./context";
7import { ProbotOctokit } from "./octokit/probot-octokit";
8import { Application } from "./application";
9import type { Logger, LogFn } from "pino";
10export interface Options {
11 privateKey?: string;
12 githubToken?: string;
13 appId?: number | string;
14 Octokit?: typeof ProbotOctokit;
15 log?: Logger;
16 redisConfig?: Redis.RedisOptions | string;
17 secret?: string;
18 webhookPath?: string;
19 logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "fatal";
20 port?: number;
21 host?: string;
22 webhookProxy?: string;
23 baseUrl?: string;
24 /**
25 * @deprecated `id` options is deprecated. Use `appId` instead
26 */
27 id?: number | string;
28 /**
29 * @deprecated `cert` options is deprecated. Use `privateKey` instead
30 */
31 cert?: string;
32 /**
33 * @deprecated set `Octokit` to `ProbotOctokit.defaults({ throttle })` instead
34 */
35 throttleOptions?: any;
36}
37export declare type State = {
38 appId?: number;
39 privateKey?: string;
40 githubToken?: string;
41 log: Logger;
42 Octokit: typeof ProbotOctokit;
43 octokit: InstanceType<typeof ProbotOctokit>;
44 cache?: LRUCache<number, string>;
45 webhooks: {
46 path?: string;
47 secret?: string;
48 };
49 port?: number;
50 host?: string;
51 webhookProxy?: string;
52 baseUrl?: string;
53};
54export declare type ProbotWebhooks = Webhooks<WebhookEvent, Omit<Context, keyof WebhookEvent>>;
55export declare type DeprecatedLogger = LogFn & Logger;
56declare type deprecatedKeys = "router" | "log" | "on" | "receive" | "load" | "route" | "auth";
57export declare type ApplicationFunctionOptions = {
58 [K in deprecatedKeys]: Application[K];
59} & {
60 app: Probot;
61 getRouter: (path?: string) => express.Router;
62};
63export declare type ApplicationFunction = (options: ApplicationFunctionOptions) => void;
64export declare type ServerOptions = {
65 log?: Logger;
66 port?: number;
67 host?: string;
68 webhookPath?: string;
69 webhookProxy?: string;
70 Probot: typeof Probot;
71};
72export declare type MiddlewareOptions = {
73 probot: Probot;
74 [key: string]: unknown;
75 /**
76 * @deprecated "Probot" option is deprecated. Pass a "probot" instance instead, see https://github.com/probot/probot/pull/1431
77 */
78 Probot?: typeof Probot;
79};
80export {};