UNPKG

1.79 kBPlain TextView Raw
1/**
2 * `SearchCriteria` represents the available search criteria.
3 *
4 * @see {@link https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#get-v1search}
5 */
6export interface SearchCriteria {
7 /**
8 * Query text
9 *
10 * @remarks
11 * The following special text attributes can be used to refine results:
12 *
13 * - `author:<name>`: show packages from the given author
14 * (for example, `author:someone`)
15 *
16 * - `maintainer:<name>`: show packages with the given maintainer
17 * (for example, `maintainer:someone`)
18 *
19 * - `keywords:<keyword list>`: show packages matching the given keyword(s);
20 * separators `,`, `+` and `,-` mean respectively `OR`, `AND` and `NOT`
21 * (for example, use `keywords:foo,bar+baz,-quux` to include keywords `foo`
22 * or `bar` and `baz` but not `quux`)
23 *
24 * - `not:unstable`: exclude unstable packages (version `<1.0.0`)
25 *
26 * - `not:insecure`: exclude insecure packages
27 *
28 * - `is:unstable`: include only unstable packages (version `<1.0.0`)
29 *
30 * - `is:insecure`: include only insecure packages
31 *
32 * - `boost-exact:<true/false>`: boost packages with exact name match
33 * (default: `true`)
34 */
35 readonly text?: string;
36
37 /** Number of results to return (from `0` to `250`; default: `20` on the npm registry) */
38 readonly size?: number;
39
40 /** Return results from this offset */
41 readonly from?: number;
42
43 /** Package quality influence on results (from `0.0` to `1.0`) */
44 readonly quality?: number;
45
46 /** Package popularity influence on results (from `0.0` to `1.0`) */
47 readonly popularity?: number;
48
49 /** Package maintenance influence on results (from `0.0` to `1.0`) */
50 readonly maintenance?: number;
51}