UNPKG

1.75 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 type { Logger, LogFn } from "pino";
9export interface Options {
10 privateKey?: string;
11 githubToken?: string;
12 appId?: number | string;
13 Octokit?: typeof ProbotOctokit;
14 log?: Logger;
15 redisConfig?: Redis.RedisOptions | string;
16 secret?: string;
17 webhookPath?: string;
18 logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "fatal";
19 port?: number;
20 host?: string;
21 baseUrl?: string;
22}
23export declare type State = {
24 appId?: number;
25 privateKey?: string;
26 githubToken?: string;
27 log: Logger;
28 Octokit: typeof ProbotOctokit;
29 octokit: InstanceType<typeof ProbotOctokit>;
30 cache?: LRUCache<number, string>;
31 webhooks: {
32 path?: string;
33 secret?: string;
34 };
35 port?: number;
36 host?: string;
37 baseUrl?: string;
38};
39export declare type ProbotWebhooks = Webhooks<WebhookEvent, Omit<Context, keyof WebhookEvent>>;
40export declare type DeprecatedLogger = LogFn & Logger;
41export declare type ApplicationFunctionOptions = {
42 getRouter?: (path?: string) => express.Router;
43 [key: string]: unknown;
44};
45export declare type ApplicationFunction = (app: Probot, options: ApplicationFunctionOptions) => void;
46export declare type ServerOptions = {
47 log?: Logger;
48 port?: number;
49 host?: string;
50 webhookPath?: string;
51 webhookProxy?: string;
52 Probot: typeof Probot;
53};
54export declare type MiddlewareOptions = {
55 probot: Probot;
56 [key: string]: unknown;
57};