INNER CODE UNIT · TypeScript

available

SimonAKing/scrcpy-gui · src/main/main.ts:431

  const available = new Set(listTrackedDevices().filter((device) => device.state === 'device').map((device) => device.serial))
  const missing = serials.filter((serial) => !available.has(serial))
  if (missing.length) throw new TypeError(`Device is no longer available: ${missing.join(', ')}.`)
  return serials
}

handle('app:version', () => app.getVersion())
handle('events:list', (_event, query: unknown) => eventStore.list(validateEventQuery(query)))
handle('events:clear', () => eventStore.clear())
handle('diagnostics:preview', async (_event, runtime: RuntimeConfig) => {
  try {
    return { ok: true, data: (await prepareDiagnostics(runtime, false)).preview }
  } catch (error) {
    return failureFromUnknown(error, 'DIAGNOSTIC_PREVIEW_FAILED', 'diagnostic-preview', 'Unable to prepare the diagnostic preview.')
  }
})
handle('diagnostics:export', async (_event, runtime: RuntimeConfig) => {
  if (!artifactService) return operationFailure('ARTIFACT_SERVICE_UNAVAILABLE', 'diagnostic-export', 'Artifact service is not ready.')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…