我使用Clone.clone fromnodegit
并且正在寻找进度状态回调。该函数有一个CheckoutOptions对象,我这样称呼它:
var opts: CloneOptions = {};
opts.checkoutOpts = {
progressCb: function() {
console.log("Foo");
},
}
但这似乎使 BrowserWindow 崩溃。有没有人通过查看CheckoutOptions
我可能做错的声明?
注意,CheckoutOptions
是会员CloneOptions
export class CheckoutOptions {
version?: number;
checkoutStrategy?: number;
disableFilters?: number;
dirMode?: number;
fileMode?: number;
fileOpenFlags?: number;
notifyFlags?: number;
notifyCb?: any;
notifyPayload?: undefined;
progressCb?: any;
progressPayload?: undefined;
paths?: Strarray | string | string[];
baseline?: Tree;
baselineIndex?: Index;
targetDirectory?: string;
ancestorLabel?: string;
ourLabel?: string;
theirLabel?: string;
perfdataCb?: any;
perfdataPayload?: undefined;
[key: string]: any;
}
export class CloneOptions {
version?: number;
checkoutOpts?: CheckoutOptions;
fetchOpts?: FetchOptions;
bare?: number;
local?: number;
checkoutBranch?: string;
repositoryCbPayload?: any;
remoteCbPayload?: any;
}