Added more files

This commit is contained in:
Dolan
2017-06-04 02:39:34 +01:00
parent cdf69c51e9
commit dd5dc38dec
19 changed files with 218 additions and 26 deletions

View File

@@ -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;
}

View File

@@ -1,3 +1,5 @@
import { EventEmitter } from 'events';
import { Repository } from './repository';
import { Signature } from './signature';
import { Oid } from './oid';

22
types/nodegit/config.d.ts vendored Normal file
View File

@@ -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<Config>;
getStringBuf(name: string): Promise<Buf>;
setInt64(name: string, value: number): number;
setMultivar(name: string, regexp: string, value: string): number;
setString(name: string, value: string): Promise<number>;
snapshot(): Promise<Config>;
}

View File

@@ -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<any>;
static blobToBuffer(old_blob: Blob, oldAsPath: string,
buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: 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>;

View File

@@ -1,6 +1,6 @@
import { Oid } from './oid';
interface IndexTime {
export interface IndexTime {
seconds: number;
nanoseconds: number;
}

View File

@@ -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';

7
types/nodegit/merge-file-input.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
export interface MergeFileInput {
version: number;
ptr: string;
size: number;
path: string;
mode: number;
}

8
types/nodegit/merge-options.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
export interface MergeOptions {
version: number;
treeFlags: number;
renameThreshold: number;
targetLimit: number;
fileFavor: number;
fileFlags: number;
}

59
types/nodegit/merge.d.ts vendored Normal file
View File

@@ -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<Oid>;
static bases(repo: Repository, one: Oid, two: Oid): Promise<Oidarray>;
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<Index>;
}

7
types/nodegit/oid-array.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
import { Oid } from './oid';
export class Oidarray {
free(): void;
ids: Oid;
count: number;
}

7
types/nodegit/push-options.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
import { RemoteCallbacks } from './remote-callbacks';
export interface PushOptions {
version: number;
pbParallelism: number;
callbacks: RemoteCallbacks;
}

8
types/nodegit/ref-db.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
import { Repository } from './repository';
export class Refdb {
static open(repo: Repository): Promise<Refdb>;
compress(): number;
free(): void;
}

8
types/nodegit/ref-spec.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
export class Refspec {
direction(): number;
dst(): string;
dstMatches(refname: string): number;
force(): number;
src(): string;
srcMatches(refname: string): number;
}

View File

@@ -1,8 +1,8 @@
export interface RemoteCallbacks {
export class RemoteCallbacks {
version?: number;
credentials?: Function;
certificateCheck?: Function;
transferProgress?: Function;
transport?: Function;
payload?: void;
payload?: undefined;
}

View File

@@ -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 {

View File

@@ -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<Repository>;
cleanup(): void;
config(): Promise<NodeGit.Config>;
configSnapshot(): Promise<NodeGit.Config>;
config(): Promise<Config>;
configSnapshot(): Promise<Config>;
detachHead(): number;
fetchheadForeach(callback: Function): Promise<any>;
free(): void;
@@ -101,7 +105,7 @@ export class Repository {
messageRemove(): number;
odb(): Promise<Odb>;
path(): string;
refdb(): Promise<NodeGit.Refdb>;
refdb(): Promise<Refdb>;
setHead(refname: string): Promise<number>;
setHeadDetached(commitish: Oid): number;
setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): number;
@@ -122,10 +126,10 @@ export class Repository {
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>;
createTag(string: string | Oid, name: string, message: string): Promise<Tag>;
createLightweightTag(string: string | Oid, name: string): Promise<Reference>;
getTag(string: string | Oid): Promise<NodeGit.Tag>;
getTagByName(Short: string): Promise<NodeGit.Tag>;
getTag(string: string | Oid): Promise<Tag>;
getTagByName(Short: string): Promise<Tag>;
deleteTagByName(Short: string): Promise<any>;
createRevWalk(string: string | Oid): any;
getMasterCommit(): Promise<Commit>;
@@ -139,7 +143,7 @@ export class Repository {
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: Signature, mergePreference: NodeGit.Merge.PREFERENCE, mergeOptions: NodeGit.MergeOptions): Promise<Oid>;
mergeBranches(to: string | Reference, from: string | Reference, signature: Signature, mergePreference: Merge.PREFERENCE, mergeOptions: 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[]>;

27
types/nodegit/tag.d.ts vendored Normal file
View File

@@ -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<Oid>;
static create(repo: Repository, tag_name: string, target: Object, tagger: Signature, message: string, force: number): Promise<Oid>;
static createLightweight(repo: Repository, tag_name: string, target: Object, force: number): Promise<Oid>;
static delete(repo: Repository, tag_name: string): Promise<number>;
static list(repo: Repository): Promise<any[]>;
static listMatch(tag_names: Strarray, pattern: string, repo: Repository): number;
static lookup(repo: Repository, id: string | Oid | Tag): Promise<Tag>;
static lookupPrefix(repo: Repository, id: Oid, len: number): Promise<Tag>;
free(): void;
id(): Oid;
message(): string;
name(): string;
owner(): Repository;
peel(tag_target_out: Object): number;
tagger(): Signature;
target(): Object;
targetId(): Oid;
targetType(): number;
}

9
types/nodegit/transfer-progress.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
export class TransferProgress {
totalObjects: number;
indexedObjects: number;
receivedObjects: number;
localObjects: number;
totalDeltas: number;
indexedDeltas: number;
receivedBytes: number;
}

View File

@@ -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"