Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#63736 [@npmcli/arborist] Add missing optio…
Browse files Browse the repository at this point in the history
…ns by @forivall

* [@npmcli/arborist] Add missing options

* [@npmcli/arborist] Update tests
  • Loading branch information
forivall authored Jan 13, 2023
1 parent bb353b3 commit 81e5fb0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
34 changes: 34 additions & 0 deletions types/npmcli__arborist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,40 @@ declare namespace Arborist {
workspacesEnabled?: boolean;
replaceRegistryHost?: string;
saveType?: SaveType;

// Tracker
progress?: boolean;

// IdealTreeBuilder
follow?: boolean;
force?: boolean;
global?: boolean;
globalStyle?: boolean;
idealTree?: Node | null;
includeWorkspaceRoot?: boolean;
installLinks?: boolean;
legacyPeerDeps?: boolean;
packageLock?: boolean;
strictPeerDeps?: boolean;
workspaces?: string[];

// ActualLoader
actualTree?: Node | null;

// VirtualLoader
virtualTree?: Node | null;

// Builder
ignoreScripts?: boolean;
scriptShell?: string;
binLinks?: boolean;
rebuildBundle?: boolean;

// Reifier
savePrefix?: string;
packageLockOnly?: boolean;
dryRun?: boolean;
formatPackageLock?: boolean;
}
interface NormalizedOptions extends Options {
nodeVersion: NonNullable<Options['nodeVersion']>;
Expand Down
14 changes: 11 additions & 3 deletions types/npmcli__arborist/npmcli__arborist-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ const arb = new Arborist({
'//registry.foo.com:token': 'blahblahblah',
'//basic.auth.only.foo.com:_auth': 'aXNhYWNzOm5vdCBteSByZWFsIHBhc3N3b3Jk',
'//registry.foo.com:always-auth': true,
progress: true,
formatPackageLock: true,
});

arb.loadActual().then(tree => {});
arb.loadActual().then(tree => {
tree; // $ExpectType Node
});

arb.loadVirtual().then(tree => {});
arb.loadVirtual().then(tree => {
tree; // $ExpectType Node
});

arb.buildIdealTree({}).then(() => {});
arb.buildIdealTree({}).then(tree => {
tree; // $ExpectType Node
});

arb.reify({
save: true,
Expand Down

0 comments on commit 81e5fb0

Please sign in to comment.