forked from npm/npm-registry-client
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
declare module '@qiwi/npm-registry-client' { | ||
import { ReadStream } from 'fs' | ||
type TAuth = { alwaysAuth?: boolean } & ( | ||
{ | ||
username: string | ||
password: string | ||
email?: string | ||
} | { token: string }) | ||
|
||
type TPackage = { | ||
version: string | ||
message: string | ||
} | ||
|
||
type TCallback<T = any> = (error: any, data: T, raw: any, res: any) => void | ||
|
||
type TPackageMetadata = { | ||
name: string | ||
version: string | ||
} | ||
|
||
type TAccess = 'public' | 'restricted' | ||
|
||
class RegClient { | ||
deprecate( | ||
uri: string, | ||
params: TPackage & { auth: TAuth }, | ||
cb: TCallback | ||
): void | ||
|
||
get( | ||
uri: string, | ||
params: any, | ||
cb: TCallback | ||
): void | ||
|
||
publish( | ||
uri: string, | ||
params: { | ||
metadata: TPackageMetadata | ||
access: TAccess | ||
auth: TAuth | ||
body: ReadStream | ||
}, | ||
cb: TCallback | ||
): void | ||
} | ||
export = RegClient | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters