TypeCheck underline style names

This commit is contained in:
Kovid Goyal 2022-01-22 12:41:26 +05:30
parent d4e7587686
commit 08f159c2ba
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 7 additions and 5 deletions

View File

@ -5,13 +5,13 @@ import sys
from contextlib import contextmanager
from enum import Enum, auto
from functools import wraps
from typing import (
IO, Any, Callable, Dict, Generator, Optional, TypeVar, Union
)
from typing import IO, Any, Callable, Dict, Generator, Optional, TypeVar, Union
from kitty.fast_data_types import Color
from kitty.rgb import color_as_sharp, to_color
from kitty.typing import GraphicsCommandType, HandlerType, ScreenSize
from kitty.typing import (
GraphicsCommandType, HandlerType, ScreenSize, UnderlineLiteral
)
from .operations_stub import CMD
@ -214,7 +214,7 @@ def styled(
bg_intense: bool = False,
italic: Optional[bool] = None,
bold: Optional[bool] = None,
underline: Optional[str] = None,
underline: Optional[UnderlineLiteral] = None,
underline_color: Optional[ColorSpec] = None,
reverse: Optional[bool] = None,
dim: Optional[bool] = None,

View File

@ -17,6 +17,7 @@ TermManagerType = LoopType = Debug = GraphicsCommandType = None
CompletedProcess = Tuple
TypedDict = dict
EdgeLiteral = str
UnderlineLiteral = str
PowerlineStyle = str
MatchType = str
Protocol = object

View File

@ -33,6 +33,7 @@ from .utils import ScreenSize as ScreenSize
from .window import Window as WindowType
EdgeLiteral = Literal['left', 'top', 'right', 'bottom']
UnderlineLiteral = Literal['straight', 'double', 'curly', 'dotted', 'dashed']
MatchType = Literal['mime', 'ext', 'protocol', 'file', 'path', 'url', 'fragment_matches']
PowerlineStyle = Literal['angled', 'slanted', 'round']
GRT_a = Literal['t', 'T', 'q', 'p', 'd', 'f', 'a', 'c', 'q']