import { NDKUser, NDKUserProfile } from '@nostr-dev-kit/ndk'; import { NostrBaseComponent, NCStatus } from '../base-component/nostr-base-component'; /** * NostrUserComponent * ================== * Extension of `NostrBaseComponent` that resolves and manages a Nostr user. * * Overview * - Accepts identity attributes (`npub`, `nip05`, or `pubkey`) and validates them. * - Resolves an `NDKUser` via the shared `nostrService` and fetches its profile. * - Exposes resolved `user` and `profile` to subclasses for rendering or logic. * - Emits lifecycle events for status and user readiness. * * Observed attributes * - `npub` — user's Nostr public key (bech32 npub) * - `nip05` — NIP-05 identifier (e.g. `alice@example.com`) * - `pubkey` — raw hex-encoded public key * * Events * - `nc:status` — from base, reflects connection and user/profile loading status * - `nc:user` — fired when a user and profile are successfully resolved */ export declare class NostrUserComponent extends NostrBaseComponent { protected user: NDKUser | null; protected profile: NDKUserProfile | null; protected userStatus: { set: (s: NCStatus, e?: string) => void; get: () => NCStatus; }; private loadSeq; private resolver; constructor(shadow?: boolean); /** Lifecycle methods */ static get observedAttributes(): string[]; connectedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; /** Protected methods */ protected validateInputs(): boolean; protected resolveUserAndProfile(): Promise; protected renderContent(): void; /** Hook for subclasses to react when user/profile are ready (e.g., render). */ protected onUserReady(_user: NDKUser, _profile: NDKUserProfile | null): void; }