mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-07 23:37:35 +08:00
More types
This commit is contained in:
13
types/nodegit/annotated-commit.d.ts
vendored
Normal file
13
types/nodegit/annotated-commit.d.ts
vendored
Normal file
@@ -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<AnnotatedCommit>;
|
||||
static fromRef(repo: Repository, ref: Reference): Promise<AnnotatedCommit>;
|
||||
static fromRevspec(repo: Repository, revspec: string): Promise<AnnotatedCommit>;
|
||||
static lookup(repo: Repository, id: Oid): Promise<AnnotatedCommit>;
|
||||
|
||||
free(): void;
|
||||
id(): Oid;
|
||||
}
|
||||
20
types/nodegit/blob.d.ts
vendored
Normal file
20
types/nodegit/blob.d.ts
vendored
Normal file
@@ -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<Blob>;
|
||||
static lookupPrefix(repo: Repository, id: Oid, len: number): Promise<Blob>;
|
||||
|
||||
free(): void;
|
||||
id(): Oid;
|
||||
isBinary(): number;
|
||||
owner(): Repository;
|
||||
rawcontent(): Buffer;
|
||||
rawsize(): number;
|
||||
content(): Buffer;
|
||||
toString(): string;
|
||||
filemode(): number;
|
||||
}
|
||||
26
types/nodegit/checkout-options.d.ts
vendored
Normal file
26
types/nodegit/checkout-options.d.ts
vendored
Normal file
@@ -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;
|
||||
}
|
||||
47
types/nodegit/commit.d.ts
vendored
Normal file
47
types/nodegit/commit.d.ts
vendored
Normal file
@@ -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<Commit>;
|
||||
static lookupPrefix(repo: Repository, id: Oid, len: number): Promise<Commit>;
|
||||
|
||||
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<Buf>;
|
||||
id(): Oid;
|
||||
message(): string;
|
||||
messageEncoding(): string;
|
||||
messageRaw(): string;
|
||||
nthGenAncestor(n: number): Promise<Commit>;
|
||||
owner(): Repository;
|
||||
parent(n: number): Promise<Commit>;
|
||||
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<Tree>;
|
||||
getEntry(path: string): Promise<TreeEntry>;
|
||||
history(): EventEmitter;
|
||||
getParents(limit: number, callback: Function): Promise<Commit[]>;
|
||||
parents(callback: Function): Oid[];
|
||||
getDiff(callback: Function): Promise<Diff[]>;
|
||||
getDiffWithOptions(options: Object, callback: Function): Promise<Diff[]>;
|
||||
toString(): string;
|
||||
}
|
||||
10
types/nodegit/diff-delta.d.ts
vendored
Normal file
10
types/nodegit/diff-delta.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { DiffFile } from './diff-file';
|
||||
|
||||
export class DiffDelta {
|
||||
status: number;
|
||||
flags: number;
|
||||
similarity: number;
|
||||
nfiles: number;
|
||||
oldFile: DiffFile;
|
||||
newFile: DiffFile;
|
||||
}
|
||||
9
types/nodegit/diff-file.d.ts
vendored
Normal file
9
types/nodegit/diff-file.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Oid } from './oid';
|
||||
|
||||
export class DiffFile {
|
||||
flags(): number;
|
||||
id(): Oid;
|
||||
mode(): number;
|
||||
path(): string;
|
||||
size(): number;
|
||||
}
|
||||
5
types/nodegit/diff-perf-data.d.ts
vendored
Normal file
5
types/nodegit/diff-perf-data.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export class DiffPerfdata {
|
||||
version: number;
|
||||
statCalls: number;
|
||||
oidCalculations: number;
|
||||
}
|
||||
154
types/nodegit/diff.d.ts
vendored
Normal file
154
types/nodegit/diff.d.ts
vendored
Normal file
@@ -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<any>;
|
||||
static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise<Diff>;
|
||||
static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise<Diff>;
|
||||
static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise<Diff>;
|
||||
static treeToWorkdir(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise<Diff>;
|
||||
static treeToWorkdirWithIndex(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise<Diff>;
|
||||
|
||||
findSimilar(options: DiffFindOptions): Promise<number>;
|
||||
getDelta(idx: number): DiffDelta;
|
||||
getPerfdata(): Promise<DiffPerfdata>;
|
||||
numDeltas(): number;
|
||||
patches(): Promise<any[]>;
|
||||
}
|
||||
41
types/nodegit/enums.d.ts
vendored
Normal file
41
types/nodegit/enums.d.ts
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
9
types/nodegit/fetch-options.d.ts
vendored
Normal file
9
types/nodegit/fetch-options.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { RemoteCallbacks } from './remote-callbacks';
|
||||
|
||||
export interface FetchOptions {
|
||||
version?: number;
|
||||
callbacks?: RemoteCallbacks;
|
||||
prune?: number;
|
||||
updateFetchhead?: number;
|
||||
downloadTags?: number;
|
||||
}
|
||||
21
types/nodegit/index-entry.d.ts
vendored
Normal file
21
types/nodegit/index-entry.d.ts
vendored
Normal file
@@ -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;
|
||||
}
|
||||
19
types/nodegit/index.d.ts
vendored
19
types/nodegit/index.d.ts
vendored
@@ -3,11 +3,30 @@
|
||||
// Definitions by: Dolan Miu <https://github.com/dolanmiu>
|
||||
// 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';
|
||||
|
||||
56
types/nodegit/index_.d.ts
vendored
Normal file
56
types/nodegit/index_.d.ts
vendored
Normal file
@@ -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<Index>;
|
||||
|
||||
add(source_entry: IndexEntry): number;
|
||||
addAll(pathspec: Strarray, flags: number, callback: Function, payload: void): Promise<number>;
|
||||
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<IndexEntry>;
|
||||
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<number>;
|
||||
removeByPath(path: string): number;
|
||||
removeDirectory(dir: string, stage: number): number;
|
||||
setCaps(caps: number): number;
|
||||
updateAll(pathspec: Strarray, callback: Function, payload: void): Promise<number>;
|
||||
write(): number;
|
||||
writeTree(): Promise<Oid>;
|
||||
writeTreeTo(repo: Repository): Promise<Oid>;
|
||||
entries(): IndexEntry[];
|
||||
}
|
||||
@@ -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
|
||||
});
|
||||
|
||||
10
types/nodegit/odb-object.d.ts
vendored
Normal file
10
types/nodegit/odb-object.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Oid } from './oid';
|
||||
|
||||
export class OdbObject {
|
||||
data(): Buffer;
|
||||
dup(): Promise<OdbObject>;
|
||||
free(): void;
|
||||
id(): Oid;
|
||||
size(): number;
|
||||
type(): number;
|
||||
}
|
||||
3
types/nodegit/odb.d.ts
vendored
3
types/nodegit/odb.d.ts
vendored
@@ -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<NodeGit.OdbObject>;
|
||||
read(id: Oid): Promise<OdbObject>;
|
||||
write(data: Buffer, len: number, type: number): Promise<Oid>;
|
||||
}
|
||||
|
||||
3
types/nodegit/reference.d.ts
vendored
3
types/nodegit/reference.d.ts
vendored
@@ -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<NodeGit.Object>;
|
||||
peel(type: number): Promise<Object>;
|
||||
rename(newName: string, force: number, logMessage: string): Promise<Reference>;
|
||||
resolve(): Promise<Reference>;
|
||||
setTarget(id: Oid, logMessage: string): Promise<Reference>;
|
||||
|
||||
8
types/nodegit/remote-callbacks.d.ts
vendored
Normal file
8
types/nodegit/remote-callbacks.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export interface RemoteCallbacks {
|
||||
version?: number;
|
||||
credentials?: Function;
|
||||
certificateCheck?: Function;
|
||||
transferProgress?: Function;
|
||||
transport?: Function;
|
||||
payload?: void;
|
||||
}
|
||||
62
types/nodegit/remote.d.ts
vendored
Normal file
62
types/nodegit/remote.d.ts
vendored
Normal file
@@ -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<Remote>;
|
||||
static createWithFetchspec(repo: Repository, name: string, url: string, fetch: string): Promise<Remote>;
|
||||
static delete(repo: Repository, name: string): Promise<number>;
|
||||
static initCallbacks(opts: RemoteCallbacks, version: number): number;
|
||||
static isValidName(remote_name: string): number;
|
||||
static list(repo: Repository): Promise<any[]>;
|
||||
static lookup(repo: Repository, name: string | Remote, callback: Function): Promise<Remote>;
|
||||
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<number>;
|
||||
connected(): number;
|
||||
defaultBranch(): Promise<Buf>;
|
||||
disconnect(): Promise<void>;
|
||||
download(refSpecs: any[], opts: FetchOptions, callback: Function): Promise<number>;
|
||||
dup(): Promise<Remote>;
|
||||
fetch(refSpecs: any[], opts: FetchOptions, message: string, callback: Function): Promise<number>;
|
||||
free(): void;
|
||||
getFetchRefspecs(): Promise<any[]>;
|
||||
getPushRefspecs(): Promise<any[]>;
|
||||
getRefspec(n: number): Refspec;
|
||||
name(): string;
|
||||
owner(): Repository;
|
||||
prune(callbacks: RemoteCallbacks): number;
|
||||
pruneRefs(): number;
|
||||
push(refSpecs: any[], options: PushOptions, callback: Function): Promise<number>;
|
||||
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;
|
||||
}
|
||||
43
types/nodegit/repository.d.ts
vendored
43
types/nodegit/repository.d.ts
vendored
@@ -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<Reference>;
|
||||
headDetached(): number;
|
||||
headUnborn(): number;
|
||||
index(): Promise<NodeGit.Index>;
|
||||
index(): Promise<Index>;
|
||||
isBare(): number;
|
||||
isEmpty(): number;
|
||||
isShallow(): number;
|
||||
@@ -95,44 +104,44 @@ export class Repository {
|
||||
refdb(): Promise<NodeGit.Refdb>;
|
||||
setHead(refname: string): Promise<number>;
|
||||
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<Reference>;
|
||||
getReferenceCommit(name: string | Reference): Promise<NodeGit.Commit>;
|
||||
createBranch(name: string, commit: Commit | string | Oid, force: boolean, signature: Signature, logMessage: string): Promise<Reference>;
|
||||
getReferenceCommit(name: string | Reference): Promise<Commit>;
|
||||
getBranch(name: string | Reference): Promise<Reference>;
|
||||
getBranchCommit(name: string | Reference): Promise<NodeGit.Commit>;
|
||||
getBranchCommit(name: string | Reference): Promise<Commit>;
|
||||
getCurrentBranch(): Promise<Reference>;
|
||||
getReference(name: string | Reference): Promise<Reference>;
|
||||
getReferences(type: Reference.TYPE): Promise<Reference[]>;
|
||||
getReferenceNames(type: Reference.TYPE): Promise<string[]>;
|
||||
getCommit(string: string | Oid): Promise<NodeGit.Commit>;
|
||||
getBlob(string: string | Oid): Promise<NodeGit.Blob>;
|
||||
getTree(string: string | Oid): Promise<NodeGit.Tree>;
|
||||
getCommit(string: string | Oid): Promise<Commit>;
|
||||
getBlob(string: string | Oid): Promise<Blob>;
|
||||
getTree(string: string | Oid): Promise<Tree>;
|
||||
createTag(string: string | Oid, name: string, message: string): Promise<NodeGit.Tag>;
|
||||
createLightweightTag(string: string | Oid, name: string): Promise<Reference>;
|
||||
getTag(string: string | Oid): Promise<NodeGit.Tag>;
|
||||
getTagByName(Short: string): Promise<NodeGit.Tag>;
|
||||
deleteTagByName(Short: string): Promise<any>;
|
||||
createRevWalk(string: string | Oid): any;
|
||||
getMasterCommit(): Promise<NodeGit.Commit>;
|
||||
getHeadCommit(): Promise<NodeGit.Commit>;
|
||||
createCommit(updateRef: string, author: NodeGit.Signature, committer: NodeGit.Signature, message: string, Tree: NodeGit.Tree | Oid | string, parents: any[]): Promise<Oid>;
|
||||
createCommitOnHead(filesToAdd: any[], author: NodeGit.Signature, committer: NodeGit.Signature, message: string): Promise<Oid>;
|
||||
getMasterCommit(): Promise<Commit>;
|
||||
getHeadCommit(): Promise<Commit>;
|
||||
createCommit(updateRef: string, author: Signature, committer: Signature, message: string, Tree: Tree | Oid | string, parents: any[]): Promise<Oid>;
|
||||
createCommitOnHead(filesToAdd: any[], author: Signature, committer: Signature, message: string): Promise<Oid>;
|
||||
createBlobFromBuffer(buffer: Buffer): Oid;
|
||||
treeBuilder(tree: NodeGit.Tree): any;
|
||||
treeBuilder(tree: Tree): any;
|
||||
defaultSignature(): Signature;
|
||||
getRemotes(Optional: Function): Promise<Object>;
|
||||
getRemote(remote: string | Remote, callback: Function): Promise<NodeGit.Remote>;
|
||||
getRemote(remote: string | Remote, callback: Function): Promise<Remote>;
|
||||
fetch(remote: string | Remote, fetchOptions: Object | FetchOptions): Promise<any>;
|
||||
fetchAll(fetchOptions: Object | FetchOptions, callback: Function): Promise<any>;
|
||||
mergeBranches(to: string | Reference, from: string | Reference, signature: NodeGit.Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise<Oid>;
|
||||
rebaseBranches(branch: string, upstream: string, onto: string, signature: NodeGit.Signature, beforeNextFn: Function): Promise<Oid>;
|
||||
continueRebase(signature: NodeGit.Signature, beforeNextFn: Function): Promise<Oid>;
|
||||
mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise<Oid>;
|
||||
rebaseBranches(branch: string, upstream: string, onto: string, signature: Signature, beforeNextFn: Function): Promise<Oid>;
|
||||
continueRebase(signature: Signature, beforeNextFn: Function): Promise<Oid>;
|
||||
getStatus(opts: any): Promise<any[]>;
|
||||
getStatusExt(opts: any): Promise<any[]>;
|
||||
getSubmoduleNames(): Promise<string[]>;
|
||||
|
||||
6
types/nodegit/str-array.d.ts
vendored
Normal file
6
types/nodegit/str-array.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export class Strarray {
|
||||
copy(src: Strarray): number;
|
||||
free(): void;
|
||||
strings: string;
|
||||
count: number;
|
||||
}
|
||||
16
types/nodegit/tree-builder.d.ts
vendored
Normal file
16
types/nodegit/tree-builder.d.ts
vendored
Normal file
@@ -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<Treebuilder>;
|
||||
|
||||
clear(): void;
|
||||
entrycount(): number;
|
||||
free(): void;
|
||||
get(filename: string): TreeEntry;
|
||||
insert(filename: string, id: Oid, filemode: number): Promise<TreeEntry>;
|
||||
remove(filename: string): number;
|
||||
write(): Oid;
|
||||
}
|
||||
30
types/nodegit/tree-entry.d.ts
vendored
Normal file
30
types/nodegit/tree-entry.d.ts
vendored
Normal file
@@ -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<Tree>;
|
||||
getBlob(): Promise<Blob>;
|
||||
path(): string;
|
||||
toString(): string;
|
||||
attr: number;
|
||||
oid: Oid;
|
||||
filenameLen: number;
|
||||
filename: string;
|
||||
}
|
||||
44
types/nodegit/tree.d.ts
vendored
Normal file
44
types/nodegit/tree.d.ts
vendored
Normal file
@@ -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<Tree>;
|
||||
static lookupPrefix(repo: Repository, id: Oid, len: number): Promise<Tree>;
|
||||
|
||||
entryById(id: Oid): TreeEntry;
|
||||
_entryByIndex(idx: number): TreeEntry;
|
||||
entryByName(name: string): TreeEntry;
|
||||
entryByPath(path: string): Promise<TreeEntry>;
|
||||
entryCount(): number;
|
||||
free(): void;
|
||||
id(): Oid;
|
||||
owner(): Repository;
|
||||
diff(tree: Tree, callback: Function): Promise<DiffFile[]>;
|
||||
diffWithOptions(tree: Tree, options: Object, callback: Function): Promise<DiffFile[]>;
|
||||
entryByIndex(i: number): TreeEntry;
|
||||
getEntry(filePath: string): TreeEntry;
|
||||
entries(): TreeEntry[];
|
||||
walk(blobsOnly?: Boolean): NodeJS.EventEmitter;
|
||||
path(): string;
|
||||
builder(): Treebuilder;
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user