UNPKG

1.79 kBTypeScriptView Raw
1/// <reference types="node" />
2export declare const ENV: string;
3import 'deps-check';
4import Express from 'express';
5import { SessionOptions } from 'express-session';
6import { DBOptions } from './dbInit';
7import { BaseDB, SchemaConstraint } from './Orm/PostgresqlDriver';
8import * as bodyparser from 'body-parser';
9import serveStatic from 'serve-static';
10import https from 'https';
11import http from 'http';
12import { Pool } from 'pg';
13export * from './di';
14export * from './graphQLUtils';
15export * from './Orm/PostgresqlDriver';
16export * from './request';
17export * from './testUtils';
18export * from './utils';
19export * from './dateUtils';
20export * from './assert';
21export * from './logger';
22export declare const bodyParser: typeof bodyparser;
23export declare const PRODUCTION: boolean;
24interface Options {
25 https?: {
26 privateKeyFile: string;
27 certificateFile: string;
28 port?: number;
29 };
30 session?: SessionOptions;
31 db?: DBOptions;
32 graphql: {
33 schema: string;
34 resolver: object;
35 };
36 static?: {
37 rootDir: string;
38 options?: serveStatic.ServeStaticOptions;
39 };
40 parcel?: {
41 indexFilename: string;
42 };
43 errors: {
44 unknown: unknown;
45 };
46 port: number;
47}
48interface Result<DBSchema extends SchemaConstraint> {
49 server: https.Server | http.Server;
50 express: Express.Express;
51 projectDir: string;
52 db: BaseDB<DBSchema>;
53 dbPool: Pool;
54}
55export declare function createGraphqApp<DBSchema extends SchemaConstraint>(options: Options, runMiddlewares?: (app: Result<DBSchema>) => Promise<void>): Promise<Result<DBSchema>>;
56export declare function asyncThread(fn: (req: Express.Request, res: Express.Response) => Promise<unknown>): Express.Handler;
57//# sourceMappingURL=index.d.ts.map
\No newline at end of file