import * as Sentry from "@sentry/node"; import express, { Router } from "express"; import jwt from "jsonwebtoken"; import { FernsRouterOptions } from "./api"; import { UserModel as UserMongooseModel } from "./auth"; import { LoggingOptions } from "./logger"; export declare function setupEnvironment(): void; export type AddRoutes = (router: Router, options?: Partial>) => void; export declare function logRequests(req: any, res: any, next: any): void; export declare function createRouter(rootPath: string, addRoutes: AddRoutes, middleware?: any[]): any[]; export declare function createRouterWithAuth(rootPath: string, addRoutes: (router: Router) => void, middleware?: any[]): any[]; export interface AuthOptions { generateJWTPayload?: (user: any) => Record; generateTokenExpiration?: (user: any) => number | jwt.SignOptions["expiresIn"]; generateRefreshTokenExpiration?: (user: any) => number | jwt.SignOptions["expiresIn"]; } export interface SetupServerOptions { userModel: UserMongooseModel; addRoutes: AddRoutes; loggingOptions?: LoggingOptions; authOptions?: AuthOptions; skipListen?: boolean; corsOrigin?: string | boolean | RegExp | Array | ((requestOrigin: string | undefined, callback: (err: Error | null, origin?: boolean | string | RegExp | Array) => void) => void); addMiddleware?: AddRoutes; ignoreTraces?: string[]; sentryOptions?: Sentry.NodeOptions; } export declare function setupServer(options: SetupServerOptions): express.Application; export declare function cronjob(name: string, schedule: "hourly" | "minutely" | string, callback: () => void): void; export interface WrapScriptOptions { onFinish?: (result?: any) => void | Promise; terminateTimeout?: number; slackChannel?: string; } export declare function wrapScript(func: () => Promise, options?: WrapScriptOptions): Promise;