import type { DatabaseConnection } from '@cloudbeaver/core-connections' ; import type { IExecutionContextProvider } from '@cloudbeaver/core-executor' ; import type { CachedResourceIncludeArgs , GetConnectionsQueryVariables } from '@cloudbeaver/core-sdk' ; import type { IConnectionFormState } from './IConnectionFormProps' ; export type ConnectionFormInfoIncludes = CachedResourceIncludeArgs < DatabaseConnection , GetConnectionsQueryVariables > ; export interface IConnectionFormConfigureContext { readonly driverId : string | undefined ; readonly info : DatabaseConnection | undefined ; readonly connectionIncludes : ConnectionFormInfoIncludes ; include : ( ... includes : ConnectionFormInfoIncludes ) => any ; } export function connectionFormConfigureContext ( contexts , state ) { return { info : state . info , driverId : state . config . driverId , connectionIncludes : [ ] , include ( ... includes ) { for ( const include of includes ) { if ( ! this . connectionIncludes . includes ( include ) ) { this . connectionIncludes . push ( include ) ; } } } , } ; }