本文整理汇总了TypeScript中vs/base/parts/ipc/common/ipc.IChannel类的典型用法代码示例。如果您正苦于以下问题:TypeScript IChannel类的具体用法?TypeScript IChannel怎么用?TypeScript IChannel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IChannel类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: c
.then(() => {
out = fs.createWriteStream(to);
out.once('close', () => c(to));
out.once('error', e);
const uploadStream = this.channel.listen<UploadResponse>('upload', from);
const disposable = uploadStream(result => {
if (result === undefined) {
disposable.dispose();
out.end(() => c(to));
} else if (Buffer.isBuffer(result)) {
out.write(result);
} else if (typeof result === 'string') {
disposable.dispose();
out.end(() => e(result));
}
});
});
示例2:
getTitle(windowId: number): Promise<string> {
return this.channel.call('getTitle', [windowId]);
}
示例3: onDidChangeLogLevel
get onDidChangeLogLevel(): Event<LogLevel> {
return this.channel.listen('onDidChangeLogLevel');
}
示例4:
open(url: URI): Promise<boolean> {
return this.channel.call('open', url.toJSON());
}
示例5:
setRoots(roots: IWatcherRequest[]): Promise<void> {
return this.channel.call('setRoots', roots);
}