Applesauce
    Preparing search index...

    Interface IAsyncEventDatabase<E>

    The async base interface for a set of events

    interface IAsyncEventDatabase<E extends StoreEvent = NostrEvent> {
        update?: (event: E) => void;
        add(event: E): Promise<E>;
        getByFilters(filters: Filter | Filter[]): Promise<E[]>;
        getEvent(id: string): Promise<E | undefined>;
        getReplaceable(
            kind: number,
            pubkey: string,
            identifier?: string,
        ): Promise<E | undefined>;
        getReplaceableHistory(
            kind: number,
            pubkey: string,
            identifier?: string,
        ): Promise<E[] | undefined>;
        getSyncPairs?(filters: Filter | Filter[]): Promise<SyncPair[]>;
        getTimeline(filters: Filter | Filter[]): Promise<E[]>;
        hasEvent(id: string): Promise<boolean>;
        hasReplaceable(
            kind: number,
            pubkey: string,
            identifier?: string,
        ): Promise<boolean>;
        remove(event: string | E): Promise<boolean>;
        removeByFilters(filters: Filter | Filter[]): Promise<number>;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index
    update?: (event: E) => void

    Notifies the database that an event has updated