mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Fix _winapi stub (#3903)
This commit is contained in:
@@ -57,7 +57,7 @@ def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ...
|
||||
@overload
|
||||
def ConnectNamedPipe(handle: int, overlapped: Literal[False] = ...) -> None: ...
|
||||
@overload
|
||||
def ConnectNamedPipe(handle: int, overlapped: bool) -> Any: ...
|
||||
def ConnectNamedPipe(handle: int, overlapped: bool) -> Optional[Overlapped]: ...
|
||||
|
||||
def CreateFile(file_name: str, desired_access: int, share_mode: int, security_attributes: int, creation_disposition: int, flags_and_attributes: int, template_file: int) -> int: ...
|
||||
def CreateJunction(src_path: str, dest_path: str) -> None: ...
|
||||
@@ -77,11 +77,12 @@ def GetVersion() -> int: ...
|
||||
def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int) -> int: ...
|
||||
def PeekNamedPipe(handle: int, size: int = ...) -> Union[Tuple[int, int], Tuple[bytes, int, int]]: ...
|
||||
|
||||
# TODO: once literal types are supported, overload with Literal[True/False]
|
||||
@overload
|
||||
def ReadFile(handle: int, size: int, overlapped: Union[int, bool]) -> Any: ...
|
||||
def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> Tuple[Overlapped, int]: ...
|
||||
@overload
|
||||
def ReadFile(handle: int, size: int) -> Tuple[int, int]: ...
|
||||
def ReadFile(handle: int, size: int, overlapped: Literal[False] = ...) -> Tuple[bytes, int]: ...
|
||||
@overload
|
||||
def ReadFile(handle: int, size: int, overlapped: Union[int, bool]) -> Tuple[Any, int]: ...
|
||||
|
||||
def SetNamedPipeHandleState(named_pipe: int, mode: Optional[int], max_collection_count: Optional[int], collect_data_timeout: Optional[int]) -> None: ...
|
||||
def TerminateProcess(handle: int, exit_code: int) -> None: ...
|
||||
@@ -89,11 +90,13 @@ def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseco
|
||||
def WaitForSingleObject(handle: int, milliseconds: int) -> int: ...
|
||||
def WaitNamedPipe(name: str, timeout: int) -> None: ...
|
||||
|
||||
# TODO: once literal types are supported, overload with Literal[True/False]
|
||||
|
||||
@overload
|
||||
def WriteFile(handle: int, buffer: bytes, overlapped: Union[int, bool]) -> Any: ...
|
||||
def WriteFile(handle: int, buffer: bytes, overlapped: Literal[True]) -> Tuple[Overlapped, int]: ...
|
||||
@overload
|
||||
def WriteFile(handle: int, buffer: bytes) -> Tuple[bytes, int]: ...
|
||||
def WriteFile(handle: int, buffer: bytes, overlapped: Literal[False]) -> Tuple[int, int]: ...
|
||||
@overload
|
||||
def WriteFile(handle: int, buffer: bytes, overlapped: Union[int, bool]) -> Tuple[Any, int]: ...
|
||||
|
||||
|
||||
class Overlapped:
|
||||
|
||||
Reference in New Issue
Block a user