/** * @license * Copyright 2024 Nuraly * SPDX-License-Identifier: MIT */ import { LitElement } from 'lit'; /** * Minimal KV entry shape this component needs. * Avoids importing from the redux store. */ export interface KvSecretEntry { keyPath: string; value?: any; isSecret: boolean; } /** * KV Secret Select Component * * A select component for choosing API keys, filtered by provider scope. * Includes inline creation of new secrets. * * Data-in / events-out: * - Host provides `entries` and `loading` * - Component fires `create-entry` when the user submits the create form * - Component fires `value-change` when the selection changes * * @example * ```html * console.log(e.detail.value)} * @create-entry=${(e) => handleCreate(e.detail)} * > * ``` * * @fires value-change - Fired when selection changes * @fires create-entry - Fired when user submits the create form. Detail: { keyPath, value, scope, isSecret } * * @csspart container - The root nr-select wrapper */ export declare class NrKvSecretSelect extends LitElement { static styles: import("lit").CSSResult; static useShadowDom: boolean; /** Provider/scope to filter display labels */ provider: string; /** Currently selected key path */ value: string; /** Placeholder text */ placeholder: string; /** Type of secret - affects labels */ type: 'api-key' | 'url'; /** Entries provided by the host */ entries: KvSecretEntry[]; /** Loading state provided by the host */ loading: boolean; private showCreateForm; private newKeyName; private newKeyValue; private creating; private error; private handleSelectChange; private toggleCreateForm; private resetCreateForm; private handleCreate; /** * Called by host after create-entry succeeds to reset the form and select the new entry. */ notifyCreateSuccess(keyPath: string): void; /** * Called by host if create-entry fails. */ notifyCreateError(message: string): void; private getTypeLabel; private getValuePlaceholder; private renderCreateForm; private renderAddButton; render(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'nr-kv-secret-select': NrKvSecretSelect; } } //# sourceMappingURL=kv-secret-select.component.d.ts.map