本文整理汇总了TypeScript中vs/base/common/uriIpc.IURITransformer.transformOutgoing方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IURITransformer.transformOutgoing方法的具体用法?TypeScript IURITransformer.transformOutgoing怎么用?TypeScript IURITransformer.transformOutgoing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/base/common/uriIpc.IURITransformer
的用法示例。
在下文中一共展示了IURITransformer.transformOutgoing方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: download
download(from: URI, to: string): TPromise<void> {
from = this.uriTransformer.transformOutgoing(from);
const dirName = path.dirname(to);
let out: fs.WriteStream;
return new TPromise((c, e) => {
return mkdirp(dirName)
.then(() => {
out = fs.createWriteStream(to);
out.once('close', () => c(null));
out.once('error', e);
const uploadStream = this.channel.listen('upload', from);
const disposable = uploadStream((result: UploadResponse) => {
if (result === void 0) {
out.end();
disposable.dispose();
c(null);
} else if (Buffer.isBuffer(result)) {
out.write(result);
} else if (typeof result === 'string') {
out.close();
disposable.dispose();
e(result);
}
});
});
});
}
示例2: install
install(vsix: URI): Promise<IExtensionIdentifier> {
return Promise.resolve(this.channel.call('install', [this.uriTransformer.transformOutgoing(vsix)]));
}
示例3: unzip
unzip(zipLocation: URI, type: LocalExtensionType): Promise<IExtensionIdentifier> {
return Promise.resolve(this.channel.call('unzip', [this.uriTransformer.transformOutgoing(zipLocation), type]));
}
示例4: _transformOutgoing
private _transformOutgoing(extension: ILocalExtension | undefined): ILocalExtension | undefined {
return extension ? { ...extension, ...{ location: this.uriTransformer.transformOutgoing(extension.location) } } : extension;
}
示例5: cloneAndChange
return transformer ? cloneAndChange(extension, value => value instanceof URI ? transformer.transformOutgoing(value) : undefined) : extension;
示例6: transformOutgoingURI
function transformOutgoingURI(uri: URI, transformer: IURITransformer | null): URI {
return transformer ? transformer.transformOutgoing(uri) : uri;
}