mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Added documentation
This commit is contained in:
Vendored
+204
-8
@@ -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<any>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
static blobToBuffer(old_blob: Blob, oldAsPath: string,
|
||||
buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise<any>;
|
||||
buffer: string, bufferAsPath: string, opts: DiffOptions, fileCb: Function, binaryCb: Function, hunkCb: Function, lineCb: Function): Promise<any>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @static
|
||||
* @param {string} content
|
||||
* @param {number} contentLen
|
||||
* @returns {Promise<Diff>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
static fromBuffer(content: string, contentLen: number): Promise<Diff>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @static
|
||||
* @param {Repository} repo
|
||||
* @param {Index} index
|
||||
* @param {DiffOptions} opts
|
||||
* @returns {Promise<Diff>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
static indexToWorkdir(repo: Repository, index: Index, opts: DiffOptions): Promise<Diff>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @static
|
||||
* @param {Repository} repo
|
||||
* @param {Index} oldIndex
|
||||
* @param {Index} newIndex
|
||||
* @param {DiffOptions} opts
|
||||
* @returns {Promise<Diff>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
static indexToIndex(repo: Repository, oldIndex: Index, newIndex: Index, opts: DiffOptions): Promise<Diff>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @static
|
||||
* @param {Repository} repo
|
||||
* @param {Tree} old_tree
|
||||
* @param {Index} index
|
||||
* @param {DiffOptions} opts
|
||||
* @returns {Promise<Diff>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
static treeToIndex(repo: Repository, old_tree: Tree, index: Index, opts: DiffOptions): Promise<Diff>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @static
|
||||
* @param {Repository} repo
|
||||
* @param {Tree} old_tree
|
||||
* @param {Tree} new_tree
|
||||
* @param {DiffOptions} opts
|
||||
* @returns {Promise<Diff>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
static treeToTree(repo: Repository, old_tree: Tree, new_tree: Tree, opts: DiffOptions): Promise<Diff>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @static
|
||||
* @param {Repository} repo
|
||||
* @param {Tree} old_tree
|
||||
* @param {DiffOptions} opts
|
||||
* @returns {Promise<Diff>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
static treeToWorkdir(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise<Diff>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @static
|
||||
* @param {Repository} repo
|
||||
* @param {Tree} old_tree
|
||||
* @param {DiffOptions} opts
|
||||
* @returns {Promise<Diff>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
static treeToWorkdirWithIndex(repo: Repository, old_tree: Tree, opts: DiffOptions): Promise<Diff>;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {DiffFindOptions} options
|
||||
* @returns {Promise<number>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
findSimilar(options: DiffFindOptions): Promise<number>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {number} idx
|
||||
* @returns {DiffDelta}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
getDelta(idx: number): DiffDelta;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @returns {Promise<DiffPerfdata>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
getPerfdata(): Promise<DiffPerfdata>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @returns {number}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
numDeltas(): number;
|
||||
/**
|
||||
* Retrieve patches in this difflist
|
||||
*
|
||||
* @returns {Promise<any[]>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
patches(): Promise<any[]>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {Diff} from
|
||||
* @returns {Promise<number>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
merge(from: Diff): Promise<number>;
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {Diff.FORMAT} format
|
||||
* @returns {Promise<Buf>}
|
||||
*
|
||||
* @memberof Diff
|
||||
*/
|
||||
toBuf(format: Diff.FORMAT): Promise<Buf>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user