UNPKG

1.95 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 id?: number;
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 `cert` options is deprecated. Use `privateKey` instead
26 */
27 cert?: string;
28 /**
29 * @deprecated set `Octokit` to `ProbotOctokit.defaults({ throttle })` instead
30 */
31 throttleOptions?: any;
32}
33export declare type State = {
34 id?: number;
35 privateKey?: string;
36 githubToken?: string;
37 log: Logger;
38 Octokit: typeof ProbotOctokit;
39 octokit: InstanceType<typeof ProbotOctokit>;
40 cache?: LRUCache<number, string>;
41 webhooks: {
42 path?: string;
43 secret?: string;
44 };
45 port?: number;
46 host?: string;
47 webhookProxy?: string;
48 webhookPath?: string;
49 baseUrl?: string;
50};
51export declare type ProbotWebhooks = Webhooks<WebhookEvent, Omit<Context, keyof WebhookEvent>>;
52export declare type DeprecatedLogger = LogFn & Logger;
53declare type deprecatedKeys = "router" | "log" | "on" | "receive" | "load" | "route" | "auth";
54export declare type ApplicationFunctionOptions = {
55 [K in deprecatedKeys]: Application[K];
56} & {
57 app: Probot;
58 getRouter: (path?: string) => express.Router;
59};
60export declare type ApplicationFunction = (options: ApplicationFunctionOptions) => void;
61export {};