/** * @license * Copyright 2024 Nuraly * SPDX-License-Identifier: MIT */ import { LitElement } from 'lit'; import type { DatabaseType } from '../canvas/data-node/data-node.types.js'; /** * Minimal KV entry shape this component needs. */ export interface KvConnectionEntry { keyPath: string; value?: any; isSecret: boolean; } /** * Database Connection Select Component * * A select component for choosing database connections. * Includes inline creation of new connections with connection testing. * * Data-in / events-out: * - Host provides `entries`, `loading`, and `testResult` * - Component fires `create-entry` when the user submits the create form * - Component fires `test-connection` when the user clicks test * - Component fires `value-change` when the selection changes * * @example * ```html * console.log(e.detail.value)} * @create-entry=${(e) => handleCreate(e.detail)} * @test-connection=${(e) => handleTest(e.detail)} * > * ``` * * @fires value-change - Fired when selection changes * @fires create-entry - Fired when user submits the create form * @fires test-connection - Fired when user clicks Test Connection * * @csspart container - The root nr-select wrapper */ export declare class NrDbConnectionSelect extends LitElement { static styles: import("lit").CSSResult; static useShadowDom: boolean; /** Database type/scope to filter KV entries by */ dbType: DatabaseType; /** Currently selected connection path */ value: string; /** Placeholder text */ placeholder: string; /** Entries provided by the host */ entries: KvConnectionEntry[]; /** Loading state provided by the host */ loading: boolean; /** Test result pushed by the host */ testResult: { success: boolean; message: string; } | null; private showCreateForm; private creating; private testing; private error; private newConnectionName; private newHost; private newPort; private newDatabase; private newUsername; private newPassword; private newSsl; connectedCallback(): void; updated(changedProperties: Map): void; private updateDefaultPort; private handleSelectChange; private toggleCreateForm; private resetCreateForm; private handleTestConnection; /** * Called by host after test-connection completes. */ notifyTestResult(result: { success: boolean; message: string; }): void; private handleCreate; /** * Called by host after create-entry succeeds. */ notifyCreateSuccess(keyPath: string): void; /** * Called by host if create-entry fails. */ notifyCreateError(message: string): void; private getDbTypeLabel; private renderCreateForm; private renderAddButton; render(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'nr-db-connection-select': NrDbConnectionSelect; } } //# sourceMappingURL=db-connection-select.component.d.ts.map