Skip to content

Commit

Permalink
refactor: improve sublime.open_dialog overloading
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
  • Loading branch information
jfcherng committed Apr 1, 2023
1 parent 2e2b97d commit 4b32296
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions typings/sublime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ from typing import (
Sequence,
Tuple,
TypeVar,
overload,
)

from _sublime_types import (
Expand Down Expand Up @@ -266,6 +267,40 @@ def yes_no_cancel_dialog(msg: str, yes_title: str = "", no_title: str = "", titl
...


@overload
def open_dialog(
callback: Callable[[None | Sequence[str]], None],
file_types: Sequence[Tuple[str, Sequence[str]]],
directory: None | str,
multi_select: Literal[True],
allow_folders: bool = False,
) -> None:
...


@overload
def open_dialog(
callback: Callable[[None | Sequence[str]], None],
file_types: Sequence[Tuple[str, Sequence[str]]] = [],
directory: None | str = None,
allow_folders: bool = False,
*,
multi_select: Literal[True],
) -> None:
...


@overload
def open_dialog(
callback: Callable[[None | str], None],
file_types: Sequence[Tuple[str, Sequence[str]]] = [],
directory: None | str = None,
multi_select: bool = False,
allow_folders: bool = False,
) -> None:
...


def open_dialog(
callback: Callable[[None | str | Sequence[str]], None],
file_types: Sequence[Tuple[str, Sequence[str]]] = [],
Expand Down

0 comments on commit 4b32296

Please sign in to comment.