mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[hosted-git-info] Update types for 3.0 (#42499)
Not exactly sure where the original author got `host` from but from what I can see it's always been `type`. Also remove `fromUrl` from the class as it's not actually a part of the class
This commit is contained in:
parent
c0824717e9
commit
a6c082f346
99
types/hosted-git-info/index.d.ts
vendored
99
types/hosted-git-info/index.d.ts
vendored
@ -1,82 +1,61 @@
|
||||
// Type definitions for hosted-git-info 2.7
|
||||
// Type definitions for hosted-git-info 3.0
|
||||
// Project: https://github.com/npm/hosted-git-info
|
||||
// Definitions by: Jason <https://github.com/OiyouYeahYou>
|
||||
// Definitions by: Jason <https://github.com/OiyouYeahYou>, Michael <https://github.com/Ovyerus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class HostedGitInfo {
|
||||
host: HostedGitInfo.hosts;
|
||||
user: string | null;
|
||||
auth: string | null;
|
||||
project: string | null;
|
||||
committish: string | null;
|
||||
declare class GitHost {
|
||||
constructor(type: GitHost.Hosts, user: string, auth: string | undefined, project: string, committish: string | undefined, defaultRepresentation: string, opts?: GitHost.FillOptions);
|
||||
|
||||
type: GitHost.Hosts;
|
||||
user: string;
|
||||
auth?: string;
|
||||
project: string;
|
||||
committish?: string;
|
||||
default: string;
|
||||
opts: HostedGitInfo.Options;
|
||||
opts: GitHost.Options;
|
||||
protocols: string[];
|
||||
domain: string;
|
||||
treepath?: string;
|
||||
|
||||
constructor(
|
||||
host: HostedGitInfo.hosts,
|
||||
user: string | null,
|
||||
auth: string | null,
|
||||
project: string | null,
|
||||
committish: string | null,
|
||||
defaultRepresentation: string,
|
||||
opts?: HostedGitInfo.Options
|
||||
);
|
||||
|
||||
// From git-host-info
|
||||
|
||||
// defaults
|
||||
// Templates
|
||||
sshtemplate: string;
|
||||
sshurltemplate: string;
|
||||
browsetemplate: string;
|
||||
browsefiletemplate: string;
|
||||
docstemplate: string;
|
||||
httpstemplate: string;
|
||||
filetemplate: string;
|
||||
shortcuttemplate: string;
|
||||
pathtemplate: string;
|
||||
bugstemplate: string;
|
||||
gittemplate?: string;
|
||||
tarballtemplate: string;
|
||||
|
||||
pathmatch: RegExp;
|
||||
protocols_re: RegExp;
|
||||
hashformat(fragment: string): string;
|
||||
|
||||
// special
|
||||
protocols: string[];
|
||||
domain: string;
|
||||
bugstemplate: string;
|
||||
gittemplate: string;
|
||||
browsefiletemplate: string;
|
||||
httpstemplate: string;
|
||||
treepath: string;
|
||||
tarballtemplate: string;
|
||||
|
||||
// /From git-host-info
|
||||
|
||||
hash(): string;
|
||||
ssh(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
sshurl(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
browse(
|
||||
path: string,
|
||||
fragment: string,
|
||||
opts?: HostedGitInfo.FillOptions
|
||||
): string | undefined;
|
||||
browse(path: string, opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
browse(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
docs(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
bugs(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
https(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
git(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
shortcut(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
path(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
tarball(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
file(path: string, opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
ssh(opts?: GitHost.FillOptions): string;
|
||||
sshurl(opts?: GitHost.FillOptions): string;
|
||||
browse(opts?: GitHost.FillOptions): string;
|
||||
browse(path: string, opts?: GitHost.FillOptions): string;
|
||||
browse(path: string, fragment: string, opts?: GitHost.FillOptions): string;
|
||||
docs(opts?: GitHost.FillOptions): string;
|
||||
bugs(opts?: GitHost.FillOptions): string;
|
||||
https(opts?: GitHost.FillOptions): string;
|
||||
git(opts?: GitHost.FillOptions): string;
|
||||
shortcut(opts?: GitHost.FillOptions): string;
|
||||
path(opts?: GitHost.FillOptions): string;
|
||||
tarball(opts?: GitHost.FillOptions): string;
|
||||
file(path: string, opts?: GitHost.FillOptions): string;
|
||||
getDefaultRepresentation(): string;
|
||||
toString(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
|
||||
static fromUrl(
|
||||
gitUrl: string,
|
||||
options?: HostedGitInfo.Options
|
||||
): HostedGitInfo;
|
||||
toString(opts?: GitHost.FillOptions): string;
|
||||
}
|
||||
|
||||
declare namespace HostedGitInfo {
|
||||
declare namespace GitHost {
|
||||
function fromUrl(gitUrl: string, opts?: Options): GitHost;
|
||||
|
||||
interface Options {
|
||||
noCommittish?: boolean;
|
||||
noGitPlus?: boolean;
|
||||
@ -90,7 +69,7 @@ declare namespace HostedGitInfo {
|
||||
treepath?: string;
|
||||
}
|
||||
|
||||
type hosts = 'github' | 'bitbucket' | 'gitlab' | 'gist';
|
||||
type Hosts = 'github' | 'bitbucket' | 'gitlab' | 'gist';
|
||||
}
|
||||
|
||||
export = HostedGitInfo;
|
||||
export = GitHost;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user