fix(types): add TypeScript declarations for JS modules

Add .d.ts files for all JS modules imported by TypeScript source to resolve
TS7016 errors. Files are force-added because src/**/*.d.ts is gitignored.

- preferences, preferences-models, gitignore, agentic-docs-scaffold
- doc-checker, code-intelligence, native-git-bridge, paths, repo-identity
- types, trace-collector, doctor, url-utils, config
This commit is contained in:
Mikael Hugo 2026-05-04 18:57:34 +02:00
parent ccdd3027ab
commit 33383ed53a
14 changed files with 133 additions and 0 deletions

View file

@ -0,0 +1,8 @@
export interface RemoteConfig {
endpoint: string;
apiKey?: string;
timeout?: number;
}
export function resolveRemoteConfig(): RemoteConfig;
export function loadRemoteConfig(path?: string): RemoteConfig;

View file

@ -0,0 +1,3 @@
export function normalizeUrl(url: string): string;
export function isValidUrl(url: string): boolean;
export function extractDomain(url: string): string;

View file

@ -0,0 +1,7 @@
export interface ScaffoldResult {
success: boolean;
files?: string[];
error?: string;
}
export function scaffoldDocs(options?: { basePath?: string }): ScaffoldResult;

View file

@ -0,0 +1,8 @@
export interface CodeIntelligenceResult {
symbols?: string[];
dependencies?: string[];
complexity?: number;
}
export function analyzeCode(path: string): CodeIntelligenceResult;
export function getSymbolDefinitions(query: string): unknown[];

View file

@ -0,0 +1,7 @@
export interface DocCheckResult {
summary: string;
issues?: string[];
score?: number;
}
export function checkDocsScaffold(path: string): DocCheckResult;

View file

@ -0,0 +1,8 @@
export interface DoctorResult {
healthy: boolean;
issues: string[];
recommendations: string[];
}
export function runDoctor(): DoctorResult;
export function checkSystemHealth(): Promise<DoctorResult>;

View file

@ -0,0 +1,2 @@
export function isPathIgnored(path: string, basePath?: string): boolean;
export function loadGitignore(basePath?: string): void;

View file

@ -0,0 +1,9 @@
export interface GitStatus {
branch: string;
clean: boolean;
modified: string[];
untracked: string[];
}
export function getGitStatus(path?: string): GitStatus;
export function execGit(args: string[], cwd?: string): { stdout: string; stderr: string; code: number };

View file

@ -0,0 +1,2 @@
export function resolvePath(path: string): string;
export function getProjectRoot(): string;

View file

@ -0,0 +1,8 @@
export interface ModelConfig {
provider: string;
model: string;
[key: string]: unknown;
}
export function isProviderModelAllowed(provider: string, model: string): boolean;
export function getDefaultModel(): ModelConfig;

View file

@ -0,0 +1,13 @@
export interface Preferences {
preferences?: {
experimental?: {
rtk?: boolean;
[key: string]: unknown;
};
[key: string]: unknown;
};
[key: string]: unknown;
}
export function loadPreferences(): Preferences;
export function getPreferences(): Preferences;

View file

@ -0,0 +1,9 @@
export interface RepoIdentity {
name: string;
url?: string;
branch: string;
commit: string;
}
export function getRepoIdentity(path?: string): RepoIdentity;
export function getRepoName(): string;

View file

@ -0,0 +1,19 @@
export interface Span {
id: string;
name: string;
startTime: number;
endTime?: number;
attributes: Record<string, unknown>;
children: Span[];
}
export interface Trace {
id: string;
rootSpan: Span;
startTime: number;
endTime?: number;
attributes: Record<string, unknown>;
}
export function initTraceCollector(): { getActiveTrace(): Trace | null } | null;
export function getTraceCollector(): { getActiveTrace(): Trace | null } | null;

30
src/resources/extensions/sf/types.d.ts vendored Normal file
View file

@ -0,0 +1,30 @@
export interface Milestone {
id: string;
title: string;
status: string;
phase?: string;
nextAction?: string;
}
export interface Slice {
id: string;
milestoneId: string;
title: string;
status: string;
}
export interface Task {
id: string;
sliceId: string;
milestoneId: string;
title: string;
status: string;
}
export type UnitType = "milestone" | "slice" | "task";
export interface Unit {
id: string;
type: UnitType;
status: string;
}