diff --git a/types/nodegit/blame-options.d.ts b/types/nodegit/blame-options.d.ts index 6452eb08cb..1fdc6f6281 100644 --- a/types/nodegit/blame-options.d.ts +++ b/types/nodegit/blame-options.d.ts @@ -8,4 +8,5 @@ export class BlameOptions { oldestCommit?: Oid; minLine?: number; maxLine?: number; + [key: string]: any; } diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index 4122dfbe28..d711ae7ba9 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -23,4 +23,5 @@ export class CheckoutOptions { theirLabel?: string; perfdataCb?: any; perfdataPayload?: undefined; + [key: string]: any; } diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts index 8a7a259cbf..5c9a82bf70 100644 --- a/types/nodegit/commit.d.ts +++ b/types/nodegit/commit.d.ts @@ -85,25 +85,25 @@ export class Commit { * * */ - getParents(limit: number, callback: Function): Promise; + getParents(limit: number, callback?: Function): Promise; /** * Retrieve the commit's parent shas. * * */ - parents(callback: Function): Oid[]; + parents(): Oid[]; /** * Generate an array of diff trees showing changes between this commit and its parent(s). * * */ - getDiff(callback: Function): Promise; + getDiff(callback?: Function): Promise; /** * Generate an array of diff trees showing changes between this commit and its parent(s). * * */ - getDiffWithOptions(options: Object, callback: Function): Promise; + getDiffWithOptions(options: Object, callback?: Function): Promise; /** * The sha of this commit * diff --git a/types/nodegit/convenient-hunk.d.ts b/types/nodegit/convenient-hunk.d.ts new file mode 100644 index 0000000000..a844fd4e9b --- /dev/null +++ b/types/nodegit/convenient-hunk.d.ts @@ -0,0 +1,37 @@ +import { DiffLine } from './diff-line'; + +export class ConvenientHunk { + /** + * Diff header string that represents the context of this hunk + * of the diff. Something like `@@ -169,14 +167,12 @@ ...` + */ + header(): string; + /** + * The length of the header + */ + headerLen(): number; + /** + * The lines in this hunk + */ + lines(): Promise; + /** + * The number of new lines in the hunk + */ + newLines(): number; + /** + * The starting offset of the first new line in the file + */ + newStart(): number; + /** + * The number of old lines in the hunk + */ + oldLines(): number; + /** + * The starting offset of the first old line in the file + */ + oldStart(): number; + /** + * Number of lines in this hunk + */ + size(): number; +} diff --git a/types/nodegit/convenient-patch.d.ts b/types/nodegit/convenient-patch.d.ts index 68951ded3c..05fa0def4f 100644 --- a/types/nodegit/convenient-patch.d.ts +++ b/types/nodegit/convenient-patch.d.ts @@ -1,3 +1,4 @@ +import { ConvenientHunk } from './convenient-hunk'; import { DiffFile } from './diff-file'; export class ConvenientPatch { @@ -16,7 +17,7 @@ export class ConvenientPatch { /** * The hunks in this patch */ - hunks(): Promise; + hunks(): Promise; /** * The status of this patch (unmodified, added, deleted) */ diff --git a/types/nodegit/describe-format-options.d.ts b/types/nodegit/describe-format-options.d.ts index 2ada190800..b4213f0d68 100644 --- a/types/nodegit/describe-format-options.d.ts +++ b/types/nodegit/describe-format-options.d.ts @@ -3,4 +3,5 @@ export class DescribeFormatOptions { abbreviatedSize?: number; alwaysUseLongFormat?: number; dirtySuffix?: string; + [key: string]: any; } diff --git a/types/nodegit/describe-options.d.ts b/types/nodegit/describe-options.d.ts index 9712228ec2..2934006a93 100644 --- a/types/nodegit/describe-options.d.ts +++ b/types/nodegit/describe-options.d.ts @@ -5,4 +5,5 @@ export class DescribeOptions { pattern?: string; onlyFollowFirstParent?: number; showCommitOidAsFallback?: number; + [key: string]: any; } diff --git a/types/nodegit/diff-hunk.d.ts b/types/nodegit/diff-hunk.d.ts deleted file mode 100644 index 14a1a9a304..0000000000 --- a/types/nodegit/diff-hunk.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export class DiffHunk { - oldStart: number; - oldLines: number; - newStart: number; - newLines: number; - headerLen: number; - header: string; -} diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts index 06821b9608..408a0530e1 100644 --- a/types/nodegit/diff-options.d.ts +++ b/types/nodegit/diff-options.d.ts @@ -14,4 +14,5 @@ export interface DiffOptions { newPrefix?: string; payload?: any; progressCb?: any; + [key: string]: any; } diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 6d8a161e9d..62de0de6c4 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -7,6 +7,7 @@ import { DiffDelta } from './diff-delta'; import { DiffPerfdata } from './diff-perf-data'; import { DiffOptions } from './diff-options'; import { Buf } from './buf'; +import { ConvenientPatch } from './convenient-patch'; export interface DiffFindOptions { version?: number; @@ -134,12 +135,12 @@ 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 fromBuffer(content: string, contentLen: number): Promise; - static indexToWorkdir(repo: Repository, index: Index, 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 indexToWorkdir(repo: Repository, index: Index, 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; findSimilar(options: DiffFindOptions): Promise; getDelta(idx: number): DiffDelta; @@ -150,7 +151,7 @@ export class Diff { * * */ - patches(): Promise; + patches(): Promise; merge(from: Diff): Promise; toBuf(format: Diff.FORMAT): Promise; } diff --git a/types/nodegit/fetch-options.d.ts b/types/nodegit/fetch-options.d.ts index b2fd38cfbb..77b5a9586c 100644 --- a/types/nodegit/fetch-options.d.ts +++ b/types/nodegit/fetch-options.d.ts @@ -9,4 +9,5 @@ export interface FetchOptions { downloadTags?: number; customHeaders?: Strarray; proxyOpts?: any; + [key: string]: any; } diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index b0a68f67b5..e6d95ba83e 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -22,6 +22,7 @@ export { CloneOptions } from './clone-options'; export { Clone } from './clone'; export { Commit } from './commit'; export { Config } from './config'; +export { ConvenientHunk } from './convenient-hunk'; export { ConvenientPatch } from './convenient-patch'; export { CredUserpassPayload } from './cred-user-pass-payload'; export { CredUsername } from './cred-username'; @@ -33,7 +34,6 @@ export { DiffBinaryFile } from './diff-binary-file'; export { DiffBinary } from './diff-binary'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; -export { DiffHunk } from './diff-hunk'; export { DiffLine } from './diff-line'; export { DiffOptions } from './diff-options'; export { DiffPerfdata } from './diff-perf-data'; @@ -87,6 +87,8 @@ export { Revert } from './revert'; export { Signature } from './signature'; export { Stash } from './stash'; export { StatusEntry } from './status-entry'; +export { StatusFileOptions } from './status-file-options'; +export { StatusFile } from './status-file'; export { StatusList } from './status-list'; export { StatusOptions } from './status-options'; export { Status } from './status'; diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index e2aed770f6..3bf55c229d 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -21,13 +21,13 @@ export namespace Index { } export class Index { - static entryIsConflict(entry: IndexEntry): number; + static entryIsConflict(entry: IndexEntry): boolean; static entryStage(entry: IndexEntry): number; static open(indexPath: string): Promise; add(sourceEntry: IndexEntry): number; - addAll(pathspec: Strarray, flags: number, callback: Function, payload: void): Promise; - addByPath(path: string): number; + addAll(pathspec: Strarray, flags: number, callback?: Function): Promise; + addByPath(path: string): Promise; caps(): number; checksum(): Oid; clear(): number; @@ -38,17 +38,17 @@ export class Index { entryCount(): number; getByIndex(n: number): IndexEntry; getByPath(path: string, stage: number): IndexEntry; - hasConflicts(): number; + hasConflicts(): boolean; owner(): Repository; path(): string; read(force: number): number; readTree(tree: Tree): number; remove(path: string, stage: number): number; - removeAll(pathspec: Strarray, callback: Function, payload: void): Promise; - removeByPath(path: string): number; + removeAll(pathspec: Strarray, callback?: Function): Promise; + removeByPath(path: string): Promise; removeDirectory(dir: string, stage: number): number; setCaps(caps: number): number; - updateAll(pathspec: Strarray, callback: Function, payload: void): Promise; + updateAll(pathspec: Strarray, callback?: Function): Promise; write(): number; writeTree(): Promise; writeTreeTo(repo: Repository): Promise; diff --git a/types/nodegit/merge-file-options.d.ts b/types/nodegit/merge-file-options.d.ts index 9fe6394b4e..861abaf9b8 100644 --- a/types/nodegit/merge-file-options.d.ts +++ b/types/nodegit/merge-file-options.d.ts @@ -5,4 +5,5 @@ export interface MergeFileOptions { theirLabel?: string; favor?: number; flags?: number; + [key: string]: any; } diff --git a/types/nodegit/merge-options.d.ts b/types/nodegit/merge-options.d.ts index eb5aac909a..5149422008 100644 --- a/types/nodegit/merge-options.d.ts +++ b/types/nodegit/merge-options.d.ts @@ -7,4 +7,5 @@ export class MergeOptions { defaultDriver?: string; flags?: number; recursionLimit?: number; + [key: string]: any; } diff --git a/types/nodegit/merge.d.ts b/types/nodegit/merge.d.ts index a7b262e61c..4233b725e7 100644 --- a/types/nodegit/merge.d.ts +++ b/types/nodegit/merge.d.ts @@ -55,5 +55,5 @@ export class Merge { static commits(repo: Repository, ourCommit: Commit, theirCommit: Commit, options?: MergeOptions): any; static fileInitInput(opts: MergeFileInput, version: number): number; static initOptions(opts: MergeOptions, version: number): number; - static trees(repo: Repository, ancestorTree: Tree, ourTree: Tree, theirTree: Tree, opts: MergeOptions): Promise; + static trees(repo: Repository, ancestorTree: Tree, ourTree: Tree, theirTree: Tree, opts?: MergeOptions): Promise; } diff --git a/types/nodegit/proxy-options.d.ts b/types/nodegit/proxy-options.d.ts index 19bba458cb..88f734833d 100644 --- a/types/nodegit/proxy-options.d.ts +++ b/types/nodegit/proxy-options.d.ts @@ -5,4 +5,5 @@ export class ProxyOptions { type?: number; url?: string; version?: number; + [key: string]: any; } diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index 7c589bfb91..b736325f91 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -8,4 +8,5 @@ export interface PushOptions { callbacks?: RemoteCallbacks; customHeaders?: Strarray; proxyOpts?: ProxyOptions; + [key: string]: any; } diff --git a/types/nodegit/rebase.d.ts b/types/nodegit/rebase.d.ts index 383642137e..be0b5d2c92 100644 --- a/types/nodegit/rebase.d.ts +++ b/types/nodegit/rebase.d.ts @@ -14,9 +14,9 @@ export interface RebaseOptions { } export class Rebase { - static init(repo: Repository, branch: AnnotatedCommit, upstream: AnnotatedCommit, onto: AnnotatedCommit, opts: RebaseOptions): Promise; + static init(repo: Repository, branch: AnnotatedCommit, upstream: AnnotatedCommit, onto: AnnotatedCommit, opts?: RebaseOptions): Promise; static initOptions(opts: RebaseOptions, version: number): number; - static open(repo: Repository, opts: RebaseOptions): Promise; + static open(repo: Repository, opts?: RebaseOptions): Promise; abort(): number; commit(author: Signature, committer: Signature, messageEncoding: string, message: string): Oid; diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts index 10b21a0add..80e16c9350 100644 --- a/types/nodegit/reference.d.ts +++ b/types/nodegit/reference.d.ts @@ -21,12 +21,12 @@ export namespace Reference { export class Reference { static create(repo: Repository, name: string, id: Oid, force: number, logMessage: string): Promise; static createMatching(repo: Repository, name: string, id: Oid, force: number, currentId: Oid, logMessage: string): Promise; - static dwim(repo: Repository, id: string | Reference, callback: Function): Promise; + static dwim(repo: Repository, id: string | Reference, callback?: Function): Promise; static ensureLog(repo: Repository, refname: string): number; static hasLog(repo: Repository, refname: string): number; static isValidName(refname: string): number; static list(repo: Repository): Promise; - static lookup(repo: Repository, id: string | Reference, callback: Function): Promise; + static lookup(repo: Repository, id: string | Reference, callback?: Function): Promise; static nameToId(repo: Repository, name: string): Promise; static normalizeName(bufferOut: string, bufferSize: number, name: string, flags: number): number; static remove(repo: Repository, name: string): number; diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 5f118629ea..61fdc63d1c 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -31,21 +31,21 @@ export class Remote { static createWithFetchspec(repo: Repository, name: string, url: string, fetch: string): Promise; static delete(repo: Repository, name: string): Promise; static initCallbacks(opts: RemoteCallbacks, version: number): number; - static isValidName(remoteName: string): number; + static isValidName(remoteName: string): boolean; static list(repo: Repository): Promise; - static lookup(repo: Repository, name: string | Remote, callback: Function): Promise; + static lookup(repo: Repository, name: string | Remote, callback?: Function): Promise; static setAutotag(repo: Repository, remote: string, value: number): number; static setPushurl(repo: Repository, remote: string, url: string): number; static setUrl(repo: Repository, remote: string, url: string): number; autotag(): number; - connect(direction: Enums.DIRECTION, callbacks: RemoteCallbacks, callback: Function): Promise; + connect(direction: Enums.DIRECTION, callbacks: RemoteCallbacks, callback?: Function): Promise; connected(): number; defaultBranch(): Promise; disconnect(): Promise; - download(refSpecs: any[], opts: FetchOptions, callback: Function): Promise; + download(refSpecs: any[], opts?: FetchOptions, callback?: Function): Promise; dup(): Promise; - fetch(refSpecs: any[], opts: FetchOptions, message: string, callback: Function): Promise; + fetch(refSpecs: any[], opts: FetchOptions, message: string, callback?: Function): Promise; free(): void; getFetchRefspecs(): Promise; @@ -55,14 +55,14 @@ export class Remote { owner(): Repository; prune(callbacks: RemoteCallbacks): number; pruneRefs(): number; - push(refSpecs: any[], options: PushOptions, callback: Function): Promise; + push(refSpecs: any[], options?: PushOptions, callback?: Function): Promise; pushurl(): string; refspecCount(): number; stats(): TransferProgress; stop(): void; updateTips(callbacks: RemoteCallbacks, updateFetchhead: number, downloadTags: number, reflogMessage: string): number; - upload(refspecs: Strarray, opts: PushOptions): number; + upload(refspecs: Strarray, opts?: PushOptions): number; url(): string; /** * Lists advertised references from a remote. You must connect to the remote before using referenceList. diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index fa3d235b37..b94d7bd626 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -18,6 +18,10 @@ import { Merge } from './merge'; import { MergeOptions } from './merge-options'; import { Refdb } from './ref-db'; import { Revwalk } from './rev-walk'; +import { StatusFile } from './status-file'; +import { StatusOptions } from './status-options'; +import { DiffLine } from './diff-line'; +import { Treebuilder } from './tree-builder'; export interface RepositoryInitOptions { description: string; @@ -46,7 +50,7 @@ export class Repository { config(): Promise; configSnapshot(): Promise; detachHead(): number; - fetchheadForeach(callback: Function): Promise; + fetchheadForeach(callback?: Function): Promise; free(): void; getNamespace(): string; @@ -57,7 +61,7 @@ export class Repository { isBare(): number; isEmpty(): number; isShallow(): number; - mergeheadForeach(callback: Function): Promise; + mergeheadForeach(callback?: Function): Promise; messageRemove(): number; odb(): Promise; path(): string; @@ -103,7 +107,7 @@ export class Repository { * Lookup reference names for a repository. */ getReferenceNames(type: Reference.TYPE): Promise; - getCommit(string: string | Oid): Promise; + getCommit(string: string | Commit| Oid): Promise; /** * Retrieve the blob represented by the oid. */ @@ -128,7 +132,7 @@ export class Repository { /** * Deletes a tag from a repository by the tag name. */ - deleteTagByName(Short: string): Promise; + deleteTagByName(Short: string): Promise; /** * Instantiate a new revision walker for browsing the Repository"s history. See also Commit.prototype.history() */ @@ -141,16 +145,16 @@ export class Repository { * Retrieve the commit that HEAD is currently pointing to */ getHeadCommit(): Promise; - createCommit(updateRef: string, author: Signature, committer: Signature, message: string, Tree: Tree | Oid | string, parents: any[]): Promise; + createCommit(updateRef: string, author: Signature, committer: Signature, message: string, Tree: Tree | Oid | string, parents: Array, callback?: Function): Promise; /** * Creates a new commit on HEAD from the list of passed in files */ - createCommitOnHead(filesToAdd: any[], author: Signature, committer: Signature, message: string): Promise; + createCommitOnHead(filesToAdd: string[], author: Signature, committer: Signature, message: string): Promise; /** * Create a blob from a buffer */ createBlobFromBuffer(buffer: Buffer): Oid; - treeBuilder(tree: Tree): any; + treeBuilder(tree: Tree): Promise; /** * Gets the default signature for the default user and now timestamp */ @@ -158,20 +162,20 @@ export class Repository { /** * Lists out the remotes in the given repository. */ - getRemotes(Optional: Function): Promise; + getRemotes(callback?: Function): Promise; /** * Gets a remote from the repo */ - getRemote(remote: string | Remote, callback: Function): Promise; + getRemote(remote: string | Remote, callback?: Function): Promise; /** * Fetches from a remote */ - fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; + fetch(remote: string | Remote, fetchOptions?: FetchOptions): Promise; /** * Fetches from all remotes. This is done in series due to deadlocking issues with fetching from many remotes that can happen. */ - fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; - mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: Merge.PREFERENCE, mergeOptions: MergeOptions): Promise; + fetchAll(fetchOptions?: FetchOptions, callback?: Function): Promise; + mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: Merge.PREFERENCE, mergeOptions?: MergeOptions): Promise; /** * Rebases a branch onto another branch */ @@ -180,11 +184,11 @@ export class Repository { /** * Get the status of a repo to it's working directory */ - getStatus(opts: any): Promise; + getStatus(opts?: StatusOptions): Promise; /** * Get extended statuses of a repo to it's working directory. Status entries have status, headToIndex delta, and indexToWorkdir deltas */ - getStatusExt(opts: any): Promise; + getStatusExt(opts?: StatusOptions): Promise; /** * Get the names of the submodules in the repository. */ @@ -192,19 +196,19 @@ export class Repository { /** * This will set the HEAD to point to the reference and then attempt to update the index and working tree to match the content of the latest commit on that reference */ - checkoutRef(reference: Reference, opts: Object | CheckoutOptions): Promise; + checkoutRef(reference: Reference, opts?: CheckoutOptions): Promise; /** * This will set the HEAD to point to the local branch and then attempt to update the index and working tree to match the content of the latest commit on that branch */ - checkoutBranch(branch: string | Reference, opts: Object | CheckoutOptions): Promise; + checkoutBranch(branch: string | Reference, opts?: CheckoutOptions): Promise; /** * Stages or unstages line selection of a specified file */ - stageFilemode(filePath: string | any[], stageNew: boolean): Promise; + stageFilemode(filePath: string | string[], stageNew: boolean): Promise; /** * Stages or unstages line selection of a specified file */ - stageLines(filePath: string, newLines: any[], isStaged: boolean): Promise; + stageLines(filePath: string, newLines: DiffLine[], isStaged: boolean): Promise; /** * Returns true if the repository is in the default NONE state. */ @@ -236,7 +240,7 @@ export class Repository { /** * Discard line selection of a specified file. Assumes selected lines are unstaged. */ - discardLines(filePath: string, selectedLines: any[]): Promise; + discardLines(filePath: string, selectedLines: DiffLine[]): Promise; /** * Grabs a fresh copy of the index from the repository. Invalidates all previously grabbed indexes */ diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts index 59611cf62b..065c515743 100644 --- a/types/nodegit/rev-walk.d.ts +++ b/types/nodegit/rev-walk.d.ts @@ -38,7 +38,7 @@ export class Revwalk { /** * Walk the history from the given oid. The callback is invoked for each commit; When the walk is over, the callback is invoked with (null, null). */ - walk(oid: Oid, callback: Function): Commit; + walk(oid: Oid, callback?: Function): Commit; /** * Walk the history grabbing commits until the checkFn called with the current commit returns false. */ diff --git a/types/nodegit/revert.d.ts b/types/nodegit/revert.d.ts index 16154aea76..1f9d4a2677 100644 --- a/types/nodegit/revert.d.ts +++ b/types/nodegit/revert.d.ts @@ -5,10 +5,11 @@ import { Commit } from './commit'; import { Index } from './index'; export interface RevertOptions { - version: number; - mainline: number; - mergeOpts: MergeOptions; - checkoutOpts: CheckoutOptions; + version?: number; + mainline?: number; + mergeOpts?: MergeOptions; + checkoutOpts?: CheckoutOptions; + [key: string]: any; } export class Revert { @@ -16,5 +17,5 @@ export class Revert { /** * Reverts the given commit against the given "our" commit, producing an index that reflects the result of the revert. */ - static commit(repo: Repository, revertCommit: Commit, ourCommit: Commit, mainline: number, mergeOptions: MergeOptions): Promise; + static commit(repo: Repository, revertCommit: Commit, ourCommit: Commit, mainline: number, mergeOptions?: MergeOptions): Promise; } diff --git a/types/nodegit/stash.d.ts b/types/nodegit/stash.d.ts index 494631928c..68d61d0e0f 100644 --- a/types/nodegit/stash.d.ts +++ b/types/nodegit/stash.d.ts @@ -37,10 +37,10 @@ export interface StashApplyOptions { } export class Stash { - static apply(repo: Repository, index: number, options: StashApplyOptions): Promise; + static apply(repo: Repository, index: number, options?: StashApplyOptions): Promise; static applyInitOptions(opts: StashApplyOptions, version: number): number; static drop(repo: Repository, index: number): Promise; - static foreach(repo: Repository, callback: Function, payload: any): Promise; - static pop(repo: Repository, index: number, options: StashApplyOptions): Promise; + static foreach(repo: Repository, callback?: Function): Promise; + static pop(repo: Repository, index: number, options?: StashApplyOptions): Promise; static save(repo: Repository, stasher: Signature, message: string, flags: number): Promise; } diff --git a/types/nodegit/status-entry.d.ts b/types/nodegit/status-entry.d.ts index bc2ab62a12..59de1a9760 100644 --- a/types/nodegit/status-entry.d.ts +++ b/types/nodegit/status-entry.d.ts @@ -1,7 +1,7 @@ import { DiffDelta } from './diff-delta'; export class StatusEntry { - status: number; - headToIndex: DiffDelta; - indexToWorkdir: DiffDelta; + status(): number; + headToIndex(): DiffDelta; + indexToWorkdir(): DiffDelta; } diff --git a/types/nodegit/status-file-options.d.ts b/types/nodegit/status-file-options.d.ts new file mode 100644 index 0000000000..e3852cf0e6 --- /dev/null +++ b/types/nodegit/status-file-options.d.ts @@ -0,0 +1,8 @@ +import { StatusEntry } from './status-entry'; + +export interface StatusFileOptions { + path?: string; + status?: number; + entry?: StatusEntry; + [key: string]: any; +} diff --git a/types/nodegit/status-file.d.ts b/types/nodegit/status-file.d.ts new file mode 100644 index 0000000000..b34a0f234f --- /dev/null +++ b/types/nodegit/status-file.d.ts @@ -0,0 +1,20 @@ +import { DiffDelta } from './diff-delta'; +import { StatusFileOptions } from './status-file-options'; + +export class StatusFile { + constructor(args: StatusFileOptions); + headToIndex(): DiffDelta; + indexToWorkdir(): DiffDelta; + inIndex(): boolean; + inWorkingTree(): boolean; + isConflicted(): boolean; + isDeleted(): boolean; + isIgnored(): boolean; + isModified(): boolean; + isNew(): boolean; + isRenamed(): boolean; + isTypechange(): boolean; + path(): string; + status(): string[]; + statusBit(): number; +} diff --git a/types/nodegit/status-list.d.ts b/types/nodegit/status-list.d.ts index 42119bbfd4..1b470ceb71 100644 --- a/types/nodegit/status-list.d.ts +++ b/types/nodegit/status-list.d.ts @@ -3,7 +3,7 @@ import { DiffPerfdata } from './diff-perf-data'; import { StatusOptions } from './status-options'; export class StatusList { - static create(repo: Repository, opts: StatusOptions): Promise; + static create(repo: Repository, opts?: StatusOptions): Promise; entrycount(): number; diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts index 9f75bbe96d..363dcd1fbb 100644 --- a/types/nodegit/status-options.d.ts +++ b/types/nodegit/status-options.d.ts @@ -5,4 +5,5 @@ export interface StatusOptions { show?: number; flags?: number; pathspec?: Strarray; + [key: string]: any; } diff --git a/types/nodegit/status.d.ts b/types/nodegit/status.d.ts index 1059dd6bff..5b657d1cc5 100644 --- a/types/nodegit/status.d.ts +++ b/types/nodegit/status.d.ts @@ -1,7 +1,7 @@ import { Repository } from './repository'; import { StatusList } from './status-list'; -import { StatusEntry } from './status-entry'; import { StatusOptions } from './status-options'; +import { StatusEntry } from './status-entry'; export namespace Status { const enum STATUS { @@ -50,7 +50,7 @@ export namespace Status { export class Status { static byIndex(statuslist: StatusList, idx: number): StatusEntry; static file(repo: Repository, path: string): number; - static foreach(repo: Repository, callback: Function, payload: any): Promise; - static foreachExt(repo: Repository, opts: StatusOptions, callback: Function, payload: any): Promise; + static foreach(repo: Repository, callback?: Function): Promise; + static foreachExt(repo: Repository, opts?: StatusOptions, callback?: Function): Promise; static shouldIgnore(ignored: number, repo: Repository, path: string): number; } diff --git a/types/nodegit/submodule-update-options.d.ts b/types/nodegit/submodule-update-options.d.ts index d96320204b..5be827b368 100644 --- a/types/nodegit/submodule-update-options.d.ts +++ b/types/nodegit/submodule-update-options.d.ts @@ -6,4 +6,5 @@ export interface SubmoduleUpdateOptions { checkoutOpts?: CheckoutOptions; fetchOpts?: FetchOptions; cloneCheckoutStrategy?: number; + [key: string]: any; } diff --git a/types/nodegit/submodule.d.ts b/types/nodegit/submodule.d.ts index c53aee7a3d..4ac5ce3ac6 100644 --- a/types/nodegit/submodule.d.ts +++ b/types/nodegit/submodule.d.ts @@ -46,7 +46,7 @@ export namespace Submodule { export class Submodule { static addSetup(repo: Repository, url: string, path: string, useGitLink: number): Promise; - static foreach(repo: Repository, callback: Function, payload: any): Promise; + static foreach(repo: Repository, callback?: Function): Promise; static lookup(repo: Repository, name: string): Promise; static resolveUrl(repo: Repository, url: string): Promise; static setBranch(repo: Repository, name: string, branch: string): number; @@ -80,7 +80,7 @@ export class Submodule { * * */ - update(init: number, options: SubmoduleUpdateOptions): Promise; + update(init: number, options?: SubmoduleUpdateOptions): Promise; updateStrategy(): number; url(): string; wdId(): Oid; diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index fd2674a025..50c29e8a3f 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -20,7 +20,7 @@ export class Tree { /** * Retrieves the tree pointed to by the oid */ - static lookup(repo: Repository, id: string | Oid | Tree, callback: Function): Promise; + static lookup(repo: Repository, id: string | Oid | Tree, callback?: Function): Promise; entryById(id: Oid): TreeEntry; _entryByIndex(idx: number): TreeEntry; @@ -38,11 +38,11 @@ export class Tree { /** * Diff two trees */ - diff(tree: Tree, callback: Function): Promise; + diff(tree: Tree, callback?: Function): Promise; /** * Diff two trees with options */ - diffWithOptions(tree: Tree, options: Object, callback: Function): Promise; + diffWithOptions(tree: Tree, options?: Object, callback?: Function): Promise; /** * Get an entry at the ith position. */ diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 4ba1bdece6..e097a77133 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -36,6 +36,7 @@ "clone.d.ts", "commit.d.ts", "config.d.ts", + "convenient-hunk.d.ts", "convenient-patch.d.ts", "cred-user-pass-payload.d.ts", "cred-username.d.ts", @@ -47,7 +48,6 @@ "diff-binary.d.ts", "diff-delta.d.ts", "diff-file.d.ts", - "diff-hunk.d.ts", "diff-line.d.ts", "diff-options.d.ts", "diff-perf-data.d.ts", @@ -102,6 +102,8 @@ "signature.d.ts", "stash.d.ts", "status-entry.d.ts", + "status-file-options.d.ts", + "status-file.d.ts", "status-list.d.ts", "status-options.d.ts", "status.d.ts", @@ -117,4 +119,4 @@ "tree-update.d.ts", "tree.d.ts" ] -} \ No newline at end of file +}