本文整理匯總了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);
}