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"