mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Adding hosted-git-info
This commit is contained in:
22
types/hosted-git-info/hosted-git-info-tests.ts
Normal file
22
types/hosted-git-info/hosted-git-info-tests.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import info = require("hosted-git-info");
|
||||
|
||||
info.fromUrl('');
|
||||
const result = info.fromUrl('', {});
|
||||
|
||||
result.hashformat('');
|
||||
result.hash();
|
||||
result.ssh({});
|
||||
result.sshurl({});
|
||||
result.browse('', '', {});
|
||||
result.browse('', {});
|
||||
result.browse({});
|
||||
result.docs({});
|
||||
result.bugs({});
|
||||
result.https({});
|
||||
result.git({});
|
||||
result.shortcut({});
|
||||
result.path({});
|
||||
result.tarball({});
|
||||
result.file('', {});
|
||||
result.getDefaultRepresentation();
|
||||
result.toString({});
|
||||
96
types/hosted-git-info/index.d.ts
vendored
Normal file
96
types/hosted-git-info/index.d.ts
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
// Type definitions for hosted-git-info 2.7
|
||||
// Project: https://github.com/npm/hosted-git-info
|
||||
// Definitions by: Jason <https://github.com/OiyouYeahYou>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class HostedGitInfo {
|
||||
host: HostedGitInfo.hosts;
|
||||
user: string | null;
|
||||
auth: string | null;
|
||||
project: string | null;
|
||||
committish: string | null;
|
||||
default: string;
|
||||
opts: HostedGitInfo.Options;
|
||||
|
||||
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
|
||||
sshtemplate: string;
|
||||
sshurltemplate: string;
|
||||
browsetemplate: string;
|
||||
docstemplate: string;
|
||||
filetemplate: string;
|
||||
shortcuttemplate: string;
|
||||
pathtemplate: 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;
|
||||
getDefaultRepresentation(): string;
|
||||
toString(opts?: HostedGitInfo.FillOptions): string | undefined;
|
||||
|
||||
static fromUrl(
|
||||
gitUrl: string,
|
||||
options?: HostedGitInfo.Options
|
||||
): HostedGitInfo;
|
||||
}
|
||||
|
||||
declare namespace HostedGitInfo {
|
||||
interface Options {
|
||||
noCommittish?: boolean;
|
||||
noGitPlus?: boolean;
|
||||
}
|
||||
|
||||
interface FillOptions extends Options {
|
||||
path?: string;
|
||||
auth?: string;
|
||||
fragment?: string;
|
||||
committish?: string;
|
||||
treepath?: string;
|
||||
}
|
||||
|
||||
type hosts = 'github' | 'bitbucket' | 'gitlab' | 'gist';
|
||||
}
|
||||
|
||||
export = HostedGitInfo;
|
||||
23
types/hosted-git-info/tsconfig.json
Normal file
23
types/hosted-git-info/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"hosted-git-info-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/hosted-git-info/tslint.json
Normal file
1
types/hosted-git-info/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user