1 | import { SearchCriteria } from '../types/search-criteria';
|
2 | import { SearchResults } from '../types/search-results';
|
3 | /**
|
4 | * `searchPackages` returns the packages corresponding to a given query.
|
5 | *
|
6 | * @param query - one or more search criteria
|
7 | * @param registry - URL of the registry (default: npm registry)
|
8 | * @param mirrors - URLs of the registry mirrors (default: npm registry mirrors)
|
9 | * @param cached - accept cached responses (default: `true`)
|
10 | *
|
11 | * @example
|
12 | * Get the search results for text query `query-registry` from the npm registry:
|
13 | *
|
14 | * ```typescript
|
15 | * import { searchPackages } from 'query-registry';
|
16 | *
|
17 | * (async () => {
|
18 | * const results = await searchPackages({ query: { text: 'query-registry' } });
|
19 | *
|
20 | * // Output: 'query-registry'
|
21 | * console.log(results.objects[0].package.name);
|
22 | * })();
|
23 | * ```
|
24 | *
|
25 | * @see {@link SearchResults}
|
26 | * @see {@link SearchCriteria}
|
27 | * @see {@link npmRegistry}
|
28 | * @see {@link npmRegistryMirrors}
|
29 | */
|
30 | export declare function searchPackages({ query: rawSearchCriteria, registry, mirrors, cached, }: {
|
31 | query: SearchCriteria;
|
32 | registry?: string;
|
33 | mirrors?: string[];
|
34 | cached?: boolean;
|
35 | }): Promise<SearchResults>;
|
36 | //# sourceMappingURL=search-packages.d.ts.map |
\ | No newline at end of file |