apple-dev-mcp
Version:
Complete Apple development guidance: Human Interface Guidelines (design) + Technical Documentation for iOS, macOS, watchOS, tvOS, and visionOS
153 lines • 4.24 kB
TypeScript
/**
* Apple Content API Client
*
* Unified client for Apple's developer documentation and Human Interface Guidelines
* Direct API access to Apple's developer documentation at developer.apple.com/tutorials/data
* Adapted from MightyDillah's apple-doc-mcp with enhancements for HIG integration
*/
import type { HIGCache } from '../cache.js';
import type { FrameworkInfo } from '../types.js';
export interface Technology {
title: string;
abstract: {
text: string;
type: string;
}[];
url: string;
kind: string;
role: string;
identifier: string;
}
export interface TopicSection {
title: string;
identifiers: string[];
anchor?: string;
}
export interface FrameworkData {
metadata: {
title: string;
role: string;
platforms: any[];
};
abstract: {
text: string;
type: string;
}[];
topicSections: TopicSection[];
references: Record<string, any>;
}
export interface SymbolData {
metadata: {
title: string;
symbolKind: string;
platforms: any[];
};
abstract: {
text: string;
type: string;
}[];
primaryContentSections: any[];
topicSections: TopicSection[];
references: Record<string, any>;
}
export interface TechnicalSearchResult {
title: string;
description: string;
path: string;
framework: string;
symbolKind?: string;
platforms?: string;
url: string;
relevanceScore: number;
type: 'technical';
}
export interface TechnicalDocumentation {
id: string;
symbol: string;
framework: string;
symbolKind: string;
platforms: string[];
abstract: string;
apiReference: string;
codeExamples: string[];
relatedSymbols: string[];
url: string;
lastUpdated: Date;
}
export declare class AppleContentAPIClient {
private cache;
private readonly cacheTimeout;
constructor(cache: HIGCache);
private makeRequest;
getTechnologies(): Promise<Record<string, Technology>>;
getFramework(frameworkName: string): Promise<FrameworkData>;
getSymbol(path: string): Promise<SymbolData>;
/**
* Get technical documentation for a symbol with enhanced formatting
*/
getTechnicalDocumentation(path: string): Promise<TechnicalDocumentation>;
/**
* Search across frameworks with direct symbol lookup and framework search
*/
searchGlobal(query: string, options?: {
symbolType?: string;
platform?: string;
maxResults?: number;
includeRelevanceScore?: boolean;
}): Promise<TechnicalSearchResult[]>;
/**
* Try direct symbol lookup for common Apple symbols
*/
private tryDirectSymbolLookup;
/**
* Guess the most likely framework for a symbol
*/
private guessFramework;
/**
* Calculate relevance score for direct symbol matches
*/
private calculateDirectSymbolRelevance;
/**
* Prioritize frameworks based on query hints and common usage
*/
private prioritizeFrameworks;
/**
* Search within a specific framework
*/
searchFramework(frameworkName: string, query: string, options?: {
symbolType?: string;
platform?: string;
maxResults?: number;
includeRelevanceScore?: boolean;
}): Promise<TechnicalSearchResult[]>;
/**
* Get list of available frameworks
*/
getFrameworkList(): Promise<{
name: string;
description: string;
platforms: string[];
}[]>;
/**
* Check if a path exists in Apple's documentation
*/
pathExists(path: string): Promise<boolean>;
/**
* Get framework information by name
*/
getFrameworkInfo(frameworkName: string): Promise<FrameworkInfo>;
private createSearchPattern;
private matchesSearch;
private calculateRelevanceScore;
private extractFrameworkFromPath;
private extractCodeExamples;
private extractRelatedSymbols;
private generateAPIReference;
extractText(abstract: {
text: string;
type: string;
}[]): string;
private formatPlatforms;
private formatPlatformList;
}
//# sourceMappingURL=apple-content-api-client.service.d.ts.map