2 from typing import IO, Any, BinaryIO, NamedTuple, Union, overload
4 _chtype = Union[str, bytes, int]
6 # ACS codes are only initialized after initscr is called
60 if sys.version_info >= (3, 7):
73 BUTTON1_DOUBLE_CLICKED: int
76 BUTTON1_TRIPLE_CLICKED: int
78 BUTTON2_DOUBLE_CLICKED: int
81 BUTTON2_TRIPLE_CLICKED: int
83 BUTTON3_DOUBLE_CLICKED: int
86 BUTTON3_TRIPLE_CLICKED: int
88 BUTTON4_DOUBLE_CLICKED: int
91 BUTTON4_TRIPLE_CLICKED: int
92 # Darwin ncurses doesn't provide BUTTON5_* constants
93 if sys.version_info >= (3, 10) and sys.platform != "darwin":
97 BUTTON5_DOUBLE_CLICKED: int
98 BUTTON5_TRIPLE_CLICKED: int
268 REPORT_MOUSE_POSITION: int
272 def baudrate() -> int: ...
273 def beep() -> None: ...
274 def can_change_color() -> bool: ...
275 def cbreak(__flag: bool = ...) -> None: ...
276 def color_content(__color_number: int) -> tuple[int, int, int]: ...
278 # Changed in Python 3.8.8 and 3.9.2
279 if sys.version_info >= (3, 8):
280 def color_pair(pair_number: int) -> int: ...
283 def color_pair(__color_number: int) -> int: ...
285 def curs_set(__visibility: int) -> int: ...
286 def def_prog_mode() -> None: ...
287 def def_shell_mode() -> None: ...
288 def delay_output(__ms: int) -> None: ...
289 def doupdate() -> None: ...
290 def echo(__flag: bool = ...) -> None: ...
291 def endwin() -> None: ...
292 def erasechar() -> bytes: ...
293 def filter() -> None: ...
294 def flash() -> None: ...
295 def flushinp() -> None: ...
296 def getmouse() -> tuple[int, int, int, int, int]: ...
297 def getsyx() -> tuple[int, int]: ...
298 def getwin(__file: BinaryIO) -> _CursesWindow: ...
299 def halfdelay(__tenths: int) -> None: ...
300 def has_colors() -> bool: ...
302 if sys.version_info >= (3, 10):
303 def has_extended_color_support() -> bool: ...
305 def has_ic() -> bool: ...
306 def has_il() -> bool: ...
307 def has_key(__key: int) -> bool: ...
308 def init_color(__color_number: int, __r: int, __g: int, __b: int) -> None: ...
309 def init_pair(__pair_number: int, __fg: int, __bg: int) -> None: ...
310 def initscr() -> _CursesWindow: ...
311 def intrflush(__flag: bool) -> None: ...
312 def is_term_resized(__nlines: int, __ncols: int) -> bool: ...
313 def isendwin() -> bool: ...
314 def keyname(__key: int) -> bytes: ...
315 def killchar() -> bytes: ...
316 def longname() -> bytes: ...
317 def meta(__yes: bool) -> None: ...
318 def mouseinterval(__interval: int) -> None: ...
319 def mousemask(__newmask: int) -> tuple[int, int]: ...
320 def napms(__ms: int) -> int: ...
321 def newpad(__nlines: int, __ncols: int) -> _CursesWindow: ...
322 def newwin(__nlines: int, __ncols: int, __begin_y: int = ..., __begin_x: int = ...) -> _CursesWindow: ...
323 def nl(__flag: bool = ...) -> None: ...
324 def nocbreak() -> None: ...
325 def noecho() -> None: ...
326 def nonl() -> None: ...
327 def noqiflush() -> None: ...
328 def noraw() -> None: ...
329 def pair_content(__pair_number: int) -> tuple[int, int]: ...
330 def pair_number(__attr: int) -> int: ...
331 def putp(__string: bytes) -> None: ...
332 def qiflush(__flag: bool = ...) -> None: ...
333 def raw(__flag: bool = ...) -> None: ...
334 def reset_prog_mode() -> None: ...
335 def reset_shell_mode() -> None: ...
336 def resetty() -> None: ...
337 def resize_term(__nlines: int, __ncols: int) -> None: ...
338 def resizeterm(__nlines: int, __ncols: int) -> None: ...
339 def savetty() -> None: ...
340 def setsyx(__y: int, __x: int) -> None: ...
341 def setupterm(term: str | None = ..., fd: int = ...) -> None: ...
342 def start_color() -> None: ...
343 def termattrs() -> int: ...
344 def termname() -> bytes: ...
345 def tigetflag(__capname: str) -> int: ...
346 def tigetnum(__capname: str) -> int: ...
347 def tigetstr(__capname: str) -> bytes: ...
360 def typeahead(__fd: int) -> None: ...
361 def unctrl(__ch: _chtype) -> bytes: ...
362 def unget_wch(__ch: int | str) -> None: ...
363 def ungetch(__ch: _chtype) -> None: ...
364 def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ...
365 def update_lines_cols() -> int: ...
366 def use_default_colors() -> None: ...
367 def use_env(__flag: bool) -> None: ...
369 class error(Exception): ...
374 def addch(self, ch: _chtype, attr: int = ...) -> None: ...
376 def addch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ...
378 def addnstr(self, str: str, n: int, attr: int = ...) -> None: ...
380 def addnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ...
382 def addstr(self, str: str, attr: int = ...) -> None: ...
384 def addstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ...
385 def attroff(self, __attr: int) -> None: ...
386 def attron(self, __attr: int) -> None: ...
387 def attrset(self, __attr: int) -> None: ...
388 def bkgd(self, __ch: _chtype, __attr: int = ...) -> None: ...
389 def bkgdset(self, __ch: _chtype, __attr: int = ...) -> None: ...
402 def box(self) -> None: ...
404 def box(self, vertch: _chtype = ..., horch: _chtype = ...) -> None: ...
406 def chgat(self, attr: int) -> None: ...
408 def chgat(self, num: int, attr: int) -> None: ...
410 def chgat(self, y: int, x: int, attr: int) -> None: ...
412 def chgat(self, y: int, x: int, num: int, attr: int) -> None: ...
413 def clear(self) -> None: ...
414 def clearok(self, yes: int) -> None: ...
415 def clrtobot(self) -> None: ...
416 def clrtoeol(self) -> None: ...
417 def cursyncup(self) -> None: ...
419 def delch(self) -> None: ...
421 def delch(self, y: int, x: int) -> None: ...
422 def deleteln(self) -> None: ...
424 def derwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ...
426 def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ...
427 def echochar(self, __ch: _chtype, __attr: int = ...) -> None: ...
428 def enclose(self, __y: int, __x: int) -> bool: ...
429 def erase(self) -> None: ...
430 def getbegyx(self) -> tuple[int, int]: ...
431 def getbkgd(self) -> tuple[int, int]: ...
433 def getch(self) -> int: ...
435 def getch(self, y: int, x: int) -> int: ...
437 def get_wch(self) -> int | str: ...
439 def get_wch(self, y: int, x: int) -> int | str: ...
441 def getkey(self) -> str: ...
443 def getkey(self, y: int, x: int) -> str: ...
444 def getmaxyx(self) -> tuple[int, int]: ...
445 def getparyx(self) -> tuple[int, int]: ...
447 def getstr(self) -> _chtype: ...
449 def getstr(self, n: int) -> _chtype: ...
451 def getstr(self, y: int, x: int) -> _chtype: ...
453 def getstr(self, y: int, x: int, n: int) -> _chtype: ...
454 def getyx(self) -> tuple[int, int]: ...
456 def hline(self, ch: _chtype, n: int) -> None: ...
458 def hline(self, y: int, x: int, ch: _chtype, n: int) -> None: ...
459 def idcok(self, flag: bool) -> None: ...
460 def idlok(self, yes: bool) -> None: ...
461 def immedok(self, flag: bool) -> None: ...
463 def inch(self) -> _chtype: ...
465 def inch(self, y: int, x: int) -> _chtype: ...
467 def insch(self, ch: _chtype, attr: int = ...) -> None: ...
469 def insch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ...
470 def insdelln(self, nlines: int) -> None: ...
471 def insertln(self) -> None: ...
473 def insnstr(self, str: str, n: int, attr: int = ...) -> None: ...
475 def insnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ...
477 def insstr(self, str: str, attr: int = ...) -> None: ...
479 def insstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ...
481 def instr(self, n: int = ...) -> _chtype: ...
483 def instr(self, y: int, x: int, n: int = ...) -> _chtype: ...
484 def is_linetouched(self, __line: int) -> bool: ...
485 def is_wintouched(self) -> bool: ...
486 def keypad(self, yes: bool) -> None: ...
487 def leaveok(self, yes: bool) -> None: ...
488 def move(self, new_y: int, new_x: int) -> None: ...
489 def mvderwin(self, y: int, x: int) -> None: ...
490 def mvwin(self, new_y: int, new_x: int) -> None: ...
491 def nodelay(self, yes: bool) -> None: ...
492 def notimeout(self, yes: bool) -> None: ...
494 def noutrefresh(self) -> None: ...
496 def noutrefresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ...
498 def overlay(self, destwin: _CursesWindow) -> None: ...
501 self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int
504 def overwrite(self, destwin: _CursesWindow) -> None: ...
507 self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int
509 def putwin(self, __file: IO[Any]) -> None: ...
510 def redrawln(self, __beg: int, __num: int) -> None: ...
511 def redrawwin(self) -> None: ...
513 def refresh(self) -> None: ...
515 def refresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ...
516 def resize(self, nlines: int, ncols: int) -> None: ...
517 def scroll(self, lines: int = ...) -> None: ...
518 def scrollok(self, flag: bool) -> None: ...
519 def setscrreg(self, __top: int, __bottom: int) -> None: ...
520 def standend(self) -> None: ...
521 def standout(self) -> None: ...
523 def subpad(self, begin_y: int, begin_x: int) -> _CursesWindow: ...
525 def subpad(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ...
527 def subwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ...
529 def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ...
530 def syncdown(self) -> None: ...
531 def syncok(self, flag: bool) -> None: ...
532 def syncup(self) -> None: ...
533 def timeout(self, delay: int) -> None: ...
534 def touchline(self, start: int, count: int, changed: bool = ...) -> None: ...
535 def touchwin(self) -> None: ...
536 def untouchwin(self) -> None: ...
538 def vline(self, ch: _chtype, n: int) -> None: ...
540 def vline(self, y: int, x: int, ch: _chtype, n: int) -> None: ...
542 if sys.version_info >= (3, 8):
543 class _ncurses_version(NamedTuple):
547 ncurses_version: _ncurses_version
548 window = _CursesWindow # undocumented