From b47f2db564c54f8145a791fe197d7092c9b677c0 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:07:26 +0100 Subject: [PATCH] Added documentation --- types/nodegit/cert.d.ts | 6 + types/nodegit/clone-options.d.ts | 48 +++ types/nodegit/clone.d.ts | 21 ++ types/nodegit/commit.d.ts | 326 ++++++++++++++++++++- types/nodegit/config.d.ts | 69 +++++ types/nodegit/convenient-patch.d.ts | 119 ++++++++ types/nodegit/cred-user-pass-payload.d.ts | 12 + types/nodegit/cred-username.d.ts | 12 + types/nodegit/cred.d.ts | 78 ++++- types/nodegit/cvar-map.d.ts | 18 ++ types/nodegit/describe-format-options.d.ts | 24 ++ types/nodegit/describe-options.d.ts | 36 +++ types/nodegit/diff-binary-file.d.ts | 24 ++ types/nodegit/diff-binary.d.ts | 19 ++ types/nodegit/diff-file.d.ts | 35 +++ types/nodegit/diff-hunk.d.ts | 36 +++ types/nodegit/diff-line.d.ts | 51 ++++ types/nodegit/diff-options.d.ts | 103 ++++++- types/nodegit/diff-perf-data.d.ts | 18 ++ types/nodegit/diff.d.ts | 212 +++++++++++++- types/nodegit/error.d.ts | 12 + types/nodegit/fetch-options.d.ts | 45 +++ types/nodegit/fetch.d.ts | 10 + types/nodegit/filter.d.ts | 108 +++++++ types/nodegit/git-err.d.ts | 34 ++- types/nodegit/graph.d.ts | 22 ++ types/nodegit/ignore.d.ts | 29 ++ 27 files changed, 1500 insertions(+), 27 deletions(-) diff --git a/types/nodegit/cert.d.ts b/types/nodegit/cert.d.ts index fde86569b9..c368f83bb6 100644 --- a/types/nodegit/cert.d.ts +++ b/types/nodegit/cert.d.ts @@ -13,5 +13,11 @@ export namespace Cert { } export class Cert { + /** + * + * + * @type {Cert.TYPE} + * @memberof Cert + */ certType: Cert.TYPE; } diff --git a/types/nodegit/clone-options.d.ts b/types/nodegit/clone-options.d.ts index 8535b28c81..424a289cbe 100644 --- a/types/nodegit/clone-options.d.ts +++ b/types/nodegit/clone-options.d.ts @@ -2,12 +2,60 @@ import { CheckoutOptions } from './checkout-options'; import { FetchOptions } from './fetch-options'; export class CloneOptions { + /** + * + * + * @type {number} + * @memberof CloneOptions + */ version?: number; + /** + * + * + * @type {CheckoutOptions} + * @memberof CloneOptions + */ checkoutOpts?: CheckoutOptions; + /** + * + * + * @type {FetchOptions} + * @memberof CloneOptions + */ fetchOpts?: FetchOptions; + /** + * + * + * @type {number} + * @memberof CloneOptions + */ bare?: number; + /** + * + * + * @type {number} + * @memberof CloneOptions + */ local?: number; + /** + * + * + * @type {string} + * @memberof CloneOptions + */ checkoutBranch?: string; + /** + * + * + * @type {*} + * @memberof CloneOptions + */ repositoryCbPayload?: any; + /** + * + * + * @type {*} + * @memberof CloneOptions + */ remoteCbPayload?: any; } diff --git a/types/nodegit/clone.d.ts b/types/nodegit/clone.d.ts index c038a8e26a..61f8cfe2cf 100644 --- a/types/nodegit/clone.d.ts +++ b/types/nodegit/clone.d.ts @@ -11,6 +11,27 @@ export namespace Clone { } export class Clone { + /** + * Patch repository cloning to automatically coerce objects. + * + * @static + * @param {string} url + * @param {string} local_path + * @param {CloneOptions} [options] + * @returns {Promise} + * + * @memberof Clone + */ static clone(url: string, local_path: string, options?: CloneOptions): Promise; + /** + * + * + * @static + * @param {CloneOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Clone + */ static initOptions(opts: CloneOptions, version: number): number; } diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts index 24ee08cc48..247fdb102d 100644 --- a/types/nodegit/commit.d.ts +++ b/types/nodegit/commit.d.ts @@ -10,40 +10,360 @@ import { TreeEntry } from './tree-entry'; import { Diff } from './diff'; export class Commit { - static create(repo: Repository, update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree, parent_count: number, parents: any[]): Oid; - static createV(id: Oid, repo: Repository, update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree, parent_count: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {string} messageEncoding + * @param {string} message + * @param {Tree} tree + * @param {number} parentCount + * @param {any[]} parents + * @returns {Oid} + * + * @memberof Commit + */ + static create(repo: Repository, updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree, parentCount: number, parents: any[]): Oid; + /** + * + * + * @static + * @param {Oid} id + * @param {Repository} repo + * @param {string} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {string} messageEncoding + * @param {string} message + * @param {Tree} tree + * @param {number} parentCount + * @returns {number} + * + * @memberof Commit + */ + static createV(id: Oid, repo: Repository, updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree, parentCount: number): number; + /** + * Retrieves the commit pointed to by the oid + * + * @static + * @param {Repository} repo + * @param {(string | Oid | Commit)} id + * @returns {Promise} + * + * @memberof Commit + */ static lookup(repo: Repository, id: string | Oid | Commit): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @returns {Promise} + * + * @memberof Commit + */ static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} commitContent + * @param {string} signature + * @param {string} signatureField + * @returns {Promise} + * + * @memberof Commit + */ + static createWithSignature(repo: Repository, commitContent: string, signature: string, signatureField: string): Promise; - amend(update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree): Oid; + /** + * + * + * @param {string} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {string} messageEncoding + * @param {string} message + * @param {Tree} tree + * @returns {Oid} + * + * @memberof Commit + */ + amend(updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree): Oid; + /** + * + * + * @returns {Signature} + * + * @memberof Commit + */ author(): Signature; + /** + * + * + * @returns {Signature} + * + * @memberof Commit + */ committer(): Signature; + /** + * + * + * + * @memberof Commit + */ free(): void; + /** + * + * + * @param {string} field + * @returns {Promise} + * + * @memberof Commit + */ headerField(field: string): Promise; + /** + * + * + * @returns {Oid} + * + * @memberof Commit + */ id(): Oid; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ message(): string; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ messageEncoding(): string; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ messageRaw(): string; + /** + * + * + * @param {number} n + * @returns {Promise} + * + * @memberof Commit + */ nthGenAncestor(n: number): Promise; + /** + * + * + * @returns {Repository} + * + * @memberof Commit + */ owner(): Repository; + /** + * + * + * @param {number} n + * @returns {Promise} + * + * @memberof Commit + */ parent(n: number): Promise; + /** + * + * + * @param {number} n + * @returns {Oid} + * + * @memberof Commit + */ parentId(n: number): Oid; + /** + * + * + * @returns {number} + * + * @memberof Commit + */ parentcount(): number; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ rawHeader(): string; + /** + * + * + * @returns {string} + * + * @memberof Commit + */ summary(): string; + /** + * + * + * @returns {number} + * + * @memberof Commit + */ time(): number; + /** + * + * + * @returns {number} + * + * @memberof Commit + */ timeOffset(): number; + /** + * + * + * @param {Tree} tree_out + * @returns {number} + * + * @memberof Commit + */ tree(tree_out: Tree): number; + /** + * + * + * @returns {Oid} + * + * @memberof Commit + */ treeId(): Oid; + /** + * Retrieve the SHA. + * + * @returns {string} + * + * @memberof Commit + */ sha(): string; + /** + * Retrieve the commit time as a unix timestamp. + * + * @returns {number} + * + * @memberof Commit + */ timeMs(): number; + /** + * Retrieve the commit time as a Date object. + * + * @returns {Date} + * + * @memberof Commit + */ date(): Date; + /** + * Get the tree associated with this commit. + * + * @returns {Promise} + * + * @memberof Commit + */ getTree(): Promise; + /** + * Retrieve the entry represented by path for this commit. Path must be relative to repository root. + * + * @param {string} path + * @returns {Promise} + * + * @memberof Commit + */ getEntry(path: string): Promise; + /** + * Walk the history from this commit backwards. + * An EventEmitter is returned that will emit a "commit" event for each commit in the history, and one "end" + * event when the walk is completed. Don't forget to call start() on the returned event. + * + * @returns {EventEmitter} + * + * @memberof Commit + */ history(): EventEmitter; + /** + * Retrieve the commit's parents as commit objects. + * + * @param {number} limit + * @param {Function} callback + * @returns {Promise} + * + * @memberof Commit + */ getParents(limit: number, callback: Function): Promise; + /** + * Retrieve the commit's parent shas. + * + * @param {Function} callback + * @returns {Oid[]} + * + * @memberof Commit + */ parents(callback: Function): Oid[]; + /** + * Generate an array of diff trees showing changes between this commit and its parent(s). + * + * @param {Function} callback + * @returns {Promise} + * + * @memberof Commit + */ getDiff(callback: Function): Promise; + /** + * Generate an array of diff trees showing changes between this commit and its parent(s). + * + * @param {Object} options + * @param {Function} callback + * @returns {Promise} + * + * @memberof Commit + */ getDiffWithOptions(options: Object, callback: Function): Promise; + /** + * The sha of this commit + * + * @returns {string} + * + * @memberof Commit + */ toString(): string; + /** + * + * + * @returns {Promise} + * + * @memberof Commit + */ + dup(): Promise; + /** + * consists of a summary + * + * @returns {string} + * + * @memberof Commit + */ + body(): string; } diff --git a/types/nodegit/config.d.ts b/types/nodegit/config.d.ts index ea61c52d3c..eea13c6c70 100644 --- a/types/nodegit/config.d.ts +++ b/types/nodegit/config.d.ts @@ -12,11 +12,80 @@ export namespace Config { } export class Config { + /** + * + * + * @static + * @returns {Promise} + * + * @memberof Config + */ static openDefault(): Promise; + /** + * + * + * @static + * @returns {Promise} + * + * @memberof Config + */ + static findProgramdata(): Promise; + /** + * + * + * @param {string} name + * @returns {Promise} + * + * @memberof Config + */ getStringBuf(name: string): Promise; + /** + * + * + * @param {string} name + * @param {number} value + * @returns {number} + * + * @memberof Config + */ setInt64(name: string, value: number): number; + /** + * + * + * @param {string} name + * @param {string} regexp + * @param {string} value + * @returns {number} + * + * @memberof Config + */ setMultivar(name: string, regexp: string, value: string): number; + /** + * + * + * @param {string} name + * @param {string} value + * @returns {Promise} + * + * @memberof Config + */ setString(name: string, value: string): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Config + */ snapshot(): Promise; + /** + * + * + * @param {*} transaction + * @returns {number} + * + * @memberof Config + */ + lock(transaction: any): number; } diff --git a/types/nodegit/convenient-patch.d.ts b/types/nodegit/convenient-patch.d.ts index 8dee260aa0..b03bb2ff54 100644 --- a/types/nodegit/convenient-patch.d.ts +++ b/types/nodegit/convenient-patch.d.ts @@ -1,21 +1,140 @@ import { DiffFile } from './diff-file'; export class ConvenientPatch { + /** + * Old attributes of the file + * + * @returns {DiffFile} + * + * @memberof ConvenientPatch + */ oldFile(): DiffFile; + /** + * New attributes of the file + * + * @returns {DiffFile} + * + * @memberof ConvenientPatch + */ newFile(): DiffFile; + /** + * The number of hunks in this patch + * + * @returns {number} + * + * @memberof ConvenientPatch + */ size(): number; + /** + * The hunks in this patch + * + * @returns {Promise} + * + * @memberof ConvenientPatch + */ hunks(): Promise; + /** + * The status of this patch (unmodified, added, deleted) + * + * @returns {number} + * + * @memberof ConvenientPatch + */ status(): number; + /** + * The line statistics of this patch (#contexts, #added, #deleted) + * + * @returns {*} + * + * @memberof ConvenientPatch + */ lineStats(): any; + /** + * Is this an unmodified patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isUnmodified(): Boolean; + /** + * Is this an added patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isAdded(): Boolean; + /** + * Is this a deleted patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isDeleted(): Boolean; + /** + * Is this an modified patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isModified(): Boolean; + /** + * Is this a renamed patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isRenamed(): Boolean; + /** + * Is this a copied patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isCopied(): Boolean; + /** + * Is this an ignored patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isIgnored(): Boolean; + /** + * Is this an untracked patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isUntracked(): Boolean; + /** + * Is this a type change? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isTypeChange(): Boolean; + /** + * Is this an undreadable patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isUnreadable(): Boolean; + /** + * Is this a conflicted patch? + * + * @returns {Boolean} + * + * @memberof ConvenientPatch + */ isConflicted(): Boolean; } diff --git a/types/nodegit/cred-user-pass-payload.d.ts b/types/nodegit/cred-user-pass-payload.d.ts index 95beeb9f3a..fdf65b9342 100644 --- a/types/nodegit/cred-user-pass-payload.d.ts +++ b/types/nodegit/cred-user-pass-payload.d.ts @@ -1,4 +1,16 @@ export class CredUserpassPayload { + /** + * + * + * @type {string} + * @memberof CredUserpassPayload + */ username: string; + /** + * + * + * @type {string} + * @memberof CredUserpassPayload + */ password: string; } diff --git a/types/nodegit/cred-username.d.ts b/types/nodegit/cred-username.d.ts index d7b619eb5d..2522b3968a 100644 --- a/types/nodegit/cred-username.d.ts +++ b/types/nodegit/cred-username.d.ts @@ -1,6 +1,18 @@ import { Cred } from './cred'; export class CredUsername { + /** + * + * + * @type {Cred} + * @memberof CredUsername + */ parent: Cred; + /** + * + * + * @type {string} + * @memberof CredUsername + */ username: string; } diff --git a/types/nodegit/cred.d.ts b/types/nodegit/cred.d.ts index 9de014311b..d7b96c9fd8 100644 --- a/types/nodegit/cred.d.ts +++ b/types/nodegit/cred.d.ts @@ -11,12 +11,86 @@ export namespace Cred { } export class Cred { + /** + * + * + * @static + * @returns {Cred} + * + * @memberof Cred + */ static defaultNew(): Cred; + /** + * + * + * @static + * @param {string} username + * @returns {Cred} + * + * @memberof Cred + */ static sshKeyFromAgent(username: string): Cred; - static sshKeyMemoryNew(username: string, publickey: string, privatekey: string, passphrase: string): Promise; - static sshKeyNew(username: string, publickey: string, privatekey: string, passphrase: string): Cred; + /** + * + * + * @static + * @param {string} username + * @param {string} publicKey + * @param {string} privateKey + * @param {string} passphrase + * @returns {Promise} + * + * @memberof Cred + */ + static sshKeyMemoryNew(username: string, publicKey: string, privateKey: string, passphrase: string): Promise; + /** + * + * + * @static + * @param {string} username + * @param {string} publicKey + * @param {string} privateKey + * @param {string} passphrase + * @returns {Cred} + * + * @memberof Cred + */ + static sshKeyNew(username: string, publicKey: string, privateKey: string, passphrase: string): Cred; + /** + * + * + * @static + * @param {string} username + * @returns {Promise} + * + * @memberof Cred + */ static usernameNew(username: string): Promise; + /** + * + * + * @static + * @param {string} username + * @param {string} password + * @returns {Cred} + * + * @memberof Cred + */ static userpassPlaintextNew(username: string, password: string): Cred; + /** + * + * + * @returns {number} + * + * @memberof Cred + */ hasUsername(): number; + /** + * + * + * + * @memberof Cred + */ + free(): void; } diff --git a/types/nodegit/cvar-map.d.ts b/types/nodegit/cvar-map.d.ts index f7c4b227d0..2a5665dc6b 100644 --- a/types/nodegit/cvar-map.d.ts +++ b/types/nodegit/cvar-map.d.ts @@ -1,5 +1,23 @@ export class CvarMap { + /** + * + * + * @type {number} + * @memberof CvarMap + */ cvarType: number; + /** + * + * + * @type {string} + * @memberof CvarMap + */ strMatch: string; + /** + * + * + * @type {number} + * @memberof CvarMap + */ mapValue: number; } diff --git a/types/nodegit/describe-format-options.d.ts b/types/nodegit/describe-format-options.d.ts index ecb7f4d762..4a67cd9082 100644 --- a/types/nodegit/describe-format-options.d.ts +++ b/types/nodegit/describe-format-options.d.ts @@ -1,6 +1,30 @@ export class DescribeFormatOptions { + /** + * + * + * @type {number} + * @memberof DescribeFormatOptions + */ version: number; + /** + * + * + * @type {number} + * @memberof DescribeFormatOptions + */ abbreviatedSize: number; + /** + * + * + * @type {number} + * @memberof DescribeFormatOptions + */ alwaysUseLongFormat: number; + /** + * + * + * @type {string} + * @memberof DescribeFormatOptions + */ dirtySuffix: string; } diff --git a/types/nodegit/describe-options.d.ts b/types/nodegit/describe-options.d.ts index 939750eb11..f860bb88e9 100644 --- a/types/nodegit/describe-options.d.ts +++ b/types/nodegit/describe-options.d.ts @@ -1,8 +1,44 @@ export class DescribeOptions { + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ version: number; + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ maxCandidatesTags: number; + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ describeStrategy: number; + /** + * + * + * @type {string} + * @memberof DescribeOptions + */ pattern: string; + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ onlyFollowFirstParent: number; + /** + * + * + * @type {number} + * @memberof DescribeOptions + */ showCommitOidAsFallback: number; } diff --git a/types/nodegit/diff-binary-file.d.ts b/types/nodegit/diff-binary-file.d.ts index 46b67f406e..9774b99b87 100644 --- a/types/nodegit/diff-binary-file.d.ts +++ b/types/nodegit/diff-binary-file.d.ts @@ -1,6 +1,30 @@ export class DiffBinaryFile { + /** + * + * + * @type {number} + * @memberof DiffBinaryFile + */ type: number; + /** + * + * + * @type {string} + * @memberof DiffBinaryFile + */ data: string; + /** + * + * + * @type {number} + * @memberof DiffBinaryFile + */ datalen: number; + /** + * + * + * @type {number} + * @memberof DiffBinaryFile + */ inflatedlen: number; } diff --git a/types/nodegit/diff-binary.d.ts b/types/nodegit/diff-binary.d.ts index d01181c92a..f447510165 100644 --- a/types/nodegit/diff-binary.d.ts +++ b/types/nodegit/diff-binary.d.ts @@ -9,6 +9,25 @@ export namespace DiffBinary { } export class DiffBinary { + /** + * + * + * @type {DiffBinaryFile} + * @memberof DiffBinary + */ oldFile: DiffBinaryFile; + /** + * + * + * @type {DiffBinaryFile} + * @memberof DiffBinary + */ newFile: DiffBinaryFile; + /** + * + * + * @type {DiffBinary.DIFF_BINARY} + * @memberof DiffBinary + */ + containsData: DiffBinary.DIFF_BINARY; } diff --git a/types/nodegit/diff-file.d.ts b/types/nodegit/diff-file.d.ts index 99646ec08b..7602f0dba9 100644 --- a/types/nodegit/diff-file.d.ts +++ b/types/nodegit/diff-file.d.ts @@ -1,9 +1,44 @@ import { Oid } from './oid'; export class DiffFile { + /** + * Returns the file's flags + * + * @returns {number} + * + * @memberof DiffFile + */ flags(): number; + /** + * Returns the file's Oid + * + * @returns {Oid} + * + * @memberof DiffFile + */ id(): Oid; + /** + * Returns the file's mode + * + * @returns {number} + * + * @memberof DiffFile + */ mode(): number; + /** + * Returns the file's path + * + * @returns {string} + * + * @memberof DiffFile + */ path(): string; + /** + * Returns the file's size + * + * @returns {number} + * + * @memberof DiffFile + */ size(): number; } diff --git a/types/nodegit/diff-hunk.d.ts b/types/nodegit/diff-hunk.d.ts index 14a1a9a304..1a522ae8c6 100644 --- a/types/nodegit/diff-hunk.d.ts +++ b/types/nodegit/diff-hunk.d.ts @@ -1,8 +1,44 @@ export class DiffHunk { + /** + * + * + * @type {number} + * @memberof DiffHunk + */ oldStart: number; + /** + * + * + * @type {number} + * @memberof DiffHunk + */ oldLines: number; + /** + * + * + * @type {number} + * @memberof DiffHunk + */ newStart: number; + /** + * + * + * @type {number} + * @memberof DiffHunk + */ newLines: number; + /** + * + * + * @type {number} + * @memberof DiffHunk + */ headerLen: number; + /** + * + * + * @type {string} + * @memberof DiffHunk + */ header: string; } diff --git a/types/nodegit/diff-line.d.ts b/types/nodegit/diff-line.d.ts index 587653b09f..612041a92d 100644 --- a/types/nodegit/diff-line.d.ts +++ b/types/nodegit/diff-line.d.ts @@ -1,9 +1,60 @@ export class DiffLine { + /** + * The relevant line + * + * @returns {string} + * + * @memberof DiffLine + */ content(): string; + /** + * The non utf8 translated text + * + * @returns {string} + * + * @memberof DiffLine + */ + rawContent(): string; + /** + * + * + * @type {number} + * @memberof DiffLine + */ origin: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ oldLineno: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ newLineno: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ numLines: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ contentLen: number; + /** + * + * + * @type {number} + * @memberof DiffLine + */ contentOffset: number; } diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts index 32dec9943f..c4f28f984f 100644 --- a/types/nodegit/diff-options.d.ts +++ b/types/nodegit/diff-options.d.ts @@ -1,16 +1,95 @@ import { Strarray } from './str-array'; export interface DiffOptions { - version: number; - flags: number; - ignoreSubmodules: number; - pathspec: Strarray; - notifyCb: Function; - notifyPayload: any; - contextLines: number; - interhunkLines: number; - idAbbrev: number; - maxSize: number; - oldPrefix: string; - newPrefix: string; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + version?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + flags?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + ignoreSubmodules?: number; + /** + * + * + * @type {Strarray} + * @memberof DiffOptions + */ + pathspec?: Strarray; + /** + * + * + * @type {Function} + * @memberof DiffOptions + */ + notifyCb?: Function; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + contextLines?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + interhunkLines?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + idAbbrev?: number; + /** + * + * + * @type {number} + * @memberof DiffOptions + */ + maxSize?: number; + /** + * + * + * @type {string} + * @memberof DiffOptions + */ + oldPrefix?: string; + /** + * + * + * @type {string} + * @memberof DiffOptions + */ + newPrefix?: string; + /** + * + * + * @type {*} + * @memberof DiffOptions + */ + payload?: any; + /** + * + * + * @type {*} + * @memberof DiffOptions + */ + progressCb?: any; } diff --git a/types/nodegit/diff-perf-data.d.ts b/types/nodegit/diff-perf-data.d.ts index 5dfca09670..30bae1d2c9 100644 --- a/types/nodegit/diff-perf-data.d.ts +++ b/types/nodegit/diff-perf-data.d.ts @@ -1,5 +1,23 @@ export class DiffPerfdata { + /** + * + * + * @type {number} + * @memberof DiffPerfdata + */ version: number; + /** + * + * + * @type {number} + * @memberof DiffPerfdata + */ statCalls: number; + /** + * + * + * @type {number} + * @memberof DiffPerfdata + */ oidCalculations: number; } diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 6926527124..23d3ddf5fc 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -6,15 +6,58 @@ import { Index } from './index_'; import { DiffDelta } from './diff-delta'; import { DiffPerfdata } from './diff-perf-data'; import { DiffOptions } from './diff-options'; +import { Buf } from './buf'; export interface DiffFindOptions { - version: number; - flags: number; - renameThreshold: number; - renameFromRewriteThreshold: number; - copyThreshold: number; - breakRewriteThreshold: number; - renameLimit: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + version?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + flags?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + renameThreshold?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + renameFromRewriteThreshold?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + copyThreshold?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + breakRewriteThreshold?: number; + /** + * + * + * @type {number} + * @memberof DiffFindOptions + */ + renameLimit?: number; } export namespace Diff { @@ -125,17 +168,170 @@ export namespace Diff { } export class Diff { + /** + * Directly run a diff between a blob and a buffer. + * + * @static + * @param {Blob} old_blob + * @param {string} oldAsPath + * @param {string} buffer + * @param {string} bufferAsPath + * @param {DiffOptions} opts + * @param {Function} fileCb + * @param {Function} binaryCb + * @param {Function} hunkCb + * @param {Function} lineCb + * @returns {Promise} + * + * @memberof Diff + */ static blobToBuffer(old_blob: Blob, oldAsPath: string, - buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + /** + * + * + * @static + * @param {string} content + * @param {number} contentLen + * @returns {Promise} + * + * @memberof Diff + */ + static fromBuffer(content: string, contentLen: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Index} index + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Index} oldIndex + * @param {Index} newIndex + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ + static indexToIndex(repo: Repository, oldIndex: Index, newIndex: Index, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} old_tree + * @param {Index} index + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} old_tree + * @param {Tree} new_tree + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} old_tree + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static treeToWorkdir(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} old_tree + * @param {DiffOptions} opts + * @returns {Promise} + * + * @memberof Diff + */ static treeToWorkdirWithIndex(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + /** + * + * + * @param {DiffFindOptions} options + * @returns {Promise} + * + * @memberof Diff + */ findSimilar(options: DiffFindOptions): Promise; + /** + * + * + * @param {number} idx + * @returns {DiffDelta} + * + * @memberof Diff + */ getDelta(idx: number): DiffDelta; + /** + * + * + * @returns {Promise} + * + * @memberof Diff + */ getPerfdata(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Diff + */ numDeltas(): number; + /** + * Retrieve patches in this difflist + * + * @returns {Promise} + * + * @memberof Diff + */ patches(): Promise; + /** + * + * + * @param {Diff} from + * @returns {Promise} + * + * @memberof Diff + */ + merge(from: Diff): Promise; + /** + * + * + * @param {Diff.FORMAT} format + * @returns {Promise} + * + * @memberof Diff + */ + toBuf(format: Diff.FORMAT): Promise; } diff --git a/types/nodegit/error.d.ts b/types/nodegit/error.d.ts index c259749e8b..9acf4cc2cd 100644 --- a/types/nodegit/error.d.ts +++ b/types/nodegit/error.d.ts @@ -63,6 +63,18 @@ export namespace Error { } export class Error { + /** + * + * + * @type {string} + * @memberof Error + */ message: string; + /** + * + * + * @type {number} + * @memberof Error + */ klass: number; } diff --git a/types/nodegit/fetch-options.d.ts b/types/nodegit/fetch-options.d.ts index 1aa26fd974..3b3a1b26c1 100644 --- a/types/nodegit/fetch-options.d.ts +++ b/types/nodegit/fetch-options.d.ts @@ -1,9 +1,54 @@ import { RemoteCallbacks } from './remote-callbacks'; +import { Strarray} from './str-array'; export interface FetchOptions { + /** + * + * + * @type {number} + * @memberof FetchOptions + */ version?: number; + /** + * + * + * @type {RemoteCallbacks} + * @memberof FetchOptions + */ callbacks?: RemoteCallbacks; + /** + * + * + * @type {number} + * @memberof FetchOptions + */ prune?: number; + /** + * + * + * @type {number} + * @memberof FetchOptions + */ updateFetchhead?: number; + /** + * + * + * @type {number} + * @memberof FetchOptions + */ downloadTags?: number; + /** + * + * + * @type {Strarray} + * @memberof FetchOptions + */ + customHeaders?: Strarray; + /** + * + * + * @type {*} + * @memberof FetchOptions + */ + proxyOpts?: any; } diff --git a/types/nodegit/fetch.d.ts b/types/nodegit/fetch.d.ts index db0980586f..b777066629 100644 --- a/types/nodegit/fetch.d.ts +++ b/types/nodegit/fetch.d.ts @@ -9,5 +9,15 @@ export namespace Fetch { } export class Fetch { + /** + * + * + * @static + * @param {FetchOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Fetch + */ static initOptions(opts: FetchOptions, version: number): number; } diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts index 066a51183e..7b73196ed0 100644 --- a/types/nodegit/filter.d.ts +++ b/types/nodegit/filter.d.ts @@ -19,17 +19,125 @@ export namespace Filter { } export class Filter { + /** + * + * + * @static + * @param {*} filters + * @param {string} name + * @returns {number} + * + * @memberof Filter + */ static listContains(filters: any, name: string): number; + /** + * + * + * @static + * @param {*} fl + * @returns {number} + * + * @memberof Filter + */ static listLength(fl: any): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {number} mode + * @param {number} options + * @returns {Promise} + * + * @memberof Filter + */ static listNew(repo: Repository, mode: number, options: number): Promise; + /** + * + * + * @static + * @param {*} filters + * @param {Blob} blob + * @param {WriteStream} target + * @returns {number} + * + * @memberof Filter + */ static listStreamBlob(filters: any, blob: Blob, target: WriteStream): number; + /** + * + * + * @static + * @param {*} filters + * @param {Buf} data + * @param {WriteStream} target + * @returns {number} + * + * @memberof Filter + */ static listStreamData(filters: any, data: Buf, target: WriteStream): number; + /** + * + * + * @static + * @param {*} filters + * @param {Repository} repo + * @param {string} path + * @param {WriteStream} target + * @returns {number} + * + * @memberof Filter + */ static listStreamFile(filters: any, repo: Repository, path: string, target: WriteStream): number; + /** + * + * + * @static + * @param {string} name + * @returns {number} + * + * @memberof Filter + */ static unregister(name: string): number; + /** + * + * + * @param {string} name + * @returns {Filter} + * + * @memberof Filter + */ lookup(name: string): Filter; + /** + * + * + * @param {string} name + * @param {number} priority + * @returns {number} + * + * @memberof Filter + */ register(name: string, priority: number): number; + /** + * + * + * @type {number} + * @memberof Filter + */ version: number; + /** + * + * + * @type {string} + * @memberof Filter + */ attributes: string; + /** + * + * + * @type {Function} + * @memberof Filter + */ stream: Function; } diff --git a/types/nodegit/git-err.d.ts b/types/nodegit/git-err.d.ts index 6a9da24bb3..541a191e30 100644 --- a/types/nodegit/git-err.d.ts +++ b/types/nodegit/git-err.d.ts @@ -1,9 +1,39 @@ import { Error } from './error'; export class Giterr { + /** + * + * + * @static + * + * @memberof Giterr + */ static errClear(): void; - static errDetach(cpy: Error): number; + /** + * + * + * @static + * @returns {Error} + * + * @memberof Giterr + */ static errLast(): Error; + /** + * + * + * @static + * + * @memberof Giterr + */ static errSetOom(): void; - static errSetString(error_class: number, string: string): void; + /** + * + * + * @static + * @param {number} errorClass + * @param {string} string + * + * @memberof Giterr + */ + static errSetString(errorClass: number, string: string): void; } diff --git a/types/nodegit/graph.d.ts b/types/nodegit/graph.d.ts index d16d7b5dee..90639a5075 100644 --- a/types/nodegit/graph.d.ts +++ b/types/nodegit/graph.d.ts @@ -2,6 +2,28 @@ import { Repository } from './repository'; import { Oid } from './oid'; export class Graph { + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} local + * @param {Oid} upstream + * @returns {Promise} + * + * @memberof Graph + */ static aheadBehind(repo: Repository, local: Oid, upstream: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} commit + * @param {Oid} ancestor + * @returns {Promise} + * + * @memberof Graph + */ static descendantOf(repo: Repository, commit: Oid, ancestor: Oid): Promise; } diff --git a/types/nodegit/ignore.d.ts b/types/nodegit/ignore.d.ts index c38d84d1f3..017637c8d2 100644 --- a/types/nodegit/ignore.d.ts +++ b/types/nodegit/ignore.d.ts @@ -1,7 +1,36 @@ import { Repository } from './repository'; export class Ignore { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} rules + * @returns {number} + * + * @memberof Ignore + */ static addRule(repo: Repository, rules: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @returns {number} + * + * @memberof Ignore + */ static clearInternalRules(repo: Repository): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} path + * @returns {Promise} + * + * @memberof Ignore + */ static pathIsIgnored(repo: Repository, path: string): Promise; }