@iflow-mcp/leetcode-mcp-server
Version:
MCP Server for LeetCode API (supports leetcode.com and leetcode.cn)
104 lines (103 loc) • 4.52 kB
TypeScript
import { Credential, LeetCodeCN } from "leetcode-query";
import { LeetCodeBaseService } from "./leetcode-base-service.js";
/**
* LeetCode CN API Service Implementation
*
* This class provides methods to interact with the LeetCode CN API
*/
export declare class LeetCodeCNService implements LeetCodeBaseService {
private readonly leetCodeApi;
private readonly credential;
constructor(leetCodeApi: LeetCodeCN, 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>;
fetchUserRecentSubmissions(username: string, limit?: number): Promise<any>;
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 on LeetCode CN.
*
* @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 CN.
*
* @param slug - The slug of the solution
* @returns Promise resolving to the solution detail data
*/
fetchSolutionArticleDetail(slug: string): Promise<any>;
/**
* Retrieves user notes from LeetCode CN with filtering and pagination options.
* Available only on LeetCode CN platform.
*
* @param options - Query parameters for filtering notes
* @param options.aggregateType - Type of notes to aggregate (e.g., "QUESTION_NOTE")
* @param options.keyword - Optional search term to filter notes
* @param options.orderBy - Optional sorting criteria for notes
* @param options.limit - Maximum number of notes to return
* @param options.skip - Number of notes to skip (for pagination)
* @returns Promise resolving to the filtered notes data
*/
fetchUserNotes(options: {
aggregateType: string;
keyword?: string;
orderBy?: string;
limit?: number;
skip?: number;
}): Promise<any>;
/**
* Retrieves user notes for a specific question ID.
* Available only on LeetCode CN platform.
*
* @param questionId - The question ID to fetch notes for
* @param limit - Maximum number of notes to return (default: 20)
* @param skip - Number of notes to skip (default: 0)
* @returns Promise resolving to the notes data for the specified question
*/
fetchNotesByQuestionId(questionId: string, limit?: number, skip?: number): Promise<any>;
/**
* Creates a new note for a specific question on LeetCode CN.
* Available only on LeetCode CN platform.
*
* @param content - The content of the note
* @param noteType - The type of note (e.g., "COMMON_QUESTION")
* @param targetId - The ID of the target (e.g., question ID)
* @param summary - Optional summary of the note
* @returns Promise resolving to the created note data
*/
createUserNote(content: string, noteType: string, targetId: string, summary: string): Promise<any>;
/**
* Updates an existing note on LeetCode CN.
* Available only on LeetCode CN platform.
*
* @param noteId - The ID of the note to update
* @param content - The new content of the note
* @param summary - Optional new summary of the note
* @returns Promise resolving to the updated note data
*/
updateUserNote(noteId: string, content: string, summary: string): Promise<any>;
isAuthenticated(): boolean;
isCN(): boolean;
}