irongit

A Neovim plugin enabling you to solve LeetCode problems.

407 lines12 KBLua
1---@alias interpret.state
2---| "PENDING"
3---| "STARTED"
4---| "SUCCESS"
5---| "FAILURE"
6
7---@class lc.Interpreter.item
8---@field title string
9---@field hl string
10---@field submission boolean
11---@field success boolean
12
13---@class lc.Interpreter.Response
14---@field status_code integer
15---@field lang string
16---@field run_success boolean
17---@field compile_error string
18---@field full_compile_error string
19---@field full_runtime_error string
20---@field status_runtime string
21---@field memory integer
22---@field code_answer string[]
23---@field expected_code_answer string[]
24---@field code_output table
25---@field std_output_list table
26---@field task_finish_time integer
27---@field task_name string
28---@field correct_answer boolean
29---@field total_correct any
30---@field total_testcases any
31---@field runtime_percentile any
32---@field status_memory string
33---@field memory_percentile any
34---@field pretty_lang string
35---@field submission_id string
36---@field status_msg string
37---@field state interpret.state
38---@field case_idx integer
39---@field _ lc.Interpreter.item
40
41--------------------------------------------
42--- Runtime Error | 15
43--------------------------------------------
44---@class lc.Interpreter.Response.runtime_error
45---@field status_code number
46---@field lang string
47---@field run_success boolean
48---@field runtime_error string
49---@field full_runtime_error string
50---@field status_runtime string
51---@field memory number
52---@field code_answer table
53---@field code_output table
54---@field std_output_list table
55---@field elapsed_time number
56---@field invalid_testcase boolean
57---@field task_finish_time number
58---@field task_name string
59---@field total_correct any
60---@field total_testcases any
61---@field runtime_percentile any
62---@field status_memory string
63---@field memory_percentile any
64---@field pretty_lang string
65---@field submission_id string
66---@field status_msg string
67---@field state string
68---@field question_id string
69---@field compare_result string
70---@field std_output string
71---@field last_testcase string
72---@field expected_output string
73---@field finished boolean
74---@field _ lc.Interpreter.item
75
76---@alias lc.runtime_error lc.Interpreter.Response.runtime_error
77
78--------------------------------------------
79--- Runtime | 10
80--------------------------------------------
81---@class lc.Interpreter.Response.runtime
82---@field status_code number
83---@field lang string
84---@field run_success boolean
85---@field status_runtime string
86---@field memory number
87---@field display_runtime string
88---@field code_answer table
89---@field code_output table
90---@field std_output_list table
91---@field elapsed_time number
92---@field task_finish_time number
93---@field task_name string
94---@field expected_status_code number
95---@field expected_lang string
96---@field expected_run_success boolean
97---@field expected_status_runtime string
98---@field expected_memory number
99---@field expected_code_answer table
100---@field expected_code_output table
101---@field expected_std_output_list table
102---@field expected_elapsed_time number
103---@field expected_task_finish_time number
104---@field expected_task_name string
105---@field correct_answer boolean
106---@field compare_result string
107---@field total_correct number
108---@field total_testcases number
109---@field runtime_percentile number | nil
110---@field status_memory string
111---@field memory_percentile number | nil
112---@field pretty_lang string
113---@field submission_id string
114---@field status_msg string
115---@field state string
116---@field lcnvim_is_submission boolean
117---@field lcnvim_title string
118---@field lcnvim_hl string
119---@field _ lc.Interpreter.item
120
121---@alias lc.runtime lc.Interpreter.Response.runtime
122
123--------------------------------------------
124--- Compile Error | 20
125--------------------------------------------
126---@class lc.Interpreter.Response.compile_error
127---@field status_code number
128---@field lang string
129---@field run_success boolean
130---@field compile_error string
131---@field full_compile_error string
132---@field status_runtime string
133---@field memory number
134---@field code_answer table
135---@field code_output table
136---@field std_output_list table
137---@field task_finish_time number
138---@field task_name string
139---@field total_correct number | nil
140---@field total_testcases number | nil
141---@field runtime_percentile number | nil
142---@field status_memory string
143---@field memory_percentile number | nil
144---@field pretty_lang string
145---@field submission_id string
146---@field status_msg string
147---@field state string
148---@field _ lc.Interpreter.item
149
150---@alias lc.compile_error lc.Interpreter.Response.compile_error
151
152--------------------------------------------
153--- Time Limit Exceeded | 13, 14
154--------------------------------------------
155---@class lc.Interpreter.Response.limit.exceeded
156---@field status_code number
157---@field lang string
158---@field run_success boolean
159---@field status_runtime string
160---@field memory number
161---@field code_answer table
162---@field code_output table
163---@field std_output_list table
164---@field std_output string
165---@field task_finish_time number
166---@field task_name string
167---@field total_correct number | nil
168---@field total_testcases number | nil
169---@field runtime_percentile number | nil
170---@field status_memory string
171---@field memory_percentile number | nil
172---@field pretty_lang string
173---@field submission_id string
174---@field status_msg string
175---@field state string
176---@field compare_result string | nil
177---@field question_id string | nil
178---@field elapsed_time number | nil
179---@field last_testcase string | nil
180---@field expected_output string | nil
181---@field finished boolean | nil
182---@field _ lc.Interpreter.item
183
184---@alias lc.limit_exceeded_error lc.Interpreter.Response.limit.exceeded
185
186--------------------------------------------
187--- Time Limit Exceeded | 13, 14
188--------------------------------------------
189---@class lc.Interpreter.Response.internal.error
190---@field status_code integer
191---@field status_msg string
192---@field state interpret.state
193
194---@alias lc.internal_error lc.Interpreter.Response.internal.error
195
196--------------------------------------------
197--- Interpreter responses
198--------------------------------------------
199---@alias lc.interpreter_response
200---| lc.runtime
201---| lc.runtime_error
202---| lc.compile_error
203---| lc.limit_exceeded_error
204---| lc.internal_error
205
206--------------------------------------------
207--- Code snipppet
208--------------------------------------------
209---@class lc.QuestionCodeSnippet
210---@field lang string
211---@field lang_slug string
212---@field code string
213
214---@alias code_snippet lc.QuestionCodeSnippet
215
216--------------------------------------------
217--- Metadata Param
218--------------------------------------------
219---@class lc.QuestionResponse.metadata.param
220---@field name string
221---@field type string
222
223---@alias metadata_param lc.QuestionResponse.metadata.param
224
225--------------------------------------------
226--- Metadata Return
227--------------------------------------------
228---@class lc.QuestionResponse.metadata.return
229---@field type string
230---@field size integer
231
232---@alias metadata_return lc.QuestionResponse.metadata.return
233
234--------------------------------------------
235--- Metadata
236--------------------------------------------
237---@class lc.QuestionResponse.metadata
238---@field manual boolean
239---@field name string
240---@field database boolean
241---@field params metadata_param[]
242---@field return metadata_return
243
244---@alias lc.metadata lc.QuestionResponse.metadata
245
246--------------------------------------------
247--- Question Response
248--------------------------------------------
249---@class lc.QuestionResponse.similar
250---@field difficulty "Easy" | "Medium" | "Hard"
251---@field title_slug string
252---@field title string
253---@field paid_only boolean
254
255---@class lc.QuestionResponse
256---@field id integer
257---@field frontend_id integer
258---@field title string
259---@field translated_title string
260---@field title_slug string
261---@field is_paid_only boolean
262---@field difficulty string
263---@field likes integer
264---@field dislikes integer
265---@field category_title string
266---@field content string
267---@field translated_content string
268---@field mysql_schemas string[]
269---@field data_schemas string[]
270---@field code_snippets code_snippet[]
271---@field testcase_list string[]
272---@field meta_data lc.metadata
273---@field stats question_stats
274---@field topic_tags lc.topic_tag[]
275---@field hints table[]
276---@field similar lc.QuestionResponse.similar[]
277
278---@alias lc.question_res lc.QuestionResponse
279
280---@class lc.topic_tag
281---@field name string
282---@field slug string
283
284---@class question_stats
285---@field acRate string
286---@field totalAccepted string
287---@field totalAcceptedRaw string
288---@field totalSubmission string
289---@field totalSubmissionRaw string
290
291--------------------------------------------
292--- Submission
293--------------------------------------------
294---@class lc.Interpreter.Response.submission
295---@field status_code number
296---@field lang string
297---@field run_success boolean
298---@field status_runtime string
299---@field memory number
300---@field display_runtime string
301---@field question_id string
302---@field elapsed_time number
303---@field compare_result string
304---@field code_output string
305---@field std_output string
306---@field last_testcase string
307---@field expected_output string
308---@field task_finish_time number
309---@field task_name string
310---@field finished boolean
311---@field total_correct number
312---@field total_testcases number
313---@field runtime_percentile number | nil
314---@field status_memory string
315---@field memory_percentile number | nil
316---@field pretty_lang string
317---@field submission_id string
318---@field input_formatted string
319---@field input string
320---@field status_msg string
321---@field state string
322---@field _ lc.Interpreter.item
323
324---@alias lc.submission lc.Interpreter.Response.submission
325
326--------------------------------------------
327--- UserStatus
328--------------------------------------------
329---@class lc.UserStatus
330---@field name string
331---@field is_signed_in boolean
332---@field is_premium boolean
333---@field is_verified boolean
334---@field id integer
335---@field session_id integer
336
337--------------------------------------------
338--- Statistics
339--------------------------------------------
340---@class lc.Stats.CalendarData
341---@field active_years table
342---@field dcc_badges table
343---@field streak number
344---@field submission_calendar table<string, integer>
345---@field total_active_days number
346
347---@class lc.Stats.QuestionCount
348---@field count number
349---@field difficulty string
350
351---@class lc.Stats.SolvedBeat
352---@field difficulty string
353---@field percentage number
354
355---@class lc.Stats.SubmissionStat
356---@field acSubmissionNum table
357
358---@class lc.Stats.Res
359---@field questions_count table<lc.Stats.QuestionCount>
360---@field submit_stats lc.Stats.SubmissionStat
361
362--------------------------------------------
363--- Skills
364--------------------------------------------
365---@class lc.Skills.Skill
366---@field tag string
367---@field slug string
368---@field problems_solved integer
369
370---@class lc.Skills.Res
371---@field advanced lc.Skills.Skill
372---@field intermediate lc.Skills.Skill
373---@field fundamental lc.Skills.Skill
374
375--------------------------------------------
376--- Languages
377--------------------------------------------
378---@class lc.Languages.Res
379---@field advanced {tag: string, slug: string, problems_solved: number}[]
380---@field intermediate {tag: string, slug: string, problems_solved: number}[]
381---@field fundamental {tag: string, slug: string, problems_solved: number}[]
382
383--------------------------------------------
384--- Error
385--------------------------------------------
386---@class lc.Api.err
387---@field code integer
388---@field err string
389---@field out string
390---@field response table
391---@field status integer
392---@field msg string
393---@field lvl integer
394
395---@alias lc.err lc.Api.err|nil
396
397--------------------------------------------
398--- Sessions
399--------------------------------------------
400---@class lc.res.session
401---@field ac_questions integer
402---@field id integer
403---@field is_active boolean
404---@field name string
405---@field submitted_questions integer
406---@field total_acs integer
407---@field total_submitted integer