import { DAppSchema, DAppStoreSchema, EnrichSchema, FilterOptions } from "../interfaces"; export declare enum RegistryStrategy { GitHub = "GitHub", Static = "Static" } export declare class DappStoreRegistry { strategy: RegistryStrategy; private static TTL; private lastRegistryCheckedAt; private initialized; private readonly githubOwner; private readonly githubRepo; readonly registryRemoteUrl: string; private searchEngine; private cachedRegistry; constructor(strategy?: RegistryStrategy); private localRegistry; private queryRemoteRegistry; static validateRegistryJson: (json: DAppStoreSchema) => (string | boolean)[]; registry: () => Promise; private buildSearchIndex; enrichMetadataForDappStore(storeKey: string, res: DAppSchema[], dappsEnrichData?: EnrichSchema[]): DAppSchema[]; private filterDapps; /** * Initializes the registry. This is required before you can use the registry. * It builds the search Index and caches the registry. Specifically it performs * the following steps * 1. If there's no cached Registry or the cached registry is stale, it fetches * the registry from the remote URL * 2. It builds the search index * * If the strategy is Static, then the first load will **always** happen from * local registry.json file. Any subsequent calls after TTL will fetch the * registry from the remote URL (if static is stale) & rebuild the search index. * @returns A promise that resolves when the registry is initialized */ init(): Promise; /** * * @returns The title of the registry */ getRegistryTitle(): Promise; /** * Returns the list of dApps that are listed in the registry. You can optionally * filter the results. * @param filterOpts The filter options. Defaults to `{ isListed: true}` * @returns The list of dApps that are listed in the registry */ dApps: (filterOpts?: FilterOptions) => Promise; /** * Performs search & filter on the dApps in the registry. This always returns the dApps * that are listed. * @param queryTxt The text to search for * @param filterOpts The filter options. Defaults to `{ isListed: true}` * @returns The filtered & sorted list of dApps */ search: (queryTxt: string, filterOpts?: FilterOptions) => DAppSchema[]; /** * search by dapp id * @param queryTxt dappId * @returns if matches return dappInfo */ searchByDappId: (queryTxt: string) => DAppSchema[]; /** * Gets all the featured sections defined in the registry. Along with the dApps. * If no featured section is defined, returns `undefined` * @returns The list of featured sections and the dApps in that section */ getFeaturedDapps: () => Promise; getAllCategories: () => { category: string; subCategory: string[]; }[]; getAllDappIds: () => Promise; }