/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // This is the place for API experiments and proposal. import * as vscode from 'vscode'; declare module 'azdata' { /** * Namespace for connection management */ export namespace connection { export type ConnectionEventType = | 'onConnect' | 'onDisconnect' | 'onConnectionChanged'; export interface ConnectionEventListener { onConnectionEvent(type: ConnectionEventType, ownerUri: string, args: IConnectionProfile): void; } /** * Register a connection event listener */ export function registerConnectionEventListener(listener: connection.ConnectionEventListener): void; export function getConnection(uri: string): Thenable; } export type SqlDbType = 'BigInt' | 'Binary' | 'Bit' | 'Char' | 'DateTime' | 'Decimal' | 'Float' | 'Image' | 'Int' | 'Money' | 'NChar' | 'NText' | 'NVarChar' | 'Real' | 'UniqueIdentifier' | 'SmallDateTime' | 'SmallInt' | 'SmallMoney' | 'Text' | 'Timestamp' | 'TinyInt' | 'VarBinary' | 'VarChar' | 'Variant' | 'Xml' | 'Udt' | 'Structured' | 'Date' | 'Time' | 'DateTime2' | 'DateTimeOffset'; export interface SimpleColumnInfo { name: string; /** * This is expected to match the SqlDbTypes for serialization purposes */ dataTypeName: SqlDbType; } export interface SerializeDataStartRequestParams { /** * 'csv', 'json', 'excel', 'xml' */ saveFormat: string; filePath: string; isLastBatch: boolean; rows: DbCellValue[][]; columns: SimpleColumnInfo[]; includeHeaders?: boolean; delimiter?: string; lineSeperator?: string; textIdentifier?: string; encoding?: string; formatted?: boolean; } export interface SerializeDataContinueRequestParams { filePath: string; isLastBatch: boolean; rows: DbCellValue[][]; } export interface SerializeDataResult { messages?: string; succeeded: boolean; } export interface SerializationProvider extends DataProvider { startSerialization(requestParams: SerializeDataStartRequestParams): Thenable; continueSerialization(requestParams: SerializeDataContinueRequestParams): Thenable; } export namespace dataprotocol { export function registerSerializationProvider(provider: SerializationProvider): vscode.Disposable; } }