default: {
    getAdapterForSource(sourceID: string): default;
    getAll(): default[];
    getFirstResultWithData(results: unknown[]): AdapterLookupResult;
    getSourceURL(sourceID: string): string;
    getSupportedLookupsAsSafePromises(
        url: string,
    ): Promise<AdapterLookupResult | { error: unknown }>[];
} = ...

General helper functions for adapters that obtain metadata about specific URLs.

Type declaration

  • getAdapterForSource:function
    • Returns the adapter that handles a specific source (undefined if not found).

      Parameters

      • sourceID: string

      Returns default

  • getAll:function
  • getFirstResultWithData:function
  • getSourceURL:function
    • Returns the canonical URL that represents a specific source, typically a project's main website. Used for "About this source" links and such.

      Parameters

      • sourceID: string

      Returns string

  • getSupportedLookupsAsSafePromises:function
    • Return a lookup promise from every adapter that can support metadata about this URL. Each promise is wrapped to never reject.

      Parameters

      • url: string

      Returns Promise<AdapterLookupResult | { error: unknown }>[]