From 7ded9e7db477e1503b219009ff7971b25d08cb53 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 1 Jun 2017 21:09:29 +0100 Subject: [PATCH 01/91] Initial commit of files --- types/nodegit/index.d.ts | 6 +++ types/nodegit/nodegit-tests.ts | 5 +++ types/nodegit/repository.d.ts | 71 ++++++++++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 23 +++++++++++ types/nodegit/tslint.json | 6 +++ 5 files changed, 111 insertions(+) create mode 100644 types/nodegit/index.d.ts create mode 100644 types/nodegit/nodegit-tests.ts create mode 100644 types/nodegit/repository.d.ts create mode 100644 types/nodegit/tsconfig.json create mode 100644 types/nodegit/tslint.json diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts new file mode 100644 index 0000000000..3a70a8ea9a --- /dev/null +++ b/types/nodegit/index.d.ts @@ -0,0 +1,6 @@ +// Type definitions for nodegit 0.18 +// Project: https://github.com/nodegit/nodegit +// Definitions by: Dolan Miu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export { Repository } from './repository'; diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts new file mode 100644 index 0000000000..b7fa54b0c1 --- /dev/null +++ b/types/nodegit/nodegit-tests.ts @@ -0,0 +1,5 @@ +import * as Git from 'nodegit'; + +Git.Repository.discover("startPath", 1, "ceilingDirs").then((string) => { + // Use string +}); diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts new file mode 100644 index 0000000000..f075a063f1 --- /dev/null +++ b/types/nodegit/repository.d.ts @@ -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} + * + * @memberof Repository + */ + static discover(startPath: string, acrossFs: number, ceilingDirs: string): Promise; + /** + * + * + * @static + * @param {string} path + * @param {boolean} [isBare] + * @returns {Promise} + * + * @memberof Repository + */ + static init(path: string, isBare?: boolean): Promise; + /** + * + * + * @static + * @param {string} repoPath + * @param {RepositoryInitOptions} [options] + * @returns {Promise} + * + * @memberof Repository + */ + static initExt(repoPath: string, options?: RepositoryInitOptions): Promise; + /** + * + * + * @static + * @param {string} path + * @returns {Promise} + * + * @memberof Repository + */ + static open(path: string): Promise; + /** + * + * + * @static + * @param {string} barePath + * @returns {Promise} + * + * @memberof Repository + */ + static openBare(barePath: string): Promise; + static openExt(path: string, flags?: number, ceilingDirs?: string): Promise; + + // getBranchCommit(name: string): Promise; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json new file mode 100644 index 0000000000..ba25d4da3e --- /dev/null +++ b/types/nodegit/tsconfig.json @@ -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" + ] +} diff --git a/types/nodegit/tslint.json b/types/nodegit/tslint.json new file mode 100644 index 0000000000..a62d0d4e68 --- /dev/null +++ b/types/nodegit/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false + } +} From 082710a32c88410a67e873c250f7ce1c1c29fd72 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 2 Jun 2017 03:05:10 +0100 Subject: [PATCH 02/91] Added more types --- types/nodegit/buf.d.ts | 12 +++++ types/nodegit/index.d.ts | 7 +++ types/nodegit/object.d.ts | 21 +++++++++ types/nodegit/odb.d.ts | 18 ++++++++ types/nodegit/oid.d.ts | 11 +++++ types/nodegit/reference.d.ts | 58 ++++++++++++++++++++++++ types/nodegit/repository.d.ts | 83 ++++++++++++++++++++++++++++++++++- types/nodegit/signature.d.ts | 15 +++++++ types/nodegit/time.d.ts | 4 ++ types/nodegit/tsconfig.json | 9 +++- 10 files changed, 235 insertions(+), 3 deletions(-) create mode 100644 types/nodegit/buf.d.ts create mode 100644 types/nodegit/object.d.ts create mode 100644 types/nodegit/odb.d.ts create mode 100644 types/nodegit/oid.d.ts create mode 100644 types/nodegit/reference.d.ts create mode 100644 types/nodegit/signature.d.ts create mode 100644 types/nodegit/time.d.ts diff --git a/types/nodegit/buf.d.ts b/types/nodegit/buf.d.ts new file mode 100644 index 0000000000..53886615ed --- /dev/null +++ b/types/nodegit/buf.d.ts @@ -0,0 +1,12 @@ +/// + +export class Buf { + containsNul(): number; + free(): void; + grow(target_size: number): Promise; + isBinary(): number; + set(data: Buffer, datalen: number): Promise; + ptr: string; + asize: number; + size: number; + } diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 3a70a8ea9a..77d7003e05 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -3,4 +3,11 @@ // Definitions by: Dolan Miu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export { Buf } from './buf'; +export { Object } from './object'; +export { Odb } from './odb'; +export { Oid } from './oid'; +export { Reference } from './reference'; export { Repository } from './repository'; +export { Signature } from './signature'; +export { Time } from './time'; diff --git a/types/nodegit/object.d.ts b/types/nodegit/object.d.ts new file mode 100644 index 0000000000..8fabe5fdd2 --- /dev/null +++ b/types/nodegit/object.d.ts @@ -0,0 +1,21 @@ +import { Oid } from './oid'; +import { Repository } from './repository'; +import { Buf } from './buf'; + +export class Object { + static size(type: number): number; + static lookup(repo: Repository, id: Oid, type: number): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number, type: number): Promise; + static string2type(str: string): number; + static type2string(type: number): string; + static typeisloose(type: number): number; + + dup(): Promise; + free(): void; + id(): Oid; + lookupByPath(path: string, type: number): Promise; + owner(): Repository; + peel(target_type: number): Promise; + shortId(): Promise; + type(): number; +} diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts new file mode 100644 index 0000000000..acacda8b73 --- /dev/null +++ b/types/nodegit/odb.d.ts @@ -0,0 +1,18 @@ +import { Oid } from './oid'; + +export namespace Odb { + enum STREAM { + RDONLY = 2, + WRONLY = 4, + RW = 6 + } +} + +export class Odb { + static open(objects_dir: string): Promise; + + addDiskAlternate(path: string): number; + free(): void; + read(id: Oid): Promise; + write(data: Buffer, len: number, type: number): Promise; +} diff --git a/types/nodegit/oid.d.ts b/types/nodegit/oid.d.ts new file mode 100644 index 0000000000..2aa65905f6 --- /dev/null +++ b/types/nodegit/oid.d.ts @@ -0,0 +1,11 @@ +export class Oid { + static fromString(str: string): Oid; + cmp(b: Oid): number; + cpy(): Oid; + equal(b: Oid): number; + iszero(): number; + ncmp(b: Oid, len: number): number; + strcmp(str: string): number; + streq(str: string): number; + tostrS(): string; +} diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts new file mode 100644 index 0000000000..92e3e546b2 --- /dev/null +++ b/types/nodegit/reference.d.ts @@ -0,0 +1,58 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; + +export namespace Reference { + enum TYPE { + INVALID = 0, + OID = 1, + SYMBOLIC = 2, + LISTALL = 3 + } + + enum NORMALIZE { + REF_FORMAT_NORMAL = 0, + REF_FORMAT_ALLOW_ONELEVEL = 1, + REF_FORMAT_REFSPEC_PATTERN = 2, + REF_FORMAT_REFSPEC_SHORTHAND = 4 + } +} + +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 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 nameToId(repo: Repository, name: string): Promise; + static normalizeName(bufferOut: string, bufferSize: number, name: string, flags: number): number; + static remove(repo: Repository, name: string): number; + static symbolicCreate(repo: Repository, name: string, target: string, force: number, logMessage: string): Promise; + static symbolicCreateMatching(repo: Repository, name: string, target: string, force: number, currentValue: string, logMessage: string): Promise; + + cmp(ref2: Reference): number; + delete(): number; + isBranch(): number; + isNote(): number; + isRemote(): number; + isTag(): number; + name(): string; + owner(): Repository; + peel(type: number): Promise; + rename(newName: string, force: number, logMessage: string): Promise; + resolve(): Promise; + setTarget(id: Oid, logMessage: string): Promise; + shorthand(): string; + symbolicSetTarget(target: string, logMessage: string): Promise; + symbolicTarget(): string; + target(): Oid; + targetPeel(): Oid; + type(): number; + isValid(): Boolean; + isConcrete(): Boolean; + isSymbolic(): Boolean; + toString(): string; + isHead(): boolean; +} diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index f075a063f1..f32ca65c60 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -1,3 +1,9 @@ +import { Oid } from './oid'; +import { Buf } from './buf'; +import { Reference } from './reference'; +import { Odb } from './odb'; +import { Object } from './object'; + interface RepositoryInitOptions { description: string, flags: number, @@ -22,7 +28,7 @@ export class Repository { * * @memberof Repository */ - static discover(startPath: string, acrossFs: number, ceilingDirs: string): Promise; + static discover(startPath: string, acrossFs: number, ceilingDirs: string): Promise; /** * * @@ -66,6 +72,79 @@ export class Repository { */ static openBare(barePath: string): Promise; static openExt(path: string, flags?: number, ceilingDirs?: string): Promise; + static wrapOdb(odb: Odb): Promise; - // getBranchCommit(name: string): Promise; + cleanup(): void; + config(): Promise; + configSnapshot(): Promise; + detachHead(): number; + fetchheadForeach(callback: Function): Promise; + free(): void; + getNamespace(): string; + head(): Promise; + headDetached(): number; + headUnborn(): number; + index(): Promise; + isBare(): number; + isEmpty(): number; + isShallow(): number; + mergeheadForeach(callback: Function): Promise; + messageRemove(): number; + odb(): Promise; + path(): string; + refdb(): Promise; + setHead(refname: string): Promise; + setHeadDetached(commitish: Oid): number; + setHeadDetachedFromAnnotated(commitish: NodeGit.AnnotatedCommit): number; + setIdent(name: string, email: string): number; + setNamespace(nmspace: string): number; + setWorkdir(workdir: string, update_gitlink: number): number; + state(): number; + stateCleanup(): number; + workdir(): string; + createBranch(name: string, commit: NodeGit.Commit | string | Oid, force: boolean, signature: NodeGit.Signature, logMessage: string): Promise; + getReferenceCommit(name: string | Reference): Promise; + getBranch(name: string | Reference): Promise; + getBranchCommit(name: string | Reference): Promise; + getCurrentBranch(): Promise; + getReference(name: string | Reference): Promise; + getReferences(type: Reference.TYPE): Promise; + getReferenceNames(type: Reference.TYPE): Promise; + getCommit(string: string | Oid): Promise; + getBlob(string: string | Oid): Promise; + getTree(string: string | Oid): Promise; + createTag(string: string | Oid, name: string, message: string): Promise; + createLightweightTag(string: string | Oid, name: string): Promise; + getTag(string: string | Oid): Promise; + getTagByName(Short: string): Promise; + deleteTagByName(Short: string): Promise; + createRevWalk(string: string | Oid): any; + getMasterCommit(): Promise; + getHeadCommit(): Promise; + createCommit(updateRef: string, author: NodeGit.Signature, committer: NodeGit.Signature, message: string, Tree: NodeGit.Tree | Oid | string, parents: any[]): Promise; + createCommitOnHead(filesToAdd: any[], author: NodeGit.Signature, committer: NodeGit.Signature, message: string): Promise; + createBlobFromBuffer(buffer: Buffer): Oid; + treeBuilder(tree: NodeGit.Tree): any; + defaultSignature(): Signature; + getRemotes(Optional: Function): Promise; + getRemote(remote: string | Remote, callback: Function): Promise; + fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; + fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; + mergeBranches(to: string | Reference, from: string | Reference, signature: NodeGit.Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise; + rebaseBranches(branch: string, upstream: string, onto: string, signature: NodeGit.Signature, beforeNextFn: Function): Promise; + continueRebase(signature: NodeGit.Signature, beforeNextFn: Function): Promise; + getStatus(opts: any): Promise; + getStatusExt(opts: any): Promise; + getSubmoduleNames(): Promise; + checkoutRef(reference: Reference, opts: Object | CheckoutOptions): Promise; + checkoutBranch(branch: string | Reference, opts: Object | CheckoutOptions): Promise; + stageFilemode(filePath: string | any[], stageNew: Boolean): Promise; + stageLines(filePath: string, newLines: any[], isStaged: Boolean): Promise; + isDefaultState(): Boolean; + isApplyingMailbox(): Boolean; + isBisecting(): Boolean; + isCherrypicking(): Boolean; + isMerging(): Boolean; + isRebasing(): Boolean; + isReverting(): Boolean; } diff --git a/types/nodegit/signature.d.ts b/types/nodegit/signature.d.ts new file mode 100644 index 0000000000..c18ccb45ff --- /dev/null +++ b/types/nodegit/signature.d.ts @@ -0,0 +1,15 @@ +import { Repository } from './repository'; +import { Time } from './time'; + +export class Signature { + static default(repo: Repository): Signature; + static create(name: string, email: string, time: number, offset: number): Signature; + static now(name: string, email: string): Signature; + + dup(): Promise; + free(): void; + toString(): string; + name: string; + email: string; + when: Time; +} diff --git a/types/nodegit/time.d.ts b/types/nodegit/time.d.ts new file mode 100644 index 0000000000..575c005781 --- /dev/null +++ b/types/nodegit/time.d.ts @@ -0,0 +1,4 @@ +export class Time { + time: number; + offset: number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index ba25d4da3e..471d7919cd 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -16,8 +16,15 @@ "forceConsistentCasingInFileNames": true }, "files": [ + "buf.d.ts", "index.d.ts", "nodegit-tests.ts", - "repository.d.ts" + "object.d.ts", + "odb.d.ts", + "oid.d.ts", + "reference.d.ts", + "repository.d.ts", + "signature.d.ts", + "time.d.ts", ] } From cdf69c51e9a57b1b069b74727a0b4ef28d2d64f5 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 00:45:48 +0100 Subject: [PATCH 03/91] More types --- types/nodegit/annotated-commit.d.ts | 13 +++ types/nodegit/blob.d.ts | 20 ++++ types/nodegit/checkout-options.d.ts | 26 +++++ types/nodegit/commit.d.ts | 47 +++++++++ types/nodegit/diff-delta.d.ts | 10 ++ types/nodegit/diff-file.d.ts | 9 ++ types/nodegit/diff-perf-data.d.ts | 5 + types/nodegit/diff.d.ts | 154 ++++++++++++++++++++++++++++ types/nodegit/enums.d.ts | 41 ++++++++ types/nodegit/fetch-options.d.ts | 9 ++ types/nodegit/index-entry.d.ts | 21 ++++ types/nodegit/index.d.ts | 19 ++++ types/nodegit/index_.d.ts | 56 ++++++++++ types/nodegit/nodegit-tests.ts | 4 + types/nodegit/odb-object.d.ts | 10 ++ types/nodegit/odb.d.ts | 3 +- types/nodegit/reference.d.ts | 3 +- types/nodegit/remote-callbacks.d.ts | 8 ++ types/nodegit/remote.d.ts | 62 +++++++++++ types/nodegit/repository.d.ts | 43 +++++--- types/nodegit/str-array.d.ts | 6 ++ types/nodegit/tree-builder.d.ts | 16 +++ types/nodegit/tree-entry.d.ts | 30 ++++++ types/nodegit/tree.d.ts | 44 ++++++++ types/nodegit/tsconfig.json | 18 ++++ 25 files changed, 658 insertions(+), 19 deletions(-) create mode 100644 types/nodegit/annotated-commit.d.ts create mode 100644 types/nodegit/blob.d.ts create mode 100644 types/nodegit/checkout-options.d.ts create mode 100644 types/nodegit/commit.d.ts create mode 100644 types/nodegit/diff-delta.d.ts create mode 100644 types/nodegit/diff-file.d.ts create mode 100644 types/nodegit/diff-perf-data.d.ts create mode 100644 types/nodegit/diff.d.ts create mode 100644 types/nodegit/enums.d.ts create mode 100644 types/nodegit/fetch-options.d.ts create mode 100644 types/nodegit/index-entry.d.ts create mode 100644 types/nodegit/index_.d.ts create mode 100644 types/nodegit/odb-object.d.ts create mode 100644 types/nodegit/remote-callbacks.d.ts create mode 100644 types/nodegit/remote.d.ts create mode 100644 types/nodegit/str-array.d.ts create mode 100644 types/nodegit/tree-builder.d.ts create mode 100644 types/nodegit/tree-entry.d.ts create mode 100644 types/nodegit/tree.d.ts diff --git a/types/nodegit/annotated-commit.d.ts b/types/nodegit/annotated-commit.d.ts new file mode 100644 index 0000000000..f0f9d4d925 --- /dev/null +++ b/types/nodegit/annotated-commit.d.ts @@ -0,0 +1,13 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Reference } from './reference'; + +export class AnnotatedCommit { + static fromFetchhead(repo: Repository, branch_name: string, remote_url: string, id: Oid): Promise; + static fromRef(repo: Repository, ref: Reference): Promise; + static fromRevspec(repo: Repository, revspec: string): Promise; + static lookup(repo: Repository, id: Oid): Promise; + + free(): void; + id(): Oid; +} diff --git a/types/nodegit/blob.d.ts b/types/nodegit/blob.d.ts new file mode 100644 index 0000000000..32f020b0ce --- /dev/null +++ b/types/nodegit/blob.d.ts @@ -0,0 +1,20 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; + +export class Blob { + static createFromBuffer(repo: Repository, buffer: Buffer, len: number): Oid; + static createFromDisk(id: Oid, repo: Repository, path: string): number; + static createFromWorkdir(id: Oid, repo: Repository, relative_path: string): number; + static lookup(repo: Repository, id: string | Oid | Blob): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + free(): void; + id(): Oid; + isBinary(): number; + owner(): Repository; + rawcontent(): Buffer; + rawsize(): number; + content(): Buffer; + toString(): string; + filemode(): number; +} diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts new file mode 100644 index 0000000000..cd23a70ede --- /dev/null +++ b/types/nodegit/checkout-options.d.ts @@ -0,0 +1,26 @@ +import { Strarray } from './str-array'; +import { Tree } from './tree'; +import { Index } from './index'; + +export interface CheckoutOptions { + version?: number; + checkoutStrategy?: number; + disableFilters?: number; + dirMode?: number; + fileMode?: number; + fileOpenFlags?: number; + notifyFlags?: number; + notifyCb?: any; + notifyPayload?: void; + progressCb?: any; + progressPayload?: void; + paths?: Strarray; + baseline?: Tree; + baselineIndex?: Index; + targetDirectory?: string; + ancestorLabel?: string; + ourLabel?: string; + theirLabel?: string; + perfdataCb?: any; + perfdataPayload?: void; +} diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts new file mode 100644 index 0000000000..3980ce080e --- /dev/null +++ b/types/nodegit/commit.d.ts @@ -0,0 +1,47 @@ +import { Repository } from './repository'; +import { Signature } from './signature'; +import { Oid } from './oid'; +import { Buf } from './buf'; +import { Object } from './object'; +import { Tree } from './tree'; +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 lookup(repo: Repository, id: string | Oid | Commit): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + amend(update_ref: string, author: Signature, committer: Signature, message_encoding: string, message: string, tree: Tree): Oid; + author(): Signature; + committer(): Signature; + free(): void; + headerField(field: string): Promise; + id(): Oid; + message(): string; + messageEncoding(): string; + messageRaw(): string; + nthGenAncestor(n: number): Promise; + owner(): Repository; + parent(n: number): Promise; + parentId(n: number): Oid; + parentcount(): number; + rawHeader(): string; + summary(): string; + time(): number; + timeOffset(): number; + tree(tree_out: Tree): number; + treeId(): Oid; + sha(): string; + timeMs(): number; + date(): Date; + getTree(): Promise; + getEntry(path: string): Promise; + history(): EventEmitter; + getParents(limit: number, callback: Function): Promise; + parents(callback: Function): Oid[]; + getDiff(callback: Function): Promise; + getDiffWithOptions(options: Object, callback: Function): Promise; + toString(): string; +} diff --git a/types/nodegit/diff-delta.d.ts b/types/nodegit/diff-delta.d.ts new file mode 100644 index 0000000000..c21d98f430 --- /dev/null +++ b/types/nodegit/diff-delta.d.ts @@ -0,0 +1,10 @@ +import { DiffFile } from './diff-file'; + +export class DiffDelta { + status: number; + flags: number; + similarity: number; + nfiles: number; + oldFile: DiffFile; + newFile: DiffFile; +} diff --git a/types/nodegit/diff-file.d.ts b/types/nodegit/diff-file.d.ts new file mode 100644 index 0000000000..99646ec08b --- /dev/null +++ b/types/nodegit/diff-file.d.ts @@ -0,0 +1,9 @@ +import { Oid } from './oid'; + +export class DiffFile { + flags(): number; + id(): Oid; + mode(): number; + path(): string; + size(): number; +} diff --git a/types/nodegit/diff-perf-data.d.ts b/types/nodegit/diff-perf-data.d.ts new file mode 100644 index 0000000000..5dfca09670 --- /dev/null +++ b/types/nodegit/diff-perf-data.d.ts @@ -0,0 +1,5 @@ +export class DiffPerfdata { + version: number; + statCalls: number; + oidCalculations: number; +} diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts new file mode 100644 index 0000000000..ab3b3aa2c8 --- /dev/null +++ b/types/nodegit/diff.d.ts @@ -0,0 +1,154 @@ +import { Blob } from './blob'; +import { Repository } from './repository'; +import { Tree } from './tree'; +import { Strarray } from './str-array'; +import { Index } from './index_'; +import { DiffDelta } from './diff-delta'; +import { DiffPerfdata } from './diff-perf-data'; + +export interface DiffFindOptions { + version: number; + flags: number; + renameThreshold: number; + renameFromRewriteThreshold: number; + copyThreshold: number; + breakRewriteThreshold: number; + renameLimit: number; +} + +export interface DiffOptions { + version: number; + flags: number; + ignoreSubmodules: number; + pathspec: Strarray; + notifyCb: Function; + notifyPayload: void; + contextLines: number; + interhunkLines: number; + idAbbrev: number; + maxSize: number; + oldPrefix: string; + newPrefix: string; +} + +export namespace Diff { + enum DELTA { + UNMODIFIED = 0, + ADDED = 1, + DELETED = 2, + MODIFIED = 3, + RENAMED = 4, + COPIED = 5, + IGNORED = 6, + UNTRACKED = 7, + TYPECHANGE = 8, + UNREADABLE = 9, + CONFLICTED = 10 + } + + enum FIND { + BY_CONFIG = 0, + RENAMES = 1, + RENAMES_FROM_REWRITES = 2, + COPIES = 4, + COPIES_FROM_UNMODIFIED = 8, + REWRITES = 16, + BREAK_REWRITES = 32, + AND_BREAK_REWRITES = 48, + FOR_UNTRACKED = 64, + ALL = 255, + IGNORE_LEADING_WHITESPACE = 0, + IGNORE_WHITESPACE = 4096, + DONT_IGNORE_WHITESPACE = 8192, + EXACT_MATCH_ONLY = 16384, + BREAK_REWRITES_FOR_RENAMES_ONLY = 32768, + REMOVE_UNMODIFIED = 65536 + } + + enum FLAG { + BINARY = 1, + NOT_BINARY = 2, + VALID_ID = 4, + EXISTS = 8 + } + + enum FORMAT { + PATCH = 1, + PATCH_HEADER = 2, + RAW = 3, + NAME_ONLY = 4, + NAME_STATUS = 5 + } + + enum FORMAT_EMAIL_FLAGS { + FORMAT_EMAIL_NONE = 0, + FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = 1 + } + + enum LINE { + CONTEXT = 32, + ADDITION = 43, + DELETION = 45, + CONTEXT_EOFNL = 61, + ADD_EOFNL = 62, + DEL_EOFNL = 60, + FILE_HDR = 70, + HUNK_HDR = 72, + BINARY = 66 + } + + enum OPTION { + NORMAL = 0, + REVERSE = 1, + INCLUDE_IGNORED = 2, + RECURSE_IGNORED_DIRS = 4, + INCLUDE_UNTRACKED = 8, + RECURSE_UNTRACKED_DIRS = 16, + INCLUDE_UNMODIFIED = 32, + INCLUDE_TYPECHANGE = 64, + INCLUDE_TYPECHANGE_TREES = 128, + IGNORE_FILEMODE = 256, + IGNORE_SUBMODULES = 512, + IGNORE_CASE = 1024, + INCLUDE_CASECHANGE = 2048, + DISABLE_PATHSPEC_MATCH = 4096, + SKIP_BINARY_CHECK = 8192, + ENABLE_FAST_UNTRACKED_DIRS = 16384, + UPDATE_INDEX = 32768, + INCLUDE_UNREADABLE = 65536, + INCLUDE_UNREADABLE_AS_UNTRACKED = 131072, + FORCE_TEXT = 1048576, + FORCE_BINARY = 2097152, + IGNORE_WHITESPACE = 4194304, + IGNORE_WHITESPACE_CHANGE = 8388608, + IGNORE_WHITESPACE_EOL = 16777216, + SHOW_UNTRACKED_CONTENT = 33554432, + SHOW_UNMODIFIED = 67108864, + PATIENCE = 268435456, + MINIMAL = 536870912, + SHOW_BINARY = 1073741824 + } + + enum STATS_FORMAT { + STATS_NONE = 0, + STATS_FULL = 1, + STATS_SHORT = 2, + STATS_NUMBER = 4, + STATS_INCLUDE_SUMMARY = 8 + } +} + +export class Diff { + static blobToBuffer(old_blob: Blob, old_as_path: string, buffer: string, buffer_as_path: string, opts: DiffOptions, file_cb: Function, binary_cb: Function, hunk_cb: Function, line_cb: Function): Promise; + static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; + static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; + static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; + static treeToWorkdir(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + static treeToWorkdirWithIndex(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + + findSimilar(options: DiffFindOptions): Promise; + getDelta(idx: number): DiffDelta; + getPerfdata(): Promise; + numDeltas(): number; + patches(): Promise; +} diff --git a/types/nodegit/enums.d.ts b/types/nodegit/enums.d.ts new file mode 100644 index 0000000000..850979ac51 --- /dev/null +++ b/types/nodegit/enums.d.ts @@ -0,0 +1,41 @@ +export namespace Enums { + enum CVAR { + FALSE = 0, + TRUE = 1, + INT32 = 2, + string = 3 + } + + enum DIRECTION { + FETCH = 0, + PUSH = 1 + } + + enum FEATURE { + THREADS = 1, + HTTPS = 2, + SSH = 4 + } + + enum IDXENTRY_EXTENDED_FLAG { + IDXENTRY_INTENT_TO_ADD = 8192, + IDXENTRY_SKIP_WORKTREE = 16384, + IDXENTRY_EXTENDED2 = 32768, + S = 24576, + IDXENTRY_UPDATE = 1, + IDXENTRY_REMOVE = 2, + IDXENTRY_UPTODATE = 4, + IDXENTRY_ADDED = 8, + IDXENTRY_HASHED = 16, + IDXENTRY_UNHASHED = 32, + IDXENTRY_WT_REMOVE = 64, + IDXENTRY_CONFLICTED = 128, + IDXENTRY_UNPACKED = 256, + IDXENTRY_NEW_SKIP_WORKTREE = 512 + } + + enum INDXENTRY_FLAG { + IDXENTRY_EXTENDED = 16384, + IDXENTRY_VALID = 32768 + } +} diff --git a/types/nodegit/fetch-options.d.ts b/types/nodegit/fetch-options.d.ts new file mode 100644 index 0000000000..1aa26fd974 --- /dev/null +++ b/types/nodegit/fetch-options.d.ts @@ -0,0 +1,9 @@ +import { RemoteCallbacks } from './remote-callbacks'; + +export interface FetchOptions { + version?: number; + callbacks?: RemoteCallbacks; + prune?: number; + updateFetchhead?: number; + downloadTags?: number; +} diff --git a/types/nodegit/index-entry.d.ts b/types/nodegit/index-entry.d.ts new file mode 100644 index 0000000000..a6591e37b9 --- /dev/null +++ b/types/nodegit/index-entry.d.ts @@ -0,0 +1,21 @@ +import { Oid } from './oid'; + +interface IndexTime { + seconds: number; + nanoseconds: number; +} + +export interface IndexEntry { + ctime: IndexTime; + mtime: IndexTime; + dev: number; + ino: number; + mode: number; + uid: number; + gid: number; + fileSize: number; + id: Oid; + flags: number; + flagsExtended: number; + path: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 77d7003e05..92307a1abb 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -3,11 +3,30 @@ // Definitions by: Dolan Miu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export { AnnotatedCommit } from './annotated-commit'; +export { Blob } from './blob'; export { Buf } from './buf'; +export { CheckoutOptions } from './checkout-options'; +export { Commit } from './commit'; +export { DiffDelta } from './diff-delta'; +export { DiffFile } from './diff-file'; +export { DiffPerfdata } from './diff-perf-data'; +export { Diff } from './diff'; +export { Enums } from './enums'; +export { FetchOptions } from './fetch-options'; +export { IndexEntry } from './index-entry'; +export { Index } from './index_'; export { Object } from './object'; +export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oid } from './oid'; export { Reference } from './reference'; +export { RemoteCallbacks } from './remote-callbacks'; +export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; +export { Strarray } from './str-array'; export { Time } from './time'; +export { Treebuilder } from './tree-builder'; +export { TreeEntry } from './tree-entry'; +export { Tree } from './tree'; diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts new file mode 100644 index 0000000000..9902b53d35 --- /dev/null +++ b/types/nodegit/index_.d.ts @@ -0,0 +1,56 @@ +import { Oid } from './oid'; +import { IndexEntry } from './index-entry'; +import { Repository } from './repository'; +import { Tree } from './tree'; +import { Strarray } from './str-array'; + +export namespace Index { + enum ADD_OPTION { + ADD_DEFAULT = 0, + ADD_FORCE = 1, + ADD_DISABLE_PATHSPEC_MATCH = 2, + ADD_CHECK_PATHSPEC = 4 + } + + enum CAP { + IGNORE_CASE = 1, + NO_FILEMODE = 2, + NO_SYMLINKS = 4, + FROM_OWNER = -1 + } +} + +export class Index { + static entryIsConflict(entry: IndexEntry): number; + static entryStage(entry: IndexEntry): number; + static open(index_path: string): Promise; + + add(source_entry: IndexEntry): number; + addAll(pathspec: Strarray, flags: number, callback: Function, payload: void): Promise; + addByPath(path: string): number; + caps(): number; + checksum(): Oid; + clear(): number; + conflictAdd(ancestor_entry: IndexEntry, our_entry: IndexEntry, their_entry: IndexEntry): number; + conflictCleanup(): number; + conflictGet(path: string): Promise; + conflictRemove(path: string): number; + entryCount(): number; + getByIndex(n: number): IndexEntry; + getByPath(path: string, stage: number): IndexEntry; + hasConflicts(): number; + 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; + removeDirectory(dir: string, stage: number): number; + setCaps(caps: number): number; + updateAll(pathspec: Strarray, callback: Function, payload: void): Promise; + write(): number; + writeTree(): Promise; + writeTreeTo(repo: Repository): Promise; + entries(): IndexEntry[]; +} diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index b7fa54b0c1..c4c57854b7 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -3,3 +3,7 @@ import * as Git from 'nodegit'; Git.Repository.discover("startPath", 1, "ceilingDirs").then((string) => { // Use string }); + +Git.Repository.init("path", true).then((repository) => { + // Use repository +}); diff --git a/types/nodegit/odb-object.d.ts b/types/nodegit/odb-object.d.ts new file mode 100644 index 0000000000..361e8c0718 --- /dev/null +++ b/types/nodegit/odb-object.d.ts @@ -0,0 +1,10 @@ +import { Oid } from './oid'; + +export class OdbObject { + data(): Buffer; + dup(): Promise; + free(): void; + id(): Oid; + size(): number; + type(): number; +} diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index acacda8b73..f43f1673db 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -1,4 +1,5 @@ import { Oid } from './oid'; +import { OdbObject } from './odb-object'; export namespace Odb { enum STREAM { @@ -13,6 +14,6 @@ export class Odb { addDiskAlternate(path: string): number; free(): void; - read(id: Oid): Promise; + read(id: Oid): Promise; write(data: Buffer, len: number, type: number): Promise; } diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts index 92e3e546b2..e2148f6a07 100644 --- a/types/nodegit/reference.d.ts +++ b/types/nodegit/reference.d.ts @@ -1,5 +1,6 @@ import { Repository } from './repository'; import { Oid } from './oid'; +import { Object } from './object'; export namespace Reference { enum TYPE { @@ -40,7 +41,7 @@ export class Reference { isTag(): number; name(): string; owner(): Repository; - peel(type: number): Promise; + peel(type: number): Promise; rename(newName: string, force: number, logMessage: string): Promise; resolve(): Promise; setTarget(id: Oid, logMessage: string): Promise; diff --git a/types/nodegit/remote-callbacks.d.ts b/types/nodegit/remote-callbacks.d.ts new file mode 100644 index 0000000000..0987b6259f --- /dev/null +++ b/types/nodegit/remote-callbacks.d.ts @@ -0,0 +1,8 @@ +export interface RemoteCallbacks { + version?: number; + credentials?: Function; + certificateCheck?: Function; + transferProgress?: Function; + transport?: Function; + payload?: void; +} diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts new file mode 100644 index 0000000000..3fc10534d4 --- /dev/null +++ b/types/nodegit/remote.d.ts @@ -0,0 +1,62 @@ +import { Repository } from './repository'; +import { RemoteCallbacks } from './remote-callbacks'; +import { Strarray } from './str-array'; +import { FetchOptions } from './fetch-options'; +import { Buf } from './buf'; +import { Enums } from './enums'; + +export namespace Remote { + enum AUTOTAG_OPTION { + DOWNLOAD_TAGS_UNSPECIFIED = 0, + DOWNLOAD_TAGS_AUTO = 1, + DOWNLOAD_TAGS_NONE = 2, + DOWNLOAD_TAGS_ALL = 3 + } + + enum COMPLETION_TYPE { + COMPLETION_DOWNLOAD = 0, + COMPLETION_INDEXING = 1, + COMPLETION_ERROR = 2 + } +} + +export class Remote { + static addFetch(repo: Repository, remote: string, refspec: string): number; + static addPush(repo: Repository, remote: string, refspec: string): number; + static create(repo: Repository, name: string, url: string): Remote; + static createAnonymous(repo: Repository, url: string): Promise; + 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(remote_name: string): number; + static list(repo: Repository): 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; + connected(): number; + defaultBranch(): Promise; + disconnect(): Promise; + download(refSpecs: any[], opts: FetchOptions, callback: Function): Promise; + dup(): Promise; + fetch(refSpecs: any[], opts: FetchOptions, message: string, callback: Function): Promise; + free(): void; + getFetchRefspecs(): Promise; + getPushRefspecs(): Promise; + getRefspec(n: number): Refspec; + name(): string; + owner(): Repository; + prune(callbacks: RemoteCallbacks): number; + pruneRefs(): number; + push(refSpecs: any[], options: PushOptions, callback: Function): Promise; + pushurl(): string; + refspecCount(): number; + stats(): TransferProgress; + stop(): void; + updateTips(callbacks: RemoteCallbacks, update_fetchhead: number, download_tags: number, reflog_message: string): number; + upload(refspecs: Strarray, opts: PushOptions): number; + url(): string; +} diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index f32ca65c60..e18984bbcb 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -3,6 +3,15 @@ import { Buf } from './buf'; import { Reference } from './reference'; import { Odb } from './odb'; import { Object } from './object'; +import { Index } from './index_'; +import { Commit } from './commit'; +import { Blob } from './blob'; +import { Tree } from './tree'; +import { Signature } from './signature'; +import { AnnotatedCommit } from './annotated-commit'; +import { FetchOptions } from './fetch-options'; +import { CheckoutOptions } from './checkout-options'; +import { Remote } from './remote'; interface RepositoryInitOptions { description: string, @@ -84,7 +93,7 @@ export class Repository { head(): Promise; headDetached(): number; headUnborn(): number; - index(): Promise; + index(): Promise; isBare(): number; isEmpty(): number; isShallow(): number; @@ -95,44 +104,44 @@ export class Repository { refdb(): Promise; setHead(refname: string): Promise; setHeadDetached(commitish: Oid): number; - setHeadDetachedFromAnnotated(commitish: NodeGit.AnnotatedCommit): number; + setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): number; setIdent(name: string, email: string): number; setNamespace(nmspace: string): number; setWorkdir(workdir: string, update_gitlink: number): number; state(): number; stateCleanup(): number; workdir(): string; - createBranch(name: string, commit: NodeGit.Commit | string | Oid, force: boolean, signature: NodeGit.Signature, logMessage: string): Promise; - getReferenceCommit(name: string | Reference): Promise; + createBranch(name: string, commit: Commit | string | Oid, force: boolean, signature: Signature, logMessage: string): Promise; + getReferenceCommit(name: string | Reference): Promise; getBranch(name: string | Reference): Promise; - getBranchCommit(name: string | Reference): Promise; + getBranchCommit(name: string | Reference): Promise; getCurrentBranch(): Promise; getReference(name: string | Reference): Promise; getReferences(type: Reference.TYPE): Promise; getReferenceNames(type: Reference.TYPE): Promise; - getCommit(string: string | Oid): Promise; - getBlob(string: string | Oid): Promise; - getTree(string: string | Oid): Promise; + getCommit(string: string | Oid): Promise; + getBlob(string: string | Oid): Promise; + getTree(string: string | Oid): Promise; createTag(string: string | Oid, name: string, message: string): Promise; createLightweightTag(string: string | Oid, name: string): Promise; getTag(string: string | Oid): Promise; getTagByName(Short: string): Promise; deleteTagByName(Short: string): Promise; createRevWalk(string: string | Oid): any; - getMasterCommit(): Promise; - getHeadCommit(): Promise; - createCommit(updateRef: string, author: NodeGit.Signature, committer: NodeGit.Signature, message: string, Tree: NodeGit.Tree | Oid | string, parents: any[]): Promise; - createCommitOnHead(filesToAdd: any[], author: NodeGit.Signature, committer: NodeGit.Signature, message: string): Promise; + getMasterCommit(): Promise; + getHeadCommit(): Promise; + createCommit(updateRef: string, author: Signature, committer: Signature, message: string, Tree: Tree | Oid | string, parents: any[]): Promise; + createCommitOnHead(filesToAdd: any[], author: Signature, committer: Signature, message: string): Promise; createBlobFromBuffer(buffer: Buffer): Oid; - treeBuilder(tree: NodeGit.Tree): any; + treeBuilder(tree: Tree): any; defaultSignature(): Signature; getRemotes(Optional: Function): Promise; - getRemote(remote: string | Remote, callback: Function): Promise; + getRemote(remote: string | Remote, callback: Function): Promise; fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; - mergeBranches(to: string | Reference, from: string | Reference, signature: NodeGit.Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise; - rebaseBranches(branch: string, upstream: string, onto: string, signature: NodeGit.Signature, beforeNextFn: Function): Promise; - continueRebase(signature: NodeGit.Signature, beforeNextFn: Function): Promise; + mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise; + rebaseBranches(branch: string, upstream: string, onto: string, signature: Signature, beforeNextFn: Function): Promise; + continueRebase(signature: Signature, beforeNextFn: Function): Promise; getStatus(opts: any): Promise; getStatusExt(opts: any): Promise; getSubmoduleNames(): Promise; diff --git a/types/nodegit/str-array.d.ts b/types/nodegit/str-array.d.ts new file mode 100644 index 0000000000..fc400448f2 --- /dev/null +++ b/types/nodegit/str-array.d.ts @@ -0,0 +1,6 @@ +export class Strarray { + copy(src: Strarray): number; + free(): void; + strings: string; + count: number; +} diff --git a/types/nodegit/tree-builder.d.ts b/types/nodegit/tree-builder.d.ts new file mode 100644 index 0000000000..03d11db900 --- /dev/null +++ b/types/nodegit/tree-builder.d.ts @@ -0,0 +1,16 @@ +import { Oid } from './oid'; +import { Repository } from './repository'; +import { Tree } from './tree'; +import { TreeEntry } from './tree-entry'; + +export class Treebuilder { + static create(repo: Repository, source: Tree): Promise; + + clear(): void; + entrycount(): number; + free(): void; + get(filename: string): TreeEntry; + insert(filename: string, id: Oid, filemode: number): Promise; + remove(filename: string): number; + write(): Oid; +} diff --git a/types/nodegit/tree-entry.d.ts b/types/nodegit/tree-entry.d.ts new file mode 100644 index 0000000000..8d1b5d553e --- /dev/null +++ b/types/nodegit/tree-entry.d.ts @@ -0,0 +1,30 @@ +import { Tree } from './tree'; +import { Oid } from './oid'; +import { Blob } from './blob'; + +export namespace TreeEntry { + enum FILEMODE { + UNREADABLE = 0, + TREE = 16384, + BLOB = 33188, + EXECUTABLE = 33261, + LINK = 40960, + COMMIT = 57344 + } +} + +export class TreeEntry { + isFile(): Boolean; + isTree(): Boolean; + isDirectory(): Boolean; + isBlob(): Boolean; + sha(): string; + getTree(): Promise; + getBlob(): Promise; + path(): string; + toString(): string; + attr: number; + oid: Oid; + filenameLen: number; + filename: string; +} diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts new file mode 100644 index 0000000000..b9ac62f9e2 --- /dev/null +++ b/types/nodegit/tree.d.ts @@ -0,0 +1,44 @@ +import { Oid } from './oid'; +import { TreeEntry } from './tree-entry'; +import { Repository } from './repository'; +import { Object } from './object'; +import { Treebuilder } from './tree-builder'; +import { DiffFile } from './diff-file'; + +export namespace Tree { + enum WALK_MODE { + WALK_PRE = 0, + WALK_POST = 1 + } +} + +export class Tree { + static entryCmp(e1: TreeEntry, e2: TreeEntry): number; + static entryDup(dest: TreeEntry, source: TreeEntry): number; + static entryFilemode(entry: TreeEntry): number; + static entryFilemodeRaw(entry: TreeEntry): number; + static entryFree(entry: TreeEntry): void; + static entryId(entry: TreeEntry): Oid; + static entryName(entry: TreeEntry): string; + static entryToObject(object_out: Object, repo: Repository, entry: TreeEntry): number; + static entryType(entry: TreeEntry): number; + static lookup(repo: Repository, id: string | Oid | Tree, callback: Function): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + entryById(id: Oid): TreeEntry; + _entryByIndex(idx: number): TreeEntry; + entryByName(name: string): TreeEntry; + entryByPath(path: string): Promise; + entryCount(): number; + free(): void; + id(): Oid; + owner(): Repository; + diff(tree: Tree, callback: Function): Promise; + diffWithOptions(tree: Tree, options: Object, callback: Function): Promise; + entryByIndex(i: number): TreeEntry; + getEntry(filePath: string): TreeEntry; + entries(): TreeEntry[]; + walk(blobsOnly?: Boolean): NodeJS.EventEmitter; + path(): string; + builder(): Treebuilder; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 471d7919cd..eec4787935 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -16,15 +16,33 @@ "forceConsistentCasingInFileNames": true }, "files": [ + "annotated-commit.d.ts", + "blob.d.ts", "buf.d.ts", + "checkout-options.d.ts", + "commit.d.ts", + "diff-delta.d.ts", + "diff-file.d.ts", + "diff-perf-data.d.ts", + "diff.d.ts", + "enums.d.ts", + "fetch-options.d.ts", + "index-entry.d.ts", "index.d.ts", "nodegit-tests.ts", "object.d.ts", + "odb-object.d.ts", "odb.d.ts", "oid.d.ts", "reference.d.ts", + "remote-callbacks.d.ts", + "remote.d.ts", "repository.d.ts", "signature.d.ts", + "str-array.d.ts", "time.d.ts", + "tree-builder.d.ts", + "tree-entry.d.ts", + "tree.d.ts" ] } From dd5dc38dec7b349456af6a5604a88cbca23a5b3c Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 02:39:34 +0100 Subject: [PATCH 04/91] Added more files --- types/nodegit/checkout-options.d.ts | 6 +-- types/nodegit/commit.d.ts | 2 + types/nodegit/config.d.ts | 22 +++++++++++ types/nodegit/diff.d.ts | 5 ++- types/nodegit/index-entry.d.ts | 2 +- types/nodegit/index.d.ts | 12 +++++- types/nodegit/merge-file-input.d.ts | 7 ++++ types/nodegit/merge-options.d.ts | 8 ++++ types/nodegit/merge.d.ts | 59 ++++++++++++++++++++++++++++ types/nodegit/oid-array.d.ts | 7 ++++ types/nodegit/push-options.d.ts | 7 ++++ types/nodegit/ref-db.d.ts | 8 ++++ types/nodegit/ref-spec.d.ts | 8 ++++ types/nodegit/remote-callbacks.d.ts | 4 +- types/nodegit/remote.d.ts | 3 ++ types/nodegit/repository.d.ts | 38 ++++++++++-------- types/nodegit/tag.d.ts | 27 +++++++++++++ types/nodegit/transfer-progress.d.ts | 9 +++++ types/nodegit/tsconfig.json | 10 +++++ 19 files changed, 218 insertions(+), 26 deletions(-) create mode 100644 types/nodegit/config.d.ts create mode 100644 types/nodegit/merge-file-input.d.ts create mode 100644 types/nodegit/merge-options.d.ts create mode 100644 types/nodegit/merge.d.ts create mode 100644 types/nodegit/oid-array.d.ts create mode 100644 types/nodegit/push-options.d.ts create mode 100644 types/nodegit/ref-db.d.ts create mode 100644 types/nodegit/ref-spec.d.ts create mode 100644 types/nodegit/tag.d.ts create mode 100644 types/nodegit/transfer-progress.d.ts diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index cd23a70ede..c799ce2047 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -11,9 +11,9 @@ export interface CheckoutOptions { fileOpenFlags?: number; notifyFlags?: number; notifyCb?: any; - notifyPayload?: void; + notifyPayload?: undefined; progressCb?: any; - progressPayload?: void; + progressPayload?: undefined; paths?: Strarray; baseline?: Tree; baselineIndex?: Index; @@ -22,5 +22,5 @@ export interface CheckoutOptions { ourLabel?: string; theirLabel?: string; perfdataCb?: any; - perfdataPayload?: void; + perfdataPayload?: undefined; } diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts index 3980ce080e..24ee08cc48 100644 --- a/types/nodegit/commit.d.ts +++ b/types/nodegit/commit.d.ts @@ -1,3 +1,5 @@ +import { EventEmitter } from 'events'; + import { Repository } from './repository'; import { Signature } from './signature'; import { Oid } from './oid'; diff --git a/types/nodegit/config.d.ts b/types/nodegit/config.d.ts new file mode 100644 index 0000000000..ad8df1a327 --- /dev/null +++ b/types/nodegit/config.d.ts @@ -0,0 +1,22 @@ +import { Buf } from './buf'; + +export namespace Config { + enum LEVEL { + SYSTEM = 1, + XDG = 2, + GLOBAL = 3, + LOCAL = 4, + APP = 5, + HIGHEST_LEVEL = -1 + } +} + +export class Config { + static openDefault(): Promise; + + getStringBuf(name: string): Promise; + setInt64(name: string, value: number): number; + setMultivar(name: string, regexp: string, value: string): number; + setString(name: string, value: string): Promise; + snapshot(): Promise; +} diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index ab3b3aa2c8..d8b60e1c6a 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -22,7 +22,7 @@ export interface DiffOptions { ignoreSubmodules: number; pathspec: Strarray; notifyCb: Function; - notifyPayload: void; + notifyPayload: undefined; contextLines: number; interhunkLines: number; idAbbrev: number; @@ -139,7 +139,8 @@ export namespace Diff { } export class Diff { - static blobToBuffer(old_blob: Blob, old_as_path: string, buffer: string, buffer_as_path: string, opts: DiffOptions, file_cb: Function, binary_cb: Function, hunk_cb: Function, line_cb: Function): Promise; + static blobToBuffer(old_blob: Blob, oldAsPath: string, + buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; diff --git a/types/nodegit/index-entry.d.ts b/types/nodegit/index-entry.d.ts index a6591e37b9..f2ac5cad8a 100644 --- a/types/nodegit/index-entry.d.ts +++ b/types/nodegit/index-entry.d.ts @@ -1,6 +1,6 @@ import { Oid } from './oid'; -interface IndexTime { +export interface IndexTime { seconds: number; nanoseconds: number; } diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 92307a1abb..10e7c3483a 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -8,25 +8,35 @@ export { Blob } from './blob'; export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; +export { Config } from './config'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; -export { IndexEntry } from './index-entry'; export { Index } from './index_'; +export { IndexEntry } from './index-entry'; +export { MergeFileInput } from './merge-file-input'; +export { MergeOptions } from './merge-options'; +export { Merge } from './merge'; export { Object } from './object'; export { OdbObject } from './odb-object'; export { Odb } from './odb'; +export { Oidarray } from './oid-array'; export { Oid } from './oid'; +export { PushOptions } from './push-options'; +export { Refdb } from './ref-db'; +import { Refspec } from './ref-spec'; export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; export { Strarray } from './str-array'; +export { Tag } from './tag'; export { Time } from './time'; +export { TransferProgress } from './transfer-progress'; export { Treebuilder } from './tree-builder'; export { TreeEntry } from './tree-entry'; export { Tree } from './tree'; diff --git a/types/nodegit/merge-file-input.d.ts b/types/nodegit/merge-file-input.d.ts new file mode 100644 index 0000000000..f49bd446ca --- /dev/null +++ b/types/nodegit/merge-file-input.d.ts @@ -0,0 +1,7 @@ +export interface MergeFileInput { + version: number; + ptr: string; + size: number; + path: string; + mode: number; +} diff --git a/types/nodegit/merge-options.d.ts b/types/nodegit/merge-options.d.ts new file mode 100644 index 0000000000..a4108c767d --- /dev/null +++ b/types/nodegit/merge-options.d.ts @@ -0,0 +1,8 @@ +export interface MergeOptions { + version: number; + treeFlags: number; + renameThreshold: number; + targetLimit: number; + fileFavor: number; + fileFlags: number; +} diff --git a/types/nodegit/merge.d.ts b/types/nodegit/merge.d.ts new file mode 100644 index 0000000000..fb135e178f --- /dev/null +++ b/types/nodegit/merge.d.ts @@ -0,0 +1,59 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Tree } from './tree'; +import { Commit } from './commit'; +import { Index } from './index'; +import { AnnotatedCommit } from './annotated-commit'; +import { CheckoutOptions } from './checkout-options'; +import { Oidarray } from './oid-array'; +import { MergeOptions } from './merge-options'; +import { MergeFileInput } from './merge-file-input'; + +export namespace Merge { + enum ANALYSIS { + NONE = 0, + NORMAL = 1, + UP_TO_DATE = 2, + FASTFORWARD = 4, + UNBORN = 8 + } + + enum FILE_FAVOR { + NORMAL = 0, + OURS = 1, + THEIRS = 2, + UNION = 3 + } + + enum FILE_FLAGS { + FILE_DEFAULT = 0, + FILE_STYLE_MERGE = 1, + FILE_STYLE_DIFF3 = 2, + FILE_SIMPLIFY_ALNUM = 4, + FILE_IGNORE_WHITESPACE = 8, + FILE_IGNORE_WHITESPACE_CHANGE = 16, + FILE_IGNORE_WHITESPACE_EOL = 32, + FILE_DIFF_PATIENCE = 64, + FILE_DIFF_MINIMAL = 128 + } + + enum PREFERENCE { + NONE = 0, + NO_FASTFORWARD = 1, + FASTFORWARD_ONLY = 2 + } + + enum TREE_FLAG { + TREE_FIND_RENAMES = 1 + } +} + +export class Merge { + static merge(repo: Repository, theirHead: AnnotatedCommit, mergeOpts?: MergeOptions, checkoutOpts?: CheckoutOptions): any; + static base(repo: Repository, one: Oid, two: Oid): Promise; + static bases(repo: Repository, one: Oid, two: Oid): Promise; + 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, ancestor_tree: Tree, our_tree: Tree, their_tree: Tree, opts: MergeOptions): Promise; +} diff --git a/types/nodegit/oid-array.d.ts b/types/nodegit/oid-array.d.ts new file mode 100644 index 0000000000..7a96f24a7a --- /dev/null +++ b/types/nodegit/oid-array.d.ts @@ -0,0 +1,7 @@ +import { Oid } from './oid'; + +export class Oidarray { + free(): void; + ids: Oid; + count: number; +} diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts new file mode 100644 index 0000000000..5187548b8f --- /dev/null +++ b/types/nodegit/push-options.d.ts @@ -0,0 +1,7 @@ +import { RemoteCallbacks } from './remote-callbacks'; + +export interface PushOptions { + version: number; + pbParallelism: number; + callbacks: RemoteCallbacks; +} diff --git a/types/nodegit/ref-db.d.ts b/types/nodegit/ref-db.d.ts new file mode 100644 index 0000000000..8c9046d48d --- /dev/null +++ b/types/nodegit/ref-db.d.ts @@ -0,0 +1,8 @@ +import { Repository } from './repository'; + +export class Refdb { + static open(repo: Repository): Promise; + + compress(): number; + free(): void; +} diff --git a/types/nodegit/ref-spec.d.ts b/types/nodegit/ref-spec.d.ts new file mode 100644 index 0000000000..bf40f21ac2 --- /dev/null +++ b/types/nodegit/ref-spec.d.ts @@ -0,0 +1,8 @@ +export class Refspec { + direction(): number; + dst(): string; + dstMatches(refname: string): number; + force(): number; + src(): string; + srcMatches(refname: string): number; +} diff --git a/types/nodegit/remote-callbacks.d.ts b/types/nodegit/remote-callbacks.d.ts index 0987b6259f..ca244e5c5e 100644 --- a/types/nodegit/remote-callbacks.d.ts +++ b/types/nodegit/remote-callbacks.d.ts @@ -1,8 +1,8 @@ -export interface RemoteCallbacks { +export class RemoteCallbacks { version?: number; credentials?: Function; certificateCheck?: Function; transferProgress?: Function; transport?: Function; - payload?: void; + payload?: undefined; } diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 3fc10534d4..0c3923c57c 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -4,6 +4,9 @@ import { Strarray } from './str-array'; import { FetchOptions } from './fetch-options'; import { Buf } from './buf'; import { Enums } from './enums'; +import { TransferProgress } from './transfer-progress'; +import { PushOptions } from './push-options'; +import { Refspec } from './ref-spec'; export namespace Remote { enum AUTOTAG_OPTION { diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index e18984bbcb..acf5f5b83a 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -12,19 +12,23 @@ import { AnnotatedCommit } from './annotated-commit'; import { FetchOptions } from './fetch-options'; import { CheckoutOptions } from './checkout-options'; import { Remote } from './remote'; +import { Tag } from './tag'; +import { Config } from './config'; +import { Merge } from './merge'; +import { MergeOptions } from './merge-options'; +import { Refdb } from './ref-db'; -interface RepositoryInitOptions { - description: string, - flags: number, - initialHead: string, - mode: number, - originUrl: string, - templatePath: string, - version: number, - workdirPath: string +export 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 @@ -84,8 +88,8 @@ export class Repository { static wrapOdb(odb: Odb): Promise; cleanup(): void; - config(): Promise; - configSnapshot(): Promise; + config(): Promise; + configSnapshot(): Promise; detachHead(): number; fetchheadForeach(callback: Function): Promise; free(): void; @@ -101,7 +105,7 @@ export class Repository { messageRemove(): number; odb(): Promise; path(): string; - refdb(): Promise; + refdb(): Promise; setHead(refname: string): Promise; setHeadDetached(commitish: Oid): number; setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): number; @@ -122,10 +126,10 @@ export class Repository { getCommit(string: string | Oid): Promise; getBlob(string: string | Oid): Promise; getTree(string: string | Oid): Promise; - createTag(string: string | Oid, name: string, message: string): Promise; + createTag(string: string | Oid, name: string, message: string): Promise; createLightweightTag(string: string | Oid, name: string): Promise; - getTag(string: string | Oid): Promise; - getTagByName(Short: string): Promise; + getTag(string: string | Oid): Promise; + getTagByName(Short: string): Promise; deleteTagByName(Short: string): Promise; createRevWalk(string: string | Oid): any; getMasterCommit(): Promise; @@ -139,7 +143,7 @@ export class Repository { getRemote(remote: string | Remote, callback: Function): Promise; fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; - mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise; + mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: Merge.PREFERENCE, mergeOptions: MergeOptions): Promise; rebaseBranches(branch: string, upstream: string, onto: string, signature: Signature, beforeNextFn: Function): Promise; continueRebase(signature: Signature, beforeNextFn: Function): Promise; getStatus(opts: any): Promise; diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts new file mode 100644 index 0000000000..d8f98953a0 --- /dev/null +++ b/types/nodegit/tag.d.ts @@ -0,0 +1,27 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Object } from './object'; +import { Signature } from './signature'; +import { Strarray } from './str-array'; + +export class Tag { + static annotationCreate(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string): Promise; + static create(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string, force: number): Promise; + static createLightweight(repo: Repository, tag_name: string, target: Object, force: number): Promise; + static delete(repo: Repository, tag_name: string): Promise; + static list(repo: Repository): Promise; + static listMatch(tag_names: Strarray, pattern: string, repo: Repository): number; + static lookup(repo: Repository, id: string | Oid | Tag): Promise; + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + free(): void; + id(): Oid; + message(): string; + name(): string; + owner(): Repository; + peel(tag_target_out: Object): number; + tagger(): Signature; + target(): Object; + targetId(): Oid; + targetType(): number; +} diff --git a/types/nodegit/transfer-progress.d.ts b/types/nodegit/transfer-progress.d.ts new file mode 100644 index 0000000000..1589d4b6c6 --- /dev/null +++ b/types/nodegit/transfer-progress.d.ts @@ -0,0 +1,9 @@ +export class TransferProgress { + totalObjects: number; + indexedObjects: number; + receivedObjects: number; + localObjects: number; + totalDeltas: number; + indexedDeltas: number; + receivedBytes: number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index eec4787935..bfb1077c61 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -21,6 +21,7 @@ "buf.d.ts", "checkout-options.d.ts", "commit.d.ts", + "config.d.ts", "diff-delta.d.ts", "diff-file.d.ts", "diff-perf-data.d.ts", @@ -29,18 +30,27 @@ "fetch-options.d.ts", "index-entry.d.ts", "index.d.ts", + "merge-file-input.d.ts", + "merge-options.d.ts", + "merge.d.ts", "nodegit-tests.ts", "object.d.ts", "odb-object.d.ts", "odb.d.ts", + "oid-array.d.ts", "oid.d.ts", + "push-options.d.ts", + "ref-db.d.ts", + "ref-spec.d.ts", "reference.d.ts", "remote-callbacks.d.ts", "remote.d.ts", "repository.d.ts", "signature.d.ts", "str-array.d.ts", + "tag.d.ts", "time.d.ts", + "transfer-progress.d.ts", "tree-builder.d.ts", "tree-entry.d.ts", "tree.d.ts" From 314e6080f4a5a96bf7a03273e99a8f5f059adb99 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 03:10:28 +0100 Subject: [PATCH 05/91] Added more files --- types/nodegit/convenient-patch.d.ts | 21 ++++++ types/nodegit/index.d.ts | 4 + types/nodegit/str-array.d.ts | 2 +- types/nodegit/submodule-update-options.d.ts | 9 +++ types/nodegit/submodule.d.ts | 81 +++++++++++++++++++++ types/nodegit/transport.d.ts | 14 ++++ types/nodegit/tsconfig.json | 4 + 7 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/convenient-patch.d.ts create mode 100644 types/nodegit/submodule-update-options.d.ts create mode 100644 types/nodegit/submodule.d.ts create mode 100644 types/nodegit/transport.d.ts diff --git a/types/nodegit/convenient-patch.d.ts b/types/nodegit/convenient-patch.d.ts new file mode 100644 index 0000000000..8dee260aa0 --- /dev/null +++ b/types/nodegit/convenient-patch.d.ts @@ -0,0 +1,21 @@ +import { DiffFile } from './diff-file'; + +export class ConvenientPatch { + oldFile(): DiffFile; + newFile(): DiffFile; + size(): number; + hunks(): Promise; + status(): number; + lineStats(): any; + isUnmodified(): Boolean; + isAdded(): Boolean; + isDeleted(): Boolean; + isModified(): Boolean; + isRenamed(): Boolean; + isCopied(): Boolean; + isIgnored(): Boolean; + isUntracked(): Boolean; + isTypeChange(): Boolean; + isUnreadable(): Boolean; + isConflicted(): Boolean; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 10e7c3483a..11d274425f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -9,6 +9,7 @@ export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; +export { ConvenientPatch } from './convenient-patch'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; export { DiffPerfdata } from './diff-perf-data'; @@ -34,9 +35,12 @@ export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; export { Strarray } from './str-array'; +export { SubmoduleUpdateOptions } from './submodule-update-options'; +export { Submodule } from './submodule'; export { Tag } from './tag'; export { Time } from './time'; export { TransferProgress } from './transfer-progress'; +export { Transport } from './transport'; export { Treebuilder } from './tree-builder'; export { TreeEntry } from './tree-entry'; export { Tree } from './tree'; diff --git a/types/nodegit/str-array.d.ts b/types/nodegit/str-array.d.ts index fc400448f2..525667fbcb 100644 --- a/types/nodegit/str-array.d.ts +++ b/types/nodegit/str-array.d.ts @@ -1,6 +1,6 @@ export class Strarray { copy(src: Strarray): number; free(): void; - strings: string; + strings: string[]; count: number; } diff --git a/types/nodegit/submodule-update-options.d.ts b/types/nodegit/submodule-update-options.d.ts new file mode 100644 index 0000000000..35bbd6b3f8 --- /dev/null +++ b/types/nodegit/submodule-update-options.d.ts @@ -0,0 +1,9 @@ +import { CheckoutOptions } from './checkout-options'; +import { FetchOptions } from './fetch-options'; + +export interface SubmoduleUpdateOptions { + version: number; + checkoutOpts: CheckoutOptions; + fetchOpts: FetchOptions; + cloneCheckoutStrategy: number; +} diff --git a/types/nodegit/submodule.d.ts b/types/nodegit/submodule.d.ts new file mode 100644 index 0000000000..b3c1576db4 --- /dev/null +++ b/types/nodegit/submodule.d.ts @@ -0,0 +1,81 @@ +import { Repository } from './repository'; +import { Buf } from './buf'; +import { Oid } from './oid'; +import { SubmoduleUpdateOptions } from './submodule-update-options'; + +export namespace Submodule { + enum IGNORE { + UNSPECIFIED = -1, + NONE = 1, + UNTRACKED = 2, + DIRTY = 3, + ALL = 4 + } + + enum RECURSE { + NO = 0, + YES = 1, + ONDEMAND = 2 + } + + enum STATUS { + IN_HEAD = 1, + IN_INDEX = 2, + IN_CONFIG = 4, + IN_WD = 8, + INDEX_ADDED = 16, + INDEX_DELETED = 32, + INDEX_MODIFIED = 64, + WD_UNINITIALIZED = 128, + WD_ADDED = 256, + WD_DELETED = 512, + WD_MODIFIED = 1024, + WD_INDEX_MODIFIED = 2048, + WD_WD_MODIFIED = 4096, + WD_UNTRACKED = 8192 + } + + enum UPDATE { + CHECKOUT = 1, + REBASE = 2, + MERGE = 3, + NONE = 4, + DEFAULT = 0 + } +} + +export class Submodule { + static addSetup(repo: Repository, url: string, path: string, use_gitlink: number): Promise; + static foreach(repo: Repository, callback: Function, payload: any): Promise; + static lookup(repo: Repository, name: string): Promise; + static resolveUrl(repo: Repository, url: string): Promise; + static setBranch(repo: Repository, name: string, branch: string): number; + static setFetchRecurseSubmodules(repo: Repository, name: string, fetch_recurse_submodules: number): number; + static setIgnore(repo: Repository, name: string, ignore: number): Promise; + static setUpdate(repo: Repository, name: string, update: number): Promise; + static setUrl(repo: Repository, name: string, url: string): Promise; + static status(repo: Repository, name: string, ignore: number): Promise; + static updateInitOptions(opts: SubmoduleUpdateOptions, version: number): number; + + addFinalize(): Promise; + addToIndex(write_index: number): Promise; + branch(): string; + fetchRecurseSubmodules(): number; + free(): void; + headId(): Oid; + ignore(): number; + indexId(): Oid; + init(overwrite: number): Promise; + location(): Promise; + name(): string; + open(): Promise; + owner(): Repository; + path(): string; + reload(force: number): number; + repoInit(use_gitlink: number): Promise; + sync(): Promise; + update(init: number, options: SubmoduleUpdateOptions): Promise; + updateStrategy(): number; + url(): string; + wdId(): Oid; +} diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts new file mode 100644 index 0000000000..9d1a82b061 --- /dev/null +++ b/types/nodegit/transport.d.ts @@ -0,0 +1,14 @@ +import { Remote } from './remote'; +import { Strarray } from './str-array'; + +export namespace Transport { + enum FLAGS { + NONE = 0 + } +} + +export class Transport { + static sshWithPaths(owner: Remote, payload: Strarray): Promise; + static unregister(prefix: string): number; + init(version: number): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index bfb1077c61..483f995a50 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -22,6 +22,7 @@ "checkout-options.d.ts", "commit.d.ts", "config.d.ts", + "convenient-patch.d.ts", "diff-delta.d.ts", "diff-file.d.ts", "diff-perf-data.d.ts", @@ -48,9 +49,12 @@ "repository.d.ts", "signature.d.ts", "str-array.d.ts", + "submodule-update-options.d.ts", + "submodule.d.ts", "tag.d.ts", "time.d.ts", "transfer-progress.d.ts", + "transport.d.ts", "tree-builder.d.ts", "tree-entry.d.ts", "tree.d.ts" From c1400707cd6ed822a063cdb1471a21d1e5deda6a Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 23:02:39 +0100 Subject: [PATCH 06/91] Status typings --- types/nodegit/index.d.ts | 4 +++ types/nodegit/status-entry.d.ts | 7 ++++ types/nodegit/status-list.d.ts | 11 ++++++ types/nodegit/status-options.d.ts | 8 +++++ types/nodegit/status.d.ts | 56 +++++++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 4 +++ 6 files changed, 90 insertions(+) create mode 100644 types/nodegit/status-entry.d.ts create mode 100644 types/nodegit/status-list.d.ts create mode 100644 types/nodegit/status-options.d.ts create mode 100644 types/nodegit/status.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 11d274425f..6aa64e9e1f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -34,6 +34,10 @@ export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; +export { StatusEntry } from './status-entry'; +export { StatusList } from './status-list'; +export { StatusOptions } from './status-options'; +export { Status } from './status'; export { Strarray } from './str-array'; export { SubmoduleUpdateOptions } from './submodule-update-options'; export { Submodule } from './submodule'; diff --git a/types/nodegit/status-entry.d.ts b/types/nodegit/status-entry.d.ts new file mode 100644 index 0000000000..bc2ab62a12 --- /dev/null +++ b/types/nodegit/status-entry.d.ts @@ -0,0 +1,7 @@ +import { DiffDelta } from './diff-delta'; + +export class StatusEntry { + status: number; + headToIndex: DiffDelta; + indexToWorkdir: DiffDelta; +} diff --git a/types/nodegit/status-list.d.ts b/types/nodegit/status-list.d.ts new file mode 100644 index 0000000000..6d83044801 --- /dev/null +++ b/types/nodegit/status-list.d.ts @@ -0,0 +1,11 @@ +import { Repository } from './repository'; +import { DiffPerfdata } from './diff-perf-data'; +import { StatusOptions } from './status-options'; + +export class StatusList { + static create(repo: Repository, opts: StatusOptions): Promise; + + entrycount(): number; + free(): void; + getPerfdata(): Promise; +} diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts new file mode 100644 index 0000000000..c4296a5b92 --- /dev/null +++ b/types/nodegit/status-options.d.ts @@ -0,0 +1,8 @@ +import { Strarray } from './str-array'; + +export interface StatusOptions { + version: number; + show: number; + flags: number; + pathspec: Strarray; +} diff --git a/types/nodegit/status.d.ts b/types/nodegit/status.d.ts new file mode 100644 index 0000000000..92bbe564f3 --- /dev/null +++ b/types/nodegit/status.d.ts @@ -0,0 +1,56 @@ +import { Repository } from './repository'; +import { StatusList } from './status-list'; +import { StatusEntry } from './status-entry'; +import { StatusOptions } from './status-options'; + +export namespace Status { + enum STATUS { + CURRENT = 0, + INDEX_NEW = 1, + INDEX_MODIFIED = 2, + INDEX_DELETED = 4, + INDEX_RENAMED = 8, + INDEX_TYPECHANGE = 16, + WT_NEW = 128, + WT_MODIFIED = 256, + WT_DELETED = 512, + WT_TYPECHANGE = 1024, + WT_RENAMED = 2048, + WT_UNREADABLE = 4096, + IGNORED = 16384, + CONFLICTED = 32768 + } + + enum OPT { + INCLUDE_UNTRACKED = 1, + INCLUDE_IGNORED = 2, + INCLUDE_UNMODIFIED = 4, + EXCLUDE_SUBMODULES = 8, + RECURSE_UNTRACKED_DIRS = 16, + DISABLE_PATHSPEC_MATCH = 32, + RECURSE_IGNORED_DIRS = 64, + RENAMES_HEAD_TO_INDEX = 128, + RENAMES_INDEX_TO_WORKDIR = 256, + SORT_CASE_SENSITIVELY = 512, + SORT_CASE_INSENSITIVELY = 1024, + RENAMES_FROM_REWRITES = 2048, + NO_REFRESH = 4096, + UPDATE_INDEX = 8192, + INCLUDE_UNREADABLE = 16384, + INCLUDE_UNREADABLE_AS_UNTRACKED = 32768 + } + + enum SHOW { + INDEX_AND_WORKDIR = 0, + INDEX_ONLY = 1, + WORKDIR_ONLY = 2 + } +} + +export class Status { + static byIndex(statuslist: StatusList, idx: number): StatusEntry; + static file(repo: Repository, path: string): number; + static foreach(repo: Repository, callback: Function, payload: void): Promise; + static foreachExt(repo: Repository, opts: StatusOptions, callback: Function, payload: void): Promise; + static shouldIgnore(ignored: number, repo: Repository, path: string): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 483f995a50..40d020dd19 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -48,6 +48,10 @@ "remote.d.ts", "repository.d.ts", "signature.d.ts", + "status-entry.d.ts", + "status-list.d.ts", + "status-options.d.ts", + "status.d.ts", "str-array.d.ts", "submodule-update-options.d.ts", "submodule.d.ts", From 046c22fa46b0d4445347fb38a3d8c3eea0a72bfc Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 4 Jun 2017 23:09:57 +0100 Subject: [PATCH 07/91] Stash typings --- types/nodegit/index.d.ts | 1 + types/nodegit/stash.d.ts | 46 +++++++++++++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 48 insertions(+) create mode 100644 types/nodegit/stash.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 6aa64e9e1f..a4a90f07d2 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -34,6 +34,7 @@ export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; export { Signature } from './signature'; +export { Stash } from './stash'; export { StatusEntry } from './status-entry'; export { StatusList } from './status-list'; export { StatusOptions } from './status-options'; diff --git a/types/nodegit/stash.d.ts b/types/nodegit/stash.d.ts new file mode 100644 index 0000000000..5208fa7e5f --- /dev/null +++ b/types/nodegit/stash.d.ts @@ -0,0 +1,46 @@ +import { Repository } from './repository'; +import { Signature } from './signature'; +import { Oid } from './oid'; +import { CheckoutOptions } from './checkout-options'; + +export namespace Stash { + enum APPLY_FLAGS { + APPLY_DEFAULT = 0, + APPLY_REINSTATE_INDEX = 1 + } + + enum APPLY_PROGRESS { + NONE = 0, + LOADING_STASH = 1, + ANALYZE_INDEX = 2, + ANALYZE_MODIFIED = 3, + ANALYZE_UNTRACKED = 4, + CHECKOUT_UNTRACKED = 5, + CHECKOUT_MODIFIED = 6, + DONE = 7 + } + + enum FLAGS { + DEFAULT = 0, + KEEP_INDEX = 1, + INCLUDE_UNTRACKED = 2, + INCLUDE_IGNORED = 4 + } +} + +export interface StashApplyOptions { + version: number; + flags: number; + checkoutOptions: CheckoutOptions; + progressCb: Function; + progressPayload: void; +} + +export class Stash { + 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: void): 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/tsconfig.json b/types/nodegit/tsconfig.json index 40d020dd19..017b34314c 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -48,6 +48,7 @@ "remote.d.ts", "repository.d.ts", "signature.d.ts", + "stash.d.ts", "status-entry.d.ts", "status-list.d.ts", "status-options.d.ts", From 7d863884d0dc482dbe6934c336f61e331427a193 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Jun 2017 16:57:30 +0100 Subject: [PATCH 08/91] Added revwalk --- types/nodegit/index.d.ts | 1 + types/nodegit/rev-walk.d.ts | 36 ++++++++++++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 38 insertions(+) create mode 100644 types/nodegit/rev-walk.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index a4a90f07d2..14d88297c4 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -33,6 +33,7 @@ export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; +export { Revwalk } from './rev-walk'; export { Signature } from './signature'; export { Stash } from './stash'; export { StatusEntry } from './status-entry'; diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts new file mode 100644 index 0000000000..ad54969164 --- /dev/null +++ b/types/nodegit/rev-walk.d.ts @@ -0,0 +1,36 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Commit } from './commit'; + +export namespace Revwalk { + enum SORT { + NONE = 0, + TOPOLOGICAL = 1, + TIME = 2, + REVERSE = 4 + } +} + +export class Revwalk { + static create(repo: Repository): Revwalk; + + hide(commit_id: Oid): number; + hideGlob(glob: string): number; + hideHead(): number; + hideRef(refname: string): number; + next(): Promise; + push(id: Oid): number; + pushGlob(glob: string): number; + pushHead(): number; + pushRange(range: string): number; + pushRef(refname: string): number; + repository(): Repository; + reset(): void; + simplifyFirstParent(): void; + sorting(sort: number): any; + fastWalk(max_count: number): Promise; + fileHistoryWalk(filePath: string, max_count: number): Promise; + walk(oid: Oid, callback: Function): Commit; + getCommitsUntil(checkFn: Function): Promise; + getCommits(count: number): Promise; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 017b34314c..9e3fa9285a 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -47,6 +47,7 @@ "remote-callbacks.d.ts", "remote.d.ts", "repository.d.ts", + "rev-walk.d.ts", "signature.d.ts", "stash.d.ts", "status-entry.d.ts", From 441c41158ed03faf0a467a72991120f8cd3b01e1 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Jun 2017 23:29:38 +0100 Subject: [PATCH 09/91] Added revparse --- types/nodegit/index.d.ts | 1 + types/nodegit/rev-parse.d.ts | 16 ++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 18 insertions(+) create mode 100644 types/nodegit/rev-parse.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 14d88297c4..c9c349fff0 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -33,6 +33,7 @@ export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; +export { Revparse } from './rev-parse'; export { Revwalk } from './rev-walk'; export { Signature } from './signature'; export { Stash } from './stash'; diff --git a/types/nodegit/rev-parse.d.ts b/types/nodegit/rev-parse.d.ts new file mode 100644 index 0000000000..9d0136cac6 --- /dev/null +++ b/types/nodegit/rev-parse.d.ts @@ -0,0 +1,16 @@ +import { Object } from './object'; +import { Repository } from './repository'; +import { Reference } from './reference'; + +export namespace Revparse { + enum MODE { + SINGLE = 1, + RANGE = 2, + MERGE_BASE = 4 + } +} + +export class Revparse { + static ext(object_out: Object, reference_out: Reference, repo: Repository, spec: string): number; + static single(repo: Repository, spec: string): Promise; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 9e3fa9285a..e2307970d6 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -47,6 +47,7 @@ "remote-callbacks.d.ts", "remote.d.ts", "repository.d.ts", + "rev-parse.d.ts", "rev-walk.d.ts", "signature.d.ts", "stash.d.ts", From 332dd084791e96b13e350af56169f556aef84d80 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Jun 2017 23:32:39 +0100 Subject: [PATCH 10/91] Added Revert --- types/nodegit/index.d.ts | 1 + types/nodegit/revert.d.ts | 17 +++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 19 insertions(+) create mode 100644 types/nodegit/revert.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index c9c349fff0..e2962e2cee 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -35,6 +35,7 @@ export { Remote } from './remote'; export { Repository } from './repository'; export { Revparse } from './rev-parse'; export { Revwalk } from './rev-walk'; +export { Revert } from './revert'; export { Signature } from './signature'; export { Stash } from './stash'; export { StatusEntry } from './status-entry'; diff --git a/types/nodegit/revert.d.ts b/types/nodegit/revert.d.ts new file mode 100644 index 0000000000..a1210182eb --- /dev/null +++ b/types/nodegit/revert.d.ts @@ -0,0 +1,17 @@ +import { MergeOptions } from './merge-options'; +import { CheckoutOptions } from './checkout-options'; +import { Repository } from './repository'; +import { Commit } from './commit'; +import { Index } from './index'; + +export interface RevertOptions { + version: number; + mainline: number; + mergeOpts: MergeOptions; + checkoutOpts: CheckoutOptions; +} + +export class Revert { + static revert(repo: Repository, commit: Commit, given_opts: RevertOptions): Promise; + static commit(repo: Repository, revert_commit: Commit, our_commit: Commit, mainline: number, merge_options: MergeOptions): Promise; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e2307970d6..b8b465f84d 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -49,6 +49,7 @@ "repository.d.ts", "rev-parse.d.ts", "rev-walk.d.ts", + "revert.d.ts", "signature.d.ts", "stash.d.ts", "status-entry.d.ts", From f04f22ac45ccab878a90bba1d0aed98f498ddd0a Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:13:49 +0100 Subject: [PATCH 11/91] Added Reset --- types/nodegit/index.d.ts | 1 + types/nodegit/reset.d.ts | 0 types/nodegit/tsconfig.json | 1 + 3 files changed, 2 insertions(+) create mode 100644 types/nodegit/reset.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index e2962e2cee..94aa7fe1ef 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -33,6 +33,7 @@ export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; export { Repository } from './repository'; +export { Reset } from './reset'; export { Revparse } from './rev-parse'; export { Revwalk } from './rev-walk'; export { Revert } from './revert'; diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index b8b465f84d..56641e050c 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -47,6 +47,7 @@ "remote-callbacks.d.ts", "remote.d.ts", "repository.d.ts", + "reset.d.ts", "rev-parse.d.ts", "rev-walk.d.ts", "revert.d.ts", From 95a20577f6e937a95a3c1b54e4843456cc1e0811 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:19:16 +0100 Subject: [PATCH 12/91] fixed Reset --- types/nodegit/reset.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index e69de29bb2..8af3919ff4 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -0,0 +1,19 @@ +import { AnnotatedCommit } from './annotated-commit'; +import { Repository } from './repository'; +import { Object } from './object'; +import { Strarray } from './str-array'; +import { CheckoutOptions } from './checkout-options'; + +export namespace Reset { + enum TYPE { + SOFT = 1, + MIXED = 2, + HARD = 3 + } +} + +export class Reset { + static reset(repo: Repository, target: Object, reset_type: number, checkout_opts: CheckoutOptions): Promise; + static default(repo: Repository, target: Object, pathspecs: Strarray): Promise; + static fromAnnotated(repo: Repository, commit: AnnotatedCommit, reset_type: number, checkout_opts: CheckoutOptions): number; +} From 9bbd5e983c3e9f1377d5d8cfc6156a5b209df8d4 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:26:06 +0100 Subject: [PATCH 13/91] Added Reflog --- types/nodegit/index.d.ts | 1 + types/nodegit/ref-log.d.ts | 23 +++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 25 insertions(+) create mode 100644 types/nodegit/ref-log.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 94aa7fe1ef..79c6d60c54 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -28,6 +28,7 @@ export { Oidarray } from './oid-array'; export { Oid } from './oid'; export { PushOptions } from './push-options'; export { Refdb } from './ref-db'; +export { Reflog, ReflogEntry } from './ref-log' import { Refspec } from './ref-spec'; export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; diff --git a/types/nodegit/ref-log.d.ts b/types/nodegit/ref-log.d.ts new file mode 100644 index 0000000000..749f0c03a1 --- /dev/null +++ b/types/nodegit/ref-log.d.ts @@ -0,0 +1,23 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Signature } from './signature'; + +export class Reflog { + static delete(repo: Repository, name: string): number; + static entryCommitter(entry: ReflogEntry): Signature; + static entryIdNew(entry: ReflogEntry): Oid; + static entryIdOld(entry: ReflogEntry): Oid; + static entryMessage(entry: ReflogEntry): string; + static read(repo: Repository, name: string): Promise; + static rename(repo: Repository, old_name: string, name: string): number; + + append(id: Oid, committer: Signature, msg: string): number; + drop(idx: number, rewrite_previous_entry: number): number; + entryByIndex(idx: number): ReflogEntry; + entrycount(): number; + free(): void; + write(): number; +} + +export class ReflogEntry { +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 56641e050c..7dba399bca 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -42,6 +42,7 @@ "oid.d.ts", "push-options.d.ts", "ref-db.d.ts", + "ref-log.d.ts", "ref-spec.d.ts", "reference.d.ts", "remote-callbacks.d.ts", From bf5f2294ca8ec46c463511f2b9c45d485f26d8e3 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:27:58 +0100 Subject: [PATCH 14/91] Added RebaseOpertation --- types/nodegit/index.d.ts | 3 ++- types/nodegit/rebase-operation.d.ts | 18 ++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/rebase-operation.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 79c6d60c54..4305b092ac 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -27,9 +27,10 @@ export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; export { PushOptions } from './push-options'; +export { RebaseOperation } from './rebase-operation'; export { Refdb } from './ref-db'; export { Reflog, ReflogEntry } from './ref-log' -import { Refspec } from './ref-spec'; +export { Refspec } from './ref-spec'; export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; export { Remote } from './remote'; diff --git a/types/nodegit/rebase-operation.d.ts b/types/nodegit/rebase-operation.d.ts new file mode 100644 index 0000000000..a6e6e53bfa --- /dev/null +++ b/types/nodegit/rebase-operation.d.ts @@ -0,0 +1,18 @@ +import { Oid } from './oid'; + +export namespace RebaseOperation { + enum REBASE_OPERATION { + PICK = 0, + REWORD = 1, + EDIT = 2, + SQUASH = 3, + FIXUP = 4, + EXEC = 5 + } +} + +export class RebaseOperation { + type: number; + id: Oid; + exec: string; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 7dba399bca..0d52815cb5 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -41,6 +41,7 @@ "oid-array.d.ts", "oid.d.ts", "push-options.d.ts", + "rebase-operation.d.ts", "ref-db.d.ts", "ref-log.d.ts", "ref-spec.d.ts", From cc2fd5a8d85708fa2544c912064c95bbcf7e11ea Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:32:18 +0100 Subject: [PATCH 15/91] Added meathods to ref log --- types/nodegit/ref-log.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/nodegit/ref-log.d.ts b/types/nodegit/ref-log.d.ts index 749f0c03a1..8557d02a39 100644 --- a/types/nodegit/ref-log.d.ts +++ b/types/nodegit/ref-log.d.ts @@ -20,4 +20,8 @@ export class Reflog { } export class ReflogEntry { + committer(): Signature; + idNew(): Oid; + idOld(): Oid; + message(): string; } From 09e7e4151994672779e2e92fb7de0259edcf574f Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:32:24 +0100 Subject: [PATCH 16/91] Added Rebase --- types/nodegit/index.d.ts | 1 + types/nodegit/rebase.d.ts | 27 +++++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 29 insertions(+) create mode 100644 types/nodegit/rebase.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 4305b092ac..eca21bec1c 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -28,6 +28,7 @@ export { Oidarray } from './oid-array'; export { Oid } from './oid'; export { PushOptions } from './push-options'; export { RebaseOperation } from './rebase-operation'; +export { Rebase, RebaseOptions } from './rebase'; export { Refdb } from './ref-db'; export { Reflog, ReflogEntry } from './ref-log' export { Refspec } from './ref-spec'; diff --git a/types/nodegit/rebase.d.ts b/types/nodegit/rebase.d.ts new file mode 100644 index 0000000000..15862ff17d --- /dev/null +++ b/types/nodegit/rebase.d.ts @@ -0,0 +1,27 @@ +import { CheckoutOptions } from './checkout-options'; +import { AnnotatedCommit } from './annotated-commit'; +import { Repository } from './repository'; +import { Signature } from './signature'; +import { Oid } from './oid'; +import { RebaseOperation } from './rebase-operation'; + +export interface RebaseOptions { + version: number; + quiet: number; + rewriteNotesRef: string; + checkoutOptions: CheckoutOptions; +} + +export class Rebase { + 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; + + abort(): number; + commit(author: Signature, committer: Signature, message_encoding: string, message: string): Oid; + finish(signature: Signature): number; + next(): Promise; + operationByIndex(idx: number): RebaseOperation; + operationCurrent(): number; + operationEntrycount(): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 0d52815cb5..3753e1d693 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -42,6 +42,7 @@ "oid.d.ts", "push-options.d.ts", "rebase-operation.d.ts", + "rebase.d.ts", "ref-db.d.ts", "ref-log.d.ts", "ref-spec.d.ts", From 5c1cf0697d657f4ed0970a8caa72091bbb33728e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:43:37 +0100 Subject: [PATCH 17/91] Added Push --- types/nodegit/index.d.ts | 1 + types/nodegit/push.d.ts | 6 ++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+) create mode 100644 types/nodegit/push.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index eca21bec1c..db7b3c6ed0 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -27,6 +27,7 @@ export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; export { PushOptions } from './push-options'; +export { Push } from './push'; export { RebaseOperation } from './rebase-operation'; export { Rebase, RebaseOptions } from './rebase'; export { Refdb } from './ref-db'; diff --git a/types/nodegit/push.d.ts b/types/nodegit/push.d.ts new file mode 100644 index 0000000000..26d8f07b60 --- /dev/null +++ b/types/nodegit/push.d.ts @@ -0,0 +1,6 @@ +import { RemoteCallbacks } from './remote-callbacks'; +import { PushOptions } from './push-options'; + +export class Push { + static initOptions(opts: PushOptions, version: number): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 3753e1d693..5022d35c65 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -41,6 +41,7 @@ "oid-array.d.ts", "oid.d.ts", "push-options.d.ts", + "push.d.ts", "rebase-operation.d.ts", "rebase.d.ts", "ref-db.d.ts", From 73b4969fa08305aa8abf8db1de9391c905269d56 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:48:34 +0100 Subject: [PATCH 18/91] Added PushUpdate and Pathspec --- types/nodegit/index.d.ts | 2 ++ types/nodegit/path-spec.d.ts | 34 ++++++++++++++++++++++++++++++++++ types/nodegit/push-update.d.ts | 8 ++++++++ types/nodegit/tsconfig.json | 2 ++ 4 files changed, 46 insertions(+) create mode 100644 types/nodegit/path-spec.d.ts create mode 100644 types/nodegit/push-update.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index db7b3c6ed0..8ddc254bc6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -26,7 +26,9 @@ export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; +export { Pathspec } from './path-spec'; export { PushOptions } from './push-options'; +export { PushUpdate } from './push-update'; export { Push } from './push'; export { RebaseOperation } from './rebase-operation'; export { Rebase, RebaseOptions } from './rebase'; diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts new file mode 100644 index 0000000000..d09d2812da --- /dev/null +++ b/types/nodegit/path-spec.d.ts @@ -0,0 +1,34 @@ +import { DiffDelta } from './diff-delta'; +import { Tree } from './tree'; +import { Diff } from './diff'; +import { Repository } from './repository'; +import { Index } from './index'; +import { Strarray } from './str-array'; + +export namespace Pathspec { + enum FLAG { + DEFAULT = 0, + IGNORE_CASE = 1, + USE_CASE = 2, + NO_GLOB = 4, + NO_MATCH_ERROR = 8, + FIND_FAILURES = 16, + FAILURES_ONLY = 32 + } +} + +export class Pathspec { + static matchListDiffEntry(m: any, pos: number): DiffDelta; + static matchListEntry(m: any, pos: number): string; + static matchListEntrycount(m: any): number; + static matchListFailedEntry(m: any, pos: number): string; + static matchListFailedEntrycount(m: any): number; + static create(pathspec: Strarray): Pathspec; + + free(): void; + matchDiff(diff: Diff, flags: number): Promise; + matchIndex(index: Index, flags: number): Promise; + matchTree(tree: Tree, flags: number): Promise; + matchWorkdir(repo: Repository, flags: number): Promise; + matchesPath(flags: number, path: string): number; +} diff --git a/types/nodegit/push-update.d.ts b/types/nodegit/push-update.d.ts new file mode 100644 index 0000000000..50f46726d5 --- /dev/null +++ b/types/nodegit/push-update.d.ts @@ -0,0 +1,8 @@ +import { Oid } from './oid'; + +export class PushUpdate { + srcRefname: string; + dstRefname: string; + src: Oid; + dst: Oid; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 5022d35c65..7d446ebcbd 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -40,7 +40,9 @@ "odb.d.ts", "oid-array.d.ts", "oid.d.ts", + "path-spec.d.ts", "push-options.d.ts", + "push-update.d.ts", "push.d.ts", "rebase-operation.d.ts", "rebase.d.ts", From bdd0f86ce7033bce36605ac55a451f42e41ece2b Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:52:15 +0100 Subject: [PATCH 19/91] Added Packbuilder --- types/nodegit/index.d.ts | 1 + types/nodegit/pack-builder.d.ts | 25 +++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 27 insertions(+) create mode 100644 types/nodegit/pack-builder.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 8ddc254bc6..f343cd5dd6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -26,6 +26,7 @@ export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; +export { Packbuilder } from './pack-builder'; export { Pathspec } from './path-spec'; export { PushOptions } from './push-options'; export { PushUpdate } from './push-update'; diff --git a/types/nodegit/pack-builder.d.ts b/types/nodegit/pack-builder.d.ts new file mode 100644 index 0000000000..0f21f5f328 --- /dev/null +++ b/types/nodegit/pack-builder.d.ts @@ -0,0 +1,25 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; +import { Revwalk } from './rev-walk'; + +export namespace Packbuilder { + enum STAGE { + ADDING_OBJECTS = 0, + DELTAFICATION = 1 + } +} + +export class Packbuilder { + static create(repo: Repository): Packbuilder; + + free(): void; + hash(): Oid; + insert(id: Oid, name: string): number; + insertCommit(id: Oid): number; + insertRecur(id: Oid, name: string): number; + insertTree(id: Oid): number; + insertWalk(walk: Revwalk): number; + objectCount(): number; + setThreads(n: number): number; + written(): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 7d446ebcbd..6ec7d65565 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -40,6 +40,7 @@ "odb.d.ts", "oid-array.d.ts", "oid.d.ts", + "path-builder.d.ts", "path-spec.d.ts", "push-options.d.ts", "push-update.d.ts", From 4a60f79472da6b0df7f3f0b86c6154bd73a89dc2 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:54:30 +0100 Subject: [PATCH 20/91] fixed typo --- types/nodegit/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 6ec7d65565..1f0cfe70f9 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -40,7 +40,7 @@ "odb.d.ts", "oid-array.d.ts", "oid.d.ts", - "path-builder.d.ts", + "pack-builder.d.ts", "path-spec.d.ts", "push-options.d.ts", "push-update.d.ts", From 0fbae92912bcd278082c5cdfa2f510c2e5d647bb Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:55:10 +0100 Subject: [PATCH 21/91] Added Openssl --- types/nodegit/index.d.ts | 1 + types/nodegit/open-ssl.d.ts | 3 +++ types/nodegit/tsconfig.json | 1 + 3 files changed, 5 insertions(+) create mode 100644 types/nodegit/open-ssl.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index f343cd5dd6..ff8adee80e 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -26,6 +26,7 @@ export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oidarray } from './oid-array'; export { Oid } from './oid'; +export { Openssl } from './open-ssl'; export { Packbuilder } from './pack-builder'; export { Pathspec } from './path-spec'; export { PushOptions } from './push-options'; diff --git a/types/nodegit/open-ssl.d.ts b/types/nodegit/open-ssl.d.ts new file mode 100644 index 0000000000..f8370260d5 --- /dev/null +++ b/types/nodegit/open-ssl.d.ts @@ -0,0 +1,3 @@ +export class Openssl { + static setLocking(): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 1f0cfe70f9..0e297fb291 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -40,6 +40,7 @@ "odb.d.ts", "oid-array.d.ts", "oid.d.ts", + "open-ssl.d.ts", "pack-builder.d.ts", "path-spec.d.ts", "push-options.d.ts", From 13e07d9e23849a9b84cd11a154a126790128323c Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 00:58:49 +0100 Subject: [PATCH 22/91] Added Note --- types/nodegit/index.d.ts | 1 + types/nodegit/note.d.ts | 18 ++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 20 insertions(+) create mode 100644 types/nodegit/note.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index ff8adee80e..4f232c4cf7 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -21,6 +21,7 @@ export { IndexEntry } from './index-entry'; export { MergeFileInput } from './merge-file-input'; export { MergeOptions } from './merge-options'; export { Merge } from './merge'; +export { Note } from './note'; export { Object } from './object'; export { OdbObject } from './odb-object'; export { Odb } from './odb'; diff --git a/types/nodegit/note.d.ts b/types/nodegit/note.d.ts new file mode 100644 index 0000000000..2ea74b9df8 --- /dev/null +++ b/types/nodegit/note.d.ts @@ -0,0 +1,18 @@ +import {Repository} from './repository'; +import {Signature} from './signature'; +import {Oid} from './oid'; + +export class Note { + static create(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; + static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: void): Promise; + static iteratorNew(repo: Repository, notes_ref: string): Promise; + static next(note_id: Oid, annotated_id: Oid, it: any): number; + static read(repo: Repository, notes_ref: string, oid: Oid): Promise; + static remove(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid): Promise; + + author(): Signature; + committer(): Signature; + free(): void; + id(): Oid; + message(): string; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 0e297fb291..32102a2de8 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -35,6 +35,7 @@ "merge-options.d.ts", "merge.d.ts", "nodegit-tests.ts", + "note.d.ts", "object.d.ts", "odb-object.d.ts", "odb.d.ts", From 98b385b76d86271b708d9ed0116004bfe60e2c98 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 01:31:28 +0100 Subject: [PATCH 23/91] Added MergeFileResult --- types/nodegit/index.d.ts | 1 + types/nodegit/merge-file-result.d.ts | 7 +++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/merge-file-result.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 4f232c4cf7..a299e9c4bf 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -19,6 +19,7 @@ export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; export { MergeFileInput } from './merge-file-input'; +export { MergeFileResult } from './merge-file-result'; export { MergeOptions } from './merge-options'; export { Merge } from './merge'; export { Note } from './note'; diff --git a/types/nodegit/merge-file-result.d.ts b/types/nodegit/merge-file-result.d.ts new file mode 100644 index 0000000000..e6f2efcc3b --- /dev/null +++ b/types/nodegit/merge-file-result.d.ts @@ -0,0 +1,7 @@ +export class MergeFileResult { + automergeable: number; + path: string; + mode: number; + ptr: string; + len: number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 32102a2de8..0e6b5c6daa 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -32,6 +32,7 @@ "index-entry.d.ts", "index.d.ts", "merge-file-input.d.ts", + "merge-file-result.d.ts", "merge-options.d.ts", "merge.d.ts", "nodegit-tests.ts", From 96568ae6e3bcf8f37d44ff2b09447fd7fc5aecec Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 01:32:50 +0100 Subject: [PATCH 24/91] Added MergeFileOptions --- types/nodegit/index.d.ts | 1 + types/nodegit/merge-file-options.d.ts | 8 ++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/merge-file-options.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index a299e9c4bf..a8253f700f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -19,6 +19,7 @@ export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; export { MergeFileInput } from './merge-file-input'; +export { MergeFileOptions } from './merge-file-options'; export { MergeFileResult } from './merge-file-result'; export { MergeOptions } from './merge-options'; export { Merge } from './merge'; diff --git a/types/nodegit/merge-file-options.d.ts b/types/nodegit/merge-file-options.d.ts new file mode 100644 index 0000000000..5d8233bcd6 --- /dev/null +++ b/types/nodegit/merge-file-options.d.ts @@ -0,0 +1,8 @@ +export interface MergeFileOptions { + version: number; + ancestorLabel: string; + ourLabel: string; + theirLabel: string; + favor: number; + flags: number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 0e6b5c6daa..28a3d8e30b 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -32,6 +32,7 @@ "index-entry.d.ts", "index.d.ts", "merge-file-input.d.ts", + "merge-file-options.d.ts", "merge-file-result.d.ts", "merge-options.d.ts", "merge.d.ts", From 59c7f36e1df68a33ff7dd10c20ff4e3a90ce56c1 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 01:34:38 +0100 Subject: [PATCH 25/91] Added Libgit2 --- types/nodegit/index.d.ts | 1 + types/nodegit/lib-git2.d.ts | 25 +++++++++++++++++++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 27 insertions(+) create mode 100644 types/nodegit/lib-git2.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index a8253f700f..c9e56f125e 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -18,6 +18,7 @@ export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; +export { Libgit2 } from './lib-git2'; export { MergeFileInput } from './merge-file-input'; export { MergeFileOptions } from './merge-file-options'; export { MergeFileResult } from './merge-file-result'; diff --git a/types/nodegit/lib-git2.d.ts b/types/nodegit/lib-git2.d.ts new file mode 100644 index 0000000000..9d7f1a5281 --- /dev/null +++ b/types/nodegit/lib-git2.d.ts @@ -0,0 +1,25 @@ +export namespace Libgit2 { + enum OPT { + GET_MWINDOW_SIZE = 0, + SET_MWINDOW_SIZE = 1, + GET_MWINDOW_MAPPED_LIMIT = 2, + SET_MWINDOW_MAPPED_LIMIT = 3, + GET_SEARCH_PATH = 4, + SET_SEARCH_PATH = 5, + SET_CACHE_OBJECT_LIMIT = 6, + SET_CACHE_MAX_SIZE = 7, + ENABLE_CACHING = 8, + GET_CACHED_MEMORY = 9, + GET_TEMPLATE_PATH = 10, + SET_TEMPLATE_PATH = 11, + SET_SSL_CERT_LOCATIONS = 12 + } +} + +export class Libgit2 { + static features(): number; + static init(): number; + static opts(option: number): number; + static shutdown(): number; + static version(major: number, minor: number, rev: number): void; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 28a3d8e30b..faae7d850e 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -31,6 +31,7 @@ "fetch-options.d.ts", "index-entry.d.ts", "index.d.ts", + "lib-git2.d.ts", "merge-file-input.d.ts", "merge-file-options.d.ts", "merge-file-result.d.ts", From 498c2392a18eaf36f5b3dc0502a13fb9c2d85d71 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:14:52 +0100 Subject: [PATCH 26/91] Added Indexer --- types/nodegit/index.d.ts | 1 + types/nodegit/indexer.d.ts | 8 ++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/indexer.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index c9e56f125e..5539972cfb 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -18,6 +18,7 @@ export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; +export { Indexer } from './indexer'; export { Libgit2 } from './lib-git2'; export { MergeFileInput } from './merge-file-input'; export { MergeFileOptions } from './merge-file-options'; diff --git a/types/nodegit/indexer.d.ts b/types/nodegit/indexer.d.ts new file mode 100644 index 0000000000..ee3ba9bc69 --- /dev/null +++ b/types/nodegit/indexer.d.ts @@ -0,0 +1,8 @@ +import { TransferProgress } from './transfer-progress'; +import { Oid } from './oid'; + +export class Indexer { + commit(stats: TransferProgress): number; + free(): void; + hash(): Oid; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index faae7d850e..a5e147be73 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -31,6 +31,7 @@ "fetch-options.d.ts", "index-entry.d.ts", "index.d.ts", + "indexer.d.ts", "lib-git2.d.ts", "merge-file-input.d.ts", "merge-file-options.d.ts", From fa9c001d4630bfea938336a415ecb397742fab41 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:16:33 +0100 Subject: [PATCH 27/91] Changed from interface to class --- types/nodegit/index-entry.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/index-entry.d.ts b/types/nodegit/index-entry.d.ts index f2ac5cad8a..b121b7a826 100644 --- a/types/nodegit/index-entry.d.ts +++ b/types/nodegit/index-entry.d.ts @@ -5,7 +5,7 @@ export interface IndexTime { nanoseconds: number; } -export interface IndexEntry { +export class IndexEntry { ctime: IndexTime; mtime: IndexTime; dev: number; From f5562c51a6103854e7977292c876fbbd1cc7c794 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:18:54 +0100 Subject: [PATCH 28/91] Added Ignore --- types/nodegit/ignore.d.ts | 7 +++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/ignore.d.ts diff --git a/types/nodegit/ignore.d.ts b/types/nodegit/ignore.d.ts new file mode 100644 index 0000000000..c38d84d1f3 --- /dev/null +++ b/types/nodegit/ignore.d.ts @@ -0,0 +1,7 @@ +import { Repository } from './repository'; + +export class Ignore { + static addRule(repo: Repository, rules: string): number; + static clearInternalRules(repo: Repository): number; + static pathIsIgnored(repo: Repository, path: string): Promise; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 5539972cfb..6803e441af 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -18,6 +18,7 @@ export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; +export { Ignore } from './ignore'; export { Indexer } from './indexer'; export { Libgit2 } from './lib-git2'; export { MergeFileInput } from './merge-file-input'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index a5e147be73..17fc3afa54 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "diff.d.ts", "enums.d.ts", "fetch-options.d.ts", + "ignore.d.ts", "index-entry.d.ts", "index.d.ts", "indexer.d.ts", From aa3eb7c40986b8595a33dcc04bad34f44da7b9d9 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:20:26 +0100 Subject: [PATCH 29/91] Added Hashsig --- types/nodegit/hash-sig.d.ts | 7 +++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/hash-sig.d.ts diff --git a/types/nodegit/hash-sig.d.ts b/types/nodegit/hash-sig.d.ts new file mode 100644 index 0000000000..7cc6a91c05 --- /dev/null +++ b/types/nodegit/hash-sig.d.ts @@ -0,0 +1,7 @@ +export class Hashsig { + static create(buf: string, buflen: number, opts: number): Promise; + static createFromFile(path: string, opts: number): Promise; + + compare(b: Hashsig): number; + free(): void; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 6803e441af..c863896f24 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; +export { Hashsig } from './hash-sig'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; export { Ignore } from './ignore'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 17fc3afa54..b7d15c0739 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "diff.d.ts", "enums.d.ts", "fetch-options.d.ts", + "hash-sig.d.ts", "ignore.d.ts", "index-entry.d.ts", "index.d.ts", From 77b77136272734769a8402824c411fb2f61b0cff Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:21:08 +0100 Subject: [PATCH 30/91] Added namespace for Hashsig --- types/nodegit/hash-sig.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/nodegit/hash-sig.d.ts b/types/nodegit/hash-sig.d.ts index 7cc6a91c05..afa9bc121c 100644 --- a/types/nodegit/hash-sig.d.ts +++ b/types/nodegit/hash-sig.d.ts @@ -1,3 +1,12 @@ +export namespace Hashsig { + enum OPTION { + NORMAL = 0, + IGNORE_WHITESPACE = 1, + SMART_WHITESPACE = 2, + ALLOW_SMALL_FILES = 4 + } +} + export class Hashsig { static create(buf: string, buflen: number, opts: number): Promise; static createFromFile(path: string, opts: number): Promise; From a0ed80ee2dd0e272bd7553bde20e1607f902dd0d Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:22:30 +0100 Subject: [PATCH 31/91] Added Giterr --- types/nodegit/git-err.d.ts | 7 +++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/git-err.d.ts diff --git a/types/nodegit/git-err.d.ts b/types/nodegit/git-err.d.ts new file mode 100644 index 0000000000..5147e7fb3c --- /dev/null +++ b/types/nodegit/git-err.d.ts @@ -0,0 +1,7 @@ +export class Giterr { + static errClear(): void; + static errDetach(cpy: NodeGit.Error): number; + static errLast(): Error; + static errSetOom(): void; + static errSetString(error_class: number, string: string): void; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index c863896f24..b1e5219aa9 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; +export { Giterr } from './git-err'; export { Hashsig } from './hash-sig'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index b7d15c0739..9ddbc87a30 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "diff.d.ts", "enums.d.ts", "fetch-options.d.ts", + "git-err.d.ts", "hash-sig.d.ts", "ignore.d.ts", "index-entry.d.ts", From 4e0dccc6e751b4126ab25489ddab155f1039ed71 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:26:29 +0100 Subject: [PATCH 32/91] Added Filter --- types/nodegit/filter.d.ts | 19 +++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 21 insertions(+) create mode 100644 types/nodegit/filter.d.ts diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts new file mode 100644 index 0000000000..391ab00456 --- /dev/null +++ b/types/nodegit/filter.d.ts @@ -0,0 +1,19 @@ +import { Repository } from './repository'; +import { Blob } from './blob'; +import { Buf } from './buf'; + +export class Filter { + static listContains(filters: any, name: string): number; + static listLength(fl: any): number; + static listNew(repo: Repository, mode: number, options: number): Promise; + static listStreamBlob(filters: any, blob: Blob, target: Writestream): number; + static listStreamData(filters: any, data: Buf, target: Writestream): number; + static listStreamFile(filters: any, repo: Repository, path: string, target: Writestream): number; + static unregister(name: string): number; + + lookup(name: string): Filter; + register(name: string, priority: number): number; + version: number; + attributes: string; + stream: Function; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index b1e5219aa9..c1ece4a753 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; export { FetchOptions } from './fetch-options'; +export { Filter } from './filter'; export { Giterr } from './git-err'; export { Hashsig } from './hash-sig'; export { Index } from './index_'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 9ddbc87a30..9ff8fdea93 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "diff.d.ts", "enums.d.ts", "fetch-options.d.ts", + "filter.d.ts", "git-err.d.ts", "hash-sig.d.ts", "ignore.d.ts", From bb108937c7faa215dba04fea8d65f7a6741faa4c Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:26:38 +0100 Subject: [PATCH 33/91] Added semi-colon --- types/nodegit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index c1ece4a753..3a6aef1423 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -44,7 +44,7 @@ export { Push } from './push'; export { RebaseOperation } from './rebase-operation'; export { Rebase, RebaseOptions } from './rebase'; export { Refdb } from './ref-db'; -export { Reflog, ReflogEntry } from './ref-log' +export { Reflog, ReflogEntry } from './ref-log'; export { Refspec } from './ref-spec'; export { Reference } from './reference'; export { RemoteCallbacks } from './remote-callbacks'; From a7d31d8d6b0ced066bb516ccc2109e25c1a8c208 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:27:13 +0100 Subject: [PATCH 34/91] Added namespace to Filter --- types/nodegit/filter.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts index 391ab00456..aedc0dbd6f 100644 --- a/types/nodegit/filter.d.ts +++ b/types/nodegit/filter.d.ts @@ -2,6 +2,20 @@ import { Repository } from './repository'; import { Blob } from './blob'; import { Buf } from './buf'; +export namespace Filter { + enum FLAG { + DEFAULT = 0, + ALLOW_UNSAFE = 1 + } + + enum MODE { + TO_WORKTREE = 0, + SMUDGE = 0, + TO_ODB = 1, + CLEAN = 1 + } +} + export class Filter { static listContains(filters: any, name: string): number; static listLength(fl: any): number; From 27d38b770f9fe26386ac4560fa9d175349cb97cd Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:28:47 +0100 Subject: [PATCH 35/91] Added Error --- types/nodegit/error.d.ts | 68 +++++++++++++++++++++++++++++++++++++ types/nodegit/git-err.d.ts | 4 ++- types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/error.d.ts diff --git a/types/nodegit/error.d.ts b/types/nodegit/error.d.ts new file mode 100644 index 0000000000..e1267c082b --- /dev/null +++ b/types/nodegit/error.d.ts @@ -0,0 +1,68 @@ +export namespace Error { + enum ERROR { + GITERR_NONE = 0, + GITERR_NOMEMORY = 1, + GITERR_OS = 2, + GITERR_INVALID = 3, + GITERR_REFERENCE = 4, + GITERR_ZLIB = 5, + GITERR_REPOSITORY = 6, + GITERR_CONFIG = 7, + GITERR_REGEX = 8, + GITERR_ODB = 9, + GITERR_INDEX = 10, + GITERR_OBJECT = 11, + GITERR_NET = 12, + GITERR_TAG = 13, + GITERR_TREE = 14, + GITERR_INDEXER = 15, + GITERR_SSL = 16, + GITERR_SUBMODULE = 17, + GITERR_THREAD = 18, + GITERR_STASH = 19, + GITERR_CHECKOUT = 20, + GITERR_FETCHHEAD = 21, + GITERR_MERGE = 22, + GITERR_SSH = 23, + GITERR_FILTER = 24, + GITERR_REVERT = 25, + GITERR_CALLBACK = 26, + GITERR_CHERRYPICK = 27, + GITERR_DESCRIBE = 28, + GITERR_REBASE = 29, + GITERR_FILESYSTEM = 30 + } + + enum CODE { + OK = 0, + ERROR = -1, + ENOTFOUND = -3, + EEXISTS = -4, + EAMBIGUOUS = -5, + EBUFS = -6, + EUSER = -7, + EBAREREPO = -8, + EUNBORNBRANCH = -9, + EUNMERGED = -10, + ENONFASTFORWARD = -11, + EINVALIDSPEC = -12, + ECONFLICT = -13, + ELOCKED = -14, + EMODIFIED = -15, + EAUTH = -16, + ECERTIFICATE = -17, + EAPPLIED = -18, + EPEEL = -19, + EEOF = -20, + EINVALID = -21, + EUNCOMMITTED = -22, + EDIRECTORY = -23, + PASSTHROUGH = -30, + ITEROVER = -31 + } +} + +export class Error { + message: string; + klass: number; +} diff --git a/types/nodegit/git-err.d.ts b/types/nodegit/git-err.d.ts index 5147e7fb3c..6a9da24bb3 100644 --- a/types/nodegit/git-err.d.ts +++ b/types/nodegit/git-err.d.ts @@ -1,6 +1,8 @@ +import { Error } from './error'; + export class Giterr { static errClear(): void; - static errDetach(cpy: NodeGit.Error): number; + static errDetach(cpy: Error): number; static errLast(): Error; static errSetOom(): void; static errSetString(error_class: number, string: string): void; diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 3a6aef1423..df1b2c1f20 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -15,6 +15,7 @@ export { DiffFile } from './diff-file'; export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; +export { Error } from './error'; export { FetchOptions } from './fetch-options'; export { Filter } from './filter'; export { Giterr } from './git-err'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 9ff8fdea93..21d56ac954 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -28,6 +28,7 @@ "diff-perf-data.d.ts", "diff.d.ts", "enums.d.ts", + "error.d.ts", "fetch-options.d.ts", "filter.d.ts", "git-err.d.ts", From df90245f9953ecf2a7bf3bd48d7117b6295ef619 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:30:05 +0100 Subject: [PATCH 36/91] Added Fetch --- types/nodegit/fetch.d.ts | 13 +++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 15 insertions(+) create mode 100644 types/nodegit/fetch.d.ts diff --git a/types/nodegit/fetch.d.ts b/types/nodegit/fetch.d.ts new file mode 100644 index 0000000000..2e71097ba3 --- /dev/null +++ b/types/nodegit/fetch.d.ts @@ -0,0 +1,13 @@ +import { FetchOptions } from './fetch-options'; + +export namespace Fetch { + enum PRUNE { + GIT_FETCH_PRUNE_UNSPECIFIED = 0, + GIT_FETCH_PRUNE = 1, + GIT_FETCH_NO_PRUNE = 2 + } +} + +export class Fetch { + static initOptions(opts: FetchOptions, version: number): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index df1b2c1f20..ab802f0246 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -17,6 +17,7 @@ export { Diff } from './diff'; export { Enums } from './enums'; export { Error } from './error'; export { FetchOptions } from './fetch-options'; +export { Fetch } from './fetch'; export { Filter } from './filter'; export { Giterr } from './git-err'; export { Hashsig } from './hash-sig'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 21d56ac954..e97659918d 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -30,6 +30,7 @@ "enums.d.ts", "error.d.ts", "fetch-options.d.ts", + "fetch.d.ts", "filter.d.ts", "git-err.d.ts", "hash-sig.d.ts", From a4d567c6bc4611f5aef76b5b7b9da3d7a75a0439 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:31:43 +0100 Subject: [PATCH 37/91] Added Graph --- types/nodegit/graph.d.ts | 7 +++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 9 insertions(+) create mode 100644 types/nodegit/graph.d.ts diff --git a/types/nodegit/graph.d.ts b/types/nodegit/graph.d.ts new file mode 100644 index 0000000000..d16d7b5dee --- /dev/null +++ b/types/nodegit/graph.d.ts @@ -0,0 +1,7 @@ +import { Repository } from './repository'; +import { Oid } from './oid'; + +export class Graph { + static aheadBehind(repo: Repository, local: Oid, upstream: Oid): Promise; + static descendantOf(repo: Repository, commit: Oid, ancestor: Oid): Promise; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index ab802f0246..bce68c89da 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -20,6 +20,7 @@ export { FetchOptions } from './fetch-options'; export { Fetch } from './fetch'; export { Filter } from './filter'; export { Giterr } from './git-err'; +export { Graph } from './graph'; export { Hashsig } from './hash-sig'; export { Index } from './index_'; export { IndexEntry } from './index-entry'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e97659918d..6ae8a96742 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -33,6 +33,7 @@ "fetch.d.ts", "filter.d.ts", "git-err.d.ts", + "graph.d.ts", "hash-sig.d.ts", "ignore.d.ts", "index-entry.d.ts", From dbc4d532424fa5728793fee6022638b2e10ddd74 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:33:31 +0100 Subject: [PATCH 38/91] Added DiffOptions --- types/nodegit/diff-options.d.ts | 16 ++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 18 insertions(+) create mode 100644 types/nodegit/diff-options.d.ts diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts new file mode 100644 index 0000000000..e78de28aac --- /dev/null +++ b/types/nodegit/diff-options.d.ts @@ -0,0 +1,16 @@ +import { Strarray } from './str-array'; + +export interface DiffOptions { + version: number; + flags: number; + ignoreSubmodules: number; + pathspec: Strarray; + notifyCb: Function; + notifyPayload: void; + contextLines: number; + interhunkLines: number; + idAbbrev: number; + maxSize: number; + oldPrefix: string; + newPrefix: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index bce68c89da..bcafde5c65 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -12,6 +12,7 @@ export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; +export { DiffOptions } from './diff-options'; export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; export { Enums } from './enums'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 6ae8a96742..65a9de572d 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -25,6 +25,7 @@ "convenient-patch.d.ts", "diff-delta.d.ts", "diff-file.d.ts", + "diff-options.d.ts", "diff-perf-data.d.ts", "diff.d.ts", "enums.d.ts", From de7e279831066413ec9401911f0afd5f5dbc9305 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:34:30 +0100 Subject: [PATCH 39/91] Added DiffLine --- types/nodegit/diff-line.d.ts | 9 +++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 11 insertions(+) create mode 100644 types/nodegit/diff-line.d.ts diff --git a/types/nodegit/diff-line.d.ts b/types/nodegit/diff-line.d.ts new file mode 100644 index 0000000000..587653b09f --- /dev/null +++ b/types/nodegit/diff-line.d.ts @@ -0,0 +1,9 @@ +export class DiffLine { + content(): string; + origin: number; + oldLineno: number; + newLineno: number; + numLines: number; + contentLen: number; + contentOffset: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index bcafde5c65..3001fef55c 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -12,6 +12,7 @@ export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; +export { DiffLine } from './diff-line'; export { DiffOptions } from './diff-options'; export { DiffPerfdata } from './diff-perf-data'; export { Diff } from './diff'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 65a9de572d..82a4c1c2f2 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -25,6 +25,7 @@ "convenient-patch.d.ts", "diff-delta.d.ts", "diff-file.d.ts", + "diff-line.d.ts", "diff-options.d.ts", "diff-perf-data.d.ts", "diff.d.ts", From ad664c4773657633a70422ae27d36565c2c7d438 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:37:26 +0100 Subject: [PATCH 40/91] Exported DiffFindOptions --- types/nodegit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 3001fef55c..f1997a1ecd 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -15,7 +15,7 @@ export { DiffFile } from './diff-file'; export { DiffLine } from './diff-line'; export { DiffOptions } from './diff-options'; export { DiffPerfdata } from './diff-perf-data'; -export { Diff } from './diff'; +export { Diff, DiffFindOptions } from './diff'; export { Enums } from './enums'; export { Error } from './error'; export { FetchOptions } from './fetch-options'; From 037f9f982c00383374233fe4e35a3cc0f05edfbf Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:39:04 +0100 Subject: [PATCH 41/91] Moved out DiffOptions --- types/nodegit/diff.d.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index d8b60e1c6a..3612e402a4 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -5,6 +5,7 @@ import { Strarray } from './str-array'; import { Index } from './index_'; import { DiffDelta } from './diff-delta'; import { DiffPerfdata } from './diff-perf-data'; +import { DiffOptions } from './diff-options'; export interface DiffFindOptions { version: number; @@ -16,21 +17,6 @@ export interface DiffFindOptions { renameLimit: number; } -export interface DiffOptions { - version: number; - flags: number; - ignoreSubmodules: number; - pathspec: Strarray; - notifyCb: Function; - notifyPayload: undefined; - contextLines: number; - interhunkLines: number; - idAbbrev: number; - maxSize: number; - oldPrefix: string; - newPrefix: string; -} - export namespace Diff { enum DELTA { UNMODIFIED = 0, @@ -140,7 +126,7 @@ export namespace Diff { export class 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 indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; From b93979373bfce7a7b3daf9638871f9a5124c419a Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:39:37 +0100 Subject: [PATCH 42/91] Added DiffHunk --- types/nodegit/diff-hunk.d.ts | 8 ++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/diff-hunk.d.ts diff --git a/types/nodegit/diff-hunk.d.ts b/types/nodegit/diff-hunk.d.ts new file mode 100644 index 0000000000..14a1a9a304 --- /dev/null +++ b/types/nodegit/diff-hunk.d.ts @@ -0,0 +1,8 @@ +export class DiffHunk { + oldStart: number; + oldLines: number; + newStart: number; + newLines: number; + headerLen: number; + header: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index f1997a1ecd..2ae963d13e 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -12,6 +12,7 @@ export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; 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'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 82a4c1c2f2..645c75ffea 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -25,6 +25,7 @@ "convenient-patch.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", From 41cdc45056d0a4dd9c2f20bb9bcd13780adbb406 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:41:07 +0100 Subject: [PATCH 43/91] Added DiffBinaryFile --- types/nodegit/diff-binary-file.d.ts | 6 ++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+) create mode 100644 types/nodegit/diff-binary-file.d.ts diff --git a/types/nodegit/diff-binary-file.d.ts b/types/nodegit/diff-binary-file.d.ts new file mode 100644 index 0000000000..46b67f406e --- /dev/null +++ b/types/nodegit/diff-binary-file.d.ts @@ -0,0 +1,6 @@ +export class DiffBinaryFile { + type: number; + data: string; + datalen: number; + inflatedlen: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 2ae963d13e..b30891f96f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -10,6 +10,7 @@ export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { DiffBinaryFile } from './diff-binary-file'; export { DiffDelta } from './diff-delta'; export { DiffFile } from './diff-file'; export { DiffHunk } from './diff-hunk'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 645c75ffea..c9a324a8dc 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -23,6 +23,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "diff-binary-file.d.ts", "diff-delta.d.ts", "diff-file.d.ts", "diff-hunk.d.ts", From 9004069b4ea6b7b08808ac2f794b293c95b7805e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:42:24 +0100 Subject: [PATCH 44/91] Added DiffBinary --- types/nodegit/diff-binary.d.ts | 14 ++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 16 insertions(+) create mode 100644 types/nodegit/diff-binary.d.ts diff --git a/types/nodegit/diff-binary.d.ts b/types/nodegit/diff-binary.d.ts new file mode 100644 index 0000000000..fa6643038d --- /dev/null +++ b/types/nodegit/diff-binary.d.ts @@ -0,0 +1,14 @@ +import { DiffBinaryFile } from './diff-binary-file'; + +export namespace DiffBinary { + enum DIFF_BINARY { + NONE = 0, + LITERAL = 1, + DELTA = 2 + } +} + +export class DiffBinary { + oldFile: DiffBinaryFile; + newFile: DiffBinaryFile; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index b30891f96f..aaf1aa1d3c 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -11,6 +11,7 @@ export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; 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'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index c9a324a8dc..4f42f3bdd5 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -24,6 +24,7 @@ "config.d.ts", "convenient-patch.d.ts", "diff-binary-file.d.ts", + "diff-binary.d.ts", "diff-delta.d.ts", "diff-file.d.ts", "diff-hunk.d.ts", From 76aad31da39117bcd737bd2235cc504a3fa255af Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:43:48 +0100 Subject: [PATCH 45/91] Added DescribeOptions --- types/nodegit/describe-options.d.ts | 8 ++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/describe-options.d.ts diff --git a/types/nodegit/describe-options.d.ts b/types/nodegit/describe-options.d.ts new file mode 100644 index 0000000000..939750eb11 --- /dev/null +++ b/types/nodegit/describe-options.d.ts @@ -0,0 +1,8 @@ +export class DescribeOptions { + version: number; + maxCandidatesTags: number; + describeStrategy: number; + pattern: string; + onlyFollowFirstParent: number; + showCommitOidAsFallback: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index aaf1aa1d3c..05c4c74a18 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -10,6 +10,7 @@ export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { DescribeOptions } from './describe-options'; export { DiffBinaryFile } from './diff-binary-file'; export { DiffBinary } from './diff-binary'; export { DiffDelta } from './diff-delta'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 4f42f3bdd5..94f92b7fad 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -23,6 +23,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "describe-options.d.ts", "diff-binary-file.d.ts", "diff-binary.d.ts", "diff-delta.d.ts", From 30efc5e44ba9690f595b2c359f942178271684b7 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:44:46 +0100 Subject: [PATCH 46/91] Added DescribeFormatOptions --- types/nodegit/describe-format-options.d.ts | 6 ++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+) create mode 100644 types/nodegit/describe-format-options.d.ts diff --git a/types/nodegit/describe-format-options.d.ts b/types/nodegit/describe-format-options.d.ts new file mode 100644 index 0000000000..ecb7f4d762 --- /dev/null +++ b/types/nodegit/describe-format-options.d.ts @@ -0,0 +1,6 @@ +export class DescribeFormatOptions { + version: number; + abbreviatedSize: number; + alwaysUseLongFormat: number; + dirtySuffix: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 05c4c74a18..5813129fd5 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -10,6 +10,7 @@ export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { DescribeFormatOptions } from './describe-format-options'; export { DescribeOptions } from './describe-options'; export { DiffBinaryFile } from './diff-binary-file'; export { DiffBinary } from './diff-binary'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 94f92b7fad..5d114d2534 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -23,6 +23,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "describe-format-options.d.ts", "describe-options.d.ts", "diff-binary-file.d.ts", "diff-binary.d.ts", From e7dc8f352e8301cff84a0527c66867a9821c8915 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:47:37 +0100 Subject: [PATCH 47/91] Added CvarMap --- types/nodegit/cvar-map.d.ts | 5 +++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 7 insertions(+) create mode 100644 types/nodegit/cvar-map.d.ts diff --git a/types/nodegit/cvar-map.d.ts b/types/nodegit/cvar-map.d.ts new file mode 100644 index 0000000000..f7c4b227d0 --- /dev/null +++ b/types/nodegit/cvar-map.d.ts @@ -0,0 +1,5 @@ +export class CvarMap { + cvarType: number; + strMatch: string; + mapValue: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 5813129fd5..d69425fc75 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -10,6 +10,7 @@ export { CheckoutOptions } from './checkout-options'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { CvarMap } from './cvar-map'; export { DescribeFormatOptions } from './describe-format-options'; export { DescribeOptions } from './describe-options'; export { DiffBinaryFile } from './diff-binary-file'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 5d114d2534..b35a0c0e7a 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -23,6 +23,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "cvar-map.d.ts", "describe-format-options.d.ts", "describe-options.d.ts", "diff-binary-file.d.ts", From 32581a7937486685fb2fbe30650168db8fd17576 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 02:53:17 +0100 Subject: [PATCH 48/91] Added Checkout --- types/nodegit/checkout.d.ts | 51 +++++++++++++++++++++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 53 insertions(+) create mode 100644 types/nodegit/checkout.d.ts diff --git a/types/nodegit/checkout.d.ts b/types/nodegit/checkout.d.ts new file mode 100644 index 0000000000..a7bc6d63fc --- /dev/null +++ b/types/nodegit/checkout.d.ts @@ -0,0 +1,51 @@ +import { Repository } from './repository'; +import { CheckoutOptions } from './checkout-options'; +import { Reference } from './reference'; +import { Oid } from './oid'; +import { Tree } from './tree'; +import { Commit } from './commit'; +import { Index } from './index'; + +export namespace Checkout { + enum NOTIFY { + NONE = 0, + CONFLICT = 1, + DIRTY = 2, + UPDATED = 4, + UNTRACKED = 8, + IGNORED = 16, + ALL = 65535 + } + + enum STRATEGY { + NONE = 0, + SAFE = 1, + FORCE = 2, + RECREATE_MISSING = 4, + ALLOW_CONFLICTS = 16, + REMOVE_UNTRACKED = 32, + REMOVE_IGNORED = 64, + UPDATE_ONLY = 128, + DONT_UPDATE_INDEX = 256, + NO_REFRESH = 512, + SKIP_UNMERGED = 1024, + USE_OURS = 2048, + USE_THEIRS = 4096, + DISABLE_PATHSPEC_MATCH = 8192, + SKIP_LOCKED_DIRECTORIES = 262144, + DONT_OVERWRITE_IGNORED = 524288, + CONFLICT_STYLE_MERGE = 1048576, + CONFLICT_STYLE_DIFF3 = 2097152, + DONT_REMOVE_EXISTING = 4194304, + DONT_WRITE_INDEX = 8388608, + UPDATE_SUBMODULES = 65536, + UPDATE_SUBMODULES_IF_CHANGED = 131072 + } +} + +export class Checkout { + static head(repo: Repository, options?: CheckoutOptions): Promise; + static index(repo: Repository, The: Index, options?: CheckoutOptions): Promise; + static initOptions(opts: CheckoutOptions, version: number): number; + static tree(repo: Repository, treeish: Oid | Tree | Commit | Reference, options?: CheckoutOptions): Promise; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index d69425fc75..36e823ec19 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -7,6 +7,7 @@ export { AnnotatedCommit } from './annotated-commit'; export { Blob } from './blob'; export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; +export { Checkout } from './checkout'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index b35a0c0e7a..607f154837 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -20,6 +20,7 @@ "blob.d.ts", "buf.d.ts", "checkout-options.d.ts", + "checkout.d.ts", "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", From 36faaf10771183c4aeec6c6faa4de5fe5d96c5e6 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:00:04 +0100 Subject: [PATCH 49/91] Added Branch --- types/nodegit/branch.d.ts | 25 +++++++++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 27 insertions(+) create mode 100644 types/nodegit/branch.d.ts diff --git a/types/nodegit/branch.d.ts b/types/nodegit/branch.d.ts new file mode 100644 index 0000000000..d121650864 --- /dev/null +++ b/types/nodegit/branch.d.ts @@ -0,0 +1,25 @@ +import { Repository } from './repository'; +import { Reference } from './reference'; +import { Commit } from './commit'; +import { AnnotatedCommit } from './annotated-commit'; + +export namespace Branch { + enum BRANCH { + LOCAL = 1, + REMOTE = 2, + ALL = 3 + } +} + +export class Branch { + static create(repo: Repository, branch_name: string, target: Commit, force: number): Promise; + static createFromAnnotated(repository: Repository, branch_name: string, commit: AnnotatedCommit, force: number): Reference; + static delete(branch: Reference): number; + static isHead(branch: Reference): number; + static iteratorNew(repo: Repository, list_flags: number): Promise; + static lookup(repo: Repository, branch_name: string, branch_type: number): Promise; + static move(branch: Reference, new_branch_name: string, force: number): Promise; + static name(ref: Reference): Promise; + static setUpstream(branch: Reference, upstream_name: string): Promise; + static upstream(branch: Reference): Promise; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 36e823ec19..feeec58469 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -5,6 +5,7 @@ export { AnnotatedCommit } from './annotated-commit'; export { Blob } from './blob'; +export { Branch } from './branch'; export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 607f154837..e57dc2776b 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -18,6 +18,7 @@ "files": [ "annotated-commit.d.ts", "blob.d.ts", + "branch.d.ts", "buf.d.ts", "checkout-options.d.ts", "checkout.d.ts", From 48c8fa3df5a209ad9e78a7967abe9b6a9d0f582e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:00:12 +0100 Subject: [PATCH 50/91] Added Attr --- types/nodegit/attr.d.ts | 18 ++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 20 insertions(+) create mode 100644 types/nodegit/attr.d.ts diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts new file mode 100644 index 0000000000..84a701f2b1 --- /dev/null +++ b/types/nodegit/attr.d.ts @@ -0,0 +1,18 @@ +import { Repository } from './repository'; + +export namespace Attr { + enum STATES { + UNSPECIFIED_T = 0, + TRUE_T = 1, + FALSE_T = 2, + VALUE_T = 3 + } +} + +export class Attr { + static addMacro(repo: Repository, name: string, values: string): number; + static cacheFlush(repo: Repository): void; + static get(repo: Repository, flags: number, path: string, name: string): Promise; + static getMany(repo: Repository, flags: number, path: string, num_attr: number, names: string): any[]; + static value(attr: string): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index feeec58469..1f672ba3b4 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export { AnnotatedCommit } from './annotated-commit'; +export { Attr } from './attr'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e57dc2776b..4192e1fc08 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -17,6 +17,7 @@ }, "files": [ "annotated-commit.d.ts", + "attr.d.ts", "blob.d.ts", "branch.d.ts", "buf.d.ts", From 7e79f7358a27bd27e42a6e88d6d6e9255c6c2a30 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:03:47 +0100 Subject: [PATCH 51/91] Added Blame and co --- types/nodegit/blame-hunk.d.ts | 13 +++++++++++++ types/nodegit/blame-options.d.ts | 11 +++++++++++ types/nodegit/blame.d.ts | 0 types/nodegit/index.d.ts | 3 +++ types/nodegit/tsconfig.json | 3 +++ 5 files changed, 30 insertions(+) create mode 100644 types/nodegit/blame-hunk.d.ts create mode 100644 types/nodegit/blame-options.d.ts create mode 100644 types/nodegit/blame.d.ts diff --git a/types/nodegit/blame-hunk.d.ts b/types/nodegit/blame-hunk.d.ts new file mode 100644 index 0000000000..601a7dbdfd --- /dev/null +++ b/types/nodegit/blame-hunk.d.ts @@ -0,0 +1,13 @@ +import { Oid } from './oid'; +import { Signature } from './Signature'; + +export class BlameHunk { + linesInHunk: number; + finalCommitId: Oid; + finalStartLineNumber: number; + finalSignature: Signature; + origCommitId: Oid; + origPath: string; + origStartLineNumber: number; + origSignature: Signature; +} diff --git a/types/nodegit/blame-options.d.ts b/types/nodegit/blame-options.d.ts new file mode 100644 index 0000000000..ca5f1f50df --- /dev/null +++ b/types/nodegit/blame-options.d.ts @@ -0,0 +1,11 @@ +import {Oid} from './oid'; + +export interface BlameOptions { + version: number; + flags: number; + minMatchCharacters: number; + newestCommit: Oid; + oldestCommit: Oid; + minLine: number; + maxLine: number; +} diff --git a/types/nodegit/blame.d.ts b/types/nodegit/blame.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 1f672ba3b4..e086fe5d4c 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -5,6 +5,9 @@ export { AnnotatedCommit } from './annotated-commit'; export { Attr } from './attr'; +export { BlameHunk } from './blame-hunk'; +export { BlameOptions } from './blame-options'; +export { Blame } from './blame'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 4192e1fc08..c8d5c68fc2 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -18,6 +18,9 @@ "files": [ "annotated-commit.d.ts", "attr.d.ts", + "blame-hunk.d.ts", + "blame-options.d.ts", + "blame.d.ts", "blob.d.ts", "branch.d.ts", "buf.d.ts", From f7b5a33770a261812bae8a442830daed4cd3cf09 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:06:21 +0100 Subject: [PATCH 52/91] Changed interface to class --- types/nodegit/checkout-options.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index c799ce2047..4122dfbe28 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -2,7 +2,7 @@ import { Strarray } from './str-array'; import { Tree } from './tree'; import { Index } from './index'; -export interface CheckoutOptions { +export class CheckoutOptions { version?: number; checkoutStrategy?: number; disableFilters?: number; From 0c0761a2f4b457788e74260f6a730de4ed785f8e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:09:58 +0100 Subject: [PATCH 53/91] Added Clone and co --- types/nodegit/clone-options.d.ts | 13 +++++++++++++ types/nodegit/clone.d.ts | 16 ++++++++++++++++ types/nodegit/index.d.ts | 2 ++ types/nodegit/tsconfig.json | 2 ++ 4 files changed, 33 insertions(+) create mode 100644 types/nodegit/clone-options.d.ts create mode 100644 types/nodegit/clone.d.ts diff --git a/types/nodegit/clone-options.d.ts b/types/nodegit/clone-options.d.ts new file mode 100644 index 0000000000..b8acc9aad0 --- /dev/null +++ b/types/nodegit/clone-options.d.ts @@ -0,0 +1,13 @@ +import { CheckoutOptions } from './checkout-options'; +import { FetchOptions } from './fetch-options'; + +export class CloneOptions { + version?: number; + checkoutOpts?: CheckoutOptions; + fetchOpts?: FetchOptions; + bare?: number; + local?: number; + checkoutBranch?: string; + repositoryCbPayload?: void; + remoteCbPayload?: void; +} diff --git a/types/nodegit/clone.d.ts b/types/nodegit/clone.d.ts new file mode 100644 index 0000000000..e0b92bb9ea --- /dev/null +++ b/types/nodegit/clone.d.ts @@ -0,0 +1,16 @@ +import { Repository } from './repository'; +import { CloneOptions } from './clone-options'; + +export namespace Clone { + enum LOCAL { + AUTO = 0, + LOCAL = 1, + NO_LOCAL = 2, + NO_LINKS = 3 + } +} + +export class Clone { + static clone(url: string, local_path: string, options?: CloneOptions): Promise; + static initOptions(opts: CloneOptions, version: number): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index e086fe5d4c..860d1e9c2f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -13,6 +13,8 @@ export { Branch } from './branch'; export { Buf } from './buf'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; +export { CloneOptions } from './clone-options'; +export { Clone } from './clone'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index c8d5c68fc2..39bb95c2fc 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -26,6 +26,8 @@ "buf.d.ts", "checkout-options.d.ts", "checkout.d.ts", + "clone-options.d.ts", + "clone.d.ts", "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", From 74e32b9a5c1c04d086c7547d48ea77ce65a5f33b Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:11:15 +0100 Subject: [PATCH 54/91] Added Cert --- types/nodegit/cert.d.ts | 17 +++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 19 insertions(+) create mode 100644 types/nodegit/cert.d.ts diff --git a/types/nodegit/cert.d.ts b/types/nodegit/cert.d.ts new file mode 100644 index 0000000000..f910453700 --- /dev/null +++ b/types/nodegit/cert.d.ts @@ -0,0 +1,17 @@ +export namespace Cert { + enum TYPE { + NONE = 0, + X509 = 1, + HOSTKEY_LIBSSH2 = 2, + STRARRAY = 3 + } + + enum SSH { + MD5 = 1, + SHA1 = 2 + } +} + +export class Cert { + certType: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 860d1e9c2f..7b485e2980 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -11,6 +11,7 @@ export { Blame } from './blame'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; +export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; export { CloneOptions } from './clone-options'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 39bb95c2fc..366b54206a 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -24,6 +24,7 @@ "blob.d.ts", "branch.d.ts", "buf.d.ts", + "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", "clone-options.d.ts", From 3063a2730a089acb520893b258821186fa2c6e60 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 03:11:44 +0100 Subject: [PATCH 55/91] Added body of Blame --- types/nodegit/blame.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/types/nodegit/blame.d.ts b/types/nodegit/blame.d.ts index e69de29bb2..e5b5d90ec8 100644 --- a/types/nodegit/blame.d.ts +++ b/types/nodegit/blame.d.ts @@ -0,0 +1,25 @@ +import { Repository } from './repository'; +import { BlameOptions } from './blame-options'; +import {BlameHunk} from './blame-hunk'; + +export namespace Blame { + enum FLAG { + NORMAL = 0, + TRACK_COPIES_SAME_FILE = 1, + TRACK_COPIES_SAME_COMMIT_MOVES = 2, + TRACK_COPIES_SAME_COMMIT_COPIES = 4, + TRACK_COPIES_ANY_COMMIT_COPIES = 8, + FIRST_PARENT = 16 + } +} + +export class Blame { + static file(repo: Repository, path: string, options?: BlameOptions): Blame; + static initOptions(opts: BlameOptions, version: number): number; + + buffer(buffer: string, buffer_len: number): Promise; + free(): void; + getHunkByIndex(index: number): BlameHunk; + getHunkByLine(lineno: number): BlameHunk; + getHunkCount(): number; +} From a586ed6d0c5b431a0d81ad93b770b07af8a81e0e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 23:43:14 +0100 Subject: [PATCH 56/91] Added CertHostKey --- types/nodegit/cert-host-key.d.ts | 6 ++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+) create mode 100644 types/nodegit/cert-host-key.d.ts diff --git a/types/nodegit/cert-host-key.d.ts b/types/nodegit/cert-host-key.d.ts new file mode 100644 index 0000000000..428d04b727 --- /dev/null +++ b/types/nodegit/cert-host-key.d.ts @@ -0,0 +1,6 @@ +export class CertHostkey { + certType: number; + type: number; + hashMd5: string; + hashSha1: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 7b485e2980..bd7f7791c6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -11,6 +11,7 @@ export { Blame } from './blame'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; +export { CertHostKey } from './cert-host-key'; export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 366b54206a..15398d46c4 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -24,6 +24,7 @@ "blob.d.ts", "branch.d.ts", "buf.d.ts", + "cert-host-key.d.ts", "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", From 7fb59e070da6791587be6733aed6399ac4f81530 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 23:48:32 +0100 Subject: [PATCH 57/91] Added Cert X509 --- types/nodegit/cert-x509.d.ts | 5 +++++ types/nodegit/index.d.ts | 3 ++- types/nodegit/tsconfig.json | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/cert-x509.d.ts diff --git a/types/nodegit/cert-x509.d.ts b/types/nodegit/cert-x509.d.ts new file mode 100644 index 0000000000..14f38ac5fc --- /dev/null +++ b/types/nodegit/cert-x509.d.ts @@ -0,0 +1,5 @@ +export class CertX509 { + certType: number; + data: Buffer; + len: number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index bd7f7791c6..9b446aa056 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -11,7 +11,8 @@ export { Blame } from './blame'; export { Blob } from './blob'; export { Branch } from './branch'; export { Buf } from './buf'; -export { CertHostKey } from './cert-host-key'; +export { CertHostkey } from './cert-host-key'; +export { CertX509 } from './cert-x509'; export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 15398d46c4..02fa864776 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -25,6 +25,7 @@ "branch.d.ts", "buf.d.ts", "cert-host-key.d.ts", + "cert-x509.d.ts", "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", From 959bd0bf845e080e2fda767e9edad8dacd35e6a3 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 7 Jun 2017 23:51:00 +0100 Subject: [PATCH 58/91] Added Cherrypick --- types/nodegit/cherry-pick.d.ts | 9 +++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 11 insertions(+) create mode 100644 types/nodegit/cherry-pick.d.ts diff --git a/types/nodegit/cherry-pick.d.ts b/types/nodegit/cherry-pick.d.ts new file mode 100644 index 0000000000..333831a29b --- /dev/null +++ b/types/nodegit/cherry-pick.d.ts @@ -0,0 +1,9 @@ +import { Repository } from './repository'; +import { Commit } from './commit'; +import { MergeOptions } from './merge-options'; + +export class Cherrypick { + static cherrypick(repo: Repository, commit: Commit, options?: CherrypickOptions): Promise; + static commit(repo: Repository, cherrypickCommit: Commit, ourCommit: Commit, mainline: number, mergeOptions?: MergeOptions): Promise; + static initOptions(opts: CherrypickOptions, version: number): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 9b446aa056..30e306c5a9 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { CertX509 } from './cert-x509'; export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; +export { Cherrypick } from './cherry-pick'; export { CloneOptions } from './clone-options'; export { Clone } from './clone'; export { Commit } from './commit'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 02fa864776..5fd6456c5e 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", + "cherry-pick.d.ts", "clone-options.d.ts", "clone.d.ts", "commit.d.ts", From 45e2febe28d41e587bbde6aaf9a21f85ca8981d9 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 00:39:50 +0100 Subject: [PATCH 59/91] Added CherrypickOptions --- types/nodegit/cherry-pick-options.d.ts | 9 +++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 11 insertions(+) create mode 100644 types/nodegit/cherry-pick-options.d.ts diff --git a/types/nodegit/cherry-pick-options.d.ts b/types/nodegit/cherry-pick-options.d.ts new file mode 100644 index 0000000000..7c6ec6976c --- /dev/null +++ b/types/nodegit/cherry-pick-options.d.ts @@ -0,0 +1,9 @@ +import { MergeOptions } from './merge-options'; +import { CheckoutOptions } from './checkout-options'; + +export interface CherrypickOptions { + version: number; + mainline: number; + mergeOpts: MergeOptions; + checkoutOpts: CheckoutOptions; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 30e306c5a9..6fea8d24f3 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -16,6 +16,7 @@ export { CertX509 } from './cert-x509'; export { Cert } from './cert'; export { CheckoutOptions } from './checkout-options'; export { Checkout } from './checkout'; +export { CherrypickOptions } from './cherry-pick-options'; export { Cherrypick } from './cherry-pick'; export { CloneOptions } from './clone-options'; export { Clone } from './clone'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 5fd6456c5e..e1239f9251 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -29,6 +29,7 @@ "cert.d.ts", "checkout-options.d.ts", "checkout.d.ts", + "cherry-pick-options.d.ts", "cherry-pick.d.ts", "clone-options.d.ts", "clone.d.ts", From 41aff746508bce9b830df40fc848cd1619ced261 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 00:43:36 +0100 Subject: [PATCH 60/91] Added Cred --- types/nodegit/cred.d.ts | 22 ++++++++++++++++++++++ types/nodegit/index.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 3 files changed, 24 insertions(+) create mode 100644 types/nodegit/cred.d.ts diff --git a/types/nodegit/cred.d.ts b/types/nodegit/cred.d.ts new file mode 100644 index 0000000000..759e43d814 --- /dev/null +++ b/types/nodegit/cred.d.ts @@ -0,0 +1,22 @@ +export namespace Cred { + enum TYPE { + USERPASS_PLAINTEXT = 1, + SSH_KEY = 2, + SSH_CUSTOM = 4, + DEFAULT = 8, + SSH_INTERACTIVE = 16, + USERNAME = 32, + SSH_MEMORY = 64 + } +} + +export class Cred { + static defaultNew(): 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 usernameNew(username: string): Promise; + static userpassPlaintextNew(username: string, password: string): Cred; + + hasUsername(): number; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 6fea8d24f3..79276255c6 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -23,6 +23,7 @@ export { Clone } from './clone'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { Cred } from './cred'; export { CvarMap } from './cvar-map'; export { DescribeFormatOptions } from './describe-format-options'; export { DescribeOptions } from './describe-options'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e1239f9251..74e9c7ad1c 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -36,6 +36,7 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "cred.d.ts", "cvar-map.d.ts", "describe-format-options.d.ts", "describe-options.d.ts", From 0233c0dd42af75fddf98b65d002f5aa64f726d11 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 01:43:53 +0100 Subject: [PATCH 61/91] Added CredUsername and CredUserpassPayload --- types/nodegit/cred-user-pass-payload.d.ts | 4 ++++ types/nodegit/cred-username.d.ts | 6 ++++++ types/nodegit/index.d.ts | 2 ++ types/nodegit/tsconfig.json | 2 ++ 4 files changed, 14 insertions(+) create mode 100644 types/nodegit/cred-user-pass-payload.d.ts create mode 100644 types/nodegit/cred-username.d.ts diff --git a/types/nodegit/cred-user-pass-payload.d.ts b/types/nodegit/cred-user-pass-payload.d.ts new file mode 100644 index 0000000000..95beeb9f3a --- /dev/null +++ b/types/nodegit/cred-user-pass-payload.d.ts @@ -0,0 +1,4 @@ +export class CredUserpassPayload { + username: string; + password: string; +} diff --git a/types/nodegit/cred-username.d.ts b/types/nodegit/cred-username.d.ts new file mode 100644 index 0000000000..d7b619eb5d --- /dev/null +++ b/types/nodegit/cred-username.d.ts @@ -0,0 +1,6 @@ +import { Cred } from './cred'; + +export class CredUsername { + parent: Cred; + username: string; +} diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 79276255c6..32b86ba19f 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -23,6 +23,8 @@ export { Clone } from './clone'; export { Commit } from './commit'; export { Config } from './config'; export { ConvenientPatch } from './convenient-patch'; +export { CredUserpassPayload } from './cred-user-pass-payload'; +export { CredUsername } from './cred-username'; export { Cred } from './cred'; export { CvarMap } from './cvar-map'; export { DescribeFormatOptions } from './describe-format-options'; diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 74e9c7ad1c..31f9ee0497 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -36,6 +36,8 @@ "commit.d.ts", "config.d.ts", "convenient-patch.d.ts", + "cred-user-pass-payload.d.ts", + "cred-username.d.ts", "cred.d.ts", "cvar-map.d.ts", "describe-format-options.d.ts", From 66a6426d595f70fbf2d00386cb76cea2b93e565d Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 01:44:11 +0100 Subject: [PATCH 62/91] Fixed some errors --- types/nodegit/blame-hunk.d.ts | 2 +- types/nodegit/cherry-pick.d.ts | 1 + types/nodegit/diff.d.ts | 2 +- types/nodegit/filter.d.ts | 8 +++++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/types/nodegit/blame-hunk.d.ts b/types/nodegit/blame-hunk.d.ts index 601a7dbdfd..58ab8e7191 100644 --- a/types/nodegit/blame-hunk.d.ts +++ b/types/nodegit/blame-hunk.d.ts @@ -1,5 +1,5 @@ import { Oid } from './oid'; -import { Signature } from './Signature'; +import { Signature } from './signature'; export class BlameHunk { linesInHunk: number; diff --git a/types/nodegit/cherry-pick.d.ts b/types/nodegit/cherry-pick.d.ts index 333831a29b..291c5e0223 100644 --- a/types/nodegit/cherry-pick.d.ts +++ b/types/nodegit/cherry-pick.d.ts @@ -1,6 +1,7 @@ import { Repository } from './repository'; import { Commit } from './commit'; import { MergeOptions } from './merge-options'; +import { CherrypickOptions } from './cherry-pick-options'; export class Cherrypick { static cherrypick(repo: Repository, commit: Commit, options?: CherrypickOptions): Promise; diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 3612e402a4..d675b36acf 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -126,7 +126,7 @@ export namespace Diff { export class 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 indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise; static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise; diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts index aedc0dbd6f..da1f71c2b9 100644 --- a/types/nodegit/filter.d.ts +++ b/types/nodegit/filter.d.ts @@ -1,3 +1,5 @@ +import { WriteStream } from 'fs'; + import { Repository } from './repository'; import { Blob } from './blob'; import { Buf } from './buf'; @@ -20,9 +22,9 @@ export class Filter { static listContains(filters: any, name: string): number; static listLength(fl: any): number; static listNew(repo: Repository, mode: number, options: number): Promise; - static listStreamBlob(filters: any, blob: Blob, target: Writestream): number; - static listStreamData(filters: any, data: Buf, target: Writestream): number; - static listStreamFile(filters: any, repo: Repository, path: string, target: Writestream): number; + static listStreamBlob(filters: any, blob: Blob, target: WriteStream): number; + static listStreamData(filters: any, data: Buf, target: WriteStream): number; + static listStreamFile(filters: any, repo: Repository, path: string, target: WriteStream): number; static unregister(name: string): number; lookup(name: string): Filter; From 98e2a4a83f2f327d121369248f22aeb51e64ae9d Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 01:57:03 +0100 Subject: [PATCH 63/91] Added some tests --- types/nodegit/annotated-commit.d.ts | 27 ++++++++++++++++++- types/nodegit/attr.d.ts | 2 +- types/nodegit/nodegit-tests.ts | 42 +++++++++++++++++++++++++++-- 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/types/nodegit/annotated-commit.d.ts b/types/nodegit/annotated-commit.d.ts index f0f9d4d925..0fb5465647 100644 --- a/types/nodegit/annotated-commit.d.ts +++ b/types/nodegit/annotated-commit.d.ts @@ -3,11 +3,36 @@ import { Oid } from './oid'; import { Reference } from './reference'; export class AnnotatedCommit { - static fromFetchhead(repo: Repository, branch_name: string, remote_url: string, id: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo - repository that contains the given commit + * @param {string} branchName - name of the (remote) branch + * @param {string} remoteUrl - url of the remote + * @param {Oid} id - the commit object id of the remote branch + * @returns {Promise} + * + * @memberof AnnotatedCommit + */ + static fromFetchhead(repo: Repository, branchName: string, remoteUrl: string, id: Oid): Promise; static fromRef(repo: Repository, ref: Reference): Promise; static fromRevspec(repo: Repository, revspec: string): Promise; static lookup(repo: Repository, id: Oid): Promise; + /** + * + * + * + * @memberof AnnotatedCommit + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof AnnotatedCommit + */ id(): Oid; } diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts index 84a701f2b1..4966c407e0 100644 --- a/types/nodegit/attr.d.ts +++ b/types/nodegit/attr.d.ts @@ -13,6 +13,6 @@ export class Attr { static addMacro(repo: Repository, name: string, values: string): number; static cacheFlush(repo: Repository): void; static get(repo: Repository, flags: number, path: string, name: string): Promise; - static getMany(repo: Repository, flags: number, path: string, num_attr: number, names: string): any[]; + static getMany(repo: Repository, flags: number, path: string, numAttr: number, names: string): any[]; static value(attr: string): number; } diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index c4c57854b7..370369eed4 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -1,9 +1,47 @@ import * as Git from 'nodegit'; Git.Repository.discover("startPath", 1, "ceilingDirs").then((string) => { - // Use string + // Use string }); Git.Repository.init("path", true).then((repository) => { - // Use repository + // Use repository }); + +const repo = new Git.Repository(); +const id = new Git.Oid(); +const ref = new Git.Reference(); + +// AnnotatedCommit Tests + +Git.AnnotatedCommit.fromFetchhead(repo, "branch_name", "remote_url", id).then((annotatedCommit) => { + // Use annotatedCommit +}); + +Git.AnnotatedCommit.fromRef(repo, ref).then((annotatedCommit) => { + // Use annotatedCommit +}); + +Git.AnnotatedCommit.fromRevspec(repo, "revspec").then((annotatedCommit) => { + // Use annotatedCommit +}); + +Git.AnnotatedCommit.lookup(repo, id).then((annotatedCommit) => { + // Use annotatedCommit + annotatedCommit.free(); + annotatedCommit.id(); +}); + +// Attr tests + +let result = Git.Attr.addMacro(repo, "name", "values"); + +Git.Attr.cacheFlush(repo); + +Git.Attr.get(repo, 1, "path", "name").then((string) => { + // Use string +}); + +let array = Git.Attr.getMany(repo, 1, "path", 1, "names"); + +result = Git.Attr.value("attr"); From 73c4f21d978d6c5ea86ed54c56509fac69b52656 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:07:21 +0100 Subject: [PATCH 64/91] Added documentation --- types/nodegit/attr.d.ts | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts index 4966c407e0..41c1aa5eb2 100644 --- a/types/nodegit/attr.d.ts +++ b/types/nodegit/attr.d.ts @@ -10,9 +10,62 @@ export namespace Attr { } export class Attr { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} values + * @returns {number} + * + * @memberof Attr + */ static addMacro(repo: Repository, name: string, values: string): number; + /** + * + * + * @static + * @param {Repository} repo + * + * @memberof Attr + */ static cacheFlush(repo: Repository): void; + /** + * + * + * @static + * @param {Repository} repo - The repository containing the path. + * @param {number} flags - A combination of GIT_ATTR_CHECK... flags. + * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). + * @param {string} name - The name of the attribute to look up. + * @returns {Promise} - Output of the value of the attribute. Use the GIT_ATTR_... + * + * @memberof Attr + */ static get(repo: Repository, flags: number, path: string, name: string): Promise; + /** + * + * + * @static + * @param {Repository} repo - The repository containing the path. + * @param {number} flags - A combination of GIT_ATTR_CHECK... flags. + * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). + * @param {number} numAttr - The number of attributes being looked up + * @param {string} names - An array of num_attr strings containing attribute names. + * @returns {any[]} + * + * @memberof Attr + */ static getMany(repo: Repository, flags: number, path: string, numAttr: number, names: string): any[]; + /** + * + * + * @static + * @param {string} attr - The attribute + * @returns {number}- the value type for the attribute + * + * @memberof Attr + */ static value(attr: string): number; } From 20499792a7a8215cb4922291466683fed97cf173 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:13:24 +0100 Subject: [PATCH 65/91] Added documentation to Blame --- types/nodegit/blame-hunk.d.ts | 48 ++++++++++++++++++++++++ types/nodegit/blame-options.d.ts | 44 +++++++++++++++++++++- types/nodegit/blame.d.ts | 63 +++++++++++++++++++++++++++++++- types/nodegit/nodegit-tests.ts | 2 + 4 files changed, 154 insertions(+), 3 deletions(-) diff --git a/types/nodegit/blame-hunk.d.ts b/types/nodegit/blame-hunk.d.ts index 58ab8e7191..83dd1cc410 100644 --- a/types/nodegit/blame-hunk.d.ts +++ b/types/nodegit/blame-hunk.d.ts @@ -2,12 +2,60 @@ import { Oid } from './oid'; import { Signature } from './signature'; export class BlameHunk { + /** + * + * + * @type {number} + * @memberof BlameHunk + */ linesInHunk: number; + /** + * + * + * @type {Oid} + * @memberof BlameHunk + */ finalCommitId: Oid; + /** + * + * + * @type {number} + * @memberof BlameHunk + */ finalStartLineNumber: number; + /** + * + * + * @type {Signature} + * @memberof BlameHunk + */ finalSignature: Signature; + /** + * + * + * @type {Oid} + * @memberof BlameHunk + */ origCommitId: Oid; + /** + * + * + * @type {string} + * @memberof BlameHunk + */ origPath: string; + /** + * + * + * @type {number} + * @memberof BlameHunk + */ origStartLineNumber: number; + /** + * + * + * @type {Signature} + * @memberof BlameHunk + */ origSignature: Signature; } diff --git a/types/nodegit/blame-options.d.ts b/types/nodegit/blame-options.d.ts index ca5f1f50df..eac4c2f4f0 100644 --- a/types/nodegit/blame-options.d.ts +++ b/types/nodegit/blame-options.d.ts @@ -1,11 +1,53 @@ import {Oid} from './oid'; -export interface BlameOptions { +export class BlameOptions { + /** + * + * + * @type {number} + * @memberof BlameOptions + */ version: number; + /** + * + * + * @type {number} + * @memberof BlameOptions + */ flags: number; + /** + * + * + * @type {number} + * @memberof BlameOptions + */ minMatchCharacters: number; + /** + * + * + * @type {Oid} + * @memberof BlameOptions + */ newestCommit: Oid; + /** + * + * + * @type {Oid} + * @memberof BlameOptions + */ oldestCommit: Oid; + /** + * + * + * @type {number} + * @memberof BlameOptions + */ minLine: number; + /** + * + * + * @type {number} + * @memberof BlameOptions + */ maxLine: number; } diff --git a/types/nodegit/blame.d.ts b/types/nodegit/blame.d.ts index e5b5d90ec8..c6efdc133b 100644 --- a/types/nodegit/blame.d.ts +++ b/types/nodegit/blame.d.ts @@ -14,12 +14,71 @@ export namespace Blame { } export class Blame { + /** + * Retrieve the blame of a file + * + * @static + * @param {Repository} repo - Repository that contains the file + * @param {string} path - to the file to get the blame of + * @param {BlameOptions} [options] - Options for the blame + * @returns {Blame} + * + * @memberof Blame + */ static file(repo: Repository, path: string, options?: BlameOptions): Blame; + /** + * + * + * @static + * @param {BlameOptions} opts - The git_blame_options struct to initialize + * @param {number} version - Version of struct; pass GIT_BLAME_OPTIONS_VERSION + * @returns {number} + * + * @memberof Blame + */ static initOptions(opts: BlameOptions, version: number): number; - buffer(buffer: string, buffer_len: number): Promise; + /** + * + * + * @param {string} buffer + * @param {number} bufferLen + * @returns {Promise} + * + * @memberof Blame + */ + buffer(buffer: string, bufferLen: number): Promise; + /** + * + * + * + * @memberof Blame + */ free(): void; + /** + * + * + * @param {number} index + * @returns {BlameHunk} - the hunk at the given index, or NULL on error + * + * @memberof Blame + */ getHunkByIndex(index: number): BlameHunk; - getHunkByLine(lineno: number): BlameHunk; + /** + * + * + * @param {number} lineNo + * @returns {BlameHunk} - the hunk that contains the given line, or NULL on error + * + * @memberof Blame + */ + getHunkByLine(lineNo: number): BlameHunk; + /** + * + * + * @returns {number} + * + * @memberof Blame + */ getHunkCount(): number; } diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index 370369eed4..e9bceb601e 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -45,3 +45,5 @@ Git.Attr.get(repo, 1, "path", "name").then((string) => { let array = Git.Attr.getMany(repo, 1, "path", 1, "names"); result = Git.Attr.value("attr"); + +const blameOptions = new Git.BlameOptions(); From 415a39e089f22a85621b8a58464947ac43e33702 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:20:50 +0100 Subject: [PATCH 66/91] Added documentation and more methods to blob --- types/nodegit/blob.d.ts | 139 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 138 insertions(+), 1 deletion(-) diff --git a/types/nodegit/blob.d.ts b/types/nodegit/blob.d.ts index 32f020b0ce..edd0eb62f7 100644 --- a/types/nodegit/blob.d.ts +++ b/types/nodegit/blob.d.ts @@ -1,20 +1,157 @@ +import { WriteStream } from 'fs'; + import { Repository } from './repository'; import { Oid } from './oid'; export class Blob { + /** + * + * + * @static + * @param {Repository} repo - repository where to blob will be written + * @param {Buffer} buffer - data to be written into the blob + * @param {number} len - length of the data + * @returns {Oid} - return the id of the written blob + * + * @memberof Blob + */ static createFromBuffer(repo: Repository, buffer: Buffer, len: number): Oid; + /** + * + * + * @static + * @param {Oid} id - return the id of the written blob + * @param {Repository} repo - repository where the blob will be written. this repository can be bare or not + * @param {string} path - file from which the blob will be created + * @returns {number} + * + * @memberof Blob + */ static createFromDisk(id: Oid, repo: Repository, path: string): number; - static createFromWorkdir(id: Oid, repo: Repository, relative_path: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} hintPath + * @returns {Promise} + * + * @memberof Blob + */ + static createFromStream(repo: Repository, hintPath: string): Promise; + /** + * + * + * @static + * @param {Oid} id - return the id of the written blob + * @param {Repository} repo - repository where the blob will be written. this repository cannot be bare + * @param {string} relativePath - file from which the blob will be created, relative to the repository's working dir + * @returns {number} - 0 or an error code + * + * @memberof Blob + */ + static createFromWorkdir(id: Oid, repo: Repository, relativePath: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {(string | Oid | Blob)} id + * @returns {Promise} + * + * @memberof Blob + */ static lookup(repo: Repository, id: string | Oid | Blob): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @returns {Promise} + * + * @memberof Blob + */ static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + /** + * + * + * + * @memberof Blob + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Blob + */ id(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Blob + */ isBinary(): number; + /** + * + * + * @returns {Repository} + * + * @memberof Blob + */ owner(): Repository; + /** + * + * + * @returns {Buffer} + * + * @memberof Blob + */ rawcontent(): Buffer; + /** + * + * + * @returns {number} + * + * @memberof Blob + */ rawsize(): number; + /** + * + * + * @returns {Buffer} + * + * @memberof Blob + */ content(): Buffer; + /** + * + * + * @returns {string} + * + * @memberof Blob + */ toString(): string; + /** + * + * + * @returns {number} + * + * @memberof Blob + */ filemode(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Blob + */ + dup(): Promise; } From b54f72f4fdc599ec885558653073b74dfa2efd99 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:22:49 +0100 Subject: [PATCH 67/91] Added documentation for Branch --- types/nodegit/branch.d.ts | 114 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 108 insertions(+), 6 deletions(-) diff --git a/types/nodegit/branch.d.ts b/types/nodegit/branch.d.ts index d121650864..4c48d32101 100644 --- a/types/nodegit/branch.d.ts +++ b/types/nodegit/branch.d.ts @@ -12,14 +12,116 @@ export namespace Branch { } export class Branch { - static create(repo: Repository, branch_name: string, target: Commit, force: number): Promise; - static createFromAnnotated(repository: Repository, branch_name: string, commit: AnnotatedCommit, force: number): Reference; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} branchName + * @param {Commit} target + * @param {number} force + * @returns {Promise} + * + * @memberof Branch + */ + static create(repo: Repository, branchName: string, target: Commit, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repository + * @param {string} branchName + * @param {AnnotatedCommit} commit + * @param {number} force + * @returns {Reference} + * + * @memberof Branch + */ + static createFromAnnotated(repository: Repository, branchName: string, commit: AnnotatedCommit, force: number): Reference; + /** + * + * + * @static + * @param {Reference} branch + * @returns {number} + * + * @memberof Branch + */ static delete(branch: Reference): number; + /** + * + * + * @static + * @param {Reference} branch + * @returns {number} + * + * @memberof Branch + */ static isHead(branch: Reference): number; - static iteratorNew(repo: Repository, list_flags: number): Promise; - static lookup(repo: Repository, branch_name: string, branch_type: number): Promise; - static move(branch: Reference, new_branch_name: string, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {number} listFlags + * @returns {Promise} + * + * @memberof Branch + */ + static iteratorNew(repo: Repository, listFlags: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} branchName + * @param {number} branchType + * @returns {Promise} + * + * @memberof Branch + */ + static lookup(repo: Repository, branchName: string, branchType: number): Promise; + /** + * + * + * @static + * @param {Reference} branch + * @param {string} newBranchName + * @param {number} force + * @returns {Promise} + * + * @memberof Branch + */ + static move(branch: Reference, newBranchName: string, force: number): Promise; + /** + * + * + * @static + * @param {Reference} ref + * @returns {Promise} + * + * @memberof Branch + */ static name(ref: Reference): Promise; - static setUpstream(branch: Reference, upstream_name: string): Promise; + /** + * + * + * @static + * @param {Reference} branch + * @param {string} upstreamName + * @returns {Promise} + * + * @memberof Branch + */ + static setUpstream(branch: Reference, upstreamName: string): Promise; + /** + * + * + * @static + * @param {Reference} branch + * @returns {Promise} + * + * @memberof Branch + */ static upstream(branch: Reference): Promise; } From 29a0cd79eb39c9dde5b27833f56a1c1a2653846c Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:27:21 +0100 Subject: [PATCH 68/91] Added documentation --- types/nodegit/attr.d.ts | 6 ++++-- types/nodegit/branch.d.ts | 4 ++-- types/nodegit/nodegit-tests.ts | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts index 41c1aa5eb2..fdcf4dc56b 100644 --- a/types/nodegit/attr.d.ts +++ b/types/nodegit/attr.d.ts @@ -37,7 +37,8 @@ export class Attr { * @static * @param {Repository} repo - The repository containing the path. * @param {number} flags - A combination of GIT_ATTR_CHECK... flags. - * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). + * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. + * The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). * @param {string} name - The name of the attribute to look up. * @returns {Promise} - Output of the value of the attribute. Use the GIT_ATTR_... * @@ -50,7 +51,8 @@ export class Attr { * @static * @param {Repository} repo - The repository containing the path. * @param {number} flags - A combination of GIT_ATTR_CHECK... flags. - * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). + * @param {string} path - The path to check for attributes. Relative paths are interpreted relative to the repo root. + * The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory). * @param {number} numAttr - The number of attributes being looked up * @param {string} names - An array of num_attr strings containing attribute names. * @returns {any[]} diff --git a/types/nodegit/branch.d.ts b/types/nodegit/branch.d.ts index 4c48d32101..0c52131a51 100644 --- a/types/nodegit/branch.d.ts +++ b/types/nodegit/branch.d.ts @@ -75,12 +75,12 @@ export class Branch { * @static * @param {Repository} repo * @param {string} branchName - * @param {number} branchType + * @param {Branch.BRANCH} branchType * @returns {Promise} * * @memberof Branch */ - static lookup(repo: Repository, branchName: string, branchType: number): Promise; + static lookup(repo: Repository, branchName: string, branchType: Branch.BRANCH): Promise; /** * * diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index e9bceb601e..c8d296ea09 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -47,3 +47,7 @@ let array = Git.Attr.getMany(repo, 1, "path", 1, "names"); result = Git.Attr.value("attr"); const blameOptions = new Git.BlameOptions(); + +Git.Branch.lookup(repo, "branch_name", Git.Branch.BRANCH.LOCAL).then(function (reference) { + // Use reference +}); From 2dc0287a6b84ed7d177bea46a79e218da9223efd Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:28:00 +0100 Subject: [PATCH 69/91] Made enums all constants --- types/nodegit/attr.d.ts | 2 +- types/nodegit/blame.d.ts | 2 +- types/nodegit/branch.d.ts | 2 +- types/nodegit/cert.d.ts | 4 ++-- types/nodegit/checkout.d.ts | 4 ++-- types/nodegit/clone.d.ts | 2 +- types/nodegit/config.d.ts | 2 +- types/nodegit/cred.d.ts | 2 +- types/nodegit/diff-binary.d.ts | 2 +- types/nodegit/diff.d.ts | 16 ++++++++-------- types/nodegit/enums.d.ts | 10 +++++----- types/nodegit/error.d.ts | 4 ++-- types/nodegit/fetch.d.ts | 2 +- types/nodegit/filter.d.ts | 4 ++-- types/nodegit/hash-sig.d.ts | 2 +- types/nodegit/index_.d.ts | 4 ++-- types/nodegit/lib-git2.d.ts | 2 +- types/nodegit/merge.d.ts | 10 +++++----- types/nodegit/odb.d.ts | 2 +- types/nodegit/pack-builder.d.ts | 2 +- types/nodegit/path-spec.d.ts | 2 +- types/nodegit/rebase-operation.d.ts | 2 +- types/nodegit/reference.d.ts | 4 ++-- types/nodegit/remote.d.ts | 4 ++-- types/nodegit/reset.d.ts | 2 +- types/nodegit/rev-parse.d.ts | 2 +- types/nodegit/rev-walk.d.ts | 2 +- types/nodegit/stash.d.ts | 6 +++--- types/nodegit/status.d.ts | 6 +++--- types/nodegit/submodule.d.ts | 8 ++++---- types/nodegit/transport.d.ts | 2 +- types/nodegit/tree-entry.d.ts | 2 +- types/nodegit/tree.d.ts | 2 +- 33 files changed, 62 insertions(+), 62 deletions(-) diff --git a/types/nodegit/attr.d.ts b/types/nodegit/attr.d.ts index fdcf4dc56b..c7b2d3ea22 100644 --- a/types/nodegit/attr.d.ts +++ b/types/nodegit/attr.d.ts @@ -1,7 +1,7 @@ import { Repository } from './repository'; export namespace Attr { - enum STATES { + const enum STATES { UNSPECIFIED_T = 0, TRUE_T = 1, FALSE_T = 2, diff --git a/types/nodegit/blame.d.ts b/types/nodegit/blame.d.ts index c6efdc133b..684db81b6c 100644 --- a/types/nodegit/blame.d.ts +++ b/types/nodegit/blame.d.ts @@ -3,7 +3,7 @@ import { BlameOptions } from './blame-options'; import {BlameHunk} from './blame-hunk'; export namespace Blame { - enum FLAG { + const enum FLAG { NORMAL = 0, TRACK_COPIES_SAME_FILE = 1, TRACK_COPIES_SAME_COMMIT_MOVES = 2, diff --git a/types/nodegit/branch.d.ts b/types/nodegit/branch.d.ts index 0c52131a51..47bd1ec76f 100644 --- a/types/nodegit/branch.d.ts +++ b/types/nodegit/branch.d.ts @@ -4,7 +4,7 @@ import { Commit } from './commit'; import { AnnotatedCommit } from './annotated-commit'; export namespace Branch { - enum BRANCH { + const enum BRANCH { LOCAL = 1, REMOTE = 2, ALL = 3 diff --git a/types/nodegit/cert.d.ts b/types/nodegit/cert.d.ts index f910453700..fd749beba9 100644 --- a/types/nodegit/cert.d.ts +++ b/types/nodegit/cert.d.ts @@ -1,12 +1,12 @@ export namespace Cert { - enum TYPE { + const enum TYPE { NONE = 0, X509 = 1, HOSTKEY_LIBSSH2 = 2, STRARRAY = 3 } - enum SSH { + const enum SSH { MD5 = 1, SHA1 = 2 } diff --git a/types/nodegit/checkout.d.ts b/types/nodegit/checkout.d.ts index a7bc6d63fc..af5f66faf3 100644 --- a/types/nodegit/checkout.d.ts +++ b/types/nodegit/checkout.d.ts @@ -7,7 +7,7 @@ import { Commit } from './commit'; import { Index } from './index'; export namespace Checkout { - enum NOTIFY { + const enum NOTIFY { NONE = 0, CONFLICT = 1, DIRTY = 2, @@ -17,7 +17,7 @@ export namespace Checkout { ALL = 65535 } - enum STRATEGY { + const enum STRATEGY { NONE = 0, SAFE = 1, FORCE = 2, diff --git a/types/nodegit/clone.d.ts b/types/nodegit/clone.d.ts index e0b92bb9ea..c038a8e26a 100644 --- a/types/nodegit/clone.d.ts +++ b/types/nodegit/clone.d.ts @@ -2,7 +2,7 @@ import { Repository } from './repository'; import { CloneOptions } from './clone-options'; export namespace Clone { - enum LOCAL { + const enum LOCAL { AUTO = 0, LOCAL = 1, NO_LOCAL = 2, diff --git a/types/nodegit/config.d.ts b/types/nodegit/config.d.ts index ad8df1a327..ea61c52d3c 100644 --- a/types/nodegit/config.d.ts +++ b/types/nodegit/config.d.ts @@ -1,7 +1,7 @@ import { Buf } from './buf'; export namespace Config { - enum LEVEL { + const enum LEVEL { SYSTEM = 1, XDG = 2, GLOBAL = 3, diff --git a/types/nodegit/cred.d.ts b/types/nodegit/cred.d.ts index 759e43d814..9de014311b 100644 --- a/types/nodegit/cred.d.ts +++ b/types/nodegit/cred.d.ts @@ -1,5 +1,5 @@ export namespace Cred { - enum TYPE { + const enum TYPE { USERPASS_PLAINTEXT = 1, SSH_KEY = 2, SSH_CUSTOM = 4, diff --git a/types/nodegit/diff-binary.d.ts b/types/nodegit/diff-binary.d.ts index fa6643038d..d01181c92a 100644 --- a/types/nodegit/diff-binary.d.ts +++ b/types/nodegit/diff-binary.d.ts @@ -1,7 +1,7 @@ import { DiffBinaryFile } from './diff-binary-file'; export namespace DiffBinary { - enum DIFF_BINARY { + const enum DIFF_BINARY { NONE = 0, LITERAL = 1, DELTA = 2 diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index d675b36acf..6926527124 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -18,7 +18,7 @@ export interface DiffFindOptions { } export namespace Diff { - enum DELTA { + const enum DELTA { UNMODIFIED = 0, ADDED = 1, DELETED = 2, @@ -32,7 +32,7 @@ export namespace Diff { CONFLICTED = 10 } - enum FIND { + const enum FIND { BY_CONFIG = 0, RENAMES = 1, RENAMES_FROM_REWRITES = 2, @@ -51,14 +51,14 @@ export namespace Diff { REMOVE_UNMODIFIED = 65536 } - enum FLAG { + const enum FLAG { BINARY = 1, NOT_BINARY = 2, VALID_ID = 4, EXISTS = 8 } - enum FORMAT { + const enum FORMAT { PATCH = 1, PATCH_HEADER = 2, RAW = 3, @@ -66,12 +66,12 @@ export namespace Diff { NAME_STATUS = 5 } - enum FORMAT_EMAIL_FLAGS { + const enum FORMAT_EMAIL_FLAGS { FORMAT_EMAIL_NONE = 0, FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = 1 } - enum LINE { + const enum LINE { CONTEXT = 32, ADDITION = 43, DELETION = 45, @@ -83,7 +83,7 @@ export namespace Diff { BINARY = 66 } - enum OPTION { + const enum OPTION { NORMAL = 0, REVERSE = 1, INCLUDE_IGNORED = 2, @@ -115,7 +115,7 @@ export namespace Diff { SHOW_BINARY = 1073741824 } - enum STATS_FORMAT { + const enum STATS_FORMAT { STATS_NONE = 0, STATS_FULL = 1, STATS_SHORT = 2, diff --git a/types/nodegit/enums.d.ts b/types/nodegit/enums.d.ts index 850979ac51..4fb44850ca 100644 --- a/types/nodegit/enums.d.ts +++ b/types/nodegit/enums.d.ts @@ -1,23 +1,23 @@ export namespace Enums { - enum CVAR { + const enum CVAR { FALSE = 0, TRUE = 1, INT32 = 2, string = 3 } - enum DIRECTION { + const enum DIRECTION { FETCH = 0, PUSH = 1 } - enum FEATURE { + const enum FEATURE { THREADS = 1, HTTPS = 2, SSH = 4 } - enum IDXENTRY_EXTENDED_FLAG { + const enum IDXENTRY_EXTENDED_FLAG { IDXENTRY_INTENT_TO_ADD = 8192, IDXENTRY_SKIP_WORKTREE = 16384, IDXENTRY_EXTENDED2 = 32768, @@ -34,7 +34,7 @@ export namespace Enums { IDXENTRY_NEW_SKIP_WORKTREE = 512 } - enum INDXENTRY_FLAG { + const enum INDXENTRY_FLAG { IDXENTRY_EXTENDED = 16384, IDXENTRY_VALID = 32768 } diff --git a/types/nodegit/error.d.ts b/types/nodegit/error.d.ts index e1267c082b..c259749e8b 100644 --- a/types/nodegit/error.d.ts +++ b/types/nodegit/error.d.ts @@ -1,5 +1,5 @@ export namespace Error { - enum ERROR { + const enum ERROR { GITERR_NONE = 0, GITERR_NOMEMORY = 1, GITERR_OS = 2, @@ -33,7 +33,7 @@ export namespace Error { GITERR_FILESYSTEM = 30 } - enum CODE { + const enum CODE { OK = 0, ERROR = -1, ENOTFOUND = -3, diff --git a/types/nodegit/fetch.d.ts b/types/nodegit/fetch.d.ts index 2e71097ba3..db0980586f 100644 --- a/types/nodegit/fetch.d.ts +++ b/types/nodegit/fetch.d.ts @@ -1,7 +1,7 @@ import { FetchOptions } from './fetch-options'; export namespace Fetch { - enum PRUNE { + const enum PRUNE { GIT_FETCH_PRUNE_UNSPECIFIED = 0, GIT_FETCH_PRUNE = 1, GIT_FETCH_NO_PRUNE = 2 diff --git a/types/nodegit/filter.d.ts b/types/nodegit/filter.d.ts index da1f71c2b9..066a51183e 100644 --- a/types/nodegit/filter.d.ts +++ b/types/nodegit/filter.d.ts @@ -5,12 +5,12 @@ import { Blob } from './blob'; import { Buf } from './buf'; export namespace Filter { - enum FLAG { + const enum FLAG { DEFAULT = 0, ALLOW_UNSAFE = 1 } - enum MODE { + const enum MODE { TO_WORKTREE = 0, SMUDGE = 0, TO_ODB = 1, diff --git a/types/nodegit/hash-sig.d.ts b/types/nodegit/hash-sig.d.ts index afa9bc121c..5e9897450f 100644 --- a/types/nodegit/hash-sig.d.ts +++ b/types/nodegit/hash-sig.d.ts @@ -1,5 +1,5 @@ export namespace Hashsig { - enum OPTION { + const enum OPTION { NORMAL = 0, IGNORE_WHITESPACE = 1, SMART_WHITESPACE = 2, diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index 9902b53d35..6fd80f5047 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -5,14 +5,14 @@ import { Tree } from './tree'; import { Strarray } from './str-array'; export namespace Index { - enum ADD_OPTION { + const enum ADD_OPTION { ADD_DEFAULT = 0, ADD_FORCE = 1, ADD_DISABLE_PATHSPEC_MATCH = 2, ADD_CHECK_PATHSPEC = 4 } - enum CAP { + const enum CAP { IGNORE_CASE = 1, NO_FILEMODE = 2, NO_SYMLINKS = 4, diff --git a/types/nodegit/lib-git2.d.ts b/types/nodegit/lib-git2.d.ts index 9d7f1a5281..be5a5d1856 100644 --- a/types/nodegit/lib-git2.d.ts +++ b/types/nodegit/lib-git2.d.ts @@ -1,5 +1,5 @@ export namespace Libgit2 { - enum OPT { + const enum OPT { GET_MWINDOW_SIZE = 0, SET_MWINDOW_SIZE = 1, GET_MWINDOW_MAPPED_LIMIT = 2, diff --git a/types/nodegit/merge.d.ts b/types/nodegit/merge.d.ts index fb135e178f..737d3c5a04 100644 --- a/types/nodegit/merge.d.ts +++ b/types/nodegit/merge.d.ts @@ -10,7 +10,7 @@ import { MergeOptions } from './merge-options'; import { MergeFileInput } from './merge-file-input'; export namespace Merge { - enum ANALYSIS { + const enum ANALYSIS { NONE = 0, NORMAL = 1, UP_TO_DATE = 2, @@ -18,14 +18,14 @@ export namespace Merge { UNBORN = 8 } - enum FILE_FAVOR { + const enum FILE_FAVOR { NORMAL = 0, OURS = 1, THEIRS = 2, UNION = 3 } - enum FILE_FLAGS { + const enum FILE_FLAGS { FILE_DEFAULT = 0, FILE_STYLE_MERGE = 1, FILE_STYLE_DIFF3 = 2, @@ -37,13 +37,13 @@ export namespace Merge { FILE_DIFF_MINIMAL = 128 } - enum PREFERENCE { + const enum PREFERENCE { NONE = 0, NO_FASTFORWARD = 1, FASTFORWARD_ONLY = 2 } - enum TREE_FLAG { + const enum TREE_FLAG { TREE_FIND_RENAMES = 1 } } diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index f43f1673db..c0cbfd8725 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -2,7 +2,7 @@ import { Oid } from './oid'; import { OdbObject } from './odb-object'; export namespace Odb { - enum STREAM { + const enum STREAM { RDONLY = 2, WRONLY = 4, RW = 6 diff --git a/types/nodegit/pack-builder.d.ts b/types/nodegit/pack-builder.d.ts index 0f21f5f328..ed0fa0a2cc 100644 --- a/types/nodegit/pack-builder.d.ts +++ b/types/nodegit/pack-builder.d.ts @@ -3,7 +3,7 @@ import { Oid } from './oid'; import { Revwalk } from './rev-walk'; export namespace Packbuilder { - enum STAGE { + const enum STAGE { ADDING_OBJECTS = 0, DELTAFICATION = 1 } diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts index d09d2812da..99435d5e0d 100644 --- a/types/nodegit/path-spec.d.ts +++ b/types/nodegit/path-spec.d.ts @@ -6,7 +6,7 @@ import { Index } from './index'; import { Strarray } from './str-array'; export namespace Pathspec { - enum FLAG { + const enum FLAG { DEFAULT = 0, IGNORE_CASE = 1, USE_CASE = 2, diff --git a/types/nodegit/rebase-operation.d.ts b/types/nodegit/rebase-operation.d.ts index a6e6e53bfa..7144ebe6a9 100644 --- a/types/nodegit/rebase-operation.d.ts +++ b/types/nodegit/rebase-operation.d.ts @@ -1,7 +1,7 @@ import { Oid } from './oid'; export namespace RebaseOperation { - enum REBASE_OPERATION { + const enum REBASE_OPERATION { PICK = 0, REWORD = 1, EDIT = 2, diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts index e2148f6a07..4edd34d2da 100644 --- a/types/nodegit/reference.d.ts +++ b/types/nodegit/reference.d.ts @@ -3,14 +3,14 @@ import { Oid } from './oid'; import { Object } from './object'; export namespace Reference { - enum TYPE { + const enum TYPE { INVALID = 0, OID = 1, SYMBOLIC = 2, LISTALL = 3 } - enum NORMALIZE { + const enum NORMALIZE { REF_FORMAT_NORMAL = 0, REF_FORMAT_ALLOW_ONELEVEL = 1, REF_FORMAT_REFSPEC_PATTERN = 2, diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 0c3923c57c..bba1f640fb 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -9,14 +9,14 @@ import { PushOptions } from './push-options'; import { Refspec } from './ref-spec'; export namespace Remote { - enum AUTOTAG_OPTION { + const enum AUTOTAG_OPTION { DOWNLOAD_TAGS_UNSPECIFIED = 0, DOWNLOAD_TAGS_AUTO = 1, DOWNLOAD_TAGS_NONE = 2, DOWNLOAD_TAGS_ALL = 3 } - enum COMPLETION_TYPE { + const enum COMPLETION_TYPE { COMPLETION_DOWNLOAD = 0, COMPLETION_INDEXING = 1, COMPLETION_ERROR = 2 diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 8af3919ff4..25ff5ae563 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -5,7 +5,7 @@ import { Strarray } from './str-array'; import { CheckoutOptions } from './checkout-options'; export namespace Reset { - enum TYPE { + const enum TYPE { SOFT = 1, MIXED = 2, HARD = 3 diff --git a/types/nodegit/rev-parse.d.ts b/types/nodegit/rev-parse.d.ts index 9d0136cac6..7bdbc80676 100644 --- a/types/nodegit/rev-parse.d.ts +++ b/types/nodegit/rev-parse.d.ts @@ -3,7 +3,7 @@ import { Repository } from './repository'; import { Reference } from './reference'; export namespace Revparse { - enum MODE { + const enum MODE { SINGLE = 1, RANGE = 2, MERGE_BASE = 4 diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts index ad54969164..643220b492 100644 --- a/types/nodegit/rev-walk.d.ts +++ b/types/nodegit/rev-walk.d.ts @@ -3,7 +3,7 @@ import { Oid } from './oid'; import { Commit } from './commit'; export namespace Revwalk { - enum SORT { + const enum SORT { NONE = 0, TOPOLOGICAL = 1, TIME = 2, diff --git a/types/nodegit/stash.d.ts b/types/nodegit/stash.d.ts index 5208fa7e5f..39a6893140 100644 --- a/types/nodegit/stash.d.ts +++ b/types/nodegit/stash.d.ts @@ -4,12 +4,12 @@ import { Oid } from './oid'; import { CheckoutOptions } from './checkout-options'; export namespace Stash { - enum APPLY_FLAGS { + const enum APPLY_FLAGS { APPLY_DEFAULT = 0, APPLY_REINSTATE_INDEX = 1 } - enum APPLY_PROGRESS { + const enum APPLY_PROGRESS { NONE = 0, LOADING_STASH = 1, ANALYZE_INDEX = 2, @@ -20,7 +20,7 @@ export namespace Stash { DONE = 7 } - enum FLAGS { + const enum FLAGS { DEFAULT = 0, KEEP_INDEX = 1, INCLUDE_UNTRACKED = 2, diff --git a/types/nodegit/status.d.ts b/types/nodegit/status.d.ts index 92bbe564f3..49ad0fd142 100644 --- a/types/nodegit/status.d.ts +++ b/types/nodegit/status.d.ts @@ -4,7 +4,7 @@ import { StatusEntry } from './status-entry'; import { StatusOptions } from './status-options'; export namespace Status { - enum STATUS { + const enum STATUS { CURRENT = 0, INDEX_NEW = 1, INDEX_MODIFIED = 2, @@ -21,7 +21,7 @@ export namespace Status { CONFLICTED = 32768 } - enum OPT { + const enum OPT { INCLUDE_UNTRACKED = 1, INCLUDE_IGNORED = 2, INCLUDE_UNMODIFIED = 4, @@ -40,7 +40,7 @@ export namespace Status { INCLUDE_UNREADABLE_AS_UNTRACKED = 32768 } - enum SHOW { + const enum SHOW { INDEX_AND_WORKDIR = 0, INDEX_ONLY = 1, WORKDIR_ONLY = 2 diff --git a/types/nodegit/submodule.d.ts b/types/nodegit/submodule.d.ts index b3c1576db4..fd64a1c8ac 100644 --- a/types/nodegit/submodule.d.ts +++ b/types/nodegit/submodule.d.ts @@ -4,7 +4,7 @@ import { Oid } from './oid'; import { SubmoduleUpdateOptions } from './submodule-update-options'; export namespace Submodule { - enum IGNORE { + const enum IGNORE { UNSPECIFIED = -1, NONE = 1, UNTRACKED = 2, @@ -12,13 +12,13 @@ export namespace Submodule { ALL = 4 } - enum RECURSE { + const enum RECURSE { NO = 0, YES = 1, ONDEMAND = 2 } - enum STATUS { + const enum STATUS { IN_HEAD = 1, IN_INDEX = 2, IN_CONFIG = 4, @@ -35,7 +35,7 @@ export namespace Submodule { WD_UNTRACKED = 8192 } - enum UPDATE { + const enum UPDATE { CHECKOUT = 1, REBASE = 2, MERGE = 3, diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts index 9d1a82b061..189985c469 100644 --- a/types/nodegit/transport.d.ts +++ b/types/nodegit/transport.d.ts @@ -2,7 +2,7 @@ import { Remote } from './remote'; import { Strarray } from './str-array'; export namespace Transport { - enum FLAGS { + const enum FLAGS { NONE = 0 } } diff --git a/types/nodegit/tree-entry.d.ts b/types/nodegit/tree-entry.d.ts index 8d1b5d553e..844f5da90c 100644 --- a/types/nodegit/tree-entry.d.ts +++ b/types/nodegit/tree-entry.d.ts @@ -3,7 +3,7 @@ import { Oid } from './oid'; import { Blob } from './blob'; export namespace TreeEntry { - enum FILEMODE { + const enum FILEMODE { UNREADABLE = 0, TREE = 16384, BLOB = 33188, diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index b9ac62f9e2..c20037cb0a 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -6,7 +6,7 @@ import { Treebuilder } from './tree-builder'; import { DiffFile } from './diff-file'; export namespace Tree { - enum WALK_MODE { + const enum WALK_MODE { WALK_PRE = 0, WALK_POST = 1 } From 7097c37505310eb083657671f0e36e681b5ce50c Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:31:06 +0100 Subject: [PATCH 70/91] Fixed tests --- types/nodegit/clone-options.d.ts | 4 ++-- types/nodegit/diff-options.d.ts | 2 +- types/nodegit/nodegit-tests.ts | 2 +- types/nodegit/note.d.ts | 2 +- types/nodegit/stash.d.ts | 4 ++-- types/nodegit/status.d.ts | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/types/nodegit/clone-options.d.ts b/types/nodegit/clone-options.d.ts index b8acc9aad0..8535b28c81 100644 --- a/types/nodegit/clone-options.d.ts +++ b/types/nodegit/clone-options.d.ts @@ -8,6 +8,6 @@ export class CloneOptions { bare?: number; local?: number; checkoutBranch?: string; - repositoryCbPayload?: void; - remoteCbPayload?: void; + repositoryCbPayload?: any; + remoteCbPayload?: any; } diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts index e78de28aac..32dec9943f 100644 --- a/types/nodegit/diff-options.d.ts +++ b/types/nodegit/diff-options.d.ts @@ -6,7 +6,7 @@ export interface DiffOptions { ignoreSubmodules: number; pathspec: Strarray; notifyCb: Function; - notifyPayload: void; + notifyPayload: any; contextLines: number; interhunkLines: number; idAbbrev: number; diff --git a/types/nodegit/nodegit-tests.ts b/types/nodegit/nodegit-tests.ts index c8d296ea09..c10dfef127 100644 --- a/types/nodegit/nodegit-tests.ts +++ b/types/nodegit/nodegit-tests.ts @@ -48,6 +48,6 @@ result = Git.Attr.value("attr"); const blameOptions = new Git.BlameOptions(); -Git.Branch.lookup(repo, "branch_name", Git.Branch.BRANCH.LOCAL).then(function (reference) { +Git.Branch.lookup(repo, "branch_name", Git.Branch.BRANCH.LOCAL).then((reference) => { // Use reference }); diff --git a/types/nodegit/note.d.ts b/types/nodegit/note.d.ts index 2ea74b9df8..c5c9152bb2 100644 --- a/types/nodegit/note.d.ts +++ b/types/nodegit/note.d.ts @@ -4,7 +4,7 @@ import {Oid} from './oid'; export class Note { static create(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; - static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: void): Promise; + static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: any): Promise; static iteratorNew(repo: Repository, notes_ref: string): Promise; static next(note_id: Oid, annotated_id: Oid, it: any): number; static read(repo: Repository, notes_ref: string, oid: Oid): Promise; diff --git a/types/nodegit/stash.d.ts b/types/nodegit/stash.d.ts index 39a6893140..c81e94b7b6 100644 --- a/types/nodegit/stash.d.ts +++ b/types/nodegit/stash.d.ts @@ -33,14 +33,14 @@ export interface StashApplyOptions { flags: number; checkoutOptions: CheckoutOptions; progressCb: Function; - progressPayload: void; + progressPayload: any; } export class Stash { 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: void): Promise; + static foreach(repo: Repository, callback: Function, payload: any): 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.d.ts b/types/nodegit/status.d.ts index 49ad0fd142..1059dd6bff 100644 --- a/types/nodegit/status.d.ts +++ b/types/nodegit/status.d.ts @@ -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: void): Promise; - static foreachExt(repo: Repository, opts: StatusOptions, callback: Function, payload: void): Promise; + static foreach(repo: Repository, callback: Function, payload: any): Promise; + static foreachExt(repo: Repository, opts: StatusOptions, callback: Function, payload: any): Promise; static shouldIgnore(ignored: number, repo: Repository, path: string): number; } From 39a54fd1d7f660cac8fe2d027ab617ed1eaa5a33 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:32:35 +0100 Subject: [PATCH 71/91] Added documentation for Buf --- types/nodegit/buf.d.ts | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/types/nodegit/buf.d.ts b/types/nodegit/buf.d.ts index 53886615ed..d9670bb293 100644 --- a/types/nodegit/buf.d.ts +++ b/types/nodegit/buf.d.ts @@ -1,12 +1,67 @@ /// export class Buf { + /** + * + * + * @returns {number} + * + * @memberof Buf + */ containsNul(): number; + /** + * + * + * + * @memberof Buf + */ free(): void; + /** + * + * + * @param {number} target_size + * @returns {Promise} + * + * @memberof Buf + */ grow(target_size: number): Promise; + /** + * + * + * @returns {number} + * + * @memberof Buf + */ isBinary(): number; + /** + * + * + * @param {Buffer} data + * @param {number} datalen + * @returns {Promise} + * + * @memberof Buf + */ set(data: Buffer, datalen: number): Promise; + /** + * + * + * @type {string} + * @memberof Buf + */ ptr: string; + /** + * + * + * @type {number} + * @memberof Buf + */ asize: number; + /** + * + * + * @type {number} + * @memberof Buf + */ size: number; } From 65727b3bdb9a597acd3b524502a4363c53bac711 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:34:49 +0100 Subject: [PATCH 72/91] Added documentation for CertHostkey --- types/nodegit/cert-host-key.d.ts | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/types/nodegit/cert-host-key.d.ts b/types/nodegit/cert-host-key.d.ts index 428d04b727..c4947d347c 100644 --- a/types/nodegit/cert-host-key.d.ts +++ b/types/nodegit/cert-host-key.d.ts @@ -1,6 +1,32 @@ +import { Cert } from './cert'; + export class CertHostkey { - certType: number; + /** + * + * + * @type {Cert} + * @memberof CertHostkey + */ + parent: Cert; + /** + * + * + * @type {number} + * @memberof CertHostkey + */ type: number; + /** + * + * + * @type {string} + * @memberof CertHostkey + */ hashMd5: string; + /** + * + * + * @type {string} + * @memberof CertHostkey + */ hashSha1: string; } From 5217c986509016f65bcc5f63d2be8c385bd2b9c7 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:35:38 +0100 Subject: [PATCH 73/91] Added documentation for CertX509 --- types/nodegit/cert-x509.d.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/types/nodegit/cert-x509.d.ts b/types/nodegit/cert-x509.d.ts index 14f38ac5fc..dd395a755d 100644 --- a/types/nodegit/cert-x509.d.ts +++ b/types/nodegit/cert-x509.d.ts @@ -1,5 +1,25 @@ +import { Cert } from './cert'; + export class CertX509 { - certType: number; + /** + * + * + * @type {Buffer} + * @memberof CertX509 + */ data: Buffer; + /** + * + * + * @type {number} + * @memberof CertX509 + */ len: number; + /** + * + * + * @type {Cert} + * @memberof CertX509 + */ + parent: Cert; } From d2a75d9ecc969f045494881b55563d11625707b4 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:37:10 +0100 Subject: [PATCH 74/91] Added documentation --- types/nodegit/cert-host-key.d.ts | 8 +------- types/nodegit/cert.d.ts | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/types/nodegit/cert-host-key.d.ts b/types/nodegit/cert-host-key.d.ts index c4947d347c..f69210ca37 100644 --- a/types/nodegit/cert-host-key.d.ts +++ b/types/nodegit/cert-host-key.d.ts @@ -8,13 +8,7 @@ export class CertHostkey { * @memberof CertHostkey */ parent: Cert; - /** - * - * - * @type {number} - * @memberof CertHostkey - */ - type: number; + type: Cert.TYPE; /** * * diff --git a/types/nodegit/cert.d.ts b/types/nodegit/cert.d.ts index fd749beba9..fde86569b9 100644 --- a/types/nodegit/cert.d.ts +++ b/types/nodegit/cert.d.ts @@ -13,5 +13,5 @@ export namespace Cert { } export class Cert { - certType: number; + certType: Cert.TYPE; } From a483653f42fa1be3a0194871803748b8c69ccea7 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:38:37 +0100 Subject: [PATCH 75/91] Added documentation --- types/nodegit/checkout-options.d.ts | 120 ++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index 4122dfbe28..253755d7fb 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -3,24 +3,144 @@ import { Tree } from './tree'; import { Index } from './index'; export class CheckoutOptions { + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ version?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ checkoutStrategy?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ disableFilters?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ dirMode?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ fileMode?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ fileOpenFlags?: number; + /** + * + * + * @type {number} + * @memberof CheckoutOptions + */ notifyFlags?: number; + /** + * + * + * @type {*} + * @memberof CheckoutOptions + */ notifyCb?: any; + /** + * + * + * @type {undefined} + * @memberof CheckoutOptions + */ notifyPayload?: undefined; + /** + * + * + * @type {*} + * @memberof CheckoutOptions + */ progressCb?: any; + /** + * + * + * @type {undefined} + * @memberof CheckoutOptions + */ progressPayload?: undefined; + /** + * + * + * @type {Strarray} + * @memberof CheckoutOptions + */ paths?: Strarray; + /** + * + * + * @type {Tree} + * @memberof CheckoutOptions + */ baseline?: Tree; + /** + * + * + * @type {Index} + * @memberof CheckoutOptions + */ baselineIndex?: Index; + /** + * + * + * @type {string} + * @memberof CheckoutOptions + */ targetDirectory?: string; + /** + * + * + * @type {string} + * @memberof CheckoutOptions + */ ancestorLabel?: string; + /** + * + * + * @type {string} + * @memberof CheckoutOptions + */ ourLabel?: string; + /** + * + * + * @type {string} + * @memberof CheckoutOptions + */ theirLabel?: string; + /** + * + * + * @type {*} + * @memberof CheckoutOptions + */ perfdataCb?: any; + /** + * + * + * @type {undefined} + * @memberof CheckoutOptions + */ perfdataPayload?: undefined; } From 79e1866c4d273eb7e2613665e834370b007656e9 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:40:20 +0100 Subject: [PATCH 76/91] Added documentation for Checkout --- types/nodegit/checkout.d.ts | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/types/nodegit/checkout.d.ts b/types/nodegit/checkout.d.ts index af5f66faf3..a6ce5ff991 100644 --- a/types/nodegit/checkout.d.ts +++ b/types/nodegit/checkout.d.ts @@ -44,8 +44,50 @@ export namespace Checkout { } export class Checkout { + /** + * Patch head checkout to automatically coerce objects. + * + * @static + * @param {Repository} repo + * @param {CheckoutOptions} [options] + * @returns {Promise} + * + * @memberof Checkout + */ static head(repo: Repository, options?: CheckoutOptions): Promise; + /** + * Patch index checkout to automatically coerce objects. + * + * @static + * @param {Repository} repo + * @param {Index} The + * @param {CheckoutOptions} [options] + * @returns {Promise} + * + * @memberof Checkout + */ static index(repo: Repository, The: Index, options?: CheckoutOptions): Promise; + /** + * + * + * @static + * @param {CheckoutOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Checkout + */ static initOptions(opts: CheckoutOptions, version: number): number; + /** + * Patch tree checkout to automatically coerce objects. + * + * @static + * @param {Repository} repo + * @param {(Oid | Tree | Commit | Reference)} treeish + * @param {CheckoutOptions} [options] + * @returns {Promise} + * + * @memberof Checkout + */ static tree(repo: Repository, treeish: Oid | Tree | Commit | Reference, options?: CheckoutOptions): Promise; } From 9dd615be310d3037e3b81bf8757147909fd0e143 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 8 Jun 2017 02:41:41 +0100 Subject: [PATCH 77/91] Documented Cherrypick --- types/nodegit/cherry-pick-options.d.ts | 24 ++++++++++++++++++ types/nodegit/cherry-pick.d.ts | 34 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/types/nodegit/cherry-pick-options.d.ts b/types/nodegit/cherry-pick-options.d.ts index 7c6ec6976c..8743217b47 100644 --- a/types/nodegit/cherry-pick-options.d.ts +++ b/types/nodegit/cherry-pick-options.d.ts @@ -2,8 +2,32 @@ import { MergeOptions } from './merge-options'; import { CheckoutOptions } from './checkout-options'; export interface CherrypickOptions { + /** + * + * + * @type {number} + * @memberof CherrypickOptions + */ version: number; + /** + * + * + * @type {number} + * @memberof CherrypickOptions + */ mainline: number; + /** + * + * + * @type {MergeOptions} + * @memberof CherrypickOptions + */ mergeOpts: MergeOptions; + /** + * + * + * @type {CheckoutOptions} + * @memberof CherrypickOptions + */ checkoutOpts: CheckoutOptions; } diff --git a/types/nodegit/cherry-pick.d.ts b/types/nodegit/cherry-pick.d.ts index 291c5e0223..b895845301 100644 --- a/types/nodegit/cherry-pick.d.ts +++ b/types/nodegit/cherry-pick.d.ts @@ -4,7 +4,41 @@ import { MergeOptions } from './merge-options'; import { CherrypickOptions } from './cherry-pick-options'; export class Cherrypick { + /** + * Cherrypick a commit and, changing the index and working directory + * + * @static + * @param {Repository} repo + * @param {Commit} commit + * @param {CherrypickOptions} [options] + * @returns {Promise} + * + * @memberof Cherrypick + */ static cherrypick(repo: Repository, commit: Commit, options?: CherrypickOptions): Promise; + /** + * Cherrypicks the given commit against "our" commit, producing an index that reflects the result of the cherrypick. The index is not backed by a repo. + * + * @static + * @param {Repository} repo + * @param {Commit} cherrypickCommit + * @param {Commit} ourCommit + * @param {number} mainline + * @param {MergeOptions} [mergeOptions] + * @returns {Promise} + * + * @memberof Cherrypick + */ static commit(repo: Repository, cherrypickCommit: Commit, ourCommit: Commit, mainline: number, mergeOptions?: MergeOptions): Promise; + /** + * + * + * @static + * @param {CherrypickOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Cherrypick + */ static initOptions(opts: CherrypickOptions, version: number): number; } From b47f2db564c54f8145a791fe197d7092c9b677c0 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:07:26 +0100 Subject: [PATCH 78/91] 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; } From edf46bc72563e170c35fdfddd44e1b73536da873 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:07:35 +0100 Subject: [PATCH 79/91] Added ProxyOptions --- types/nodegit/index.d.ts | 1 + types/nodegit/proxy-options.d.ts | 8 ++++++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 10 insertions(+) create mode 100644 types/nodegit/proxy-options.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 32b86ba19f..4efd864946 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -65,6 +65,7 @@ export { Oid } from './oid'; export { Openssl } from './open-ssl'; export { Packbuilder } from './pack-builder'; export { Pathspec } from './path-spec'; +export { ProxyOptions } from './proxy-options'; export { PushOptions } from './push-options'; export { PushUpdate } from './push-update'; export { Push } from './push'; diff --git a/types/nodegit/proxy-options.d.ts b/types/nodegit/proxy-options.d.ts new file mode 100644 index 0000000000..7a4c8f4dd4 --- /dev/null +++ b/types/nodegit/proxy-options.d.ts @@ -0,0 +1,8 @@ +export class ProxyOptions { + certificateCheck?: Function + credentials?: Function + payload?: any + type?: number + url?: string + version?: number +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 31f9ee0497..635c40ac91 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -79,6 +79,7 @@ "open-ssl.d.ts", "pack-builder.d.ts", "path-spec.d.ts", + "proxy-options.d.ts", "push-options.d.ts", "push-update.d.ts", "push.d.ts", From 21a5f52f750a3034f1a6ff00d98c7979d61fc4f0 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:33:54 +0100 Subject: [PATCH 80/91] Added documentation --- types/nodegit/diff-delta.d.ts | 36 ++++ types/nodegit/hash-sig.d.ts | 35 ++++ types/nodegit/index-entry.d.ts | 84 ++++++++ types/nodegit/index_.d.ts | 279 ++++++++++++++++++++++++++ types/nodegit/indexer.d.ts | 21 ++ types/nodegit/lib-git2.d.ts | 43 ++++ types/nodegit/merge-file-input.d.ts | 30 +++ types/nodegit/merge-file-options.d.ts | 48 ++++- types/nodegit/merge-file-result.d.ts | 30 +++ types/nodegit/merge-options.d.ts | 64 +++++- types/nodegit/merge.d.ts | 79 ++++++++ types/nodegit/note.d.ts | 106 ++++++++++ types/nodegit/object.d.ts | 117 +++++++++++ types/nodegit/odb-object.d.ts | 41 ++++ types/nodegit/odb.d.ts | 3 +- types/nodegit/proxy-options.d.ts | 36 ++++ 16 files changed, 1038 insertions(+), 14 deletions(-) diff --git a/types/nodegit/diff-delta.d.ts b/types/nodegit/diff-delta.d.ts index c21d98f430..b09226c064 100644 --- a/types/nodegit/diff-delta.d.ts +++ b/types/nodegit/diff-delta.d.ts @@ -1,10 +1,46 @@ import { DiffFile } from './diff-file'; export class DiffDelta { + /** + * + * + * @type {number} + * @memberof DiffDelta + */ status: number; + /** + * + * + * @type {number} + * @memberof DiffDelta + */ flags: number; + /** + * + * + * @type {number} + * @memberof DiffDelta + */ similarity: number; + /** + * + * + * @type {number} + * @memberof DiffDelta + */ nfiles: number; + /** + * + * + * @type {DiffFile} + * @memberof DiffDelta + */ oldFile: DiffFile; + /** + * + * + * @type {DiffFile} + * @memberof DiffDelta + */ newFile: DiffFile; } diff --git a/types/nodegit/hash-sig.d.ts b/types/nodegit/hash-sig.d.ts index 5e9897450f..86bfe5d64f 100644 --- a/types/nodegit/hash-sig.d.ts +++ b/types/nodegit/hash-sig.d.ts @@ -8,9 +8,44 @@ export namespace Hashsig { } export class Hashsig { + /** + * + * + * @static + * @param {string} buf + * @param {number} buflen + * @param {number} opts + * @returns {Promise} + * + * @memberof Hashsig + */ static create(buf: string, buflen: number, opts: number): Promise; + /** + * + * + * @static + * @param {string} path + * @param {number} opts + * @returns {Promise} + * + * @memberof Hashsig + */ static createFromFile(path: string, opts: number): Promise; + /** + * + * + * @param {Hashsig} b + * @returns {number} + * + * @memberof Hashsig + */ compare(b: Hashsig): number; + /** + * + * + * + * @memberof Hashsig + */ free(): void; } diff --git a/types/nodegit/index-entry.d.ts b/types/nodegit/index-entry.d.ts index b121b7a826..df42f9cbce 100644 --- a/types/nodegit/index-entry.d.ts +++ b/types/nodegit/index-entry.d.ts @@ -1,21 +1,105 @@ import { Oid } from './oid'; export interface IndexTime { + /** + * + * + * @type {number} + * @memberof IndexTime + */ seconds: number; + /** + * + * + * @type {number} + * @memberof IndexTime + */ nanoseconds: number; } export class IndexEntry { + /** + * + * + * @type {IndexTime} + * @memberof IndexEntry + */ ctime: IndexTime; + /** + * + * + * @type {IndexTime} + * @memberof IndexEntry + */ mtime: IndexTime; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ dev: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ ino: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ mode: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ uid: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ gid: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ fileSize: number; + /** + * + * + * @type {Oid} + * @memberof IndexEntry + */ id: Oid; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ flags: number; + /** + * + * + * @type {number} + * @memberof IndexEntry + */ flagsExtended: number; + /** + * + * + * @type {string} + * @memberof IndexEntry + */ path: string; } diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index 6fd80f5047..a805a19c97 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -21,36 +21,315 @@ export namespace Index { } export class Index { + /** + * + * + * @static + * @param {IndexEntry} entry + * @returns {number} + * + * @memberof Index + */ static entryIsConflict(entry: IndexEntry): number; + /** + * + * + * @static + * @param {IndexEntry} entry + * @returns {number} + * + * @memberof Index + */ static entryStage(entry: IndexEntry): number; + /** + * + * + * @static + * @param {string} index_path + * @returns {Promise} + * + * @memberof Index + */ static open(index_path: string): Promise; + /** + * + * + * @param {IndexEntry} source_entry + * @returns {number} + * + * @memberof Index + */ add(source_entry: IndexEntry): number; + /** + * + * + * @param {Strarray} pathspec + * @param {number} flags + * @param {Function} callback + * @param {void} payload + * @returns {Promise} + * + * @memberof Index + */ addAll(pathspec: Strarray, flags: number, callback: Function, payload: void): Promise; + /** + * + * + * @param {string} path + * @returns {number} + * + * @memberof Index + */ addByPath(path: string): number; + /** + * + * + * @returns {number} + * + * @memberof Index + */ caps(): number; + /** + * + * + * @returns {Oid} + * + * @memberof Index + */ checksum(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Index + */ clear(): number; + /** + * + * + * @param {IndexEntry} ancestor_entry + * @param {IndexEntry} our_entry + * @param {IndexEntry} their_entry + * @returns {number} + * + * @memberof Index + */ conflictAdd(ancestor_entry: IndexEntry, our_entry: IndexEntry, their_entry: IndexEntry): number; + /** + * + * + * @returns {number} + * + * @memberof Index + */ conflictCleanup(): number; + /** + * + * + * @param {string} path + * @returns {Promise} + * + * @memberof Index + */ conflictGet(path: string): Promise; + /** + * + * + * @param {string} path + * @returns {number} + * + * @memberof Index + */ conflictRemove(path: string): number; + /** + * + * + * @returns {number} + * + * @memberof Index + */ entryCount(): number; + /** + * + * + * @param {number} n + * @returns {IndexEntry} + * + * @memberof Index + */ getByIndex(n: number): IndexEntry; + /** + * + * + * @param {string} path + * @param {number} stage + * @returns {IndexEntry} + * + * @memberof Index + */ getByPath(path: string, stage: number): IndexEntry; + /** + * + * + * @returns {number} + * + * @memberof Index + */ hasConflicts(): number; + /** + * + * + * @returns {Repository} + * + * @memberof Index + */ owner(): Repository; + /** + * + * + * @returns {string} + * + * @memberof Index + */ path(): string; + /** + * + * + * @param {number} force + * @returns {number} + * + * @memberof Index + */ read(force: number): number; + /** + * + * + * @param {Tree} tree + * @returns {number} + * + * @memberof Index + */ readTree(tree: Tree): number; + /** + * + * + * @param {string} path + * @param {number} stage + * @returns {number} + * + * @memberof Index + */ remove(path: string, stage: number): number; + /** + * + * + * @param {Strarray} pathspec + * @param {Function} callback + * @param {void} payload + * @returns {Promise} + * + * @memberof Index + */ removeAll(pathspec: Strarray, callback: Function, payload: void): Promise; + /** + * + * + * @param {string} path + * @returns {number} + * + * @memberof Index + */ removeByPath(path: string): number; + /** + * + * + * @param {string} dir + * @param {number} stage + * @returns {number} + * + * @memberof Index + */ removeDirectory(dir: string, stage: number): number; + /** + * + * + * @param {number} caps + * @returns {number} + * + * @memberof Index + */ setCaps(caps: number): number; + /** + * + * + * @param {Strarray} pathspec + * @param {Function} callback + * @param {void} payload + * @returns {Promise} + * + * @memberof Index + */ updateAll(pathspec: Strarray, callback: Function, payload: void): Promise; + /** + * + * + * @returns {number} + * + * @memberof Index + */ write(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Index + */ writeTree(): Promise; + /** + * + * + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Index + */ writeTreeTo(repo: Repository): Promise; + /** + * + * + * @returns {IndexEntry[]} + * + * @memberof Index + */ entries(): IndexEntry[]; + /** + * + * + * @param {number} at_pos + * @param {string} prefix + * @returns {number} + * + * @memberof Index + */ + findPrefix(at_pos: number, prefix: string): number; + /** + * + * + * @param {number} version + * @returns {number} + * + * @memberof Index + */ + setVersion(version: number): number; + /** + * + * + * @returns {number} + * + * @memberof Index + */ + version(): number; } diff --git a/types/nodegit/indexer.d.ts b/types/nodegit/indexer.d.ts index ee3ba9bc69..e776c0f508 100644 --- a/types/nodegit/indexer.d.ts +++ b/types/nodegit/indexer.d.ts @@ -2,7 +2,28 @@ import { TransferProgress } from './transfer-progress'; import { Oid } from './oid'; export class Indexer { + /** + * + * + * @param {TransferProgress} stats + * @returns {number} + * + * @memberof Indexer + */ commit(stats: TransferProgress): number; + /** + * + * + * + * @memberof Indexer + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Indexer + */ hash(): Oid; } diff --git a/types/nodegit/lib-git2.d.ts b/types/nodegit/lib-git2.d.ts index be5a5d1856..10ad4f864a 100644 --- a/types/nodegit/lib-git2.d.ts +++ b/types/nodegit/lib-git2.d.ts @@ -17,9 +17,52 @@ export namespace Libgit2 { } export class Libgit2 { + /** + * + * + * @static + * @returns {number} + * + * @memberof Libgit2 + */ static features(): number; + /** + * + * + * @static + * @returns {number} + * + * @memberof Libgit2 + */ static init(): number; + /** + * + * + * @static + * @param {number} option + * @returns {number} + * + * @memberof Libgit2 + */ static opts(option: number): number; + /** + * + * + * @static + * @returns {number} + * + * @memberof Libgit2 + */ static shutdown(): number; + /** + * + * + * @static + * @param {number} major + * @param {number} minor + * @param {number} rev + * + * @memberof Libgit2 + */ static version(major: number, minor: number, rev: number): void; } diff --git a/types/nodegit/merge-file-input.d.ts b/types/nodegit/merge-file-input.d.ts index f49bd446ca..9401f8fd1d 100644 --- a/types/nodegit/merge-file-input.d.ts +++ b/types/nodegit/merge-file-input.d.ts @@ -1,7 +1,37 @@ export interface MergeFileInput { + /** + * + * + * @type {number} + * @memberof MergeFileInput + */ version: number; + /** + * + * + * @type {string} + * @memberof MergeFileInput + */ ptr: string; + /** + * + * + * @type {number} + * @memberof MergeFileInput + */ size: number; + /** + * + * + * @type {string} + * @memberof MergeFileInput + */ path: string; + /** + * + * + * @type {number} + * @memberof MergeFileInput + */ mode: number; } diff --git a/types/nodegit/merge-file-options.d.ts b/types/nodegit/merge-file-options.d.ts index 5d8233bcd6..6212c6275e 100644 --- a/types/nodegit/merge-file-options.d.ts +++ b/types/nodegit/merge-file-options.d.ts @@ -1,8 +1,44 @@ export interface MergeFileOptions { - version: number; - ancestorLabel: string; - ourLabel: string; - theirLabel: string; - favor: number; - flags: number; + /** + * + * + * @type {number} + * @memberof MergeFileOptions + */ + version?: number; + /** + * + * + * @type {string} + * @memberof MergeFileOptions + */ + ancestorLabel?: string; + /** + * + * + * @type {string} + * @memberof MergeFileOptions + */ + ourLabel?: string; + /** + * + * + * @type {string} + * @memberof MergeFileOptions + */ + theirLabel?: string; + /** + * + * + * @type {number} + * @memberof MergeFileOptions + */ + favor?: number; + /** + * + * + * @type {number} + * @memberof MergeFileOptions + */ + flags?: number; } diff --git a/types/nodegit/merge-file-result.d.ts b/types/nodegit/merge-file-result.d.ts index e6f2efcc3b..da2410da01 100644 --- a/types/nodegit/merge-file-result.d.ts +++ b/types/nodegit/merge-file-result.d.ts @@ -1,7 +1,37 @@ export class MergeFileResult { + /** + * + * + * @type {number} + * @memberof MergeFileResult + */ automergeable: number; + /** + * + * + * @type {string} + * @memberof MergeFileResult + */ path: string; + /** + * + * + * @type {number} + * @memberof MergeFileResult + */ mode: number; + /** + * + * + * @type {string} + * @memberof MergeFileResult + */ ptr: string; + /** + * + * + * @type {number} + * @memberof MergeFileResult + */ len: number; } diff --git a/types/nodegit/merge-options.d.ts b/types/nodegit/merge-options.d.ts index a4108c767d..31445857dd 100644 --- a/types/nodegit/merge-options.d.ts +++ b/types/nodegit/merge-options.d.ts @@ -1,8 +1,58 @@ -export interface MergeOptions { - version: number; - treeFlags: number; - renameThreshold: number; - targetLimit: number; - fileFavor: number; - fileFlags: number; +export class MergeOptions { + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + version?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + renameThreshold?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + targetLimit?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + fileFavor?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + fileFlags?: number; + /** + * + * + * @type {string} + * @memberof MergeOptions + */ + defaultDriver?: string; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + flags?: number; + /** + * + * + * @type {number} + * @memberof MergeOptions + */ + recursionLimit?: number; } diff --git a/types/nodegit/merge.d.ts b/types/nodegit/merge.d.ts index 737d3c5a04..5603d2b66e 100644 --- a/types/nodegit/merge.d.ts +++ b/types/nodegit/merge.d.ts @@ -49,11 +49,90 @@ export namespace Merge { } export class Merge { + /** + * + * + * @static + * @param {Repository} repo + * @param {AnnotatedCommit} theirHead + * @param {MergeOptions} [mergeOpts] + * @param {CheckoutOptions} [checkoutOpts] + * @returns {*} + * + * @memberof Merge + */ static merge(repo: Repository, theirHead: AnnotatedCommit, mergeOpts?: MergeOptions, checkoutOpts?: CheckoutOptions): any; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} one + * @param {Oid} two + * @returns {Promise} + * + * @memberof Merge + */ static base(repo: Repository, one: Oid, two: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} one + * @param {Oid} two + * @returns {Promise} + * + * @memberof Merge + */ static bases(repo: Repository, one: Oid, two: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Commit} ourCommit + * @param {Commit} theirCommit + * @param {MergeOptions} [options] + * @returns {*} + * + * @memberof Merge + */ static commits(repo: Repository, ourCommit: Commit, theirCommit: Commit, options?: MergeOptions): any; + /** + * + * + * @static + * @param {MergeFileInput} opts + * @param {number} version + * @returns {number} + * + * @memberof Merge + */ static fileInitInput(opts: MergeFileInput, version: number): number; + /** + * + * + * @static + * @param {MergeOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Merge + */ static initOptions(opts: MergeOptions, version: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} ancestor_tree + * @param {Tree} our_tree + * @param {Tree} their_tree + * @param {MergeOptions} opts + * @returns {Promise} + * + * @memberof Merge + */ static trees(repo: Repository, ancestor_tree: Tree, our_tree: Tree, their_tree: Tree, opts: MergeOptions): Promise; } diff --git a/types/nodegit/note.d.ts b/types/nodegit/note.d.ts index c5c9152bb2..1e9382b712 100644 --- a/types/nodegit/note.d.ts +++ b/types/nodegit/note.d.ts @@ -3,16 +3,122 @@ import {Signature} from './signature'; import {Oid} from './oid'; export class Note { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @param {Signature} author + * @param {Signature} committer + * @param {Oid} oid + * @param {string} note + * @param {number} force + * @returns {Promise} + * + * @memberof Note + */ static create(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @param {Function} note_cb + * @param {*} payload + * @returns {Promise} + * + * @memberof Note + */ static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: any): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @returns {Promise} + * + * @memberof Note + */ static iteratorNew(repo: Repository, notes_ref: string): Promise; + /** + * + * + * @static + * @param {Oid} note_id + * @param {Oid} annotated_id + * @param {*} it + * @returns {number} + * + * @memberof Note + */ static next(note_id: Oid, annotated_id: Oid, it: any): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @param {Oid} oid + * @returns {Promise} + * + * @memberof Note + */ static read(repo: Repository, notes_ref: string, oid: Oid): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} notes_ref + * @param {Signature} author + * @param {Signature} committer + * @param {Oid} oid + * @returns {Promise} + * + * @memberof Note + */ static remove(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid): Promise; + /** + * + * + * @returns {Signature} + * + * @memberof Note + */ author(): Signature; + /** + * + * + * @returns {Signature} + * + * @memberof Note + */ committer(): Signature; + /** + * + * + * + * @memberof Note + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Note + */ id(): Oid; + /** + * + * + * @returns {string} + * + * @memberof Note + */ message(): string; } diff --git a/types/nodegit/object.d.ts b/types/nodegit/object.d.ts index 8fabe5fdd2..8030943e0d 100644 --- a/types/nodegit/object.d.ts +++ b/types/nodegit/object.d.ts @@ -3,19 +3,136 @@ import { Repository } from './repository'; import { Buf } from './buf'; export class Object { + /** + * + * + * @static + * @param {number} type + * @returns {number} + * + * @memberof Object + */ static size(type: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} type + * @returns {Promise} + * + * @memberof Object + */ static lookup(repo: Repository, id: Oid, type: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @param {number} type + * @returns {Promise} + * + * @memberof Object + */ static lookupPrefix(repo: Repository, id: Oid, len: number, type: number): Promise; + /** + * + * + * @static + * @param {string} str + * @returns {number} + * + * @memberof Object + */ static string2type(str: string): number; + /** + * + * + * @static + * @param {number} type + * @returns {string} + * + * @memberof Object + */ static type2string(type: number): string; + /** + * + * + * @static + * @param {number} type + * @returns {number} + * + * @memberof Object + */ static typeisloose(type: number): number; + /** + * + * + * @returns {Promise} + * + * @memberof Object + */ dup(): Promise; + /** + * + * + * + * @memberof Object + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Object + */ id(): Oid; + /** + * + * + * @param {string} path + * @param {number} type + * @returns {Promise} + * + * @memberof Object + */ lookupByPath(path: string, type: number): Promise; + /** + * + * + * @returns {Repository} + * + * @memberof Object + */ owner(): Repository; + /** + * + * + * @param {number} target_type + * @returns {Promise} + * + * @memberof Object + */ peel(target_type: number): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Object + */ shortId(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Object + */ type(): number; } diff --git a/types/nodegit/odb-object.d.ts b/types/nodegit/odb-object.d.ts index 361e8c0718..8b76274b00 100644 --- a/types/nodegit/odb-object.d.ts +++ b/types/nodegit/odb-object.d.ts @@ -1,10 +1,51 @@ import { Oid } from './oid'; export class OdbObject { + /** + * + * + * @returns {Buffer} + * + * @memberof OdbObject + */ data(): Buffer; + /** + * + * + * @returns {Promise} + * + * @memberof OdbObject + */ dup(): Promise; + /** + * + * + * + * @memberof OdbObject + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof OdbObject + */ id(): Oid; + /** + * + * + * @returns {number} + * + * @memberof OdbObject + */ size(): number; + /** + * + * + * @returns {number} + * + * @memberof OdbObject + */ type(): number; } diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index c0cbfd8725..ebaca11b5d 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -10,10 +10,11 @@ export namespace Odb { } export class Odb { - static open(objects_dir: string): Promise; + static open(objectsDir: string): Promise; addDiskAlternate(path: string): number; free(): void; read(id: Oid): Promise; write(data: Buffer, len: number, type: number): Promise; + expandIds(ids, count: number): number; } diff --git a/types/nodegit/proxy-options.d.ts b/types/nodegit/proxy-options.d.ts index 7a4c8f4dd4..512d70c99a 100644 --- a/types/nodegit/proxy-options.d.ts +++ b/types/nodegit/proxy-options.d.ts @@ -1,8 +1,44 @@ export class ProxyOptions { + /** + * + * + * @type {Function} + * @memberof ProxyOptions + */ certificateCheck?: Function + /** + * + * + * @type {Function} + * @memberof ProxyOptions + */ credentials?: Function + /** + * + * + * @type {*} + * @memberof ProxyOptions + */ payload?: any + /** + * + * + * @type {number} + * @memberof ProxyOptions + */ type?: number + /** + * + * + * @type {string} + * @memberof ProxyOptions + */ url?: string + /** + * + * + * @type {number} + * @memberof ProxyOptions + */ version?: number } From 41256279f00c2eeae19da14eadfcf0192b72d1f5 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:37:03 +0100 Subject: [PATCH 81/91] Added OdbExpandId --- types/nodegit/index.d.ts | 1 + types/nodegit/odb-expand-id.d.ts | 7 +++++++ types/nodegit/odb.d.ts | 3 ++- types/nodegit/tsconfig.json | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 types/nodegit/odb-expand-id.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 4efd864946..6551907ea4 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -58,6 +58,7 @@ export { MergeOptions } from './merge-options'; export { Merge } from './merge'; export { Note } from './note'; export { Object } from './object'; +export { OdbExpandId } from './odb-expand-id'; export { OdbObject } from './odb-object'; export { Odb } from './odb'; export { Oidarray } from './oid-array'; diff --git a/types/nodegit/odb-expand-id.d.ts b/types/nodegit/odb-expand-id.d.ts new file mode 100644 index 0000000000..842c65774e --- /dev/null +++ b/types/nodegit/odb-expand-id.d.ts @@ -0,0 +1,7 @@ +import { Oid } from './oid'; + +export class OdbExpandId { + id: Oid + length: number + type: number +} diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index ebaca11b5d..efc4fcbe13 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -1,5 +1,6 @@ import { Oid } from './oid'; import { OdbObject } from './odb-object'; +import { OdbExpandId } from './odb-expand-id'; export namespace Odb { const enum STREAM { @@ -16,5 +17,5 @@ export class Odb { free(): void; read(id: Oid): Promise; write(data: Buffer, len: number, type: number): Promise; - expandIds(ids, count: number): number; + expandIds(ids: OdbExpandId, count: number): number; } diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 635c40ac91..829e49aedd 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -72,6 +72,7 @@ "nodegit-tests.ts", "note.d.ts", "object.d.ts", + "odb-expand-id.d.ts", "odb-object.d.ts", "odb.d.ts", "oid-array.d.ts", From 93a3dc1f476028e223920a32917c5a820e3feeae Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 01:41:43 +0100 Subject: [PATCH 82/91] Documentation and made Option values optional --- types/nodegit/blame-options.d.ts | 14 ++--- types/nodegit/cherry-pick-options.d.ts | 8 +-- types/nodegit/describe-format-options.d.ts | 8 +-- types/nodegit/describe-options.d.ts | 12 ++-- types/nodegit/odb.d.ts | 50 +++++++++++++++++ types/nodegit/oid-array.d.ts | 18 ++++++ types/nodegit/oid.d.ts | 62 +++++++++++++++++++++ types/nodegit/open-ssl.d.ts | 8 +++ types/nodegit/push-options.d.ts | 6 +- types/nodegit/status-options.d.ts | 8 +-- types/nodegit/submodule-update-options.d.ts | 8 +-- 11 files changed, 170 insertions(+), 32 deletions(-) diff --git a/types/nodegit/blame-options.d.ts b/types/nodegit/blame-options.d.ts index eac4c2f4f0..fdebbeff67 100644 --- a/types/nodegit/blame-options.d.ts +++ b/types/nodegit/blame-options.d.ts @@ -7,47 +7,47 @@ export class BlameOptions { * @type {number} * @memberof BlameOptions */ - version: number; + version?: number; /** * * * @type {number} * @memberof BlameOptions */ - flags: number; + flags?: number; /** * * * @type {number} * @memberof BlameOptions */ - minMatchCharacters: number; + minMatchCharacters?: number; /** * * * @type {Oid} * @memberof BlameOptions */ - newestCommit: Oid; + newestCommit?: Oid; /** * * * @type {Oid} * @memberof BlameOptions */ - oldestCommit: Oid; + oldestCommit?: Oid; /** * * * @type {number} * @memberof BlameOptions */ - minLine: number; + minLine?: number; /** * * * @type {number} * @memberof BlameOptions */ - maxLine: number; + maxLine?: number; } diff --git a/types/nodegit/cherry-pick-options.d.ts b/types/nodegit/cherry-pick-options.d.ts index 8743217b47..5e91da0c55 100644 --- a/types/nodegit/cherry-pick-options.d.ts +++ b/types/nodegit/cherry-pick-options.d.ts @@ -8,26 +8,26 @@ export interface CherrypickOptions { * @type {number} * @memberof CherrypickOptions */ - version: number; + version?: number; /** * * * @type {number} * @memberof CherrypickOptions */ - mainline: number; + mainline?: number; /** * * * @type {MergeOptions} * @memberof CherrypickOptions */ - mergeOpts: MergeOptions; + mergeOpts?: MergeOptions; /** * * * @type {CheckoutOptions} * @memberof CherrypickOptions */ - checkoutOpts: CheckoutOptions; + checkoutOpts?: CheckoutOptions; } diff --git a/types/nodegit/describe-format-options.d.ts b/types/nodegit/describe-format-options.d.ts index 4a67cd9082..3f1989f0dd 100644 --- a/types/nodegit/describe-format-options.d.ts +++ b/types/nodegit/describe-format-options.d.ts @@ -5,26 +5,26 @@ export class DescribeFormatOptions { * @type {number} * @memberof DescribeFormatOptions */ - version: number; + version?: number; /** * * * @type {number} * @memberof DescribeFormatOptions */ - abbreviatedSize: number; + abbreviatedSize?: number; /** * * * @type {number} * @memberof DescribeFormatOptions */ - alwaysUseLongFormat: number; + alwaysUseLongFormat?: number; /** * * * @type {string} * @memberof DescribeFormatOptions */ - dirtySuffix: string; + dirtySuffix?: string; } diff --git a/types/nodegit/describe-options.d.ts b/types/nodegit/describe-options.d.ts index f860bb88e9..1a7518cd76 100644 --- a/types/nodegit/describe-options.d.ts +++ b/types/nodegit/describe-options.d.ts @@ -5,40 +5,40 @@ export class DescribeOptions { * @type {number} * @memberof DescribeOptions */ - version: number; + version?: number; /** * * * @type {number} * @memberof DescribeOptions */ - maxCandidatesTags: number; + maxCandidatesTags?: number; /** * * * @type {number} * @memberof DescribeOptions */ - describeStrategy: number; + describeStrategy?: number; /** * * * @type {string} * @memberof DescribeOptions */ - pattern: string; + pattern?: string; /** * * * @type {number} * @memberof DescribeOptions */ - onlyFollowFirstParent: number; + onlyFollowFirstParent?: number; /** * * * @type {number} * @memberof DescribeOptions */ - showCommitOidAsFallback: number; + showCommitOidAsFallback?: number; } diff --git a/types/nodegit/odb.d.ts b/types/nodegit/odb.d.ts index efc4fcbe13..549bba872e 100644 --- a/types/nodegit/odb.d.ts +++ b/types/nodegit/odb.d.ts @@ -11,11 +11,61 @@ export namespace Odb { } export class Odb { + /** + * + * + * @static + * @param {string} objectsDir + * @returns {Promise} + * + * @memberof Odb + */ static open(objectsDir: string): Promise; + /** + * + * + * @param {string} path + * @returns {number} + * + * @memberof Odb + */ addDiskAlternate(path: string): number; + /** + * + * + * + * @memberof Odb + */ free(): void; + /** + * + * + * @param {Oid} id + * @returns {Promise} + * + * @memberof Odb + */ read(id: Oid): Promise; + /** + * + * + * @param {Buffer} data + * @param {number} len + * @param {number} type + * @returns {Promise} + * + * @memberof Odb + */ write(data: Buffer, len: number, type: number): Promise; + /** + * + * + * @param {OdbExpandId} ids + * @param {number} count + * @returns {number} + * + * @memberof Odb + */ expandIds(ids: OdbExpandId, count: number): number; } diff --git a/types/nodegit/oid-array.d.ts b/types/nodegit/oid-array.d.ts index 7a96f24a7a..0b95d31a5d 100644 --- a/types/nodegit/oid-array.d.ts +++ b/types/nodegit/oid-array.d.ts @@ -1,7 +1,25 @@ import { Oid } from './oid'; export class Oidarray { + /** + * + * + * + * @memberof Oidarray + */ free(): void; + /** + * + * + * @type {Oid} + * @memberof Oidarray + */ ids: Oid; + /** + * + * + * @type {number} + * @memberof Oidarray + */ count: number; } diff --git a/types/nodegit/oid.d.ts b/types/nodegit/oid.d.ts index 2aa65905f6..412a931f00 100644 --- a/types/nodegit/oid.d.ts +++ b/types/nodegit/oid.d.ts @@ -1,11 +1,73 @@ export class Oid { static fromString(str: string): Oid; + /** + * + * + * @param {Oid} b + * @returns {number} + * + * @memberof Oid + */ cmp(b: Oid): number; + /** + * + * + * @returns {Oid} + * + * @memberof Oid + */ cpy(): Oid; + /** + * + * + * @param {Oid} b + * @returns {number} + * + * @memberof Oid + */ equal(b: Oid): number; + /** + * + * + * @returns {number} + * + * @memberof Oid + */ iszero(): number; + /** + * + * + * @param {Oid} b + * @param {number} len + * @returns {number} + * + * @memberof Oid + */ ncmp(b: Oid, len: number): number; + /** + * + * + * @param {string} str + * @returns {number} + * + * @memberof Oid + */ strcmp(str: string): number; + /** + * + * + * @param {string} str + * @returns {number} + * + * @memberof Oid + */ streq(str: string): number; + /** + * + * + * @returns {string} + * + * @memberof Oid + */ tostrS(): string; } diff --git a/types/nodegit/open-ssl.d.ts b/types/nodegit/open-ssl.d.ts index f8370260d5..4b604a6f43 100644 --- a/types/nodegit/open-ssl.d.ts +++ b/types/nodegit/open-ssl.d.ts @@ -1,3 +1,11 @@ export class Openssl { + /** + * + * + * @static + * @returns {number} + * + * @memberof Openssl + */ static setLocking(): number; } diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index 5187548b8f..693a310ed0 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -1,7 +1,7 @@ import { RemoteCallbacks } from './remote-callbacks'; export interface PushOptions { - version: number; - pbParallelism: number; - callbacks: RemoteCallbacks; + version?: number; + pbParallelism?: number; + callbacks?: RemoteCallbacks; } diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts index c4296a5b92..9f75bbe96d 100644 --- a/types/nodegit/status-options.d.ts +++ b/types/nodegit/status-options.d.ts @@ -1,8 +1,8 @@ import { Strarray } from './str-array'; export interface StatusOptions { - version: number; - show: number; - flags: number; - pathspec: Strarray; + version?: number; + show?: number; + flags?: number; + pathspec?: Strarray; } diff --git a/types/nodegit/submodule-update-options.d.ts b/types/nodegit/submodule-update-options.d.ts index 35bbd6b3f8..d96320204b 100644 --- a/types/nodegit/submodule-update-options.d.ts +++ b/types/nodegit/submodule-update-options.d.ts @@ -2,8 +2,8 @@ import { CheckoutOptions } from './checkout-options'; import { FetchOptions } from './fetch-options'; export interface SubmoduleUpdateOptions { - version: number; - checkoutOpts: CheckoutOptions; - fetchOpts: FetchOptions; - cloneCheckoutStrategy: number; + version?: number; + checkoutOpts?: CheckoutOptions; + fetchOpts?: FetchOptions; + cloneCheckoutStrategy?: number; } From 3fe8ca1a01fedceb616e8e2a29678eb6b1cec913 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 02:11:48 +0100 Subject: [PATCH 83/91] Added more documentation --- types/nodegit/pack-builder.d.ts | 86 ++++ types/nodegit/path-spec.d.ts | 108 +++++ types/nodegit/push-options.d.ts | 34 ++ types/nodegit/push-update.d.ts | 24 ++ types/nodegit/push.d.ts | 10 + types/nodegit/rebase-operation.d.ts | 18 + types/nodegit/rebase.d.ts | 98 +++++ types/nodegit/ref-db.d.ts | 22 + types/nodegit/ref-log.d.ts | 110 ++++- types/nodegit/ref-spec.d.ts | 44 ++ types/nodegit/reference.d.ts | 330 +++++++++++++- types/nodegit/remote-callbacks.d.ts | 36 ++ types/nodegit/remote.d.ts | 325 ++++++++++++++ types/nodegit/repository.d.ts | 647 +++++++++++++++++++++++++++- 14 files changed, 1873 insertions(+), 19 deletions(-) diff --git a/types/nodegit/pack-builder.d.ts b/types/nodegit/pack-builder.d.ts index ed0fa0a2cc..e528ccbf38 100644 --- a/types/nodegit/pack-builder.d.ts +++ b/types/nodegit/pack-builder.d.ts @@ -10,16 +10,102 @@ export namespace Packbuilder { } export class Packbuilder { + /** + * + * + * @static + * @param {Repository} repo + * @returns {Packbuilder} + * + * @memberof Packbuilder + */ static create(repo: Repository): Packbuilder; + /** + * + * + * + * @memberof Packbuilder + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Packbuilder + */ hash(): Oid; + /** + * + * + * @param {Oid} id + * @param {string} name + * @returns {number} + * + * @memberof Packbuilder + */ insert(id: Oid, name: string): number; + /** + * + * + * @param {Oid} id + * @returns {number} + * + * @memberof Packbuilder + */ insertCommit(id: Oid): number; + /** + * + * + * @param {Oid} id + * @param {string} name + * @returns {number} + * + * @memberof Packbuilder + */ insertRecur(id: Oid, name: string): number; + /** + * + * + * @param {Oid} id + * @returns {number} + * + * @memberof Packbuilder + */ insertTree(id: Oid): number; + /** + * + * + * @param {Revwalk} walk + * @returns {number} + * + * @memberof Packbuilder + */ insertWalk(walk: Revwalk): number; + /** + * + * + * @returns {number} + * + * @memberof Packbuilder + */ objectCount(): number; + /** + * + * + * @param {number} n + * @returns {number} + * + * @memberof Packbuilder + */ setThreads(n: number): number; + /** + * + * + * @returns {number} + * + * @memberof Packbuilder + */ written(): number; } diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts index 99435d5e0d..0581523300 100644 --- a/types/nodegit/path-spec.d.ts +++ b/types/nodegit/path-spec.d.ts @@ -18,17 +18,125 @@ export namespace Pathspec { } export class Pathspec { + /** + * + * + * @static + * @param {*} m + * @param {number} pos + * @returns {DiffDelta} + * + * @memberof Pathspec + */ static matchListDiffEntry(m: any, pos: number): DiffDelta; + /** + * + * + * @static + * @param {*} m + * @param {number} pos + * @returns {string} + * + * @memberof Pathspec + */ static matchListEntry(m: any, pos: number): string; + /** + * + * + * @static + * @param {*} m + * @returns {number} + * + * @memberof Pathspec + */ static matchListEntrycount(m: any): number; + /** + * + * + * @static + * @param {*} m + * @param {number} pos + * @returns {string} + * + * @memberof Pathspec + */ static matchListFailedEntry(m: any, pos: number): string; + /** + * + * + * @static + * @param {*} m + * @returns {number} + * + * @memberof Pathspec + */ static matchListFailedEntrycount(m: any): number; + /** + * + * + * @static + * @param {Strarray} pathspec + * @returns {Pathspec} + * + * @memberof Pathspec + */ static create(pathspec: Strarray): Pathspec; + /** + * + * + * + * @memberof Pathspec + */ free(): void; + /** + * + * + * @param {Diff} diff + * @param {number} flags + * @returns {Promise} + * + * @memberof Pathspec + */ matchDiff(diff: Diff, flags: number): Promise; + /** + * + * + * @param {Index} index + * @param {number} flags + * @returns {Promise} + * + * @memberof Pathspec + */ matchIndex(index: Index, flags: number): Promise; + /** + * + * + * @param {Tree} tree + * @param {number} flags + * @returns {Promise} + * + * @memberof Pathspec + */ matchTree(tree: Tree, flags: number): Promise; + /** + * + * + * @param {Repository} repo + * @param {number} flags + * @returns {Promise} + * + * @memberof Pathspec + */ matchWorkdir(repo: Repository, flags: number): Promise; + /** + * + * + * @param {number} flags + * @param {string} path + * @returns {number} + * + * @memberof Pathspec + */ matchesPath(flags: number, path: string): number; } diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index 693a310ed0..6cf501c84a 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -1,7 +1,41 @@ import { RemoteCallbacks } from './remote-callbacks'; +import { Strarray } from './str-array'; +import { ProxyOptions } from './proxy-options'; export interface PushOptions { + /** + * + * + * @type {number} + * @memberof PushOptions + */ version?: number; + /** + * + * + * @type {number} + * @memberof PushOptions + */ pbParallelism?: number; + /** + * + * + * @type {RemoteCallbacks} + * @memberof PushOptions + */ callbacks?: RemoteCallbacks; + /** + * + * + * @type {Strarray} + * @memberof PushOptions + */ + customHeaders: Strarray + /** + * + * + * @type {ProxyOptions} + * @memberof PushOptions + */ + proxyOpts: ProxyOptions } diff --git a/types/nodegit/push-update.d.ts b/types/nodegit/push-update.d.ts index 50f46726d5..cdd393d9ba 100644 --- a/types/nodegit/push-update.d.ts +++ b/types/nodegit/push-update.d.ts @@ -1,8 +1,32 @@ import { Oid } from './oid'; export class PushUpdate { + /** + * + * + * @type {string} + * @memberof PushUpdate + */ srcRefname: string; + /** + * + * + * @type {string} + * @memberof PushUpdate + */ dstRefname: string; + /** + * + * + * @type {Oid} + * @memberof PushUpdate + */ src: Oid; + /** + * + * + * @type {Oid} + * @memberof PushUpdate + */ dst: Oid; } diff --git a/types/nodegit/push.d.ts b/types/nodegit/push.d.ts index 26d8f07b60..4a4ce53dac 100644 --- a/types/nodegit/push.d.ts +++ b/types/nodegit/push.d.ts @@ -2,5 +2,15 @@ import { RemoteCallbacks } from './remote-callbacks'; import { PushOptions } from './push-options'; export class Push { + /** + * + * + * @static + * @param {PushOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Push + */ static initOptions(opts: PushOptions, version: number): number; } diff --git a/types/nodegit/rebase-operation.d.ts b/types/nodegit/rebase-operation.d.ts index 7144ebe6a9..e52542fb54 100644 --- a/types/nodegit/rebase-operation.d.ts +++ b/types/nodegit/rebase-operation.d.ts @@ -12,7 +12,25 @@ export namespace RebaseOperation { } export class RebaseOperation { + /** + * + * + * @type {number} + * @memberof RebaseOperation + */ type: number; + /** + * + * + * @type {Oid} + * @memberof RebaseOperation + */ id: Oid; + /** + * + * + * @type {string} + * @memberof RebaseOperation + */ exec: string; } diff --git a/types/nodegit/rebase.d.ts b/types/nodegit/rebase.d.ts index 15862ff17d..6e254545bc 100644 --- a/types/nodegit/rebase.d.ts +++ b/types/nodegit/rebase.d.ts @@ -4,6 +4,7 @@ import { Repository } from './repository'; import { Signature } from './signature'; import { Oid } from './oid'; import { RebaseOperation } from './rebase-operation'; +import { Index } from './index'; export interface RebaseOptions { version: number; @@ -13,15 +14,112 @@ export interface RebaseOptions { } export class Rebase { + /** + * + * + * @static + * @param {Repository} repo + * @param {AnnotatedCommit} branch + * @param {AnnotatedCommit} upstream + * @param {AnnotatedCommit} onto + * @param {RebaseOptions} opts + * @returns {Promise} + * + * @memberof Rebase + */ static init(repo: Repository, branch: AnnotatedCommit, upstream: AnnotatedCommit, onto: AnnotatedCommit, opts: RebaseOptions): Promise; + /** + * + * + * @static + * @param {RebaseOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Rebase + */ static initOptions(opts: RebaseOptions, version: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {RebaseOptions} opts + * @returns {Promise} + * + * @memberof Rebase + */ static open(repo: Repository, opts: RebaseOptions): Promise; + /** + * + * + * @returns {number} + * + * @memberof Rebase + */ abort(): number; + /** + * + * + * @param {Signature} author + * @param {Signature} committer + * @param {string} message_encoding + * @param {string} message + * @returns {Oid} + * + * @memberof Rebase + */ commit(author: Signature, committer: Signature, message_encoding: string, message: string): Oid; + /** + * + * + * @param {Signature} signature + * @returns {number} + * + * @memberof Rebase + */ finish(signature: Signature): number; + /** + * + * + * @param {Index} index + * @returns {number} + * + * @memberof Rebase + */ + inmemoryIndex(index: Index): number; + /** + * + * + * @returns {Promise} + * + * @memberof Rebase + */ next(): Promise; + /** + * + * + * @param {number} idx + * @returns {RebaseOperation} + * + * @memberof Rebase + */ operationByIndex(idx: number): RebaseOperation; + /** + * + * + * @returns {number} + * + * @memberof Rebase + */ operationCurrent(): number; + /** + * + * + * @returns {number} + * + * @memberof Rebase + */ operationEntrycount(): number; } diff --git a/types/nodegit/ref-db.d.ts b/types/nodegit/ref-db.d.ts index 8c9046d48d..de927eec58 100644 --- a/types/nodegit/ref-db.d.ts +++ b/types/nodegit/ref-db.d.ts @@ -1,8 +1,30 @@ import { Repository } from './repository'; export class Refdb { + /** + * + * + * @static + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Refdb + */ static open(repo: Repository): Promise; + /** + * + * + * @returns {number} + * + * @memberof Refdb + */ compress(): number; + /** + * + * + * + * @memberof Refdb + */ free(): void; } diff --git a/types/nodegit/ref-log.d.ts b/types/nodegit/ref-log.d.ts index 8557d02a39..dec49731eb 100644 --- a/types/nodegit/ref-log.d.ts +++ b/types/nodegit/ref-log.d.ts @@ -3,25 +3,127 @@ import { Oid } from './oid'; import { Signature } from './signature'; export class Reflog { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {number} + * + * @memberof Reflog + */ static delete(repo: Repository, name: string): number; - static entryCommitter(entry: ReflogEntry): Signature; - static entryIdNew(entry: ReflogEntry): Oid; - static entryIdOld(entry: ReflogEntry): Oid; - static entryMessage(entry: ReflogEntry): string; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {Promise} + * + * @memberof Reflog + */ static read(repo: Repository, name: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} old_name + * @param {string} name + * @returns {number} + * + * @memberof Reflog + */ static rename(repo: Repository, old_name: string, name: string): number; + /** + * + * + * @param {Oid} id + * @param {Signature} committer + * @param {string} msg + * @returns {number} + * + * @memberof Reflog + */ append(id: Oid, committer: Signature, msg: string): number; + /** + * + * + * @param {number} idx + * @param {number} rewrite_previous_entry + * @returns {number} + * + * @memberof Reflog + */ drop(idx: number, rewrite_previous_entry: number): number; + /** + * + * + * @param {number} idx + * @returns {ReflogEntry} + * + * @memberof Reflog + */ entryByIndex(idx: number): ReflogEntry; + /** + * + * + * @returns {number} + * + * @memberof Reflog + */ entrycount(): number; + /** + * + * + * + * @memberof Reflog + */ free(): void; + /** + * + * + * @returns {number} + * + * @memberof Reflog + */ write(): number; } export class ReflogEntry { + /** + * + * + * @returns {Signature} + * + * @memberof ReflogEntry + */ committer(): Signature; + /** + * + * + * @returns {Oid} + * + * @memberof ReflogEntry + */ idNew(): Oid; + /** + * + * + * @returns {Oid} + * + * @memberof ReflogEntry + */ idOld(): Oid; + /** + * + * + * @returns {string} + * + * @memberof ReflogEntry + */ message(): string; } diff --git a/types/nodegit/ref-spec.d.ts b/types/nodegit/ref-spec.d.ts index bf40f21ac2..e48c8cd2ac 100644 --- a/types/nodegit/ref-spec.d.ts +++ b/types/nodegit/ref-spec.d.ts @@ -1,8 +1,52 @@ export class Refspec { + /** + * + * + * @returns {number} + * + * @memberof Refspec + */ direction(): number; + /** + * + * + * @returns {string} + * + * @memberof Refspec + */ dst(): string; + /** + * + * + * @param {string} refname + * @returns {number} + * + * @memberof Refspec + */ dstMatches(refname: string): number; + /** + * + * + * @returns {number} + * + * @memberof Refspec + */ force(): number; + /** + * + * + * @returns {string} + * + * @memberof Refspec + */ src(): string; + /** + * + * + * @param {string} refname + * @returns {number} + * + * @memberof Refspec + */ srcMatches(refname: string): number; } diff --git a/types/nodegit/reference.d.ts b/types/nodegit/reference.d.ts index 4edd34d2da..cb449ee225 100644 --- a/types/nodegit/reference.d.ts +++ b/types/nodegit/reference.d.ts @@ -19,41 +19,365 @@ export namespace Reference { } export class Reference { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {Oid} id + * @param {number} force + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ static create(repo: Repository, name: string, id: Oid, force: number, logMessage: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {Oid} id + * @param {number} force + * @param {Oid} currentId + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ static createMatching(repo: Repository, name: string, id: Oid, force: number, currentId: Oid, logMessage: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {(string | Reference)} id + * @param {Function} callback + * @returns {Promise} + * + * @memberof Reference + */ static dwim(repo: Repository, id: string | Reference, callback: Function): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} refname + * @returns {number} + * + * @memberof Reference + */ static ensureLog(repo: Repository, refname: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} refname + * @returns {number} + * + * @memberof Reference + */ static hasLog(repo: Repository, refname: string): number; + /** + * + * + * @static + * @param {string} refname + * @returns {number} + * + * @memberof Reference + */ static isValidName(refname: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Reference + */ static list(repo: Repository): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {(string | Reference)} id + * @param {Function} callback + * @returns {Promise} + * + * @memberof Reference + */ static lookup(repo: Repository, id: string | Reference, callback: Function): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {Promise} + * + * @memberof Reference + */ static nameToId(repo: Repository, name: string): Promise; + /** + * + * + * @static + * @param {string} bufferOut + * @param {number} bufferSize + * @param {string} name + * @param {number} flags + * @returns {number} + * + * @memberof Reference + */ static normalizeName(bufferOut: string, bufferSize: number, name: string, flags: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {number} + * + * @memberof Reference + */ static remove(repo: Repository, name: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} target + * @param {number} force + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ static symbolicCreate(repo: Repository, name: string, target: string, force: number, logMessage: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} target + * @param {number} force + * @param {string} currentValue + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ static symbolicCreateMatching(repo: Repository, name: string, target: string, force: number, currentValue: string, logMessage: string): Promise; + /** + * + * + * @param {Reference} ref2 + * @returns {number} + * + * @memberof Reference + */ cmp(ref2: Reference): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ delete(): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ isBranch(): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ isNote(): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ isRemote(): number; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ isTag(): number; + /** + * + * + * @returns {string} + * + * @memberof Reference + */ name(): string; + /** + * + * + * @returns {Repository} + * + * @memberof Reference + */ owner(): Repository; + /** + * + * + * @param {number} type + * @returns {Promise} + * + * @memberof Reference + */ peel(type: number): Promise; + /** + * + * + * @param {string} newName + * @param {number} force + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ rename(newName: string, force: number, logMessage: string): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Reference + */ resolve(): Promise; + /** + * + * + * @param {Oid} id + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ setTarget(id: Oid, logMessage: string): Promise; + /** + * + * + * @returns {string} + * + * @memberof Reference + */ shorthand(): string; + /** + * + * + * @param {string} target + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Reference + */ symbolicSetTarget(target: string, logMessage: string): Promise; + /** + * + * + * @returns {string} + * + * @memberof Reference + */ symbolicTarget(): string; + /** + * + * + * @returns {Oid} + * + * @memberof Reference + */ target(): Oid; + /** + * + * + * @returns {Oid} + * + * @memberof Reference + */ targetPeel(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Reference + */ type(): number; - isValid(): Boolean; - isConcrete(): Boolean; - isSymbolic(): Boolean; + /** + * + * + * @returns {boolean} + * + * @memberof Reference + */ + isValid(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof Reference + */ + isConcrete(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof Reference + */ + isSymbolic(): boolean; + /** + * + * + * @returns {string} + * + * @memberof Reference + */ toString(): string; + /** + * + * + * @returns {boolean} + * + * @memberof Reference + */ isHead(): boolean; + /** + * + * + * @returns {Promise} + * + * @memberof Reference + */ + dup(): Promise; } diff --git a/types/nodegit/remote-callbacks.d.ts b/types/nodegit/remote-callbacks.d.ts index ca244e5c5e..b3cf3d9054 100644 --- a/types/nodegit/remote-callbacks.d.ts +++ b/types/nodegit/remote-callbacks.d.ts @@ -1,8 +1,44 @@ export class RemoteCallbacks { + /** + * + * + * @type {number} + * @memberof RemoteCallbacks + */ version?: number; + /** + * + * + * @type {Function} + * @memberof RemoteCallbacks + */ credentials?: Function; + /** + * + * + * @type {Function} + * @memberof RemoteCallbacks + */ certificateCheck?: Function; + /** + * + * + * @type {Function} + * @memberof RemoteCallbacks + */ transferProgress?: Function; + /** + * + * + * @type {Function} + * @memberof RemoteCallbacks + */ transport?: Function; + /** + * + * + * @type {undefined} + * @memberof RemoteCallbacks + */ payload?: undefined; } diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index bba1f640fb..165df83036 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -24,42 +24,367 @@ export namespace Remote { } export class Remote { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {string} refspec + * @returns {number} + * + * @memberof Remote + */ static addFetch(repo: Repository, remote: string, refspec: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {string} refspec + * @returns {number} + * + * @memberof Remote + */ static addPush(repo: Repository, remote: string, refspec: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} url + * @returns {Remote} + * + * @memberof Remote + */ static create(repo: Repository, name: string, url: string): Remote; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} url + * @returns {Promise} + * + * @memberof Remote + */ static createAnonymous(repo: Repository, url: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} url + * @param {string} fetch + * @returns {Promise} + * + * @memberof Remote + */ static createWithFetchspec(repo: Repository, name: string, url: string, fetch: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {Promise} + * + * @memberof Remote + */ static delete(repo: Repository, name: string): Promise; + /** + * + * + * @static + * @param {RemoteCallbacks} opts + * @param {number} version + * @returns {number} + * + * @memberof Remote + */ static initCallbacks(opts: RemoteCallbacks, version: number): number; + /** + * + * + * @static + * @param {string} remote_name + * @returns {number} + * + * @memberof Remote + */ static isValidName(remote_name: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Remote + */ static list(repo: Repository): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {(string | Remote)} name + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ static lookup(repo: Repository, name: string | Remote, callback: Function): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {number} value + * @returns {number} + * + * @memberof Remote + */ static setAutotag(repo: Repository, remote: string, value: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {string} url + * @returns {number} + * + * @memberof Remote + */ static setPushurl(repo: Repository, remote: string, url: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} remote + * @param {string} url + * @returns {number} + * + * @memberof Remote + */ static setUrl(repo: Repository, remote: string, url: string): number; + /** + * + * + * @returns {number} + * + * @memberof Remote + */ autotag(): number; + /** + * + * + * @param {Enums.DIRECTION} direction + * @param {RemoteCallbacks} callbacks + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ connect(direction: Enums.DIRECTION, callbacks: RemoteCallbacks, callback: Function): Promise; + /** + * + * + * @returns {number} + * + * @memberof Remote + */ connected(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Remote + */ defaultBranch(): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Remote + */ disconnect(): Promise; + /** + * + * + * @param {any[]} refSpecs + * @param {FetchOptions} opts + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ download(refSpecs: any[], opts: FetchOptions, callback: Function): Promise; dup(): Promise; + /** + * + * + * @param {any[]} refSpecs + * @param {FetchOptions} opts + * @param {string} message + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ fetch(refSpecs: any[], opts: FetchOptions, message: string, callback: Function): Promise; + /** + * + * + * + * @memberof Remote + */ free(): void; + /** + * + * + * @returns {Promise} + * + * @memberof Remote + */ getFetchRefspecs(): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Remote + */ getPushRefspecs(): Promise; + /** + * + * + * @param {number} n + * @returns {Refspec} + * + * @memberof Remote + */ getRefspec(n: number): Refspec; + /** + * + * + * @returns {string} + * + * @memberof Remote + */ name(): string; + /** + * + * + * @returns {Repository} + * + * @memberof Remote + */ owner(): Repository; + /** + * + * + * @param {RemoteCallbacks} callbacks + * @returns {number} + * + * @memberof Remote + */ prune(callbacks: RemoteCallbacks): number; + /** + * + * + * @returns {number} + * + * @memberof Remote + */ pruneRefs(): number; + /** + * + * + * @param {any[]} refSpecs + * @param {PushOptions} options + * @param {Function} callback + * @returns {Promise} + * + * @memberof Remote + */ push(refSpecs: any[], options: PushOptions, callback: Function): Promise; + /** + * + * + * @returns {string} + * + * @memberof Remote + */ pushurl(): string; + /** + * + * + * @returns {number} + * + * @memberof Remote + */ refspecCount(): number; + /** + * + * + * @returns {TransferProgress} + * + * @memberof Remote + */ stats(): TransferProgress; + /** + * + * + * + * @memberof Remote + */ stop(): void; + /** + * + * + * @param {RemoteCallbacks} callbacks + * @param {number} update_fetchhead + * @param {number} download_tags + * @param {string} reflog_message + * @returns {number} + * + * @memberof Remote + */ updateTips(callbacks: RemoteCallbacks, update_fetchhead: number, download_tags: number, reflog_message: string): number; + /** + * + * + * @param {Strarray} refspecs + * @param {PushOptions} opts + * @returns {number} + * + * @memberof Remote + */ upload(refspecs: Strarray, opts: PushOptions): number; + /** + * + * + * @returns {string} + * + * @memberof Remote + */ url(): string; + /** + * Lists advertised references from a remote. You must connect to the remote before using referenceList. + * + * @returns {Promise} + * + * @memberof Remote + */ + referenceList(): Promise; } diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index acf5f5b83a..bf598d5a9f 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -17,6 +17,7 @@ import { Config } from './config'; import { Merge } from './merge'; import { MergeOptions } from './merge-options'; import { Refdb } from './ref-db'; +import {Revwalk} from './rev-walk'; export interface RepositoryInitOptions { description: string; @@ -84,80 +85,702 @@ export class Repository { * @memberof Repository */ static openBare(barePath: string): Promise; + /** + * + * + * @static + * @param {string} path + * @param {number} [flags] + * @param {string} [ceilingDirs] + * @returns {Promise} + * + * @memberof Repository + */ static openExt(path: string, flags?: number, ceilingDirs?: string): Promise; + /** + * + * + * @static + * @param {Odb} odb + * @returns {Promise} + * + * @memberof Repository + */ static wrapOdb(odb: Odb): Promise; + /** + * + * + * + * @memberof Repository + */ cleanup(): void; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ config(): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ configSnapshot(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ detachHead(): number; + /** + * + * + * @param {Function} callback + * @returns {Promise} + * + * @memberof Repository + */ fetchheadForeach(callback: Function): Promise; + /** + * + * + * + * @memberof Repository + */ free(): void; + /** + * + * + * @returns {string} + * + * @memberof Repository + */ getNamespace(): string; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ head(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ headDetached(): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ headUnborn(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ index(): Promise; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ isBare(): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ isEmpty(): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ isShallow(): number; + /** + * + * + * @param {Function} callback + * @returns {Promise} + * + * @memberof Repository + */ mergeheadForeach(callback: Function): Promise; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ messageRemove(): number; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ odb(): Promise; + /** + * + * + * @returns {string} + * + * @memberof Repository + */ path(): string; + /** + * + * + * @returns {Promise} + * + * @memberof Repository + */ refdb(): Promise; + /** + * + * + * @param {string} refname + * @returns {Promise} + * + * @memberof Repository + */ setHead(refname: string): Promise; + /** + * + * + * @param {Oid} commitish + * @returns {number} + * + * @memberof Repository + */ setHeadDetached(commitish: Oid): number; + /** + * + * + * @param {AnnotatedCommit} commitish + * @returns {number} + * + * @memberof Repository + */ setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): number; + /** + * + * + * @param {string} name + * @param {string} email + * @returns {number} + * + * @memberof Repository + */ setIdent(name: string, email: string): number; + /** + * + * + * @param {string} nmspace + * @returns {number} + * + * @memberof Repository + */ setNamespace(nmspace: string): number; + /** + * + * + * @param {string} workdir + * @param {number} update_gitlink + * @returns {number} + * + * @memberof Repository + */ setWorkdir(workdir: string, update_gitlink: number): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ state(): number; + /** + * + * + * @returns {number} + * + * @memberof Repository + */ stateCleanup(): number; + /** + * + * + * @returns {string} + * + * @memberof Repository + */ workdir(): string; + /** + * Creates a branch with the passed in name pointing to the commit + * + * @param {string} name + * @param {(Commit | string | Oid)} commit + * @param {boolean} force + * @param {Signature} signature + * @param {string} logMessage + * @returns {Promise} + * + * @memberof Repository + */ createBranch(name: string, commit: Commit | string | Oid, force: boolean, signature: Signature, logMessage: string): Promise; + /** + * Look up a refs's commit. + * + * @param {(string | Reference)} name + * @returns {Promise} + * + * @memberof Repository + */ getReferenceCommit(name: string | Reference): Promise; + /** + * Look up a branch. Alias for getReference + * + * @param {(string | Reference)} name + * @returns {Promise} + * + * @memberof Repository + */ getBranch(name: string | Reference): Promise; + /** + * Look up a branch's most recent commit. Alias to getReferenceCommit + * + * @param {(string | Reference)} name + * @returns {Promise} + * + * @memberof Repository + */ getBranchCommit(name: string | Reference): Promise; + /** + * Gets the branch that HEAD currently points to Is an alias to head() + * + * @returns {Promise} + * + * @memberof Repository + */ getCurrentBranch(): Promise; + /** + * Lookup the reference with the given name. + * + * @param {(string | Reference)} name + * @returns {Promise} + * + * @memberof Repository + */ getReference(name: string | Reference): Promise; + /** + * Lookup references for a repository. + * + * @param {Reference.TYPE} type + * @returns {Promise} + * + * @memberof Repository + */ getReferences(type: Reference.TYPE): Promise; + /** + * Lookup reference names for a repository. + * + * @param {Reference.TYPE} type + * @returns {Promise} + * + * @memberof Repository + */ getReferenceNames(type: Reference.TYPE): Promise; + /** + * + * + * @param {(string | Oid)} string + * @returns {Promise} + * + * @memberof Repository + */ getCommit(string: string | Oid): Promise; + /** + * Retrieve the blob represented by the oid. + * + * @param {(string | Oid)} string + * @returns {Promise} + * + * @memberof Repository + */ getBlob(string: string | Oid): Promise; + /** + * Retrieve the tree represented by the oid. + * + * @param {(string | Oid)} string + * @returns {Promise} + * + * @memberof Repository + */ getTree(string: string | Oid): Promise; + /** + * + * + * @param {(string | Oid)} string + * @param {string} name + * @param {string} message + * @returns {Promise} + * + * @memberof Repository + */ createTag(string: string | Oid, name: string, message: string): Promise; + /** + * Creates a new lightweight tag + * + * @param {(string | Oid)} string + * @param {string} name + * @returns {Promise} + * + * @memberof Repository + */ createLightweightTag(string: string | Oid, name: string): Promise; + /** + * Retrieve the tag represented by the oid. + * + * @param {(string | Oid)} string + * @returns {Promise} + * + * @memberof Repository + */ getTag(string: string | Oid): Promise; + /** + * Retrieve the tag represented by the tag name. + * + * @param {string} Short + * @returns {Promise} + * + * @memberof Repository + */ getTagByName(Short: string): Promise; + /** + * Deletes a tag from a repository by the tag name. + * + * @param {string} Short + * @returns {Promise} + * + * @memberof Repository + */ deleteTagByName(Short: string): Promise; - createRevWalk(string: string | Oid): any; + /** + * Instantiate a new revision walker for browsing the Repository"s history. See also Commit.prototype.history() + * + * @param {(string | Oid)} string + * @returns {Revwalk} + * + * @memberof Repository + */ + createRevWalk(string: string | Oid): Revwalk; + /** + * Retrieve the master branch commit. + * + * @returns {Promise} + * + * @memberof Repository + */ getMasterCommit(): Promise; + /** + * Retrieve the commit that HEAD is currently pointing to + * + * @returns {Promise} + * + * @memberof Repository + */ getHeadCommit(): Promise; + /** + * + * + * @param {string} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {string} message + * @param {(Tree | Oid | string)} Tree + * @param {any[]} parents + * @returns {Promise} + * + * @memberof Repository + */ createCommit(updateRef: string, author: Signature, committer: Signature, message: string, Tree: Tree | Oid | string, parents: any[]): Promise; + /** + * Creates a new commit on HEAD from the list of passed in files + * + * @param {any[]} filesToAdd + * @param {Signature} author + * @param {Signature} committer + * @param {string} message + * @returns {Promise} + * + * @memberof Repository + */ createCommitOnHead(filesToAdd: any[], author: Signature, committer: Signature, message: string): Promise; + /** + * Create a blob from a buffer + * + * @param {Buffer} buffer + * @returns {Oid} + * + * @memberof Repository + */ createBlobFromBuffer(buffer: Buffer): Oid; + /** + * + * + * @param {Tree} tree + * @returns {*} + * + * @memberof Repository + */ treeBuilder(tree: Tree): any; + /** + * Gets the default signature for the default user and now timestamp + * + * @returns {Signature} + * + * @memberof Repository + */ defaultSignature(): Signature; + /** + * Lists out the remotes in the given repository. + * + * @param {Function} Optional + * @returns {Promise} + * + * @memberof Repository + */ getRemotes(Optional: Function): Promise; + /** + * Gets a remote from the repo + * + * @param {(string | Remote)} remote + * @param {Function} callback + * @returns {Promise} + * + * @memberof Repository + */ getRemote(remote: string | Remote, callback: Function): Promise; - fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; - fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; + /** + * Fetches from a remote + * + * @param {(string | Remote)} remote + * @param {(Object | FetchOptions)} fetchOptions + * @returns {Promise} + * + * @memberof Repository + */ + fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise; + /** + * Fetches from all remotes. This is done in series due to deadlocking issues with fetching from many remotes that can happen. + * + * @param {(Object | FetchOptions)} fetchOptions + * @param {Function} callback + * @returns {Promise} + * + * @memberof Repository + */ + fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise; + /** + * + * + * @param {(string | Reference)} to + * @param {(string | Reference)} from + * @param {Signature} signature + * @param {Merge.PREFERENCE} mergePreference + * @param {MergeOptions} mergeOptions + * @returns {Promise} + * + * @memberof Repository + */ mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: Merge.PREFERENCE, mergeOptions: MergeOptions): Promise; + /** + * Rebases a branch onto another branch + * + * @param {string} branch + * @param {string} upstream + * @param {string} onto + * @param {Signature} signature + * @param {Function} beforeNextFn + * @returns {Promise} + * + * @memberof Repository + */ rebaseBranches(branch: string, upstream: string, onto: string, signature: Signature, beforeNextFn: Function): Promise; + /** + * + * + * @param {Signature} signature + * @param {Function} beforeNextFn + * @returns {Promise} + * + * @memberof Repository + */ continueRebase(signature: Signature, beforeNextFn: Function): Promise; + /** + * Get the status of a repo to it's working directory + * + * @param {*} opts + * @returns {Promise} + * + * @memberof Repository + */ getStatus(opts: any): Promise; + /** + * Get extended statuses of a repo to it's working directory. Status entries have status, headToIndex delta, and indexToWorkdir deltas + * + * @param {*} opts + * @returns {Promise} + * + * @memberof Repository + */ getStatusExt(opts: any): Promise; + /** + * Get the names of the submodules in the repository. + * + * @returns {Promise} + * + * @memberof Repository + */ getSubmoduleNames(): Promise; + /** + * 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 + * + * @param {Reference} reference + * @param {(Object | CheckoutOptions)} opts + * @returns {Promise} + * + * @memberof Repository + */ checkoutRef(reference: Reference, opts: Object | 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 + * + * @param {(string | Reference)} branch + * @param {(Object | CheckoutOptions)} opts + * @returns {Promise} + * + * @memberof Repository + */ checkoutBranch(branch: string | Reference, opts: Object | CheckoutOptions): Promise; - stageFilemode(filePath: string | any[], stageNew: Boolean): Promise; - stageLines(filePath: string, newLines: any[], isStaged: Boolean): Promise; - isDefaultState(): Boolean; - isApplyingMailbox(): Boolean; - isBisecting(): Boolean; - isCherrypicking(): Boolean; - isMerging(): Boolean; - isRebasing(): Boolean; - isReverting(): Boolean; + /** + * Stages or unstages line selection of a specified file + * + * @param {(string | any[])} filePath + * @param {boolean} stageNew + * @returns {Promise} + * + * @memberof Repository + */ + stageFilemode(filePath: string | any[], stageNew: boolean): Promise; + /** + * Stages or unstages line selection of a specified file + * + * @param {string} filePath + * @param {any[]} newLines + * @param {boolean} isStaged + * @returns {Promise} + * + * @memberof Repository + */ + stageLines(filePath: string, newLines: any[], isStaged: boolean): Promise; + /** + * Returns true if the repository is in the default NONE state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isDefaultState(): boolean; + /** + * Returns true if the repository is in the APPLY_MAILBOX or APPLY_MAILBOX_OR_REBASE state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isApplyingMailbox(): boolean; + /** + * Returns true if the repository is in the BISECT state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isBisecting(): boolean; + /** + * Returns true if the repository is in the CHERRYPICK state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isCherrypicking(): boolean; + /** + * Returns true if the repository is in the MERGE state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isMerging(): boolean; + /** + * Returns true if the repository is in the REBASE, REBASE_INTERACTIVE, or REBASE_MERGE state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isRebasing(): boolean; + /** + * Returns true if the repository is in the REVERT state. + * + * @returns {boolean} + * + * @memberof Repository + */ + isReverting(): boolean; + /** + * Discard line selection of a specified file. Assumes selected lines are unstaged. + * + * @param {string} filePath + * @param {any[]} selectedLines + * @returns {Promise} + * + * @memberof Repository + */ + discardLines(filePath: string, selectedLines: any[]): Promise; + /** + * Grabs a fresh copy of the index from the repository. Invalidates all previously grabbed indexes + * + * @returns {Promise} + * + * @memberof Repository + */ + refreshIndex(): Promise; } From 21c17befd38a6b37d8dd93a06f5a2887c81b087a Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 02:11:59 +0100 Subject: [PATCH 84/91] Changed Boolean to boolean --- types/nodegit/convenient-patch.d.ts | 44 ++++++++++++++--------------- types/nodegit/tree-entry.d.ts | 8 +++--- types/nodegit/tree.d.ts | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/types/nodegit/convenient-patch.d.ts b/types/nodegit/convenient-patch.d.ts index b03bb2ff54..5d3a9fd03f 100644 --- a/types/nodegit/convenient-patch.d.ts +++ b/types/nodegit/convenient-patch.d.ts @@ -52,89 +52,89 @@ export class ConvenientPatch { /** * Is this an unmodified patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isUnmodified(): Boolean; + isUnmodified(): boolean; /** * Is this an added patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isAdded(): Boolean; + isAdded(): boolean; /** * Is this a deleted patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isDeleted(): Boolean; + isDeleted(): boolean; /** * Is this an modified patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isModified(): Boolean; + isModified(): boolean; /** * Is this a renamed patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isRenamed(): Boolean; + isRenamed(): boolean; /** * Is this a copied patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isCopied(): Boolean; + isCopied(): boolean; /** * Is this an ignored patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isIgnored(): Boolean; + isIgnored(): boolean; /** * Is this an untracked patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isUntracked(): Boolean; + isUntracked(): boolean; /** * Is this a type change? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isTypeChange(): Boolean; + isTypeChange(): boolean; /** * Is this an undreadable patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isUnreadable(): Boolean; + isUnreadable(): boolean; /** * Is this a conflicted patch? * - * @returns {Boolean} + * @returns {boolean} * * @memberof ConvenientPatch */ - isConflicted(): Boolean; + isConflicted(): boolean; } diff --git a/types/nodegit/tree-entry.d.ts b/types/nodegit/tree-entry.d.ts index 844f5da90c..a56a658ce1 100644 --- a/types/nodegit/tree-entry.d.ts +++ b/types/nodegit/tree-entry.d.ts @@ -14,10 +14,10 @@ export namespace TreeEntry { } export class TreeEntry { - isFile(): Boolean; - isTree(): Boolean; - isDirectory(): Boolean; - isBlob(): Boolean; + isFile(): boolean; + isTree(): boolean; + isDirectory(): boolean; + isBlob(): boolean; sha(): string; getTree(): Promise; getBlob(): Promise; diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index c20037cb0a..a4101217d3 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -38,7 +38,7 @@ export class Tree { entryByIndex(i: number): TreeEntry; getEntry(filePath: string): TreeEntry; entries(): TreeEntry[]; - walk(blobsOnly?: Boolean): NodeJS.EventEmitter; + walk(blobsOnly?: boolean): NodeJS.EventEmitter; path(): string; builder(): Treebuilder; } From 851aeea04ae2c6e83abea3b64fdbf68680c5fdb4 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 9 Jun 2017 02:57:41 +0100 Subject: [PATCH 85/91] Added documentation --- types/nodegit/reset.d.ts | 37 +++++ types/nodegit/rev-parse.d.ts | 22 +++ types/nodegit/rev-walk.d.ts | 157 +++++++++++++++++++- types/nodegit/revert.d.ts | 28 +++- types/nodegit/signature.d.ts | 79 ++++++++++ types/nodegit/stash.d.ts | 105 ++++++++++++- types/nodegit/status-entry.d.ts | 18 +++ types/nodegit/status-list.d.ts | 30 ++++ types/nodegit/status-options.d.ts | 24 +++ types/nodegit/status.d.ts | 54 +++++++ types/nodegit/str-array.d.ts | 26 ++++ types/nodegit/submodule-update-options.d.ts | 24 +++ 12 files changed, 596 insertions(+), 8 deletions(-) diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 25ff5ae563..1335eb8365 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -13,7 +13,44 @@ export namespace Reset { } export class Reset { + /** + * Look up a refs's commit. + * + * @static + * @param {Repository} repo + * @param {Object} target + * @param {number} reset_type + * @param {CheckoutOptions} checkout_opts + * @returns {Promise} + * + * @memberof Reset + */ static reset(repo: Repository, target: Object, reset_type: number, checkout_opts: CheckoutOptions): Promise; + /** + * Look up a refs's commit. + * + * @static + * @param {Repository} repo + * @param {Object} target + * @param {Strarray} pathspecs + * @returns {Promise} + * + * @memberof Reset + */ static default(repo: Repository, target: Object, pathspecs: Strarray): 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. + * See the documentation for reset. + * + * @static + * @param {Repository} repo + * @param {AnnotatedCommit} commit + * @param {number} reset_type + * @param {CheckoutOptions} checkout_opts + * @returns {number} + * + * @memberof Reset + */ static fromAnnotated(repo: Repository, commit: AnnotatedCommit, reset_type: number, checkout_opts: CheckoutOptions): number; } diff --git a/types/nodegit/rev-parse.d.ts b/types/nodegit/rev-parse.d.ts index 7bdbc80676..b4ef63f2f2 100644 --- a/types/nodegit/rev-parse.d.ts +++ b/types/nodegit/rev-parse.d.ts @@ -11,6 +11,28 @@ export namespace Revparse { } export class Revparse { + /** + * + * + * @static + * @param {Object} object_out + * @param {Reference} reference_out + * @param {Repository} repo + * @param {string} spec + * @returns {number} + * + * @memberof Revparse + */ static ext(object_out: Object, reference_out: Reference, repo: Repository, spec: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} spec + * @returns {Promise} + * + * @memberof Revparse + */ static single(repo: Repository, spec: string): Promise; } diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts index 643220b492..8ba18bf83a 100644 --- a/types/nodegit/rev-walk.d.ts +++ b/types/nodegit/rev-walk.d.ts @@ -12,25 +12,180 @@ export namespace Revwalk { } export class Revwalk { + /** + * + * + * @static + * @param {Repository} repo + * @returns {Revwalk} + * + * @memberof Revwalk + */ static create(repo: Repository): Revwalk; + /** + * + * + * @param {Oid} commit_id + * @returns {number} + * + * @memberof Revwalk + */ hide(commit_id: Oid): number; + /** + * + * + * @param {string} glob + * @returns {number} + * + * @memberof Revwalk + */ hideGlob(glob: string): number; + /** + * + * + * @returns {number} + * + * @memberof Revwalk + */ hideHead(): number; + /** + * + * + * @param {string} refname + * @returns {number} + * + * @memberof Revwalk + */ hideRef(refname: string): number; + /** + * + * + * @returns {Promise} + * + * @memberof Revwalk + */ next(): Promise; + /** + * + * + * @param {Oid} id + * @returns {number} + * + * @memberof Revwalk + */ push(id: Oid): number; + /** + * + * + * @param {string} glob + * @returns {number} + * + * @memberof Revwalk + */ pushGlob(glob: string): number; + /** + * + * + * @returns {number} + * + * @memberof Revwalk + */ pushHead(): number; + /** + * + * + * @param {string} range + * @returns {number} + * + * @memberof Revwalk + */ pushRange(range: string): number; + /** + * + * + * @param {string} refname + * @returns {number} + * + * @memberof Revwalk + */ pushRef(refname: string): number; + /** + * + * + * @returns {Repository} + * + * @memberof Revwalk + */ repository(): Repository; + /** + * + * + * + * @memberof Revwalk + */ reset(): void; + /** + * + * + * + * @memberof Revwalk + */ simplifyFirstParent(): void; - sorting(sort: number): any; + /** + * Set the sort order for the revwalk. This function takes variable arguments like revwalk.sorting(NodeGit.RevWalk.Topological, NodeGit.RevWalk.Reverse). + * + * @param {number} sort + * + * @memberof Revwalk + */ + sorting(sort: number): void; + /** + * + * + * @param {number} max_count + * @returns {Promise} + * + * @memberof Revwalk + */ fastWalk(max_count: number): Promise; + /** + * + * + * @param {string} filePath + * @param {number} max_count + * @returns {Promise} + * + * @memberof Revwalk + */ fileHistoryWalk(filePath: string, max_count: number): Promise; + /** + * 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). + * + * @param {Oid} oid + * @param {Function} callback + * @returns {Commit} + * + * @memberof Revwalk + */ walk(oid: Oid, callback: Function): Commit; + /** + * Walk the history grabbing commits until the checkFn called with the current commit returns false. + * + * @param {Function} checkFn + * @returns {Promise} + * + * @memberof Revwalk + */ getCommitsUntil(checkFn: Function): Promise; + /** + * + * + * @param {number} count + * @returns {Promise} + * + * @memberof Revwalk + */ getCommits(count: number): Promise; + } diff --git a/types/nodegit/revert.d.ts b/types/nodegit/revert.d.ts index a1210182eb..ac0cbf531a 100644 --- a/types/nodegit/revert.d.ts +++ b/types/nodegit/revert.d.ts @@ -12,6 +12,30 @@ export interface RevertOptions { } export class Revert { - static revert(repo: Repository, commit: Commit, given_opts: RevertOptions): Promise; - static commit(repo: Repository, revert_commit: Commit, our_commit: Commit, mainline: number, merge_options: MergeOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Commit} commit + * @param {RevertOptions} givenOpts + * @returns {Promise} + * + * @memberof Revert + */ + 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. + * + * @static + * @param {Repository} repo + * @param {Commit} revert_commit + * @param {Commit} ourCommit + * @param {number} mainline + * @param {MergeOptions} mergeOptions + * @returns {Promise} + * + * @memberof Revert + */ + static commit(repo: Repository, revert_commit: Commit, ourCommit: Commit, mainline: number, mergeOptions: MergeOptions): Promise; } diff --git a/types/nodegit/signature.d.ts b/types/nodegit/signature.d.ts index c18ccb45ff..6854760004 100644 --- a/types/nodegit/signature.d.ts +++ b/types/nodegit/signature.d.ts @@ -2,14 +2,93 @@ import { Repository } from './repository'; import { Time } from './time'; export class Signature { + /** + * + * + * @static + * @param {Repository} repo + * @returns {Signature} + * + * @memberof Signature + */ static default(repo: Repository): Signature; + /** + * + * + * @static + * @param {string} name + * @param {string} email + * @param {number} time + * @param {number} offset + * @returns {Signature} + * + * @memberof Signature + */ static create(name: string, email: string, time: number, offset: number): Signature; + /** + * + * + * @static + * @param {string} name + * @param {string} email + * @returns {Signature} + * + * @memberof Signature + */ static now(name: string, email: string): Signature; + /** + * + * + * @static + * @param {string} buf + * @returns {Promise} + * + * @memberof Signature + */ + static fromBuffer(buf: string): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Signature + */ dup(): Promise; + /** + * + * + * + * @memberof Signature + */ free(): void; + /** + * + * + * @returns {string} + * + * @memberof Signature + */ toString(): string; + /** + * + * + * @type {string} + * @memberof Signature + */ name: string; + /** + * + * + * @type {string} + * @memberof Signature + */ email: string; + /** + * + * + * @type {Time} + * @memberof Signature + */ when: Time; } diff --git a/types/nodegit/stash.d.ts b/types/nodegit/stash.d.ts index c81e94b7b6..1aae88bd85 100644 --- a/types/nodegit/stash.d.ts +++ b/types/nodegit/stash.d.ts @@ -29,18 +29,113 @@ export namespace Stash { } export interface StashApplyOptions { - version: number; - flags: number; - checkoutOptions: CheckoutOptions; - progressCb: Function; - progressPayload: any; + /** + * + * + * @type {number} + * @memberof StashApplyOptions + */ + version?: number; + /** + * + * + * @type {number} + * @memberof StashApplyOptions + */ + flags?: number; + /** + * + * + * @type {CheckoutOptions} + * @memberof StashApplyOptions + */ + checkoutOptions?: CheckoutOptions; + /** + * + * + * @type {Function} + * @memberof StashApplyOptions + */ + progressCb?: Function; + /** + * + * + * @type {*} + * @memberof StashApplyOptions + */ + progressPayload?: any; } export class Stash { + /** + * + * + * @static + * @param {Repository} repo + * @param {number} index + * @param {StashApplyOptions} options + * @returns {Promise} + * + * @memberof Stash + */ static apply(repo: Repository, index: number, options: StashApplyOptions): Promise; + /** + * + * + * @static + * @param {StashApplyOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Stash + */ static applyInitOptions(opts: StashApplyOptions, version: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {number} index + * @returns {Promise} + * + * @memberof Stash + */ static drop(repo: Repository, index: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Function} callback + * @param {*} payload + * @returns {Promise} + * + * @memberof Stash + */ static foreach(repo: Repository, callback: Function, payload: any): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {number} index + * @param {StashApplyOptions} options + * @returns {Promise} + * + * @memberof Stash + */ static pop(repo: Repository, index: number, options: StashApplyOptions): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Signature} stasher + * @param {string} message + * @param {number} flags + * @returns {Promise} + * + * @memberof Stash + */ 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..70435d5de1 100644 --- a/types/nodegit/status-entry.d.ts +++ b/types/nodegit/status-entry.d.ts @@ -1,7 +1,25 @@ import { DiffDelta } from './diff-delta'; export class StatusEntry { + /** + * + * + * @type {number} + * @memberof StatusEntry + */ status: number; + /** + * + * + * @type {DiffDelta} + * @memberof StatusEntry + */ headToIndex: DiffDelta; + /** + * + * + * @type {DiffDelta} + * @memberof StatusEntry + */ indexToWorkdir: DiffDelta; } diff --git a/types/nodegit/status-list.d.ts b/types/nodegit/status-list.d.ts index 6d83044801..7847da4d1d 100644 --- a/types/nodegit/status-list.d.ts +++ b/types/nodegit/status-list.d.ts @@ -3,9 +3,39 @@ import { DiffPerfdata } from './diff-perf-data'; import { StatusOptions } from './status-options'; export class StatusList { + /** + * + * + * @static + * @param {Repository} repo + * @param {StatusOptions} opts + * @returns {Promise} + * + * @memberof StatusList + */ static create(repo: Repository, opts: StatusOptions): Promise; + /** + * + * + * @returns {number} + * + * @memberof StatusList + */ entrycount(): number; + /** + * + * + * + * @memberof StatusList + */ free(): void; + /** + * + * + * @returns {Promise} + * + * @memberof StatusList + */ getPerfdata(): Promise; } diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts index 9f75bbe96d..fe2f728737 100644 --- a/types/nodegit/status-options.d.ts +++ b/types/nodegit/status-options.d.ts @@ -1,8 +1,32 @@ import { Strarray } from './str-array'; export interface StatusOptions { + /** + * + * + * @type {number} + * @memberof StatusOptions + */ version?: number; + /** + * + * + * @type {number} + * @memberof StatusOptions + */ show?: number; + /** + * + * + * @type {number} + * @memberof StatusOptions + */ flags?: number; + /** + * + * + * @type {Strarray} + * @memberof StatusOptions + */ pathspec?: Strarray; } diff --git a/types/nodegit/status.d.ts b/types/nodegit/status.d.ts index 1059dd6bff..892b1f1c36 100644 --- a/types/nodegit/status.d.ts +++ b/types/nodegit/status.d.ts @@ -48,9 +48,63 @@ export namespace Status { } export class Status { + /** + * + * + * @static + * @param {StatusList} statuslist + * @param {number} idx + * @returns {StatusEntry} + * + * @memberof Status + */ static byIndex(statuslist: StatusList, idx: number): StatusEntry; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} path + * @returns {number} + * + * @memberof Status + */ static file(repo: Repository, path: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {Function} callback + * @param {*} payload + * @returns {Promise} + * + * @memberof Status + */ static foreach(repo: Repository, callback: Function, payload: any): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {StatusOptions} opts + * @param {Function} callback + * @param {*} payload + * @returns {Promise} + * + * @memberof Status + */ static foreachExt(repo: Repository, opts: StatusOptions, callback: Function, payload: any): Promise; + /** + * + * + * @static + * @param {number} ignored + * @param {Repository} repo + * @param {string} path + * @returns {number} + * + * @memberof Status + */ static shouldIgnore(ignored: number, repo: Repository, path: string): number; } diff --git a/types/nodegit/str-array.d.ts b/types/nodegit/str-array.d.ts index 525667fbcb..603889f756 100644 --- a/types/nodegit/str-array.d.ts +++ b/types/nodegit/str-array.d.ts @@ -1,6 +1,32 @@ export class Strarray { + /** + * + * + * @param {Strarray} src + * @returns {number} + * + * @memberof Strarray + */ copy(src: Strarray): number; + /** + * + * + * + * @memberof Strarray + */ free(): void; + /** + * + * + * @type {string[]} + * @memberof Strarray + */ strings: string[]; + /** + * + * + * @type {number} + * @memberof Strarray + */ count: number; } diff --git a/types/nodegit/submodule-update-options.d.ts b/types/nodegit/submodule-update-options.d.ts index d96320204b..3b07383090 100644 --- a/types/nodegit/submodule-update-options.d.ts +++ b/types/nodegit/submodule-update-options.d.ts @@ -2,8 +2,32 @@ import { CheckoutOptions } from './checkout-options'; import { FetchOptions } from './fetch-options'; export interface SubmoduleUpdateOptions { + /** + * + * + * @type {number} + * @memberof SubmoduleUpdateOptions + */ version?: number; + /** + * + * + * @type {CheckoutOptions} + * @memberof SubmoduleUpdateOptions + */ checkoutOpts?: CheckoutOptions; + /** + * + * + * @type {FetchOptions} + * @memberof SubmoduleUpdateOptions + */ fetchOpts?: FetchOptions; + /** + * + * + * @type {number} + * @memberof SubmoduleUpdateOptions + */ cloneCheckoutStrategy?: number; } From b74bf960f39d7ec7a086b3a92ea4cf6a207ec920 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:30:11 +0100 Subject: [PATCH 86/91] Added more documentation --- types/nodegit/submodule.d.ts | 271 +++++++++++++++++++++++++++ types/nodegit/tag.d.ts | 170 ++++++++++++++++- types/nodegit/time.d.ts | 12 ++ types/nodegit/transfer-progress.d.ts | 42 +++++ types/nodegit/transport.d.ts | 39 ++++ types/nodegit/tree-builder.d.ts | 62 ++++++ types/nodegit/tree-entry.d.ts | 152 ++++++++++++++- types/nodegit/tree.d.ts | 203 +++++++++++++++++++- 8 files changed, 932 insertions(+), 19 deletions(-) diff --git a/types/nodegit/submodule.d.ts b/types/nodegit/submodule.d.ts index fd64a1c8ac..b9293f6bae 100644 --- a/types/nodegit/submodule.d.ts +++ b/types/nodegit/submodule.d.ts @@ -45,37 +45,308 @@ export namespace Submodule { } export class Submodule { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} url + * @param {string} path + * @param {number} use_gitlink + * @returns {Promise} + * + * @memberof Submodule + */ static addSetup(repo: Repository, url: string, path: string, use_gitlink: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Function} callback + * @param {*} payload + * @returns {Promise} + * + * @memberof Submodule + */ static foreach(repo: Repository, callback: Function, payload: any): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @returns {Promise} + * + * @memberof Submodule + */ static lookup(repo: Repository, name: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} url + * @returns {Promise} + * + * @memberof Submodule + */ static resolveUrl(repo: Repository, url: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} branch + * @returns {number} + * + * @memberof Submodule + */ static setBranch(repo: Repository, name: string, branch: string): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {number} fetch_recurse_submodules + * @returns {number} + * + * @memberof Submodule + */ static setFetchRecurseSubmodules(repo: Repository, name: string, fetch_recurse_submodules: number): number; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {number} ignore + * @returns {Promise} + * + * @memberof Submodule + */ static setIgnore(repo: Repository, name: string, ignore: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {number} update + * @returns {Promise} + * + * @memberof Submodule + */ static setUpdate(repo: Repository, name: string, update: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {string} url + * @returns {Promise} + * + * @memberof Submodule + */ static setUrl(repo: Repository, name: string, url: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} name + * @param {number} ignore + * @returns {Promise} + * + * @memberof Submodule + */ static status(repo: Repository, name: string, ignore: number): Promise; + /** + * + * + * @static + * @param {SubmoduleUpdateOptions} opts + * @param {number} version + * @returns {number} + * + * @memberof Submodule + */ static updateInitOptions(opts: SubmoduleUpdateOptions, version: number): number; + /** + * + * + * @returns {Promise} + * + * @memberof Submodule + */ addFinalize(): Promise; + /** + * + * + * @param {number} write_index + * @returns {Promise} + * + * @memberof Submodule + */ addToIndex(write_index: number): Promise; + /** + * + * + * @returns {string} + * + * @memberof Submodule + */ branch(): string; + /** + * + * + * @returns {number} + * + * @memberof Submodule + */ fetchRecurseSubmodules(): number; + /** + * + * + * + * @memberof Submodule + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Submodule + */ headId(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Submodule + */ ignore(): number; + /** + * + * + * @returns {Oid} + * + * @memberof Submodule + */ indexId(): Oid; + /** + * + * + * @param {number} overwrite + * @returns {Promise} + * + * @memberof Submodule + */ init(overwrite: number): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Submodule + */ location(): Promise; + /** + * + * + * @returns {string} + * + * @memberof Submodule + */ name(): string; + /** + * + * + * @returns {Promise} + * + * @memberof Submodule + */ open(): Promise; + /** + * + * + * @returns {Repository} + * + * @memberof Submodule + */ owner(): Repository; + /** + * + * + * @returns {string} + * + * @memberof Submodule + */ path(): string; + /** + * + * + * @param {number} force + * @returns {number} + * + * @memberof Submodule + */ reload(force: number): number; + /** + * + * + * @param {number} use_gitlink + * @returns {Promise} + * + * @memberof Submodule + */ repoInit(use_gitlink: number): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Submodule + */ sync(): Promise; + /** + * Updates a submodule + * + * @param {number} init + * @param {SubmoduleUpdateOptions} options + * @returns {Promise} + * + * @memberof Submodule + */ update(init: number, options: SubmoduleUpdateOptions): Promise; + /** + * + * + * @returns {number} + * + * @memberof Submodule + */ updateStrategy(): number; + /** + * + * + * @returns {string} + * + * @memberof Submodule + */ url(): string; + /** + * + * + * @returns {Oid} + * + * @memberof Submodule + */ wdId(): Oid; } diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts index d8f98953a0..8c419ce15f 100644 --- a/types/nodegit/tag.d.ts +++ b/types/nodegit/tag.d.ts @@ -5,23 +5,191 @@ import { Signature } from './signature'; import { Strarray } from './str-array'; export class Tag { + /** + * + * + * @static + * @param {Repository} repo + * @param {string} tag_name + * @param {Object} target + * @param {Signature} tagger + * @param {string} message + * @returns {Promise} + * + * @memberof Tag + */ static annotationCreate(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} tag_name + * @param {Object} target + * @param {Signature} tagger + * @param {string} message + * @param {number} force + * @returns {Promise} + * + * @memberof Tag + */ static create(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} tag_name + * @param {Object} target + * @param {number} force + * @returns {Promise} + * + * @memberof Tag + */ static createLightweight(repo: Repository, tag_name: string, target: Object, force: number): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {string} tag_name + * @returns {Promise} + * + * @memberof Tag + */ static delete(repo: Repository, tag_name: string): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @returns {Promise} + * + * @memberof Tag + */ static list(repo: Repository): Promise; + /** + * + * + * @static + * @param {Strarray} tag_names + * @param {string} pattern + * @param {Repository} repo + * @returns {number} + * + * @memberof Tag + */ static listMatch(tag_names: Strarray, pattern: string, repo: Repository): number; + /** + * Retrieves the tag pointed to by the oid + * + * @static + * @param {Repository} repo + * @param {(string | Oid | Tag)} id + * @returns {Promise} + * + * @memberof Tag + */ static lookup(repo: Repository, id: string | Oid | Tag): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @returns {Promise} + * + * @memberof Tag + */ static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof Tag + */ + dup(): Promise; + /** + * + * + * + * @memberof Tag + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Tag + */ id(): Oid; + /** + * + * + * @returns {string} + * + * @memberof Tag + */ message(): string; + /** + * + * + * @returns {string} + * + * @memberof Tag + */ name(): string; + /** + * + * + * @returns {Repository} + * + * @memberof Tag + */ owner(): Repository; - peel(tag_target_out: Object): number; + /** + * + * + * @param {Object} tagTargetOut + * @returns {number} + * + * @memberof Tag + */ + peel(tagTargetOut: Object): number; + /** + * + * + * @returns {Signature} + * + * @memberof Tag + */ tagger(): Signature; + /** + * + * + * @returns {Object} + * + * @memberof Tag + */ target(): Object; + /** + * + * + * @returns {Oid} + * + * @memberof Tag + */ targetId(): Oid; + /** + * + * + * @returns {number} + * + * @memberof Tag + */ targetType(): number; } diff --git a/types/nodegit/time.d.ts b/types/nodegit/time.d.ts index 575c005781..299bcfa35e 100644 --- a/types/nodegit/time.d.ts +++ b/types/nodegit/time.d.ts @@ -1,4 +1,16 @@ export class Time { + /** + * + * + * @type {number} + * @memberof Time + */ time: number; + /** + * + * + * @type {number} + * @memberof Time + */ offset: number; } diff --git a/types/nodegit/transfer-progress.d.ts b/types/nodegit/transfer-progress.d.ts index 1589d4b6c6..f4c0d21065 100644 --- a/types/nodegit/transfer-progress.d.ts +++ b/types/nodegit/transfer-progress.d.ts @@ -1,9 +1,51 @@ export class TransferProgress { + /** + * + * + * @type {number} + * @memberof TransferProgress + */ totalObjects: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ indexedObjects: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ receivedObjects: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ localObjects: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ totalDeltas: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ indexedDeltas: number; + /** + * + * + * @type {number} + * @memberof TransferProgress + */ receivedBytes: number; } diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts index 189985c469..01dd4312ef 100644 --- a/types/nodegit/transport.d.ts +++ b/types/nodegit/transport.d.ts @@ -1,5 +1,6 @@ import { Remote } from './remote'; import { Strarray } from './str-array'; +import { Cert } from './cert'; export namespace Transport { const enum FLAGS { @@ -8,7 +9,45 @@ export namespace Transport { } export class Transport { + /** + * å + * + * @static + * @param {Remote} owner + * @param {Strarray} payload + * @returns {Promise} + * + * @memberof Transport + */ static sshWithPaths(owner: Remote, payload: Strarray): Promise; + /** + * + * + * @static + * @param {string} prefix + * @returns {number} + * + * @memberof Transport + */ static unregister(prefix: string): number; + /** + * + * + * @param {number} version + * @returns {number} + * + * @memberof Transport + */ init(version: number): number; + /** + * + * + * @param {Cert} cert + * @param {number} valid + * @param {string} hostName + * @returns {number} + * + * @memberof Transport + */ + smartCertificateCheck(cert: Cert, valid: number, hostName: string): number; } diff --git a/types/nodegit/tree-builder.d.ts b/types/nodegit/tree-builder.d.ts index 03d11db900..4c50cdbd65 100644 --- a/types/nodegit/tree-builder.d.ts +++ b/types/nodegit/tree-builder.d.ts @@ -4,13 +4,75 @@ import { Tree } from './tree'; import { TreeEntry } from './tree-entry'; export class Treebuilder { + /** + * + * + * @static + * @param {Repository} repo + * @param {Tree} source + * @returns {Promise} + * + * @memberof Treebuilder + */ static create(repo: Repository, source: Tree): Promise; + /** + * + * + * + * @memberof Treebuilder + */ clear(): void; + /** + * + * + * @returns {number} + * + * @memberof Treebuilder + */ entrycount(): number; + /** + * + * + * + * @memberof Treebuilder + */ free(): void; + /** + * + * + * @param {string} filename + * @returns {TreeEntry} + * + * @memberof Treebuilder + */ get(filename: string): TreeEntry; + /** + * + * + * @param {string} filename + * @param {Oid} id + * @param {number} filemode + * @returns {Promise} + * + * @memberof Treebuilder + */ insert(filename: string, id: Oid, filemode: number): Promise; + /** + * + * + * @param {string} filename + * @returns {number} + * + * @memberof Treebuilder + */ remove(filename: string): number; + /** + * + * + * @returns {Oid} + * + * @memberof Treebuilder + */ write(): Oid; } diff --git a/types/nodegit/tree-entry.d.ts b/types/nodegit/tree-entry.d.ts index a56a658ce1..3cf20499d3 100644 --- a/types/nodegit/tree-entry.d.ts +++ b/types/nodegit/tree-entry.d.ts @@ -1,6 +1,7 @@ import { Tree } from './tree'; import { Oid } from './oid'; import { Blob } from './blob'; +import { Repository } from './repository'; export namespace TreeEntry { const enum FILEMODE { @@ -14,17 +15,148 @@ export namespace TreeEntry { } export class TreeEntry { - isFile(): boolean; - isTree(): boolean; - isDirectory(): boolean; - isBlob(): boolean; - sha(): string; - getTree(): Promise; + /** + * + * + * @returns {TreeEntry.FILEMODE} + * + * @memberof TreeEntry + */ + filemode(): TreeEntry.FILEMODE; + /** + * + * + * @returns {TreeEntry.FILEMODE} + * + * @memberof TreeEntry + */ + filemodeRaw(): TreeEntry.FILEMODE; + /** + * + * + * + * @memberof TreeEntry + */ + free(): void; + /** + * + * + * @returns {Promise} + * + * @memberof TreeEntry + */ getBlob(): Promise; + /** + * + * + * @returns {Promise} + * + * @memberof TreeEntry + */ + getTree(): Promise; + /** + * + * + * @returns {Oid} + * + * @memberof TreeEntry + */ + id(): Oid; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isBlob(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isFile(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isTree(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isDirectory(): boolean; + /** + * + * + * @returns {boolean} + * + * @memberof TreeEntry + */ + isSubmodule(): boolean; + /** + * Retrieve the SHA for this TreeEntry. + * + * @returns {string} + * + * @memberof TreeEntry + */ + sha(): string; + /** + * + * + * @returns {string} + * + * @memberof TreeEntry + */ + name(): string; + /** + * Retrieve the SHA for this TreeEntry. Alias for sha + * + * @returns {string} + * + * @memberof TreeEntry + */ + oid(): string; + /** + * Returns the path for this entry. + * + * @returns {string} + * + * @memberof TreeEntry + */ path(): string; + /** + * Alias for path + * + * @returns {string} + * + * @memberof TreeEntry + */ toString(): string; - attr: number; - oid: Oid; - filenameLen: number; - filename: string; + /** + * + * + * @param {Repository} repo + * @returns {Object} + * + * @memberof TreeEntry + */ + toObject(repo: Repository): Object; + /** + * + * + * @returns {number} + * + * @memberof TreeEntry + */ + type(): number; } diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index a4101217d3..eaa0c65ed3 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -13,32 +13,219 @@ export namespace Tree { } export class Tree { - static entryCmp(e1: TreeEntry, e2: TreeEntry): number; + /** + * + * + * @static + * @param {TreeEntry} tree1 + * @param {TreeEntry} tree2 + * @returns {number} + * + * @memberof Tree + */ + static entryCmp(tree1: TreeEntry, tree2: TreeEntry): number; + /** + * + * + * @static + * @param {TreeEntry} dest + * @param {TreeEntry} source + * @returns {number} + * + * @memberof Tree + */ static entryDup(dest: TreeEntry, source: TreeEntry): number; - static entryFilemode(entry: TreeEntry): number; - static entryFilemodeRaw(entry: TreeEntry): number; - static entryFree(entry: TreeEntry): void; - static entryId(entry: TreeEntry): Oid; - static entryName(entry: TreeEntry): string; - static entryToObject(object_out: Object, repo: Repository, entry: TreeEntry): number; - static entryType(entry: TreeEntry): number; + /** + * Retrieves the tree pointed to by the oid + * + * @static + * @returns {Promise} + * + * @memberof Tree + */ + static lookup(): Promise; + /** + * + * + * @static + * @param {Repository} repo + * @param {Oid} id + * @param {number} len + * @returns {Promise} + * + * @memberof Tree + */ + static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + + /** + * Retrieves the tree pointed to by the oid + * + * @static + * @param {Repository} repo + * @param {(string | Oid | Tree)} id + * @param {Function} callback + * @returns {Promise} + * + * @memberof Tree + */ static lookup(repo: Repository, id: string | Oid | Tree, callback: Function): Promise; static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; + /** + * + * + * @param {Oid} id + * @returns {TreeEntry} + * + * @memberof Tree + */ entryById(id: Oid): TreeEntry; + /** + * + * + * @param {number} idx + * @returns {TreeEntry} + * + * @memberof Tree + */ _entryByIndex(idx: number): TreeEntry; + /** + * Get an entry by name; if the tree is a directory, the name is the filename. + * + * @param {string} name + * @returns {TreeEntry} + * + * @memberof Tree + */ entryByName(name: string): TreeEntry; + /** + * + * + * @param {string} filename + * @returns {TreeEntry} + * + * @memberof Tree + */ + _entryByName(filename: string): TreeEntry; + /** + * + * + * @param {string} path + * @returns {Promise} + * + * @memberof Tree + */ entryByPath(path: string): Promise; + /** + * + * + * @returns {number} + * + * @memberof Tree + */ entryCount(): number; + /** + * + * + * + * @memberof Tree + */ free(): void; + /** + * + * + * @returns {Oid} + * + * @memberof Tree + */ id(): Oid; + /** + * + * + * @returns {Repository} + * + * @memberof Tree + */ owner(): Repository; + /** + * Diff two trees + * + * @param {Tree} tree + * @param {Function} callback + * @returns {Promise} + * + * @memberof Tree + */ diff(tree: Tree, callback: Function): Promise; + /** + * Diff two trees with options + * + * @param {Tree} tree + * @param {Object} options + * @param {Function} callback + * @returns {Promise} + * + * @memberof Tree + */ diffWithOptions(tree: Tree, options: Object, callback: Function): Promise; + /** + * Get an entry at the ith position. + * + * @param {number} i + * @returns {TreeEntry} + * + * @memberof Tree + */ entryByIndex(i: number): TreeEntry; + /** + * Get an entry at a path. Unlike by name, this takes a fully qualified path, like /foo/bar/baz.javascript + * + * @param {string} filePath + * @returns {TreeEntry} + * + * @memberof Tree + */ getEntry(filePath: string): TreeEntry; + /** + * Return an array of the entries in this tree (excluding its children). + * + * @returns {TreeEntry[]} + * + * @memberof Tree + */ entries(): TreeEntry[]; + /** + * Recursively walk the tree in breadth-first order. Fires an event for each entry. + * + * @param {boolean} [blobsOnly] + * @returns {NodeJS.EventEmitter} + * + * @memberof Tree + */ walk(blobsOnly?: boolean): NodeJS.EventEmitter; + /** + * Return the path of this tree, like /lib/foo/bar + * + * @returns {string} + * + * @memberof Tree + */ path(): string; + /** + * Make builder. This is helpful for modifying trees. + * + * @returns {Treebuilder} + * + * @memberof Tree + */ builder(): Treebuilder; + /** + * + * + * @returns {Promise} + * + * @memberof Tree + */ + dup(): Promise; + createUpdated(repo: Repository, nUpdates: number, updates: TreeUpdate): Promise; } From e9fbe7110a21a0a5663b2f07d5018d82d377d2d7 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:32:54 +0100 Subject: [PATCH 87/91] Added TreeUpdate --- types/nodegit/index.d.ts | 1 + types/nodegit/tree-update.d.ts | 8 ++++++++ types/nodegit/tree.d.ts | 1 + types/nodegit/tsconfig.json | 1 + 4 files changed, 11 insertions(+) create mode 100644 types/nodegit/tree-update.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 6551907ea4..2c955933d1 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -98,4 +98,5 @@ export { TransferProgress } from './transfer-progress'; export { Transport } from './transport'; export { Treebuilder } from './tree-builder'; export { TreeEntry } from './tree-entry'; +export { TreeUpdate } from './tree-update'; export { Tree } from './tree'; diff --git a/types/nodegit/tree-update.d.ts b/types/nodegit/tree-update.d.ts new file mode 100644 index 0000000000..fde63d064e --- /dev/null +++ b/types/nodegit/tree-update.d.ts @@ -0,0 +1,8 @@ +import { Oid } from './oid'; + +export class TreeUpdate { + action: number; + filemode: number; + id: Oid; + path: string; +} diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index eaa0c65ed3..d6fca995de 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -4,6 +4,7 @@ import { Repository } from './repository'; import { Object } from './object'; import { Treebuilder } from './tree-builder'; import { DiffFile } from './diff-file'; +import { TreeUpdate } from './tree-update'; export namespace Tree { const enum WALK_MODE { diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 829e49aedd..17b5c3fa6e 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -112,6 +112,7 @@ "transport.d.ts", "tree-builder.d.ts", "tree-entry.d.ts", + "tree-update.d.ts", "tree.d.ts" ] } From a38a576c6eb4f06bafe5489dbd1339cbfccffecc Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:36:24 +0100 Subject: [PATCH 88/91] Added proxy --- types/nodegit/index.d.ts | 1 + types/nodegit/proxy.d.ts | 5 +++++ types/nodegit/tsconfig.json | 1 + 3 files changed, 7 insertions(+) create mode 100644 types/nodegit/proxy.d.ts diff --git a/types/nodegit/index.d.ts b/types/nodegit/index.d.ts index 2c955933d1..b0a68f67b5 100644 --- a/types/nodegit/index.d.ts +++ b/types/nodegit/index.d.ts @@ -67,6 +67,7 @@ export { Openssl } from './open-ssl'; export { Packbuilder } from './pack-builder'; export { Pathspec } from './path-spec'; export { ProxyOptions } from './proxy-options'; +export { Proxy } from './proxy'; export { PushOptions } from './push-options'; export { PushUpdate } from './push-update'; export { Push } from './push'; diff --git a/types/nodegit/proxy.d.ts b/types/nodegit/proxy.d.ts new file mode 100644 index 0000000000..8b4806a2e0 --- /dev/null +++ b/types/nodegit/proxy.d.ts @@ -0,0 +1,5 @@ +import { ProxyOptions } from './proxy-options'; + +export class Proxy { + static initOptions(opts: ProxyOptions, version: number): number; +} diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index 17b5c3fa6e..394ec731df 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -81,6 +81,7 @@ "pack-builder.d.ts", "path-spec.d.ts", "proxy-options.d.ts", + "proxy.d.ts", "push-options.d.ts", "push-update.d.ts", "push.d.ts", From 8f535fe731495a8019b7f6816fcad22accb5e205 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:37:21 +0100 Subject: [PATCH 89/91] Added documentation for TreeUpdate --- types/nodegit/tree-update.d.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/types/nodegit/tree-update.d.ts b/types/nodegit/tree-update.d.ts index fde63d064e..f8834513f4 100644 --- a/types/nodegit/tree-update.d.ts +++ b/types/nodegit/tree-update.d.ts @@ -1,8 +1,32 @@ import { Oid } from './oid'; export class TreeUpdate { + /** + * + * + * @type {number} + * @memberof TreeUpdate + */ action: number; + /** + * + * + * @type {number} + * @memberof TreeUpdate + */ filemode: number; + /** + * + * + * @type {Oid} + * @memberof TreeUpdate + */ id: Oid; + /** + * + * + * @type {string} + * @memberof TreeUpdate + */ path: string; } From 0aaac09a4471f1906b4c341cb7d5cfe38b5cfce5 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:42:46 +0100 Subject: [PATCH 90/91] fixed linting errors --- types/nodegit/diff.d.ts | 6 +++--- types/nodegit/odb-expand-id.d.ts | 6 +++--- types/nodegit/proxy-options.d.ts | 12 ++++++------ types/nodegit/push-options.d.ts | 4 ++-- types/nodegit/rev-walk.d.ts | 1 - types/nodegit/tree.d.ts | 11 ----------- 6 files changed, 14 insertions(+), 26 deletions(-) diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 23d3ddf5fc..0150313cfb 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -172,7 +172,7 @@ export class Diff { * Directly run a diff between a blob and a buffer. * * @static - * @param {Blob} old_blob + * @param {Blob} oldBlob * @param {string} oldAsPath * @param {string} buffer * @param {string} bufferAsPath @@ -185,8 +185,8 @@ export class Diff { * * @memberof Diff */ - static blobToBuffer(old_blob: Blob, oldAsPath: string, - buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; + static blobToBuffer(oldBlob: Blob, oldAsPath: string, + buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise; /** * * diff --git a/types/nodegit/odb-expand-id.d.ts b/types/nodegit/odb-expand-id.d.ts index 842c65774e..d4fe264c3a 100644 --- a/types/nodegit/odb-expand-id.d.ts +++ b/types/nodegit/odb-expand-id.d.ts @@ -1,7 +1,7 @@ import { Oid } from './oid'; export class OdbExpandId { - id: Oid - length: number - type: number + id: Oid; + length: number; + type: number; } diff --git a/types/nodegit/proxy-options.d.ts b/types/nodegit/proxy-options.d.ts index 512d70c99a..600b34cd04 100644 --- a/types/nodegit/proxy-options.d.ts +++ b/types/nodegit/proxy-options.d.ts @@ -5,40 +5,40 @@ export class ProxyOptions { * @type {Function} * @memberof ProxyOptions */ - certificateCheck?: Function + certificateCheck?: Function; /** * * * @type {Function} * @memberof ProxyOptions */ - credentials?: Function + credentials?: Function; /** * * * @type {*} * @memberof ProxyOptions */ - payload?: any + payload?: any; /** * * * @type {number} * @memberof ProxyOptions */ - type?: number + type?: number; /** * * * @type {string} * @memberof ProxyOptions */ - url?: string + url?: string; /** * * * @type {number} * @memberof ProxyOptions */ - version?: number + version?: number; } diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index 6cf501c84a..e9cc6e2dcb 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -30,12 +30,12 @@ export interface PushOptions { * @type {Strarray} * @memberof PushOptions */ - customHeaders: Strarray + customHeaders: Strarray; /** * * * @type {ProxyOptions} * @memberof PushOptions */ - proxyOpts: ProxyOptions + proxyOpts: ProxyOptions; } diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts index 8ba18bf83a..82b322cd79 100644 --- a/types/nodegit/rev-walk.d.ts +++ b/types/nodegit/rev-walk.d.ts @@ -187,5 +187,4 @@ export class Revwalk { * @memberof Revwalk */ getCommits(count: number): Promise; - } diff --git a/types/nodegit/tree.d.ts b/types/nodegit/tree.d.ts index d6fca995de..057d3b2907 100644 --- a/types/nodegit/tree.d.ts +++ b/types/nodegit/tree.d.ts @@ -36,15 +36,6 @@ export class Tree { * @memberof Tree */ static entryDup(dest: TreeEntry, source: TreeEntry): number; - /** - * Retrieves the tree pointed to by the oid - * - * @static - * @returns {Promise} - * - * @memberof Tree - */ - static lookup(): Promise; /** * * @@ -57,7 +48,6 @@ export class Tree { * @memberof Tree */ static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; - /** * Retrieves the tree pointed to by the oid * @@ -70,7 +60,6 @@ export class Tree { * @memberof Tree */ static lookup(repo: Repository, id: string | Oid | Tree, callback: Function): Promise; - static lookupPrefix(repo: Repository, id: Oid, len: number): Promise; /** * From 0a0206e30123f7efa74f501619e7eed4120ddd76 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sat, 10 Jun 2017 02:51:39 +0100 Subject: [PATCH 91/91] Use camelCase for variables --- types/nodegit/buf.d.ts | 4 ++-- types/nodegit/clone.d.ts | 4 ++-- types/nodegit/commit.d.ts | 4 ++-- types/nodegit/diff.d.ts | 16 ++++++++-------- types/nodegit/index_.d.ts | 20 ++++++++++---------- types/nodegit/merge.d.ts | 8 ++++---- types/nodegit/note.d.ts | 28 ++++++++++++++-------------- types/nodegit/object.d.ts | 4 ++-- types/nodegit/rebase.d.ts | 4 ++-- types/nodegit/ref-log.d.ts | 8 ++++---- types/nodegit/remote.d.ts | 12 ++++++------ types/nodegit/repository.d.ts | 6 +++--- types/nodegit/reset.d.ts | 12 ++++++------ types/nodegit/rev-parse.d.ts | 6 +++--- types/nodegit/rev-walk.d.ts | 12 ++++++------ types/nodegit/revert.d.ts | 4 ++-- types/nodegit/submodule.d.ts | 16 ++++++++-------- types/nodegit/tag.d.ts | 20 ++++++++++---------- 18 files changed, 94 insertions(+), 94 deletions(-) diff --git a/types/nodegit/buf.d.ts b/types/nodegit/buf.d.ts index d9670bb293..380d76172b 100644 --- a/types/nodegit/buf.d.ts +++ b/types/nodegit/buf.d.ts @@ -19,12 +19,12 @@ export class Buf { /** * * - * @param {number} target_size + * @param {number} targetSize * @returns {Promise} * * @memberof Buf */ - grow(target_size: number): Promise; + grow(targetSize: number): Promise; /** * * diff --git a/types/nodegit/clone.d.ts b/types/nodegit/clone.d.ts index 61f8cfe2cf..7fe3b00a37 100644 --- a/types/nodegit/clone.d.ts +++ b/types/nodegit/clone.d.ts @@ -16,13 +16,13 @@ export class Clone { * * @static * @param {string} url - * @param {string} local_path + * @param {string} localPath * @param {CloneOptions} [options] * @returns {Promise} * * @memberof Clone */ - static clone(url: string, local_path: string, options?: CloneOptions): Promise; + static clone(url: string, localPath: string, options?: CloneOptions): Promise; /** * * diff --git a/types/nodegit/commit.d.ts b/types/nodegit/commit.d.ts index 247fdb102d..59928817a6 100644 --- a/types/nodegit/commit.d.ts +++ b/types/nodegit/commit.d.ts @@ -239,12 +239,12 @@ export class Commit { /** * * - * @param {Tree} tree_out + * @param {Tree} treeOut * @returns {number} * * @memberof Commit */ - tree(tree_out: Tree): number; + tree(treeOut: Tree): number; /** * * diff --git a/types/nodegit/diff.d.ts b/types/nodegit/diff.d.ts index 0150313cfb..5c2b29a33b 100644 --- a/types/nodegit/diff.d.ts +++ b/types/nodegit/diff.d.ts @@ -228,51 +228,51 @@ export class Diff { * * @static * @param {Repository} repo - * @param {Tree} old_tree + * @param {Tree} oldTree * @param {Index} index * @param {DiffOptions} opts * @returns {Promise} * * @memberof Diff */ - static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise; + static treeToIndex(repo: Repository, oldTree: Tree, index: Index, opts: DiffOptions): Promise; /** * * * @static * @param {Repository} repo - * @param {Tree} old_tree + * @param {Tree} oldTree * @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 treeToTree(repo: Repository, oldTree: Tree, new_tree: Tree, opts: DiffOptions): Promise; /** * * * @static * @param {Repository} repo - * @param {Tree} old_tree + * @param {Tree} oldTree * @param {DiffOptions} opts * @returns {Promise} * * @memberof Diff */ - static treeToWorkdir(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + static treeToWorkdir(repo: Repository, oldTree: Tree, opts: DiffOptions): Promise; /** * * * @static * @param {Repository} repo - * @param {Tree} old_tree + * @param {Tree} oldTree * @param {DiffOptions} opts * @returns {Promise} * * @memberof Diff */ - static treeToWorkdirWithIndex(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise; + static treeToWorkdirWithIndex(repo: Repository, oldTree: Tree, opts: DiffOptions): Promise; /** * diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index a805a19c97..ebc7f692f2 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -45,22 +45,22 @@ export class Index { * * * @static - * @param {string} index_path + * @param {string} indexPath * @returns {Promise} * * @memberof Index */ - static open(index_path: string): Promise; + static open(indexPath: string): Promise; /** * * - * @param {IndexEntry} source_entry + * @param {IndexEntry} sourceEntry * @returns {number} * * @memberof Index */ - add(source_entry: IndexEntry): number; + add(sourceEntry: IndexEntry): number; /** * * @@ -109,14 +109,14 @@ export class Index { /** * * - * @param {IndexEntry} ancestor_entry - * @param {IndexEntry} our_entry - * @param {IndexEntry} their_entry + * @param {IndexEntry} ancestorEntry + * @param {IndexEntry} ourEntry + * @param {IndexEntry} theirEntry * @returns {number} * * @memberof Index */ - conflictAdd(ancestor_entry: IndexEntry, our_entry: IndexEntry, their_entry: IndexEntry): number; + conflictAdd(ancestorEntry: IndexEntry, ourEntry: IndexEntry, theirEntry: IndexEntry): number; /** * * @@ -308,13 +308,13 @@ export class Index { /** * * - * @param {number} at_pos + * @param {number} atPos * @param {string} prefix * @returns {number} * * @memberof Index */ - findPrefix(at_pos: number, prefix: string): number; + findPrefix(atPos: number, prefix: string): number; /** * * diff --git a/types/nodegit/merge.d.ts b/types/nodegit/merge.d.ts index 5603d2b66e..ae4a7d053c 100644 --- a/types/nodegit/merge.d.ts +++ b/types/nodegit/merge.d.ts @@ -126,13 +126,13 @@ export class Merge { * * @static * @param {Repository} repo - * @param {Tree} ancestor_tree - * @param {Tree} our_tree - * @param {Tree} their_tree + * @param {Tree} ancestorTree + * @param {Tree} ourTree + * @param {Tree} theirTree * @param {MergeOptions} opts * @returns {Promise} * * @memberof Merge */ - static trees(repo: Repository, ancestor_tree: Tree, our_tree: Tree, their_tree: Tree, opts: MergeOptions): Promise; + static trees(repo: Repository, ancestorTree: Tree, ourTree: Tree, theirTree: Tree, opts: MergeOptions): Promise; } diff --git a/types/nodegit/note.d.ts b/types/nodegit/note.d.ts index 1e9382b712..e1412afe3c 100644 --- a/types/nodegit/note.d.ts +++ b/types/nodegit/note.d.ts @@ -8,7 +8,7 @@ export class Note { * * @static * @param {Repository} repo - * @param {string} notes_ref + * @param {string} notesRef * @param {Signature} author * @param {Signature} committer * @param {Oid} oid @@ -18,61 +18,61 @@ export class Note { * * @memberof Note */ - static create(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; + static create(repo: Repository, notesRef: string, author: Signature, committer: Signature, oid: Oid, note: string, force: number): Promise; /** * * * @static * @param {Repository} repo - * @param {string} notes_ref - * @param {Function} note_cb + * @param {string} notesRef + * @param {Function} noteCb * @param {*} payload * @returns {Promise} * * @memberof Note */ - static foreach(repo: Repository, notes_ref: string, note_cb: Function, payload: any): Promise; + static foreach(repo: Repository, notesRef: string, noteCb: Function, payload: any): Promise; /** * * * @static * @param {Repository} repo - * @param {string} notes_ref + * @param {string} notesRef * @returns {Promise} * * @memberof Note */ - static iteratorNew(repo: Repository, notes_ref: string): Promise; + static iteratorNew(repo: Repository, notesRef: string): Promise; /** * * * @static - * @param {Oid} note_id - * @param {Oid} annotated_id + * @param {Oid} noteId + * @param {Oid} annotatedId * @param {*} it * @returns {number} * * @memberof Note */ - static next(note_id: Oid, annotated_id: Oid, it: any): number; + static next(noteId: Oid, annotatedId: Oid, it: any): number; /** * * * @static * @param {Repository} repo - * @param {string} notes_ref + * @param {string} notesRef * @param {Oid} oid * @returns {Promise} * * @memberof Note */ - static read(repo: Repository, notes_ref: string, oid: Oid): Promise; + static read(repo: Repository, notesRef: string, oid: Oid): Promise; /** * * * @static * @param {Repository} repo - * @param {string} notes_ref + * @param {string} notesRef * @param {Signature} author * @param {Signature} committer * @param {Oid} oid @@ -80,7 +80,7 @@ export class Note { * * @memberof Note */ - static remove(repo: Repository, notes_ref: string, author: Signature, committer: Signature, oid: Oid): Promise; + static remove(repo: Repository, notesRef: string, author: Signature, committer: Signature, oid: Oid): Promise; /** * diff --git a/types/nodegit/object.d.ts b/types/nodegit/object.d.ts index 8030943e0d..747e4ffc28 100644 --- a/types/nodegit/object.d.ts +++ b/types/nodegit/object.d.ts @@ -113,12 +113,12 @@ export class Object { /** * * - * @param {number} target_type + * @param {number} targetType * @returns {Promise} * * @memberof Object */ - peel(target_type: number): Promise; + peel(targetType: number): Promise; /** * * diff --git a/types/nodegit/rebase.d.ts b/types/nodegit/rebase.d.ts index 6e254545bc..e1d64ede01 100644 --- a/types/nodegit/rebase.d.ts +++ b/types/nodegit/rebase.d.ts @@ -64,13 +64,13 @@ export class Rebase { * * @param {Signature} author * @param {Signature} committer - * @param {string} message_encoding + * @param {string} messageEncoding * @param {string} message * @returns {Oid} * * @memberof Rebase */ - commit(author: Signature, committer: Signature, message_encoding: string, message: string): Oid; + commit(author: Signature, committer: Signature, messageEncoding: string, message: string): Oid; /** * * diff --git a/types/nodegit/ref-log.d.ts b/types/nodegit/ref-log.d.ts index dec49731eb..78367ffccd 100644 --- a/types/nodegit/ref-log.d.ts +++ b/types/nodegit/ref-log.d.ts @@ -30,13 +30,13 @@ export class Reflog { * * @static * @param {Repository} repo - * @param {string} old_name + * @param {string} oldName * @param {string} name * @returns {number} * * @memberof Reflog */ - static rename(repo: Repository, old_name: string, name: string): number; + static rename(repo: Repository, oldName: string, name: string): number; /** * @@ -53,12 +53,12 @@ export class Reflog { * * * @param {number} idx - * @param {number} rewrite_previous_entry + * @param {number} rewritePreviousEntry * @returns {number} * * @memberof Reflog */ - drop(idx: number, rewrite_previous_entry: number): number; + drop(idx: number, rewritePreviousEntry: number): number; /** * * diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 165df83036..d1bee99365 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -110,12 +110,12 @@ export class Remote { * * * @static - * @param {string} remote_name + * @param {string} remoteName * @returns {number} * * @memberof Remote */ - static isValidName(remote_name: string): number; + static isValidName(remoteName: string): number; /** * * @@ -353,14 +353,14 @@ export class Remote { * * * @param {RemoteCallbacks} callbacks - * @param {number} update_fetchhead - * @param {number} download_tags - * @param {string} reflog_message + * @param {number} updateFetchhead + * @param {number} downloadTags + * @param {string} reflogMessage * @returns {number} * * @memberof Remote */ - updateTips(callbacks: RemoteCallbacks, update_fetchhead: number, download_tags: number, reflog_message: string): number; + updateTips(callbacks: RemoteCallbacks, updateFetchhead: number, downloadTags: number, reflogMessage: string): number; /** * * diff --git a/types/nodegit/repository.d.ts b/types/nodegit/repository.d.ts index bf598d5a9f..a8882b5d55 100644 --- a/types/nodegit/repository.d.ts +++ b/types/nodegit/repository.d.ts @@ -17,7 +17,7 @@ import { Config } from './config'; import { Merge } from './merge'; import { MergeOptions } from './merge-options'; import { Refdb } from './ref-db'; -import {Revwalk} from './rev-walk'; +import { Revwalk } from './rev-walk'; export interface RepositoryInitOptions { description: string; @@ -310,12 +310,12 @@ export class Repository { * * * @param {string} workdir - * @param {number} update_gitlink + * @param {number} updateGitLink * @returns {number} * * @memberof Repository */ - setWorkdir(workdir: string, update_gitlink: number): number; + setWorkdir(workdir: string, updateGitLink: number): number; /** * * diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 1335eb8365..0fb3af1088 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -19,13 +19,13 @@ export class Reset { * @static * @param {Repository} repo * @param {Object} target - * @param {number} reset_type - * @param {CheckoutOptions} checkout_opts + * @param {number} resetType + * @param {CheckoutOptions} checkoutOpts * @returns {Promise} * * @memberof Reset */ - static reset(repo: Repository, target: Object, reset_type: number, checkout_opts: CheckoutOptions): Promise; + static reset(repo: Repository, target: Object, resetType: number, checkoutOpts: CheckoutOptions): Promise; /** * Look up a refs's commit. * @@ -46,11 +46,11 @@ export class Reset { * @static * @param {Repository} repo * @param {AnnotatedCommit} commit - * @param {number} reset_type - * @param {CheckoutOptions} checkout_opts + * @param {number} resetType + * @param {CheckoutOptions} checkoutOpts * @returns {number} * * @memberof Reset */ - static fromAnnotated(repo: Repository, commit: AnnotatedCommit, reset_type: number, checkout_opts: CheckoutOptions): number; + static fromAnnotated(repo: Repository, commit: AnnotatedCommit, resetType: number, checkoutOpts: CheckoutOptions): number; } diff --git a/types/nodegit/rev-parse.d.ts b/types/nodegit/rev-parse.d.ts index b4ef63f2f2..098f880cd0 100644 --- a/types/nodegit/rev-parse.d.ts +++ b/types/nodegit/rev-parse.d.ts @@ -15,15 +15,15 @@ export class Revparse { * * * @static - * @param {Object} object_out - * @param {Reference} reference_out + * @param {Object} objectOut + * @param {Reference} referenceOut * @param {Repository} repo * @param {string} spec * @returns {number} * * @memberof Revparse */ - static ext(object_out: Object, reference_out: Reference, repo: Repository, spec: string): number; + static ext(objectOut: Object, referenceOut: Reference, repo: Repository, spec: string): number; /** * * diff --git a/types/nodegit/rev-walk.d.ts b/types/nodegit/rev-walk.d.ts index 82b322cd79..2736f57323 100644 --- a/types/nodegit/rev-walk.d.ts +++ b/types/nodegit/rev-walk.d.ts @@ -26,12 +26,12 @@ export class Revwalk { /** * * - * @param {Oid} commit_id + * @param {Oid} commitId * @returns {number} * * @memberof Revwalk */ - hide(commit_id: Oid): number; + hide(commitId: Oid): number; /** * * @@ -143,22 +143,22 @@ export class Revwalk { /** * * - * @param {number} max_count + * @param {number} maxCount * @returns {Promise} * * @memberof Revwalk */ - fastWalk(max_count: number): Promise; + fastWalk(maxCount: number): Promise; /** * * * @param {string} filePath - * @param {number} max_count + * @param {number} maxCount * @returns {Promise} * * @memberof Revwalk */ - fileHistoryWalk(filePath: string, max_count: number): Promise; + fileHistoryWalk(filePath: string, maxCount: number): Promise; /** * 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). * diff --git a/types/nodegit/revert.d.ts b/types/nodegit/revert.d.ts index ac0cbf531a..2e04f78758 100644 --- a/types/nodegit/revert.d.ts +++ b/types/nodegit/revert.d.ts @@ -29,7 +29,7 @@ export class Revert { * * @static * @param {Repository} repo - * @param {Commit} revert_commit + * @param {Commit} revertCommit * @param {Commit} ourCommit * @param {number} mainline * @param {MergeOptions} mergeOptions @@ -37,5 +37,5 @@ export class Revert { * * @memberof Revert */ - static commit(repo: Repository, revert_commit: 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/submodule.d.ts b/types/nodegit/submodule.d.ts index b9293f6bae..a946e28fa4 100644 --- a/types/nodegit/submodule.d.ts +++ b/types/nodegit/submodule.d.ts @@ -52,12 +52,12 @@ export class Submodule { * @param {Repository} repo * @param {string} url * @param {string} path - * @param {number} use_gitlink + * @param {number} useGitLink * @returns {Promise} * * @memberof Submodule */ - static addSetup(repo: Repository, url: string, path: string, use_gitlink: number): Promise; + static addSetup(repo: Repository, url: string, path: string, useGitLink: number): Promise; /** * * @@ -110,12 +110,12 @@ export class Submodule { * @static * @param {Repository} repo * @param {string} name - * @param {number} fetch_recurse_submodules + * @param {number} fetchRecurseSubmodules * @returns {number} * * @memberof Submodule */ - static setFetchRecurseSubmodules(repo: Repository, name: string, fetch_recurse_submodules: number): number; + static setFetchRecurseSubmodules(repo: Repository, name: string, fetchRecurseSubmodules: number): number; /** * * @@ -187,12 +187,12 @@ export class Submodule { /** * * - * @param {number} write_index + * @param {number} writeIndex * @returns {Promise} * * @memberof Submodule */ - addToIndex(write_index: number): Promise; + addToIndex(writeIndex: number): Promise; /** * * @@ -301,12 +301,12 @@ export class Submodule { /** * * - * @param {number} use_gitlink + * @param {number} useGitLink * @returns {Promise} * * @memberof Submodule */ - repoInit(use_gitlink: number): Promise; + repoInit(useGitLink: number): Promise; /** * * diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts index 8c419ce15f..f676c72ab5 100644 --- a/types/nodegit/tag.d.ts +++ b/types/nodegit/tag.d.ts @@ -10,7 +10,7 @@ export class Tag { * * @static * @param {Repository} repo - * @param {string} tag_name + * @param {string} tagName * @param {Object} target * @param {Signature} tagger * @param {string} message @@ -18,13 +18,13 @@ export class Tag { * * @memberof Tag */ - static annotationCreate(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string): Promise; + static annotationCreate(repo: Repository, tagName: string, target: Object, tagger: Signature, message: string): Promise; /** * * * @static * @param {Repository} repo - * @param {string} tag_name + * @param {string} tagName * @param {Object} target * @param {Signature} tagger * @param {string} message @@ -33,31 +33,31 @@ export class Tag { * * @memberof Tag */ - static create(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string, force: number): Promise; + static create(repo: Repository, tagName: string, target: Object, tagger: Signature, message: string, force: number): Promise; /** * * * @static * @param {Repository} repo - * @param {string} tag_name + * @param {string} tagName * @param {Object} target * @param {number} force * @returns {Promise} * * @memberof Tag */ - static createLightweight(repo: Repository, tag_name: string, target: Object, force: number): Promise; + static createLightweight(repo: Repository, tagName: string, target: Object, force: number): Promise; /** * * * @static * @param {Repository} repo - * @param {string} tag_name + * @param {string} tagName * @returns {Promise} * * @memberof Tag */ - static delete(repo: Repository, tag_name: string): Promise; + static delete(repo: Repository, tagName: string): Promise; /** * * @@ -72,14 +72,14 @@ export class Tag { * * * @static - * @param {Strarray} tag_names + * @param {Strarray} tagNames * @param {string} pattern * @param {Repository} repo * @returns {number} * * @memberof Tag */ - static listMatch(tag_names: Strarray, pattern: string, repo: Repository): number; + static listMatch(tagNames: Strarray, pattern: string, repo: Repository): number; /** * Retrieves the tag pointed to by the oid *