diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts index 57e8c55d87..8152eb8a8d 100644 --- a/types/nodegit/commit.d.ts +++ b/types/nodegit/commit.d.ts @@ -25,7 +25,7 @@ export class Commit { static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; static createWithSignature(repo: Repository, commitContent: string, signature: string, signatureField: string): Promise; - amend(updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree): Promise; + amend(updateRef: string, author: Signature, committer: Signature, messageEncoding: string, message: string, tree: Tree | Oid): Promise; author(): Signature; committer(): Signature; diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 62de0de6c4..2f1abbda62 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -132,17 +132,18 @@ export class Diff { * * */ - static blobToBuffer(oldBlob: Blob, oldAsPath: string, - buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + static blobToBuffer(oldBlob: Blob | null, oldAsPath: string | null, + buffer: string | null, bufferAsPath: string | null, opts: DiffOptions | null, fileCb: Function | null, + binaryCb: Function | null, hunkCb: Function | null, lineCb: Function): Promise; static fromBuffer(content: string, contentLen: number): Promise; - static indexToWorkdir(repo: Repository, index: Index, opts?: DiffOptions): Promise; + static indexToWorkdir(repo: Repository, index: Index | null, opts?: DiffOptions): Promise; static indexToIndex(repo: Repository, oldIndex: Index, newIndex: Index, opts?: DiffOptions): Promise; - static treeToIndex(repo: Repository, oldTree: Tree, index: Index, opts?: DiffOptions): Promise; - static treeToTree(repo: Repository, oldTree: Tree, new_tree: Tree, opts?: DiffOptions): Promise; - static treeToWorkdir(repo: Repository, oldTree: Tree, opts?: DiffOptions): Promise; - static treeToWorkdirWithIndex(repo: Repository, oldTree: Tree, opts?: DiffOptions): Promise; + static treeToIndex(repo: Repository, oldTree: Tree | null, index: Index | null, opts?: DiffOptions): Promise; + static treeToTree(repo: Repository, oldTree: Tree | null, new_tree: Tree | null, opts?: DiffOptions): Promise; + static treeToWorkdir(repo: Repository, oldTree: Tree | null, opts?: DiffOptions): Promise; + static treeToWorkdirWithIndex(repo: Repository, oldTree: Tree | null, opts?: DiffOptions): Promise; - findSimilar(options: DiffFindOptions): Promise; + findSimilar(options?: DiffFindOptions): Promise; getDelta(idx: number): DiffDelta; getPerfdata(): Promise; numDeltas(): number; diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 8f0dd811a0..c0e18853a6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for nodegit 0.24 // Project: https://github.com/nodegit/nodegit, http://nodegit.org -// Definitions by: Dolan Miu , Tobias Nießen +// Definitions by: Dolan Miu , +// Tobias Nießen , +// Pierre Vigier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export { AnnotatedCommit } from './annotated-commit'; diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 9051fa693b..ca7ff41e86 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -1,8 +1,9 @@ import { AnnotatedCommit } from './annotated-commit'; import { Repository } from './repository'; -import { Object } from './object'; import { Strarray } from './str-array'; import { CheckoutOptions } from './checkout-options'; +import { Commit } from './commit'; +import { Tag } from './tag'; export namespace Reset { const enum TYPE { @@ -16,11 +17,11 @@ export class Reset { /** * Look up a refs's commit. */ - static reset(repo: Repository, target: Object, resetType: number, checkoutOpts: CheckoutOptions): Promise; + static reset(repo: Repository, target: Commit | Tag, resetType: number, checkoutOpts: CheckoutOptions): Promise; /** * Look up a refs's commit. */ - static default(repo: Repository, target: Object, pathspecs: Strarray | string | string[]): Promise; + static default(repo: Repository, target: Commit | Tag, pathspecs: Strarray | string | string[]): Promise; /** * Sets the current head to the specified commit oid and optionally resets the index and working tree to match. * This behaves like reset but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages. diff --git a/types/nodegit/revert.d.ts b/types/nodegit/revert.d.ts index 1f9d4a2677..df804cbb48 100644 --- a/types/nodegit/revert.d.ts +++ b/types/nodegit/revert.d.ts @@ -13,7 +13,7 @@ export interface RevertOptions { } export class Revert { - static revert(repo: Repository, commit: Commit, givenOpts: RevertOptions): Promise; + static revert(repo: Repository, commit: Commit, givenOpts?: RevertOptions): Promise; /** * Reverts the given commit against the given "our" commit, producing an index that reflects the result of the revert. */