typings refactor - no compilation, renamed package

This commit is contained in:
Jan Prochazka
2020-02-02 12:02:41 +01:00
parent af80a2799f
commit 4fe2912707
20 changed files with 68 additions and 103 deletions

24
types/dbinfo.d.ts vendored Normal file
View File

@@ -0,0 +1,24 @@
export interface NamedObjectInfo {
pureName: string;
schemaName: string;
}
export interface ColumnInfo {
columnName: string;
notNull: boolean;
autoIncrement: boolean;
dataType: string;
precision: number;
scale: number;
length: number;
computedExpression: string;
isPersisted: boolean;
isSparse: boolean;
defaultValue: string;
defaultConstraint: string;
}
export interface TableInfo extends NamedObjectInfo {
columns: ColumnInfo[];
}
export interface DatabaseInfo {
tables: TableInfo[];
}

16
types/engines.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
import { QueryResult } from "./query";
export interface EngineDriver {
connect({ server, port, user, password }: {
server: any;
port: any;
user: any;
password: any;
}): any;
query(pool: any, sql: string): Promise<QueryResult>;
getVersion(pool: any): Promise<string>;
listDatabases(pool: any): Promise<{
name: string;
}[]>;
analyseFull(pool: any): Promise<void>;
analyseIncremental(pool: any): Promise<void>;
}

12
types/index.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
/// <reference types="node" />
import { ChildProcess } from "child_process";
import { DatabaseInfo } from "./dbinfo";
export interface OpenedDatabaseConnection {
conid: string;
database: string;
structure: DatabaseInfo;
subprocess: ChildProcess;
}
export * from "./engines";
export * from "./dbinfo";
export * from "./query";

7
types/package.json Normal file
View File

@@ -0,0 +1,7 @@
{
"version": "0.1.0",
"name": "@types/dbgate",
"types": "index.d.ts",
"main": "",
"typeScriptVersion": "2.8"
}

3
types/query.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
export interface QueryResult {
rows: any[];
}