UNPKG

@iflow-mcp/leetcode-mcp-server

Version:

MCP Server for LeetCode API (supports leetcode.com and leetcode.cn)

100 lines (99 loc) 4.01 kB
import { Credential, LeetCode } from "leetcode-query"; import { LeetCodeBaseService } from "./leetcode-base-service.js"; /** * LeetCode Global API Service Implementation * * This class provides methods to interact with the LeetCode Global API */ export declare class LeetCodeGlobalService implements LeetCodeBaseService { private readonly leetCodeApi; private readonly credential; constructor(leetCodeApi: LeetCode, credential: Credential); fetchUserSubmissionDetail(id: number): Promise<any>; fetchUserStatus(): Promise<any>; fetchUserAllSubmissions(options: { offset: number; limit: number; questionSlug?: string; lastKey?: string; lang?: string; status?: string; }): Promise<any>; /** * 获取用户最近的提交记录 * @param username * @param limit * @returns */ fetchUserRecentSubmissions(username: string, limit?: number): Promise<any>; /** * 获取用户最近 AC 的提交记录 * @param username * @param limit * @returns */ fetchUserRecentACSubmissions(username: string, limit?: number): Promise<any>; fetchUserProfile(username: string): Promise<any>; fetchUserContestRanking(username: string, attended?: boolean): Promise<any>; fetchDailyChallenge(): Promise<any>; fetchProblem(titleSlug: string): Promise<any>; fetchProblemSimplified(titleSlug: string): Promise<any>; searchProblems(category?: string, tags?: string[], difficulty?: string, limit?: number, offset?: number, searchKeywords?: string): Promise<any>; fetchUserProgressQuestionList(options?: { offset?: number; limit?: number; questionStatus?: string; difficulty?: string[]; }): Promise<any>; /** * Retrieves a list of solutions for a specific problem. * * @param questionSlug - The URL slug/identifier of the problem * @param options - Optional parameters for filtering and sorting the solutions * @returns Promise resolving to the solutions list data */ fetchQuestionSolutionArticles(questionSlug: string, options?: any): Promise<any>; /** * Retrieves detailed information about a specific solution on LeetCode Global. * * @param topicId - The topic ID of the solution * @returns Promise resolving to the solution detail data */ fetchSolutionArticleDetail(topicId: string): Promise<any>; /** * Note feature is not supported in LeetCode Global. * This method is implemented to satisfy the interface but will always throw an error. * * @param options - Query parameters (not used) * @throws Error indicating the feature is not supported on Global platform */ fetchUserNotes(options: { aggregateType: string; keyword?: string; orderBy?: string; limit?: number; skip?: number; }): Promise<any>; /** * Note feature is not supported in LeetCode Global. * This method is implemented to satisfy the interface but will always throw an error. * * @param questionId - The question ID (not used) * @param limit - Maximum number of notes (not used) * @param skip - Pagination offset (not used) * @throws Error indicating the feature is not supported on Global platform */ fetchNotesByQuestionId(questionId: string, limit?: number, skip?: number): Promise<any>; /** * Note feature is not supported in LeetCode Global. * This method is implemented to satisfy the interface but will always throw an error. */ createUserNote(content: string, noteType: string, targetId: string, summary: string): Promise<any>; /** * Note feature is not supported in LeetCode Global. * This method is implemented to satisfy the interface but will always throw an error. */ updateUserNote(noteId: string, content: string, summary: string): Promise<any>; isAuthenticated(): boolean; isCN(): boolean; }