diff --git a/src/commands/config/index.ts b/src/commands/config/index.ts index 000f265..bc97e72 100644 --- a/src/commands/config/index.ts +++ b/src/commands/config/index.ts @@ -63,7 +63,7 @@ export function registerConfigCommands(program: Command): void { ); } -function getNestedValue(obj: Record, path: string): unknown { +function getNestedValue(obj: object, path: string): unknown { const keys = path.split("."); let current: unknown = obj; for (const key of keys) { @@ -75,9 +75,9 @@ function getNestedValue(obj: Record, path: string): unknown { return current; } -function setNestedValue(obj: Record, path: string, value: string): void { +function setNestedValue(obj: object, path: string, value: string): void { const keys = path.split("."); - let current: Record = obj; + let current: Record = obj as Record; for (let i = 0; i < keys.length - 1; i++) { const key = keys[i]; if (typeof current[key] !== "object" || current[key] === null) { diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..d714bc7 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,30 @@ +export interface DeviceAuthResponse { + device_code: string; + user_code: string; + verification_uri: string; + verification_uri_complete?: string; + expires_in: number; + interval: number; +} + +export interface TokenResponse { + access_token: string; + token_type?: string; + expires_in?: number; + refresh_token?: string; +} + +export interface WaveConfig { + version: string; + currentProject: string; + projects: Record; + defaults: { outputFormat: OutputFormat; protocol?: string; color: "auto" | "on" | "off" }; + telemetry: { enabled: boolean; errorReporting: boolean }; +} + +export type OutputFormat = "table" | "json" | "yaml";