當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript app.isAccessibilitySupportEnabled方法代碼示例

本文整理匯總了TypeScript中electron.app.isAccessibilitySupportEnabled方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript app.isAccessibilitySupportEnabled方法的具體用法?TypeScript app.isAccessibilitySupportEnabled怎麽用?TypeScript app.isAccessibilitySupportEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在electron.app的用法示例。


在下文中一共展示了app.isAccessibilitySupportEnabled方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: formatEnvironment

function formatEnvironment(info: IMainProcessInfo): string {
	const MB = 1024 * 1024;
	const GB = 1024 * MB;

	const output: string[] = [];
	output.push(`Version:          ${pkg.name} ${pkg.version} (${product.commit || 'Commit unknown'}, ${product.date || 'Date unknown'})`);
	output.push(`OS Version:       ${os.type()} ${os.arch()} ${os.release()})`);
	const cpus = os.cpus();
	if (cpus && cpus.length > 0) {
		output.push(`CPUs:             ${cpus[0].model} (${cpus.length} x ${cpus[0].speed})`);
	}
	output.push(`Memory (System):  ${(os.totalmem() / GB).toFixed(2)}GB (${(os.freemem() / GB).toFixed(2)}GB free)`);
	if (!isWindows) {
		output.push(`Load (avg):       ${os.loadavg().map(l => Math.round(l)).join(', ')}`); // only provided on Linux/macOS
	}
	output.push(`VM:               ${Math.round((virtualMachineHint.value() * 100))}%`);
	output.push(`Screen Reader:    ${app.isAccessibilitySupportEnabled() ? 'yes' : 'no'}`);

	return output.join('\n');
}
開發者ID:AlexxNica,項目名稱:sqlopsstudio,代碼行數:20,代碼來源:diagnostics.ts

示例2: getSystemInfo

	async getSystemInfo(launchService: ILaunchService): Promise<SystemInfo> {
		const info = await launchService.getMainProcessInfo();
		const { memory, vmHint, os, cpus } = getMachineInfo();
		const systemInfo: SystemInfo = {
			os,
			memory,
			cpus,
			vmHint,
			processArgs: `${info.mainArguments.join(' ')}`,
			gpuStatus: app.getGPUFeatureStatus(),
			screenReader: `${app.isAccessibilitySupportEnabled() ? 'yes' : 'no'}`,
			remoteData: (await launchService.getRemoteDiagnostics({ includeProcesses: false, includeWorkspaceMetadata: false })).filter((x): x is IRemoteDiagnosticInfo => !(x instanceof Error))
		};


		if (!isWindows) {
			systemInfo.load = `${osLib.loadavg().map(l => Math.round(l)).join(', ')}`;
		}

		return Promise.resolve(systemInfo);
	}
開發者ID:PKRoma,項目名稱:vscode,代碼行數:21,代碼來源:diagnosticsService.ts

示例3: getSystemInfo

function getSystemInfo(info: IMainProcessInfo): SystemInfo {
	const MB = 1024 * 1024;
	const GB = 1024 * MB;

	const systemInfo: SystemInfo = {
		'Memory (System)': `${(os.totalmem() / GB).toFixed(2)}GB (${(os.freemem() / GB).toFixed(2)}GB free)`,
		VM: `${Math.round((virtualMachineHint.value() * 100))}%`,
		'Screen Reader': `${app.isAccessibilitySupportEnabled() ? 'yes' : 'no'}`,
		'Process Argv': `${info.mainArguments.join(' ')}`
	};

	const cpus = os.cpus();
	if (cpus && cpus.length > 0) {
		systemInfo.CPUs = `${cpus[0].model} (${cpus.length} x ${cpus[0].speed})`;
	}

	if (!isWindows) {
		systemInfo['Load (avg)'] = `${os.loadavg().map(l => Math.round(l)).join(', ')}`;
	}


	return systemInfo;
}
開發者ID:JarnoNijboer,項目名稱:vscode,代碼行數:23,代碼來源:diagnostics.ts

示例4: it

 it('returns whether the Chrome has accessibility APIs enabled', () => {
   expect(app.isAccessibilitySupportEnabled()).to.be.a('boolean')
 })
開發者ID:malept,項目名稱:electron,代碼行數:3,代碼來源:api-app-spec.ts


注:本文中的electron.app.isAccessibilitySupportEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。