mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add types for npm-registry-fetch * Add types for libnpmsearch * Add types for pacote * Use ReadonlyArray in libnpmsearch * pacote: Reorganize imports/exports
18 lines
519 B
TypeScript
18 lines
519 B
TypeScript
import search = require('libnpmsearch');
|
|
|
|
const opts: search.Options = {
|
|
limit: 20,
|
|
from: 0,
|
|
detailed: false,
|
|
sortBy: 'optimal',
|
|
|
|
registry: 'https://registry.npmjs.org',
|
|
token: 'token',
|
|
};
|
|
|
|
search('libnpm'); // $ExpectType Promise<Result[]>
|
|
search('libnpm', opts); // $ExpectType Promise<Result[]>
|
|
search('libnpm', { detailed: true }); // $ExpectType Promise<DetailedResult[]>
|
|
search.stream('libnpm'); // $ExpectType ReadWriteStream
|
|
search.stream('libnpm', opts); // $ExpectType ReadWriteStream
|