Skip to content

Commit b1b895e

Browse files
dtslvrpaveltiunov
authored andcommitted
feat: Add Typescript typings for server-core (#111)
* Add typings for server-core * Add types to package.json * Reuse DatabaseType for createDriver param
1 parent b065622 commit b1b895e

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
declare module '@cubejs-backend/server-core' {
2+
export function create(options?: CreateOptions): any;
3+
4+
export function createDriver(dbType: DatabaseType): DriverFactory;
5+
6+
export interface CreateOptions {
7+
apiSecret?: string;
8+
basePath?: string;
9+
checkAuthMiddleware?: (req: any, res: any, next: any) => any;
10+
contextToAppId?: any;
11+
devServer?: boolean;
12+
dbType?: DatabaseType;
13+
driverFactory?: DriverFactory;
14+
externalDriverFactory?: DriverFactory;
15+
logger?: (msg: string, params: any) => void;
16+
orchestratorOptions?: any;
17+
repositoryFactory?: any;
18+
schemaPath?: string;
19+
}
20+
21+
export interface DriverFactory {
22+
}
23+
24+
export type DatabaseType = 'athena' | 'bigquery' | 'clickhouse' | 'jdbc' | 'mongobi' | 'mssql' | 'mysql' | 'postgres' | 'redshift';
25+
}

packages/cubejs-server-core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"test": "mocha"
1111
},
1212
"main": "core/index.js",
13+
"types": "core/index.d.ts",
1314
"files": [
1415
"core",
1516
"playground"

0 commit comments

Comments
 (0)