UNPKG

1.76 kBTypeScriptView Raw
1import express from "express";
2import { EmitterWebhookEvent as 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 logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "fatal";
18 logMessageKey?: string;
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 secret?: string;
33 };
34 port?: number;
35 host?: string;
36 baseUrl?: string;
37};
38export declare type ProbotWebhooks = Webhooks<Omit<Context, keyof WebhookEvent>>;
39export declare type DeprecatedLogger = LogFn & Logger;
40export declare type ApplicationFunctionOptions = {
41 getRouter?: (path?: string) => express.Router;
42 [key: string]: unknown;
43};
44export declare type ApplicationFunction = (app: Probot, options: ApplicationFunctionOptions) => void;
45export declare type ServerOptions = {
46 log?: Logger;
47 port?: number;
48 host?: string;
49 webhookPath?: string;
50 webhookProxy?: string;
51 Probot: typeof Probot;
52};
53export declare type MiddlewareOptions = {
54 probot: Probot;
55 webhooksPath?: string;
56 [key: string]: unknown;
57};