signalk-server
Version:
An implementation of a [Signal K](http://signalk.org) server for boats.
40 lines • 1.38 kB
TypeScript
import { IndicatorInputs } from './indicators';
import { AppStoreEntryExtension } from './schemas';
interface NpmPackageLike {
name: string;
version: string;
keywords?: string[];
description?: string;
readme?: string;
links?: {
npm?: string;
homepage?: string;
repository?: string;
bugs?: string;
};
repository?: string | {
type?: string;
url?: string;
};
bugs?: string | {
url?: string;
};
signalk?: unknown;
}
/**
* A cache of pre-probed CDN URLs. When the author's declared signalk.appIcon
* or signalk.screenshots[] path 404s on unpkg (common when source assets live
* in ./public/, ./assets/, etc. but the declared path is relative to the
* repo root), a background probe discovers the real URL and stores it here.
* enrichEntry consults the cache and, if a resolution is known, uses it
* instead of the naive package-relative URL.
*/
export type ProbedUrlLookup = (pkg: string, version: string, declaredPath: string) => string | null | undefined;
export interface EnrichmentOptions {
indicatorInputs?: Partial<IndicatorInputs>;
includeIndicators?: boolean;
iconUrlLookup?: ProbedUrlLookup;
}
export declare function enrichEntry(pkg: NpmPackageLike, options?: EnrichmentOptions): AppStoreEntryExtension;
export {};
//# sourceMappingURL=enrich.d.ts.map