Download desktop/src/api/settings.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 984 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/settings.ts
- Command line
-
hf download hf://chenbhao/codev@e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/settings.ts
-
curl -L -o settings.ts https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/settings.ts
984 Bytes
| import { api } from './client' | |
| import type { PermissionMode, UserSettings } from '../types/settings' | |
| export type CliLauncherStatus = { | |
| supported: boolean | |
| command: string | |
| installed: boolean | |
| launcherPath: string | |
| binDir: string | |
| pathConfigured: boolean | |
| pathInCurrentShell: boolean | |
| availableInNewTerminals: boolean | |
| needsTerminalRestart: boolean | |
| configTarget: string | null | |
| lastError: string | null | |
| } | |
| export const settingsApi = { | |
| getUser() { | |
| return api.get<UserSettings>('/api/settings/user') | |
| }, | |
| updateUser(settings: Partial<UserSettings>) { | |
| return api.put<{ ok: true }>('/api/settings/user', settings) | |
| }, | |
| getPermissionMode() { | |
| return api.get<{ mode: PermissionMode }>('/api/permissions/mode') | |
| }, | |
| setPermissionMode(mode: PermissionMode) { | |
| return api.put<{ ok: true; mode: PermissionMode }>('/api/permissions/mode', { mode }) | |
| }, | |
| getCliLauncherStatus() { | |
| return api.get<CliLauncherStatus>('/api/settings/cli-launcher') | |
| }, | |
| } | |