Initial commit of files

This commit is contained in:
Dolan 2017-06-01 21:09:29 +01:00
parent e3a587edc9
commit 7ded9e7db4
5 changed files with 111 additions and 0 deletions

6
types/nodegit/index.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
// Type definitions for nodegit 0.18
// Project: https://github.com/nodegit/nodegit
// Definitions by: Dolan Miu <https://github.com/dolanmiu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export { Repository } from './repository';

View File

@ -0,0 +1,5 @@
import * as Git from 'nodegit';
Git.Repository.discover("startPath", 1, "ceilingDirs").then((string) => {
// Use string
});

71
types/nodegit/repository.d.ts vendored Normal file
View File

@ -0,0 +1,71 @@
interface RepositoryInitOptions {
description: string,
flags: number,
initialHead: string,
mode: number,
originUrl: string,
templatePath: string,
version: number,
workdirPath: string
}
export class Repository {
/**
* Creates a branch with the passed in name pointing to the commit
*
* @static
* @param {string} startPath
* @param {number} acrossFs
* @param {string} ceilingDirs
* @returns {Promise<string>}
*
* @memberof Repository
*/
static discover(startPath: string, acrossFs: number, ceilingDirs: string): Promise<string>;
/**
*
*
* @static
* @param {string} path
* @param {boolean} [isBare]
* @returns {Promise<Repository>}
*
* @memberof Repository
*/
static init(path: string, isBare?: boolean): Promise<Repository>;
/**
*
*
* @static
* @param {string} repoPath
* @param {RepositoryInitOptions} [options]
* @returns {Promise<Repository>}
*
* @memberof Repository
*/
static initExt(repoPath: string, options?: RepositoryInitOptions): Promise<Repository>;
/**
*
*
* @static
* @param {string} path
* @returns {Promise<Repository>}
*
* @memberof Repository
*/
static open(path: string): Promise<Repository>;
/**
*
*
* @static
* @param {string} barePath
* @returns {Promise<Repository>}
*
* @memberof Repository
*/
static openBare(barePath: string): Promise<Repository>;
static openExt(path: string, flags?: number, ceilingDirs?: string): Promise<Repository>;
// getBranchCommit(name: string): Promise<Commit>;
}

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"nodegit-tests.ts",
"repository.d.ts"
]
}

View File

@ -0,0 +1,6 @@
{
"extends": "dtslint/dt.json",
"rules": {
"ban-types": false
}
}