Repository: microsoft/playwright-python

Issue:
[BUG] Don't use `implicit-optional` for type hints
**Context:**
- Playwright Version: [what Playwright version do you use?] 1.24.0
- Operating System: [e.g. Windows, Linux or Mac] N/A
- Python version: [e.g. 3.7, 3.9] 3.10
- Browser: [e.g. All, Chromium, Firefox, WebKit] N/A
- Extra: [any specific details about your environment] N/A

**Code Snippet**
```py
browser.launch(proxy=None)  # mypy error: expected "ProxySettings" found "None"
```

**Describe the bug**
```py
proxy: ProxySettings = None,
```
This should be typed as:
```py
proxy: Optional[ProxySettings] = None,
```
implicit optional is deprecated(dead in the water 💀🌊)



Discussion:
Reference: https://github.com/python/mypy/issues/9091
@rwoll are emojis deprecated?
In titles, yes. The title was standardized with the rest of the titles. The emoji is redundant to the `[BUG]` bit.

Thanks! 
I like the emojis, every time I see them it puts a smile on my dial 😄

Resolving patch:
diff --git a/playwright/async_api/_generated.py b/playwright/async_api/_generated.py
--- a/playwright/async_api/_generated.py
+++ b/playwright/async_api/_generated.py
@@ -608,7 +608,7 @@ def request(self) -> "Request":
         """
         return mapping.from_impl(self._impl_obj.request)
 
-    async def abort(self, error_code: str = None) -> NoneType:
+    async def abort(self, error_code: typing.Optional[str] = None) -> NoneType:
         """Route.abort
 
         Aborts the route's request.
@@ -640,12 +640,12 @@ async def abort(self, error_code: str = None) -> NoneType:
     async def fulfill(
         self,
         *,
-        status: int = None,
+        status: typing.Optional[int] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        body: typing.Union[str, bytes] = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content_type: str = None,
-        response: "APIResponse" = None
+        body: typing.Optional[typing.Union[str, bytes]] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content_type: typing.Optional[str] = None,
+        response: typing.Optional["APIResponse"] = None
     ) -> NoneType:
         """Route.fulfill
 
@@ -698,10 +698,10 @@ async def fulfill(
     async def fallback(
         self,
         *,
-        url: str = None,
-        method: str = None,
+        url: typing.Optional[str] = None,
+        method: typing.Optional[str] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        post_data: typing.Union[str, bytes] = None
+        post_data: typing.Optional[typing.Union[str, bytes]] = None
     ) -> NoneType:
         """Route.fallback
 
@@ -781,10 +781,10 @@ async def handle(route, request):
     async def continue_(
         self,
         *,
-        url: str = None,
-        method: str = None,
+        url: typing.Optional[str] = None,
+        method: typing.Optional[str] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        post_data: typing.Union[str, bytes] = None
+        post_data: typing.Optional[typing.Union[str, bytes]] = None
     ) -> NoneType:
         """Route.continue_
 
@@ -936,7 +936,11 @@ def url(self) -> str:
         return mapping.from_maybe_impl(self._impl_obj.url)
 
     def expect_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager:
         """WebSocket.expect_event
 
@@ -965,7 +969,11 @@ def expect_event(
         )
 
     async def wait_for_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> typing.Any:
         """WebSocket.wait_for_event
 
@@ -1081,7 +1089,9 @@ async def insert_text(self, text: str) -> NoneType:
 
         return mapping.from_maybe_impl(await self._impl_obj.insert_text(text=text))
 
-    async def type(self, text: str, *, delay: float = None) -> NoneType:
+    async def type(
+        self, text: str, *, delay: typing.Optional[float] = None
+    ) -> NoneType:
         """Keyboard.type
 
         Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
@@ -1108,7 +1118,9 @@ async def type(self, text: str, *, delay: float = None) -> NoneType:
             await self._impl_obj.type(text=text, delay=delay)
         )
 
-    async def press(self, key: str, *, delay: float = None) -> NoneType:
+    async def press(
+        self, key: str, *, delay: typing.Optional[float] = None
+    ) -> NoneType:
         """Keyboard.press
 
         `key` can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)
@@ -1157,7 +1169,9 @@ async def press(self, key: str, *, delay: float = None) -> NoneType:
 
 
 class Mouse(AsyncBase):
-    async def move(self, x: float, y: float, *, steps: int = None) -> NoneType:
+    async def move(
+        self, x: float, y: float, *, steps: typing.Optional[int] = None
+    ) -> NoneType:
         """Mouse.move
 
         Dispatches a `mousemove` event.
@@ -1175,8 +1189,8 @@ async def move(self, x: float, y: float, *, steps: int = None) -> NoneType:
     async def down(
         self,
         *,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None
     ) -> NoneType:
         """Mouse.down
 
@@ -1197,8 +1211,8 @@ async def down(
     async def up(
         self,
         *,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None
     ) -> NoneType:
         """Mouse.up
 
@@ -1221,9 +1235,9 @@ async def click(
         x: float,
         y: float,
         *,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None
     ) -> NoneType:
         """Mouse.click
 
@@ -1252,8 +1266,8 @@ async def dblclick(
         x: float,
         y: float,
         *,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None
     ) -> NoneType:
         """Mouse.dblclick
 
@@ -1317,7 +1331,9 @@ async def tap(self, x: float, y: float) -> NoneType:
 
 
 class JSHandle(AsyncBase):
-    async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    async def evaluate(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """JSHandle.evaluate
 
         Returns the return value of `expression`.
@@ -1353,7 +1369,7 @@ async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
         )
 
     async def evaluate_handle(
-        self, expression: str, arg: typing.Any = None
+        self, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> "JSHandle":
         """JSHandle.evaluate_handle
 
@@ -1629,7 +1645,7 @@ async def is_visible(self) -> bool:
         return mapping.from_maybe_impl(await self._impl_obj.is_visible())
 
     async def dispatch_event(
-        self, type: str, event_init: typing.Dict = None
+        self, type: str, event_init: typing.Optional[typing.Dict] = None
     ) -> NoneType:
         """ElementHandle.dispatch_event
 
@@ -1675,7 +1691,9 @@ async def dispatch_event(
             )
         )
 
-    async def scroll_into_view_if_needed(self, *, timeout: float = None) -> NoneType:
+    async def scroll_into_view_if_needed(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """ElementHandle.scroll_into_view_if_needed
 
         This method waits for [actionability](https://playwright.dev/python/docs/actionability) checks, then tries to scroll element into view, unless it is
@@ -1702,10 +1720,10 @@ async def hover(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.hover
 
@@ -1754,14 +1772,14 @@ async def click(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.click
 
@@ -1824,13 +1842,13 @@ async def dblclick(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.dblclick
 
@@ -1889,14 +1907,16 @@ async def dblclick(
 
     async def select_option(
         self,
-        value: typing.Union[str, typing.List[str]] = None,
+        value: typing.Optional[typing.Union[str, typing.List[str]]] = None,
         *,
-        index: typing.Union[int, typing.List[int]] = None,
-        label: typing.Union[str, typing.List[str]] = None,
-        element: typing.Union["ElementHandle", typing.List["ElementHandle"]] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None
+        index: typing.Optional[typing.Union[int, typing.List[int]]] = None,
+        label: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        element: typing.Optional[
+            typing.Union["ElementHandle", typing.List["ElementHandle"]]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> typing.List[str]:
         """ElementHandle.select_option
 
@@ -1965,11 +1985,11 @@ async def tap(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.tap
 
@@ -2023,9 +2043,9 @@ async def fill(
         self,
         value: str,
         *,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        force: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.fill
 
@@ -2061,7 +2081,10 @@ async def fill(
         )
 
     async def select_text(
-        self, *, force: bool = None, timeout: float = None
+        self,
+        *,
+        force: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """ElementHandle.select_text
 
@@ -2085,7 +2108,7 @@ async def select_text(
             await self._impl_obj.select_text(force=force, timeout=timeout)
         )
 
-    async def input_value(self, *, timeout: float = None) -> str:
+    async def input_value(self, *, timeout: typing.Optional[float] = None) -> str:
         """ElementHandle.input_value
 
         Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
@@ -2118,8 +2141,8 @@ async def set_input_files(
             typing.List[FilePayload],
         ],
         *,
-        timeout: float = None,
-        no_wait_after: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.set_input_files
 
@@ -2161,9 +2184,9 @@ async def type(
         self,
         text: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.type
 
@@ -2209,9 +2232,9 @@ async def press(
         self,
         key: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.press
 
@@ -2259,11 +2282,11 @@ async def set_checked(
         self,
         checked: bool,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.set_checked
 
@@ -2315,11 +2338,11 @@ async def set_checked(
     async def check(
         self,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.check
 
@@ -2369,11 +2392,11 @@ async def check(
     async def uncheck(
         self,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.uncheck
 
@@ -2451,15 +2474,15 @@ async def bounding_box(self) -> typing.Optional[FloatRect]:
     async def screenshot(
         self,
         *,
-        timeout: float = None,
-        type: Literal["jpeg", "png"] = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        quality: int = None,
-        omit_background: bool = None,
-        animations: Literal["allow", "disabled"] = None,
-        caret: Literal["hide", "initial"] = None,
-        scale: Literal["css", "device"] = None,
-        mask: typing.List["Locator"] = None
+        timeout: typing.Optional[float] = None,
+        type: typing.Optional[Literal["jpeg", "png"]] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        quality: typing.Optional[int] = None,
+        omit_background: typing.Optional[bool] = None,
+        animations: typing.Optional[Literal["allow", "disabled"]] = None,
+        caret: typing.Optional[Literal["hide", "initial"]] = None,
+        scale: typing.Optional[Literal["css", "device"]] = None,
+        mask: typing.Optional[typing.List["Locator"]] = None
     ) -> bytes:
         """ElementHandle.screenshot
 
@@ -2568,7 +2591,7 @@ async def query_selector_all(self, selector: str) -> typing.List["ElementHandle"
         )
 
     async def eval_on_selector(
-        self, selector: str, expression: str, arg: typing.Any = None
+        self, selector: str, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> typing.Any:
         """ElementHandle.eval_on_selector
 
@@ -2611,7 +2634,7 @@ async def eval_on_selector(
         )
 
     async def eval_on_selector_all(
-        self, selector: str, expression: str, arg: typing.Any = None
+        self, selector: str, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> typing.Any:
         """ElementHandle.eval_on_selector_all
 
@@ -2664,7 +2687,7 @@ async def wait_for_element_state(
             "disabled", "editable", "enabled", "hidden", "stable", "visible"
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """ElementHandle.wait_for_element_state
 
@@ -2700,9 +2723,11 @@ async def wait_for_selector(
         self,
         selector: str,
         *,
-        state: Literal["attached", "detached", "hidden", "visible"] = None,
-        timeout: float = None,
-        strict: bool = None
+        state: typing.Optional[
+            Literal["attached", "detached", "hidden", "visible"]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None
     ) -> typing.Optional["ElementHandle"]:
         """ElementHandle.wait_for_selector
 
@@ -2759,7 +2784,10 @@ async def wait_for_selector(
 
 class Accessibility(AsyncBase):
     async def snapshot(
-        self, *, interesting_only: bool = None, root: "ElementHandle" = None
+        self,
+        *,
+        interesting_only: typing.Optional[bool] = None,
+        root: typing.Optional["ElementHandle"] = None
     ) -> typing.Optional[typing.Dict]:
         """Accessibility.snapshot
 
@@ -2863,8 +2891,8 @@ async def set_files(
             typing.List[FilePayload],
         ],
         *,
-        timeout: float = None,
-        no_wait_after: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """FileChooser.set_files
 
@@ -2960,9 +2988,11 @@ async def goto(
         self,
         url: str,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        referer: str = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None,
+        referer: typing.Optional[str] = None
     ) -> typing.Optional["Response"]:
         """Frame.goto
 
@@ -3018,11 +3048,13 @@ async def goto(
     def expect_navigation(
         self,
         *,
-        url: typing.Union[
-            str, typing.Pattern[str], typing.Callable[[str], bool]
+        url: typing.Optional[
+            typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]]
+        ] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
         ] = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["Response"]:
         """Frame.expect_navigation
 
@@ -3075,8 +3107,10 @@ async def wait_for_url(
         self,
         url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]],
         *,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        timeout: float = None
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Frame.wait_for_url
 
@@ -3114,9 +3148,11 @@ async def wait_for_url(
 
     async def wait_for_load_state(
         self,
-        state: Literal["domcontentloaded", "load", "networkidle"] = None,
+        state: typing.Optional[
+            Literal["domcontentloaded", "load", "networkidle"]
+        ] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Frame.wait_for_load_state
 
@@ -3172,7 +3208,9 @@ async def frame_element(self) -> "ElementHandle":
 
         return mapping.from_impl(await self._impl_obj.frame_element())
 
-    async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    async def evaluate(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """Frame.evaluate
 
         Returns the return value of `expression`.
@@ -3225,7 +3263,7 @@ async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
         )
 
     async def evaluate_handle(
-        self, expression: str, arg: typing.Any = None
+        self, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> "JSHandle":
         """Frame.evaluate_handle
 
@@ -3277,7 +3315,7 @@ async def evaluate_handle(
         )
 
     async def query_selector(
-        self, selector: str, *, strict: bool = None
+        self, selector: str, *, strict: typing.Optional[bool] = None
     ) -> typing.Optional["ElementHandle"]:
         """Frame.query_selector
 
@@ -3333,9 +3371,11 @@ async def wait_for_selector(
         self,
         selector: str,
         *,
-        strict: bool = None,
-        timeout: float = None,
-        state: Literal["attached", "detached", "hidden", "visible"] = None
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        state: typing.Optional[
+            Literal["attached", "detached", "hidden", "visible"]
+        ] = None
     ) -> typing.Optional["ElementHandle"]:
         """Frame.wait_for_selector
 
@@ -3402,7 +3442,11 @@ async def main():
         )
 
     async def is_checked(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_checked
 
@@ -3432,7 +3476,11 @@ async def is_checked(
         )
 
     async def is_disabled(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_disabled
 
@@ -3462,7 +3510,11 @@ async def is_disabled(
         )
 
     async def is_editable(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_editable
 
@@ -3492,7 +3544,11 @@ async def is_editable(
         )
 
     async def is_enabled(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_enabled
 
@@ -3522,7 +3578,11 @@ async def is_enabled(
         )
 
     async def is_hidden(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_hidden
 
@@ -3553,7 +3613,11 @@ async def is_hidden(
         )
 
     async def is_visible(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_visible
 
@@ -3587,10 +3651,10 @@ async def dispatch_event(
         self,
         selector: str,
         type: str,
-        event_init: typing.Dict = None,
+        event_init: typing.Optional[typing.Dict] = None,
         *,
-        strict: bool = None,
-        timeout: float = None
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Frame.dispatch_event
 
@@ -3653,9 +3717,9 @@ async def eval_on_selector(
         self,
         selector: str,
         expression: str,
-        arg: typing.Any = None,
+        arg: typing.Optional[typing.Any] = None,
         *,
-        strict: bool = None
+        strict: typing.Optional[bool] = None
     ) -> typing.Any:
         """Frame.eval_on_selector
 
@@ -3707,7 +3771,7 @@ async def eval_on_selector(
         )
 
     async def eval_on_selector_all(
-        self, selector: str, expression: str, arg: typing.Any = None
+        self, selector: str, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> typing.Any:
         """Frame.eval_on_selector_all
 
@@ -3765,8 +3829,10 @@ async def set_content(
         self,
         html: str,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> NoneType:
         """Frame.set_content
 
@@ -3808,10 +3874,10 @@ def is_detached(self) -> bool:
     async def add_script_tag(
         self,
         *,
-        url: str = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content: str = None,
-        type: str = None
+        url: typing.Optional[str] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content: typing.Optional[str] = None,
+        type: typing.Optional[str] = None
     ) -> "ElementHandle":
         """Frame.add_script_tag
 
@@ -3846,9 +3912,9 @@ async def add_script_tag(
     async def add_style_tag(
         self,
         *,
-        url: str = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content: str = None
+        url: typing.Optional[str] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content: typing.Optional[str] = None
     ) -> "ElementHandle":
         """Frame.add_style_tag
 
@@ -3883,15 +3949,15 @@ async def click(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.click
 
@@ -3963,14 +4029,14 @@ async def dblclick(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.dblclick
 
@@ -4042,12 +4108,12 @@ async def tap(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.tap
 
@@ -4110,10 +4176,10 @@ async def fill(
         selector: str,
         value: str,
         *,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        force: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.fill
 
@@ -4164,8 +4230,8 @@ def locator(
         self,
         selector: str,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """Frame.locator
 
@@ -4225,7 +4291,11 @@ def frame_locator(self, selector: str) -> "FrameLocator":
         return mapping.from_impl(self._impl_obj.frame_locator(selector=selector))
 
     async def focus(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Frame.focus
 
@@ -4252,7 +4322,11 @@ async def focus(
         )
 
     async def text_content(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Frame.text_content
 
@@ -4282,7 +4356,11 @@ async def text_content(
         )
 
     async def inner_text(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Frame.inner_text
 
@@ -4312,7 +4390,11 @@ async def inner_text(
         )
 
     async def inner_html(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Frame.inner_html
 
@@ -4342,7 +4424,12 @@ async def inner_html(
         )
 
     async def get_attribute(
-        self, selector: str, name: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        name: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Frame.get_attribute
 
@@ -4380,11 +4467,11 @@ async def hover(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.hover
 
@@ -4440,13 +4527,13 @@ async def drag_and_drop(
         source: str,
         target: str,
         *,
-        source_position: Position = None,
-        target_position: Position = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        timeout: float = None,
-        trial: bool = None
+        source_position: typing.Optional[Position] = None,
+        target_position: typing.Optional[Position] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.drag_and_drop
 
@@ -4498,15 +4585,17 @@ async def drag_and_drop(
     async def select_option(
         self,
         selector: str,
-        value: typing.Union[str, typing.List[str]] = None,
-        *,
-        index: typing.Union[int, typing.List[int]] = None,
-        label: typing.Union[str, typing.List[str]] = None,
-        element: typing.Union["ElementHandle", typing.List["ElementHandle"]] = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        force: bool = None
+        value: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        *,
+        index: typing.Optional[typing.Union[int, typing.List[int]]] = None,
+        label: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        element: typing.Optional[
+            typing.Union["ElementHandle", typing.List["ElementHandle"]]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> typing.List[str]:
         """Frame.select_option
 
@@ -4577,7 +4666,11 @@ async def select_option(
         )
 
     async def input_value(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Frame.input_value
 
@@ -4620,9 +4713,9 @@ async def set_input_files(
             typing.List[FilePayload],
         ],
         *,
-        strict: bool = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.set_input_files
 
@@ -4667,10 +4760,10 @@ async def type(
         selector: str,
         text: str,
         *,
-        delay: float = None,
-        strict: bool = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.type
 
@@ -4721,10 +4814,10 @@ async def press(
         selector: str,
         key: str,
         *,
-        delay: float = None,
-        strict: bool = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.press
 
@@ -4781,12 +4874,12 @@ async def check(
         self,
         selector: str,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.check
 
@@ -4845,12 +4938,12 @@ async def uncheck(
         self,
         selector: str,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.uncheck
 
@@ -4927,9 +5020,9 @@ async def wait_for_function(
         self,
         expression: str,
         *,
-        arg: typing.Any = None,
-        timeout: float = None,
-        polling: typing.Union[float, Literal["raf"]] = None
+        arg: typing.Optional[typing.Any] = None,
+        timeout: typing.Optional[float] = None,
+        polling: typing.Optional[typing.Union[float, Literal["raf"]]] = None
     ) -> "JSHandle":
         """Frame.wait_for_function
 
@@ -5007,12 +5100,12 @@ async def set_checked(
         selector: str,
         checked: bool,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.set_checked
 
@@ -5103,8 +5196,8 @@ def locator(
         self,
         selector: str,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """FrameLocator.locator
 
@@ -5202,7 +5295,9 @@ def url(self) -> str:
         """
         return mapping.from_maybe_impl(self._impl_obj.url)
 
-    async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    async def evaluate(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """Worker.evaluate
 
         Returns the return value of `expression`.
@@ -5234,7 +5329,7 @@ async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
         )
 
     async def evaluate_handle(
-        self, expression: str, arg: typing.Any = None
+        self, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> "JSHandle":
         """Worker.evaluate_handle
 
@@ -5273,10 +5368,10 @@ class Selectors(AsyncBase):
     async def register(
         self,
         name: str,
-        script: str = None,
+        script: typing.Optional[str] = None,
         *,
-        path: typing.Union[str, pathlib.Path] = None,
-        content_script: bool = None
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content_script: typing.Optional[bool] = None
     ) -> NoneType:
         """Selectors.register
 
@@ -5437,7 +5532,7 @@ def default_value(self) -> str:
         """
         return mapping.from_maybe_impl(self._impl_obj.default_value)
 
-    async def accept(self, prompt_text: str = None) -> NoneType:
+    async def accept(self, prompt_text: typing.Optional[str] = None) -> NoneType:
         """Dialog.accept
 
         Returns when the dialog has been accepted.
@@ -6286,9 +6381,11 @@ async def opener(self) -> typing.Optional["Page"]:
 
     def frame(
         self,
-        name: str = None,
+        name: typing.Optional[str] = None,
         *,
-        url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]] = None
+        url: typing.Optional[
+            typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]]
+        ] = None
     ) -> typing.Optional["Frame"]:
         """Page.frame
 
@@ -6361,7 +6458,7 @@ def set_default_timeout(self, timeout: float) -> NoneType:
         )
 
     async def query_selector(
-        self, selector: str, *, strict: bool = None
+        self, selector: str, *, strict: typing.Optional[bool] = None
     ) -> typing.Optional["ElementHandle"]:
         """Page.query_selector
 
@@ -6417,9 +6514,11 @@ async def wait_for_selector(
         self,
         selector: str,
         *,
-        timeout: float = None,
-        state: Literal["attached", "detached", "hidden", "visible"] = None,
-        strict: bool = None
+        timeout: typing.Optional[float] = None,
+        state: typing.Optional[
+            Literal["attached", "detached", "hidden", "visible"]
+        ] = None,
+        strict: typing.Optional[bool] = None
     ) -> typing.Optional["ElementHandle"]:
         """Page.wait_for_selector
 
@@ -6486,7 +6585,11 @@ async def main():
         )
 
     async def is_checked(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_checked
 
@@ -6516,7 +6619,11 @@ async def is_checked(
         )
 
     async def is_disabled(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_disabled
 
@@ -6546,7 +6653,11 @@ async def is_disabled(
         )
 
     async def is_editable(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_editable
 
@@ -6576,7 +6687,11 @@ async def is_editable(
         )
 
     async def is_enabled(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_enabled
 
@@ -6606,7 +6721,11 @@ async def is_enabled(
         )
 
     async def is_hidden(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_hidden
 
@@ -6637,7 +6756,11 @@ async def is_hidden(
         )
 
     async def is_visible(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_visible
 
@@ -6671,10 +6794,10 @@ async def dispatch_event(
         self,
         selector: str,
         type: str,
-        event_init: typing.Dict = None,
+        event_init: typing.Optional[typing.Dict] = None,
         *,
-        timeout: float = None,
-        strict: bool = None
+        timeout: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.dispatch_event
 
@@ -6733,7 +6856,9 @@ async def dispatch_event(
             )
         )
 
-    async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    async def evaluate(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """Page.evaluate
 
         Returns the value of the `expression` invocation.
@@ -6790,7 +6915,7 @@ async def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
         )
 
     async def evaluate_handle(
-        self, expression: str, arg: typing.Any = None
+        self, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> "JSHandle":
         """Page.evaluate_handle
 
@@ -6845,9 +6970,9 @@ async def eval_on_selector(
         self,
         selector: str,
         expression: str,
-        arg: typing.Any = None,
+        arg: typing.Optional[typing.Any] = None,
         *,
-        strict: bool = None
+        strict: typing.Optional[bool] = None
     ) -> typing.Any:
         """Page.eval_on_selector
 
@@ -6898,7 +7023,7 @@ async def eval_on_selector(
         )
 
     async def eval_on_selector_all(
-        self, selector: str, expression: str, arg: typing.Any = None
+        self, selector: str, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> typing.Any:
         """Page.eval_on_selector_all
 
@@ -6941,10 +7066,10 @@ async def eval_on_selector_all(
     async def add_script_tag(
         self,
         *,
-        url: str = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content: str = None,
-        type: str = None
+        url: typing.Optional[str] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content: typing.Optional[str] = None,
+        type: typing.Optional[str] = None
     ) -> "ElementHandle":
         """Page.add_script_tag
 
@@ -6980,9 +7105,9 @@ async def add_script_tag(
     async def add_style_tag(
         self,
         *,
-        url: str = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content: str = None
+        url: typing.Optional[str] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content: typing.Optional[str] = None
     ) -> "ElementHandle":
         """Page.add_style_tag
 
@@ -7071,7 +7196,11 @@ async def main():
         )
 
     async def expose_binding(
-        self, name: str, callback: typing.Callable, *, handle: bool = None
+        self,
+        name: str,
+        callback: typing.Callable,
+        *,
+        handle: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.expose_binding
 
@@ -7183,8 +7312,10 @@ async def set_content(
         self,
         html: str,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> NoneType:
         """Page.set_content
 
@@ -7215,9 +7346,11 @@ async def goto(
         self,
         url: str,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        referer: str = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None,
+        referer: typing.Optional[str] = None
     ) -> typing.Optional["Response"]:
         """Page.goto
 
@@ -7277,8 +7410,10 @@ async def goto(
     async def reload(
         self,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> typing.Optional["Response"]:
         """Page.reload
 
@@ -7310,9 +7445,11 @@ async def reload(
 
     async def wait_for_load_state(
         self,
-        state: Literal["domcontentloaded", "load", "networkidle"] = None,
+        state: typing.Optional[
+            Literal["domcontentloaded", "load", "networkidle"]
+        ] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Page.wait_for_load_state
 
@@ -7360,8 +7497,10 @@ async def wait_for_url(
         self,
         url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]],
         *,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        timeout: float = None
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Page.wait_for_url
 
@@ -7400,7 +7539,11 @@ async def wait_for_url(
         )
 
     async def wait_for_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> typing.Any:
         """Page.wait_for_event
 
@@ -7434,8 +7577,10 @@ async def wait_for_event(
     async def go_back(
         self,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> typing.Optional["Response"]:
         """Page.go_back
 
@@ -7470,8 +7615,10 @@ async def go_back(
     async def go_forward(
         self,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> typing.Optional["Response"]:
         """Page.go_forward
 
@@ -7506,10 +7653,10 @@ async def go_forward(
     async def emulate_media(
         self,
         *,
-        media: Literal["print", "screen"] = None,
-        color_scheme: Literal["dark", "light", "no-preference"] = None,
-        reduced_motion: Literal["no-preference", "reduce"] = None,
-        forced_colors: Literal["active", "none"] = None
+        media: typing.Optional[Literal["print", "screen"]] = None,
+        color_scheme: typing.Optional[Literal["dark", "light", "no-preference"]] = None,
+        reduced_motion: typing.Optional[Literal["no-preference", "reduce"]] = None,
+        forced_colors: typing.Optional[Literal["active", "none"]] = None
     ) -> NoneType:
         """Page.emulate_media
 
@@ -7607,7 +7754,10 @@ async def bring_to_front(self) -> NoneType:
         return mapping.from_maybe_impl(await self._impl_obj.bring_to_front())
 
     async def add_init_script(
-        self, script: str = None, *, path: typing.Union[str, pathlib.Path] = None
+        self,
+        script: typing.Optional[str] = None,
+        *,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> NoneType:
         """Page.add_init_script
 
@@ -7650,7 +7800,7 @@ async def route(
             typing.Callable[["Route", "Request"], typing.Any],
         ],
         *,
-        times: int = None
+        times: typing.Optional[int] = None
     ) -> NoneType:
         """Page.route
 
@@ -7723,9 +7873,11 @@ def handle_route(route):
     async def unroute(
         self,
         url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]],
-        handler: typing.Union[
-            typing.Callable[["Route"], typing.Any],
-            typing.Callable[["Route", "Request"], typing.Any],
+        handler: typing.Optional[
+            typing.Union[
+                typing.Callable[["Route"], typing.Any],
+                typing.Callable[["Route", "Request"], typing.Any],
+            ]
         ] = None,
     ) -> NoneType:
         """Page.unroute
@@ -7750,9 +7902,9 @@ async def route_from_har(
         self,
         har: typing.Union[pathlib.Path, str],
         *,
-        url: typing.Union[str, typing.Pattern[str]] = None,
-        not_found: Literal["abort", "fallback"] = None,
-        update: bool = None
+        url: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        not_found: typing.Optional[Literal["abort", "fallback"]] = None,
+        update: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.route_from_har
 
@@ -7789,17 +7941,17 @@ async def route_from_har(
     async def screenshot(
         self,
         *,
-        timeout: float = None,
-        type: Literal["jpeg", "png"] = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        quality: int = None,
-        omit_background: bool = None,
-        full_page: bool = None,
-        clip: FloatRect = None,
-        animations: Literal["allow", "disabled"] = None,
-        caret: Literal["hide", "initial"] = None,
-        scale: Literal["css", "device"] = None,
-        mask: typing.List["Locator"] = None
+        timeout: typing.Optional[float] = None,
+        type: typing.Optional[Literal["jpeg", "png"]] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        quality: typing.Optional[int] = None,
+        omit_background: typing.Optional[bool] = None,
+        full_page: typing.Optional[bool] = None,
+        clip: typing.Optional[FloatRect] = None,
+        animations: typing.Optional[Literal["allow", "disabled"]] = None,
+        caret: typing.Optional[Literal["hide", "initial"]] = None,
+        scale: typing.Optional[Literal["css", "device"]] = None,
+        mask: typing.Optional[typing.List["Locator"]] = None
     ) -> bytes:
         """Page.screenshot
 
@@ -7879,7 +8031,9 @@ async def title(self) -> str:
 
         return mapping.from_maybe_impl(await self._impl_obj.title())
 
-    async def close(self, *, run_before_unload: bool = None) -> NoneType:
+    async def close(
+        self, *, run_before_unload: typing.Optional[bool] = None
+    ) -> NoneType:
         """Page.close
 
         If `runBeforeUnload` is `false`, does not run any unload handlers and waits for the page to be closed. If
@@ -7920,15 +8074,15 @@ async def click(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None,
-        strict: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.click
 
@@ -8002,14 +8156,14 @@ async def dblclick(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.dblclick
 
@@ -8083,12 +8237,12 @@ async def tap(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.tap
 
@@ -8153,10 +8307,10 @@ async def fill(
         selector: str,
         value: str,
         *,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        force: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.fill
 
@@ -8209,8 +8363,8 @@ def locator(
         self,
         selector: str,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """Page.locator
 
@@ -8272,7 +8426,11 @@ def frame_locator(self, selector: str) -> "FrameLocator":
         return mapping.from_impl(self._impl_obj.frame_locator(selector=selector))
 
     async def focus(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Page.focus
 
@@ -8301,7 +8459,11 @@ async def focus(
         )
 
     async def text_content(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Page.text_content
 
@@ -8331,7 +8493,11 @@ async def text_content(
         )
 
     async def inner_text(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Page.inner_text
 
@@ -8361,7 +8527,11 @@ async def inner_text(
         )
 
     async def inner_html(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Page.inner_html
 
@@ -8391,7 +8561,12 @@ async def inner_html(
         )
 
     async def get_attribute(
-        self, selector: str, name: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        name: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Page.get_attribute
 
@@ -8429,11 +8604,11 @@ async def hover(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.hover
 
@@ -8491,13 +8666,13 @@ async def drag_and_drop(
         source: str,
         target: str,
         *,
-        source_position: Position = None,
-        target_position: Position = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        timeout: float = None,
-        strict: bool = None,
-        trial: bool = None
+        source_position: typing.Optional[Position] = None,
+        target_position: typing.Optional[Position] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.drag_and_drop
 
@@ -8549,15 +8724,17 @@ async def drag_and_drop(
     async def select_option(
         self,
         selector: str,
-        value: typing.Union[str, typing.List[str]] = None,
-        *,
-        index: typing.Union[int, typing.List[int]] = None,
-        label: typing.Union[str, typing.List[str]] = None,
-        element: typing.Union["ElementHandle", typing.List["ElementHandle"]] = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        force: bool = None,
-        strict: bool = None
+        value: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        *,
+        index: typing.Optional[typing.Union[int, typing.List[int]]] = None,
+        label: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        element: typing.Optional[
+            typing.Union["ElementHandle", typing.List["ElementHandle"]]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None
     ) -> typing.List[str]:
         """Page.select_option
 
@@ -8631,7 +8808,11 @@ async def select_option(
         )
 
     async def input_value(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Page.input_value
 
@@ -8674,9 +8855,9 @@ async def set_input_files(
             typing.List[FilePayload],
         ],
         *,
-        timeout: float = None,
-        strict: bool = None,
-        no_wait_after: bool = None
+        timeout: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.set_input_files
 
@@ -8721,10 +8902,10 @@ async def type(
         selector: str,
         text: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.type
 
@@ -8777,10 +8958,10 @@ async def press(
         selector: str,
         key: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.press
 
@@ -8851,12 +9032,12 @@ async def check(
         self,
         selector: str,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.check
 
@@ -8917,12 +9098,12 @@ async def uncheck(
         self,
         selector: str,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.uncheck
 
@@ -9008,9 +9189,9 @@ async def wait_for_function(
         self,
         expression: str,
         *,
-        arg: typing.Any = None,
-        timeout: float = None,
-        polling: typing.Union[float, Literal["raf"]] = None
+        arg: typing.Optional[typing.Any] = None,
+        timeout: typing.Optional[float] = None,
+        polling: typing.Optional[typing.Union[float, Literal["raf"]]] = None
     ) -> "JSHandle":
         """Page.wait_for_function
 
@@ -9091,19 +9272,19 @@ async def pause(self) -> NoneType:
     async def pdf(
         self,
         *,
-        scale: float = None,
-        display_header_footer: bool = None,
-        header_template: str = None,
-        footer_template: str = None,
-        print_background: bool = None,
-        landscape: bool = None,
-        page_ranges: str = None,
-        format: str = None,
-        width: typing.Union[str, float] = None,
-        height: typing.Union[str, float] = None,
-        prefer_css_page_size: bool = None,
-        margin: PdfMargins = None,
-        path: typing.Union[str, pathlib.Path] = None
+        scale: typing.Optional[float] = None,
+        display_header_footer: typing.Optional[bool] = None,
+        header_template: typing.Optional[str] = None,
+        footer_template: typing.Optional[str] = None,
+        print_background: typing.Optional[bool] = None,
+        landscape: typing.Optional[bool] = None,
+        page_ranges: typing.Optional[str] = None,
+        format: typing.Optional[str] = None,
+        width: typing.Optional[typing.Union[str, float]] = None,
+        height: typing.Optional[typing.Union[str, float]] = None,
+        prefer_css_page_size: typing.Optional[bool] = None,
+        margin: typing.Optional[PdfMargins] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> bytes:
         """Page.pdf
 
@@ -9214,7 +9395,11 @@ async def pdf(
         )
 
     def expect_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager:
         """Page.expect_event
 
@@ -9252,7 +9437,7 @@ def expect_console_message(
         self,
         predicate: typing.Optional[typing.Callable[["ConsoleMessage"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["ConsoleMessage"]:
         """Page.expect_console_message
 
@@ -9283,7 +9468,7 @@ def expect_download(
         self,
         predicate: typing.Optional[typing.Callable[["Download"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["Download"]:
         """Page.expect_download
 
@@ -9314,7 +9499,7 @@ def expect_file_chooser(
         self,
         predicate: typing.Optional[typing.Callable[["FileChooser"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["FileChooser"]:
         """Page.expect_file_chooser
 
@@ -9344,11 +9529,13 @@ def expect_file_chooser(
     def expect_navigation(
         self,
         *,
-        url: typing.Union[
-            str, typing.Pattern[str], typing.Callable[[str], bool]
+        url: typing.Optional[
+            typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]]
+        ] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
         ] = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["Response"]:
         """Page.expect_navigation
 
@@ -9404,7 +9591,7 @@ def expect_popup(
         self,
         predicate: typing.Optional[typing.Callable[["Page"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["Page"]:
         """Page.expect_popup
 
@@ -9437,7 +9624,7 @@ def expect_request(
             str, typing.Pattern[str], typing.Callable[["Request"], bool]
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["Request"]:
         """Page.expect_request
 
@@ -9480,7 +9667,7 @@ def expect_request_finished(
         self,
         predicate: typing.Optional[typing.Callable[["Request"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["Request"]:
         """Page.expect_request_finished
 
@@ -9513,7 +9700,7 @@ def expect_response(
             str, typing.Pattern[str], typing.Callable[["Response"], bool]
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["Response"]:
         """Page.expect_response
 
@@ -9557,7 +9744,7 @@ def expect_websocket(
         self,
         predicate: typing.Optional[typing.Callable[["WebSocket"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["WebSocket"]:
         """Page.expect_websocket
 
@@ -9588,7 +9775,7 @@ def expect_worker(
         self,
         predicate: typing.Optional[typing.Callable[["Worker"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["Worker"]:
         """Page.expect_worker
 
@@ -9620,12 +9807,12 @@ async def set_checked(
         selector: str,
         checked: bool,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.set_checked
 
@@ -10055,7 +10242,7 @@ async def new_page(self) -> "Page":
         return mapping.from_impl(await self._impl_obj.new_page())
 
     async def cookies(
-        self, urls: typing.Union[str, typing.List[str]] = None
+        self, urls: typing.Optional[typing.Union[str, typing.List[str]]] = None
     ) -> typing.List[Cookie]:
         """BrowserContext.cookies
 
@@ -10104,7 +10291,7 @@ async def clear_cookies(self) -> NoneType:
         return mapping.from_maybe_impl(await self._impl_obj.clear_cookies())
 
     async def grant_permissions(
-        self, permissions: typing.List[str], *, origin: str = None
+        self, permissions: typing.List[str], *, origin: typing.Optional[str] = None
     ) -> NoneType:
         """BrowserContext.grant_permissions
 
@@ -10155,7 +10342,9 @@ async def clear_permissions(self) -> NoneType:
 
         return mapping.from_maybe_impl(await self._impl_obj.clear_permissions())
 
-    async def set_geolocation(self, geolocation: Geolocation = None) -> NoneType:
+    async def set_geolocation(
+        self, geolocation: typing.Optional[Geolocation] = None
+    ) -> NoneType:
         """BrowserContext.set_geolocation
 
         Sets the context's geolocation. Passing `null` or `undefined` emulates position unavailable.
@@ -10211,7 +10400,10 @@ async def set_offline(self, offline: bool) -> NoneType:
         )
 
     async def add_init_script(
-        self, script: str = None, *, path: typing.Union[str, pathlib.Path] = None
+        self,
+        script: typing.Optional[str] = None,
+        *,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> NoneType:
         """BrowserContext.add_init_script
 
@@ -10247,7 +10439,11 @@ async def add_init_script(
         )
 
     async def expose_binding(
-        self, name: str, callback: typing.Callable, *, handle: bool = None
+        self,
+        name: str,
+        callback: typing.Callable,
+        *,
+        handle: typing.Optional[bool] = None
     ) -> NoneType:
         """BrowserContext.expose_binding
 
@@ -10389,7 +10585,7 @@ async def route(
             typing.Callable[["Route", "Request"], typing.Any],
         ],
         *,
-        times: int = None
+        times: typing.Optional[int] = None
     ) -> NoneType:
         """BrowserContext.route
 
@@ -10463,9 +10659,11 @@ def handle_route(route):
     async def unroute(
         self,
         url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]],
-        handler: typing.Union[
-            typing.Callable[["Route"], typing.Any],
-            typing.Callable[["Route", "Request"], typing.Any],
+        handler: typing.Optional[
+            typing.Union[
+                typing.Callable[["Route"], typing.Any],
+                typing.Callable[["Route", "Request"], typing.Any],
+            ]
         ] = None,
     ) -> NoneType:
         """BrowserContext.unroute
@@ -10492,9 +10690,9 @@ async def route_from_har(
         self,
         har: typing.Union[pathlib.Path, str],
         *,
-        url: typing.Union[str, typing.Pattern[str]] = None,
-        not_found: Literal["abort", "fallback"] = None,
-        update: bool = None
+        url: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        not_found: typing.Optional[Literal["abort", "fallback"]] = None,
+        update: typing.Optional[bool] = None
     ) -> NoneType:
         """BrowserContext.route_from_har
 
@@ -10529,7 +10727,11 @@ async def route_from_har(
         )
 
     def expect_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager:
         """BrowserContext.expect_event
 
@@ -10574,7 +10776,7 @@ async def close(self) -> NoneType:
         return mapping.from_maybe_impl(await self._impl_obj.close())
 
     async def storage_state(
-        self, *, path: typing.Union[str, pathlib.Path] = None
+        self, *, path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> StorageState:
         """BrowserContext.storage_state
 
@@ -10594,7 +10796,11 @@ async def storage_state(
         return mapping.from_impl(await self._impl_obj.storage_state(path=path))
 
     async def wait_for_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> typing.Any:
         """BrowserContext.wait_for_event
 
@@ -10629,7 +10835,7 @@ def expect_page(
         self,
         predicate: typing.Optional[typing.Callable[["Page"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> AsyncEventContextManager["Page"]:
         """BrowserContext.expect_page
 
@@ -10683,7 +10889,9 @@ async def new_cdp_session(
 
 
 class CDPSession(AsyncBase):
-    async def send(self, method: str, params: typing.Dict = None) -> typing.Dict:
+    async def send(
+        self, method: str, params: typing.Optional[typing.Dict] = None
+    ) -> typing.Dict:
         """CDPSession.send
 
         Parameters
@@ -10796,40 +11004,44 @@ def is_connected(self) -> bool:
     async def new_context(
         self,
         *,
-        viewport: ViewportSize = None,
-        screen: ViewportSize = None,
-        no_viewport: bool = None,
-        ignore_https_errors: bool = None,
-        java_script_enabled: bool = None,
-        bypass_csp: bool = None,
-        user_agent: str = None,
-        locale: str = None,
-        timezone_id: str = None,
-        geolocation: Geolocation = None,
-        permissions: typing.List[str] = None,
+        viewport: typing.Optional[ViewportSize] = None,
+        screen: typing.Optional[ViewportSize] = None,
+        no_viewport: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None,
+        java_script_enabled: typing.Optional[bool] = None,
+        bypass_csp: typing.Optional[bool] = None,
+        user_agent: typing.Optional[str] = None,
+        locale: typing.Optional[str] = None,
+        timezone_id: typing.Optional[str] = None,
+        geolocation: typing.Optional[Geolocation] = None,
+        permissions: typing.Optional[typing.List[str]] = None,
         extra_http_headers: typing.Optional[typing.Dict[str, str]] = None,
-        offline: bool = None,
-        http_credentials: HttpCredentials = None,
-        device_scale_factor: float = None,
-        is_mobile: bool = None,
-        has_touch: bool = None,
-        color_scheme: Literal["dark", "light", "no-preference"] = None,
-        reduced_motion: Literal["no-preference", "reduce"] = None,
-        forced_colors: Literal["active", "none"] = None,
-        accept_downloads: bool = None,
-        default_browser_type: str = None,
-        proxy: ProxySettings = None,
-        record_har_path: typing.Union[str, pathlib.Path] = None,
-        record_har_omit_content: bool = None,
-        record_video_dir: typing.Union[str, pathlib.Path] = None,
-        record_video_size: ViewportSize = None,
-        storage_state: typing.Union[StorageState, str, pathlib.Path] = None,
-        base_url: str = None,
-        strict_selectors: bool = None,
-        service_workers: Literal["allow", "block"] = None,
-        record_har_url_filter: typing.Union[str, typing.Pattern[str]] = None,
-        record_har_mode: Literal["full", "minimal"] = None,
-        record_har_content: Literal["attach", "embed", "omit"] = None
+        offline: typing.Optional[bool] = None,
+        http_credentials: typing.Optional[HttpCredentials] = None,
+        device_scale_factor: typing.Optional[float] = None,
+        is_mobile: typing.Optional[bool] = None,
+        has_touch: typing.Optional[bool] = None,
+        color_scheme: typing.Optional[Literal["dark", "light", "no-preference"]] = None,
+        reduced_motion: typing.Optional[Literal["no-preference", "reduce"]] = None,
+        forced_colors: typing.Optional[Literal["active", "none"]] = None,
+        accept_downloads: typing.Optional[bool] = None,
+        default_browser_type: typing.Optional[str] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        record_har_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_har_omit_content: typing.Optional[bool] = None,
+        record_video_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_video_size: typing.Optional[ViewportSize] = None,
+        storage_state: typing.Optional[
+            typing.Union[StorageState, str, pathlib.Path]
+        ] = None,
+        base_url: typing.Optional[str] = None,
+        strict_selectors: typing.Optional[bool] = None,
+        service_workers: typing.Optional[Literal["allow", "block"]] = None,
+        record_har_url_filter: typing.Optional[
+            typing.Union[str, typing.Pattern[str]]
+        ] = None,
+        record_har_mode: typing.Optional[Literal["full", "minimal"]] = None,
+        record_har_content: typing.Optional[Literal["attach", "embed", "omit"]] = None
     ) -> "BrowserContext":
         """Browser.new_context
 
@@ -11003,40 +11215,44 @@ async def new_context(
     async def new_page(
         self,
         *,
-        viewport: ViewportSize = None,
-        screen: ViewportSize = None,
-        no_viewport: bool = None,
-        ignore_https_errors: bool = None,
-        java_script_enabled: bool = None,
-        bypass_csp: bool = None,
-        user_agent: str = None,
-        locale: str = None,
-        timezone_id: str = None,
-        geolocation: Geolocation = None,
-        permissions: typing.List[str] = None,
+        viewport: typing.Optional[ViewportSize] = None,
+        screen: typing.Optional[ViewportSize] = None,
+        no_viewport: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None,
+        java_script_enabled: typing.Optional[bool] = None,
+        bypass_csp: typing.Optional[bool] = None,
+        user_agent: typing.Optional[str] = None,
+        locale: typing.Optional[str] = None,
+        timezone_id: typing.Optional[str] = None,
+        geolocation: typing.Optional[Geolocation] = None,
+        permissions: typing.Optional[typing.List[str]] = None,
         extra_http_headers: typing.Optional[typing.Dict[str, str]] = None,
-        offline: bool = None,
-        http_credentials: HttpCredentials = None,
-        device_scale_factor: float = None,
-        is_mobile: bool = None,
-        has_touch: bool = None,
-        color_scheme: Literal["dark", "light", "no-preference"] = None,
-        forced_colors: Literal["active", "none"] = None,
-        reduced_motion: Literal["no-preference", "reduce"] = None,
-        accept_downloads: bool = None,
-        default_browser_type: str = None,
-        proxy: ProxySettings = None,
-        record_har_path: typing.Union[str, pathlib.Path] = None,
-        record_har_omit_content: bool = None,
-        record_video_dir: typing.Union[str, pathlib.Path] = None,
-        record_video_size: ViewportSize = None,
-        storage_state: typing.Union[StorageState, str, pathlib.Path] = None,
-        base_url: str = None,
-        strict_selectors: bool = None,
-        service_workers: Literal["allow", "block"] = None,
-        record_har_url_filter: typing.Union[str, typing.Pattern[str]] = None,
-        record_har_mode: Literal["full", "minimal"] = None,
-        record_har_content: Literal["attach", "embed", "omit"] = None
+        offline: typing.Optional[bool] = None,
+        http_credentials: typing.Optional[HttpCredentials] = None,
+        device_scale_factor: typing.Optional[float] = None,
+        is_mobile: typing.Optional[bool] = None,
+        has_touch: typing.Optional[bool] = None,
+        color_scheme: typing.Optional[Literal["dark", "light", "no-preference"]] = None,
+        forced_colors: typing.Optional[Literal["active", "none"]] = None,
+        reduced_motion: typing.Optional[Literal["no-preference", "reduce"]] = None,
+        accept_downloads: typing.Optional[bool] = None,
+        default_browser_type: typing.Optional[str] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        record_har_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_har_omit_content: typing.Optional[bool] = None,
+        record_video_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_video_size: typing.Optional[ViewportSize] = None,
+        storage_state: typing.Optional[
+            typing.Union[StorageState, str, pathlib.Path]
+        ] = None,
+        base_url: typing.Optional[str] = None,
+        strict_selectors: typing.Optional[bool] = None,
+        service_workers: typing.Optional[Literal["allow", "block"]] = None,
+        record_har_url_filter: typing.Optional[
+            typing.Union[str, typing.Pattern[str]]
+        ] = None,
+        record_har_mode: typing.Optional[Literal["full", "minimal"]] = None,
+        record_har_content: typing.Optional[Literal["attach", "embed", "omit"]] = None
     ) -> "Page":
         """Browser.new_page
 
@@ -11228,10 +11444,10 @@ async def new_browser_cdp_session(self) -> "CDPSession":
     async def start_tracing(
         self,
         *,
-        page: "Page" = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        screenshots: bool = None,
-        categories: typing.List[str] = None
+        page: typing.Optional["Page"] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        screenshots: typing.Optional[bool] = None,
+        categories: typing.Optional[typing.List[str]] = None
     ) -> NoneType:
         """Browser.start_tracing
 
@@ -11317,22 +11533,24 @@ def executable_path(self) -> str:
     async def launch(
         self,
         *,
-        executable_path: typing.Union[str, pathlib.Path] = None,
-        channel: str = None,
-        args: typing.List[str] = None,
-        ignore_default_args: typing.Union[bool, typing.List[str]] = None,
-        handle_sigint: bool = None,
-        handle_sigterm: bool = None,
-        handle_sighup: bool = None,
-        timeout: float = None,
+        executable_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        channel: typing.Optional[str] = None,
+        args: typing.Optional[typing.List[str]] = None,
+        ignore_default_args: typing.Optional[
+            typing.Union[bool, typing.List[str]]
+        ] = None,
+        handle_sigint: typing.Optional[bool] = None,
+        handle_sigterm: typing.Optional[bool] = None,
+        handle_sighup: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
         env: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
-        headless: bool = None,
-        devtools: bool = None,
-        proxy: ProxySettings = None,
-        downloads_path: typing.Union[str, pathlib.Path] = None,
-        slow_mo: float = None,
-        traces_dir: typing.Union[str, pathlib.Path] = None,
-        chromium_sandbox: bool = None,
+        headless: typing.Optional[bool] = None,
+        devtools: typing.Optional[bool] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        downloads_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        slow_mo: typing.Optional[float] = None,
+        traces_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        chromium_sandbox: typing.Optional[bool] = None,
         firefox_user_prefs: typing.Optional[
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None
@@ -11446,53 +11664,57 @@ async def launch_persistent_context(
         self,
         user_data_dir: typing.Union[str, pathlib.Path],
         *,
-        channel: str = None,
-        executable_path: typing.Union[str, pathlib.Path] = None,
-        args: typing.List[str] = None,
-        ignore_default_args: typing.Union[bool, typing.List[str]] = None,
-        handle_sigint: bool = None,
-        handle_sigterm: bool = None,
-        handle_sighup: bool = None,
-        timeout: float = None,
+        channel: typing.Optional[str] = None,
+        executable_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        args: typing.Optional[typing.List[str]] = None,
+        ignore_default_args: typing.Optional[
+            typing.Union[bool, typing.List[str]]
+        ] = None,
+        handle_sigint: typing.Optional[bool] = None,
+        handle_sigterm: typing.Optional[bool] = None,
+        handle_sighup: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
         env: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
-        headless: bool = None,
-        devtools: bool = None,
-        proxy: ProxySettings = None,
-        downloads_path: typing.Union[str, pathlib.Path] = None,
-        slow_mo: float = None,
-        viewport: ViewportSize = None,
-        screen: ViewportSize = None,
-        no_viewport: bool = None,
-        ignore_https_errors: bool = None,
-        java_script_enabled: bool = None,
-        bypass_csp: bool = None,
-        user_agent: str = None,
-        locale: str = None,
-        timezone_id: str = None,
-        geolocation: Geolocation = None,
-        permissions: typing.List[str] = None,
+        headless: typing.Optional[bool] = None,
+        devtools: typing.Optional[bool] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        downloads_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        slow_mo: typing.Optional[float] = None,
+        viewport: typing.Optional[ViewportSize] = None,
+        screen: typing.Optional[ViewportSize] = None,
+        no_viewport: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None,
+        java_script_enabled: typing.Optional[bool] = None,
+        bypass_csp: typing.Optional[bool] = None,
+        user_agent: typing.Optional[str] = None,
+        locale: typing.Optional[str] = None,
+        timezone_id: typing.Optional[str] = None,
+        geolocation: typing.Optional[Geolocation] = None,
+        permissions: typing.Optional[typing.List[str]] = None,
         extra_http_headers: typing.Optional[typing.Dict[str, str]] = None,
-        offline: bool = None,
-        http_credentials: HttpCredentials = None,
-        device_scale_factor: float = None,
-        is_mobile: bool = None,
-        has_touch: bool = None,
-        color_scheme: Literal["dark", "light", "no-preference"] = None,
-        reduced_motion: Literal["no-preference", "reduce"] = None,
-        forced_colors: Literal["active", "none"] = None,
-        accept_downloads: bool = None,
-        traces_dir: typing.Union[str, pathlib.Path] = None,
-        chromium_sandbox: bool = None,
-        record_har_path: typing.Union[str, pathlib.Path] = None,
-        record_har_omit_content: bool = None,
-        record_video_dir: typing.Union[str, pathlib.Path] = None,
-        record_video_size: ViewportSize = None,
-        base_url: str = None,
-        strict_selectors: bool = None,
-        service_workers: Literal["allow", "block"] = None,
-        record_har_url_filter: typing.Union[str, typing.Pattern[str]] = None,
-        record_har_mode: Literal["full", "minimal"] = None,
-        record_har_content: Literal["attach", "embed", "omit"] = None
+        offline: typing.Optional[bool] = None,
+        http_credentials: typing.Optional[HttpCredentials] = None,
+        device_scale_factor: typing.Optional[float] = None,
+        is_mobile: typing.Optional[bool] = None,
+        has_touch: typing.Optional[bool] = None,
+        color_scheme: typing.Optional[Literal["dark", "light", "no-preference"]] = None,
+        reduced_motion: typing.Optional[Literal["no-preference", "reduce"]] = None,
+        forced_colors: typing.Optional[Literal["active", "none"]] = None,
+        accept_downloads: typing.Optional[bool] = None,
+        traces_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        chromium_sandbox: typing.Optional[bool] = None,
+        record_har_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_har_omit_content: typing.Optional[bool] = None,
+        record_video_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_video_size: typing.Optional[ViewportSize] = None,
+        base_url: typing.Optional[str] = None,
+        strict_selectors: typing.Optional[bool] = None,
+        service_workers: typing.Optional[Literal["allow", "block"]] = None,
+        record_har_url_filter: typing.Optional[
+            typing.Union[str, typing.Pattern[str]]
+        ] = None,
+        record_har_mode: typing.Optional[Literal["full", "minimal"]] = None,
+        record_har_content: typing.Optional[Literal["attach", "embed", "omit"]] = None
     ) -> "BrowserContext":
         """BrowserType.launch_persistent_context
 
@@ -11707,8 +11929,8 @@ async def connect_over_cdp(
         self,
         endpoint_url: str,
         *,
-        timeout: float = None,
-        slow_mo: float = None,
+        timeout: typing.Optional[float] = None,
+        slow_mo: typing.Optional[float] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None
     ) -> "Browser":
         """BrowserType.connect_over_cdp
@@ -11751,8 +11973,8 @@ async def connect(
         self,
         ws_endpoint: str,
         *,
-        timeout: float = None,
-        slow_mo: float = None,
+        timeout: typing.Optional[float] = None,
+        slow_mo: typing.Optional[float] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None
     ) -> "Browser":
         """BrowserType.connect
@@ -11918,11 +12140,11 @@ class Tracing(AsyncBase):
     async def start(
         self,
         *,
-        name: str = None,
-        title: str = None,
-        snapshots: bool = None,
-        screenshots: bool = None,
-        sources: bool = None
+        name: typing.Optional[str] = None,
+        title: typing.Optional[str] = None,
+        snapshots: typing.Optional[bool] = None,
+        screenshots: typing.Optional[bool] = None,
+        sources: typing.Optional[bool] = None
     ) -> NoneType:
         """Tracing.start
 
@@ -11962,7 +12184,7 @@ async def start(
             )
         )
 
-    async def start_chunk(self, *, title: str = None) -> NoneType:
+    async def start_chunk(self, *, title: typing.Optional[str] = None) -> NoneType:
         """Tracing.start_chunk
 
         Start a new trace chunk. If you'd like to record multiple traces on the same `BrowserContext`, use
@@ -11994,7 +12216,7 @@ async def start_chunk(self, *, title: str = None) -> NoneType:
         return mapping.from_maybe_impl(await self._impl_obj.start_chunk(title=title))
 
     async def stop_chunk(
-        self, *, path: typing.Union[str, pathlib.Path] = None
+        self, *, path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> NoneType:
         """Tracing.stop_chunk
 
@@ -12008,7 +12230,9 @@ async def stop_chunk(
 
         return mapping.from_maybe_impl(await self._impl_obj.stop_chunk(path=path))
 
-    async def stop(self, *, path: typing.Union[str, pathlib.Path] = None) -> NoneType:
+    async def stop(
+        self, *, path: typing.Optional[typing.Union[str, pathlib.Path]] = None
+    ) -> NoneType:
         """Tracing.stop
 
         Stop tracing.
@@ -12063,7 +12287,7 @@ def last(self) -> "Locator":
         return mapping.from_impl(self._impl_obj.last)
 
     async def bounding_box(
-        self, *, timeout: float = None
+        self, *, timeout: typing.Optional[float] = None
     ) -> typing.Optional[FloatRect]:
         """Locator.bounding_box
 
@@ -12103,11 +12327,11 @@ async def bounding_box(
     async def check(
         self,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.check
 
@@ -12160,14 +12384,14 @@ async def click(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.click
 
@@ -12230,13 +12454,13 @@ async def dblclick(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.dblclick
 
@@ -12294,7 +12518,11 @@ async def dblclick(
         )
 
     async def dispatch_event(
-        self, type: str, event_init: typing.Dict = None, *, timeout: float = None
+        self,
+        type: str,
+        event_init: typing.Optional[typing.Dict] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Locator.dispatch_event
 
@@ -12344,7 +12572,11 @@ async def dispatch_event(
         )
 
     async def evaluate(
-        self, expression: str, arg: typing.Any = None, *, timeout: float = None
+        self,
+        expression: str,
+        arg: typing.Optional[typing.Any] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> typing.Any:
         """Locator.evaluate
 
@@ -12383,7 +12615,9 @@ async def evaluate(
             )
         )
 
-    async def evaluate_all(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    async def evaluate_all(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """Locator.evaluate_all
 
         The method finds all elements matching the specified locator and passes an array of matched elements as a first argument
@@ -12419,7 +12653,11 @@ async def evaluate_all(self, expression: str, arg: typing.Any = None) -> typing.
         )
 
     async def evaluate_handle(
-        self, expression: str, arg: typing.Any = None, *, timeout: float = None
+        self,
+        expression: str,
+        arg: typing.Optional[typing.Any] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> "JSHandle":
         """Locator.evaluate_handle
 
@@ -12461,9 +12699,9 @@ async def fill(
         self,
         value: str,
         *,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        force: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.fill
 
@@ -12502,8 +12740,8 @@ def locator(
         self,
         selector: str,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """Locator.locator
 
@@ -12558,7 +12796,9 @@ def frame_locator(self, selector: str) -> "FrameLocator":
 
         return mapping.from_impl(self._impl_obj.frame_locator(selector=selector))
 
-    async def element_handle(self, *, timeout: float = None) -> "ElementHandle":
+    async def element_handle(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> "ElementHandle":
         """Locator.element_handle
 
         Resolves given locator to the first matching DOM element. If no elements matching the query are visible, waits for them
@@ -12608,8 +12848,8 @@ def nth(self, index: int) -> "Locator":
     def filter(
         self,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """Locator.filter
 
@@ -12646,7 +12886,7 @@ def filter(
             self._impl_obj.filter(has_text=has_text, has=has._impl_obj if has else None)
         )
 
-    async def focus(self, *, timeout: float = None) -> NoneType:
+    async def focus(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """Locator.focus
 
         Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
@@ -12676,12 +12916,12 @@ async def drag_to(
         self,
         target: "Locator",
         *,
-        force: bool = None,
-        no_wait_after: bool = None,
-        timeout: float = None,
-        trial: bool = None,
-        source_position: Position = None,
-        target_position: Position = None
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        trial: typing.Optional[bool] = None,
+        source_position: typing.Optional[Position] = None,
+        target_position: typing.Optional[Position] = None
     ) -> NoneType:
         """Locator.drag_to
 
@@ -12722,7 +12962,7 @@ async def drag_to(
         )
 
     async def get_attribute(
-        self, name: str, *, timeout: float = None
+        self, name: str, *, timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Locator.get_attribute
 
@@ -12751,10 +12991,10 @@ async def hover(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.hover
 
@@ -12797,7 +13037,7 @@ async def hover(
             )
         )
 
-    async def inner_html(self, *, timeout: float = None) -> str:
+    async def inner_html(self, *, timeout: typing.Optional[float] = None) -> str:
         """Locator.inner_html
 
         Returns the `element.innerHTML`.
@@ -12815,7 +13055,7 @@ async def inner_html(self, *, timeout: float = None) -> str:
 
         return mapping.from_maybe_impl(await self._impl_obj.inner_html(timeout=timeout))
 
-    async def inner_text(self, *, timeout: float = None) -> str:
+    async def inner_text(self, *, timeout: typing.Optional[float] = None) -> str:
         """Locator.inner_text
 
         Returns the `element.innerText`.
@@ -12833,7 +13073,7 @@ async def inner_text(self, *, timeout: float = None) -> str:
 
         return mapping.from_maybe_impl(await self._impl_obj.inner_text(timeout=timeout))
 
-    async def input_value(self, *, timeout: float = None) -> str:
+    async def input_value(self, *, timeout: typing.Optional[float] = None) -> str:
         """Locator.input_value
 
         Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
@@ -12856,7 +13096,7 @@ async def input_value(self, *, timeout: float = None) -> str:
             await self._impl_obj.input_value(timeout=timeout)
         )
 
-    async def is_checked(self, *, timeout: float = None) -> bool:
+    async def is_checked(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_checked
 
         Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
@@ -12874,7 +13114,7 @@ async def is_checked(self, *, timeout: float = None) -> bool:
 
         return mapping.from_maybe_impl(await self._impl_obj.is_checked(timeout=timeout))
 
-    async def is_disabled(self, *, timeout: float = None) -> bool:
+    async def is_disabled(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_disabled
 
         Returns whether the element is disabled, the opposite of [enabled](https://playwright.dev/python/docs/actionability#enabled).
@@ -12894,7 +13134,7 @@ async def is_disabled(self, *, timeout: float = None) -> bool:
             await self._impl_obj.is_disabled(timeout=timeout)
         )
 
-    async def is_editable(self, *, timeout: float = None) -> bool:
+    async def is_editable(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_editable
 
         Returns whether the element is [editable](https://playwright.dev/python/docs/actionability#editable).
@@ -12914,7 +13154,7 @@ async def is_editable(self, *, timeout: float = None) -> bool:
             await self._impl_obj.is_editable(timeout=timeout)
         )
 
-    async def is_enabled(self, *, timeout: float = None) -> bool:
+    async def is_enabled(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_enabled
 
         Returns whether the element is [enabled](https://playwright.dev/python/docs/actionability#enabled).
@@ -12932,7 +13172,7 @@ async def is_enabled(self, *, timeout: float = None) -> bool:
 
         return mapping.from_maybe_impl(await self._impl_obj.is_enabled(timeout=timeout))
 
-    async def is_hidden(self, *, timeout: float = None) -> bool:
+    async def is_hidden(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_hidden
 
         Returns whether the element is hidden, the opposite of [visible](https://playwright.dev/python/docs/actionability#visible).
@@ -12950,7 +13190,7 @@ async def is_hidden(self, *, timeout: float = None) -> bool:
 
         return mapping.from_maybe_impl(await self._impl_obj.is_hidden(timeout=timeout))
 
-    async def is_visible(self, *, timeout: float = None) -> bool:
+    async def is_visible(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_visible
 
         Returns whether the element is [visible](https://playwright.dev/python/docs/actionability#visible).
@@ -12972,9 +13212,9 @@ async def press(
         self,
         key: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.press
 
@@ -13021,15 +13261,15 @@ async def press(
     async def screenshot(
         self,
         *,
-        timeout: float = None,
-        type: Literal["jpeg", "png"] = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        quality: int = None,
-        omit_background: bool = None,
-        animations: Literal["allow", "disabled"] = None,
-        caret: Literal["hide", "initial"] = None,
-        scale: Literal["css", "device"] = None,
-        mask: typing.List["Locator"] = None
+        timeout: typing.Optional[float] = None,
+        type: typing.Optional[Literal["jpeg", "png"]] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        quality: typing.Optional[int] = None,
+        omit_background: typing.Optional[bool] = None,
+        animations: typing.Optional[Literal["allow", "disabled"]] = None,
+        caret: typing.Optional[Literal["hide", "initial"]] = None,
+        scale: typing.Optional[Literal["css", "device"]] = None,
+        mask: typing.Optional[typing.List["Locator"]] = None
     ) -> bytes:
         """Locator.screenshot
 
@@ -13097,7 +13337,9 @@ async def screenshot(
             )
         )
 
-    async def scroll_into_view_if_needed(self, *, timeout: float = None) -> NoneType:
+    async def scroll_into_view_if_needed(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """Locator.scroll_into_view_if_needed
 
         This method waits for [actionability](https://playwright.dev/python/docs/actionability) checks, then tries to scroll element into view, unless it is
@@ -13117,14 +13359,16 @@ async def scroll_into_view_if_needed(self, *, timeout: float = None) -> NoneType
 
     async def select_option(
         self,
-        value: typing.Union[str, typing.List[str]] = None,
+        value: typing.Optional[typing.Union[str, typing.List[str]]] = None,
         *,
-        index: typing.Union[int, typing.List[int]] = None,
-        label: typing.Union[str, typing.List[str]] = None,
-        element: typing.Union["ElementHandle", typing.List["ElementHandle"]] = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        force: bool = None
+        index: typing.Optional[typing.Union[int, typing.List[int]]] = None,
+        label: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        element: typing.Optional[
+            typing.Union["ElementHandle", typing.List["ElementHandle"]]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> typing.List[str]:
         """Locator.select_option
 
@@ -13188,7 +13432,10 @@ async def select_option(
         )
 
     async def select_text(
-        self, *, force: bool = None, timeout: float = None
+        self,
+        *,
+        force: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Locator.select_text
 
@@ -13222,8 +13469,8 @@ async def set_input_files(
             typing.List[FilePayload],
         ],
         *,
-        timeout: float = None,
-        no_wait_after: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.set_input_files
 
@@ -13259,11 +13506,11 @@ async def tap(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.tap
 
@@ -13313,7 +13560,9 @@ async def tap(
             )
         )
 
-    async def text_content(self, *, timeout: float = None) -> typing.Optional[str]:
+    async def text_content(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> typing.Optional[str]:
         """Locator.text_content
 
         Returns the `node.textContent`.
@@ -13337,9 +13586,9 @@ async def type(
         self,
         text: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.type
 
@@ -13384,11 +13633,11 @@ async def type(
     async def uncheck(
         self,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.uncheck
 
@@ -13462,8 +13711,10 @@ async def all_text_contents(self) -> typing.List[str]:
     async def wait_for(
         self,
         *,
-        timeout: float = None,
-        state: Literal["attached", "detached", "hidden", "visible"] = None
+        timeout: typing.Optional[float] = None,
+        state: typing.Optional[
+            Literal["attached", "detached", "hidden", "visible"]
+        ] = None
     ) -> NoneType:
         """Locator.wait_for
 
@@ -13500,11 +13751,11 @@ async def set_checked(
         self,
         checked: bool,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.set_checked
 
@@ -13709,14 +13960,14 @@ async def delete(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.delete
 
@@ -13779,9 +14030,9 @@ async def head(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.head
 
@@ -13828,9 +14079,9 @@ async def get(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.get
 
@@ -13877,14 +14128,14 @@ async def patch(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.patch
 
@@ -13947,14 +14198,14 @@ async def put(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.put
 
@@ -14017,14 +14268,14 @@ async def post(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.post
 
@@ -14086,16 +14337,16 @@ async def fetch(
         params: typing.Optional[
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
-        method: str = None,
+        method: typing.Optional[str] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.fetch
 
@@ -14154,7 +14405,7 @@ async def fetch(
         )
 
     async def storage_state(
-        self, *, path: typing.Union[str, pathlib.Path] = None
+        self, *, path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> StorageState:
         """APIRequestContext.storage_state
 
@@ -14182,14 +14433,16 @@ class APIRequest(AsyncBase):
     async def new_context(
         self,
         *,
-        base_url: str = None,
+        base_url: typing.Optional[str] = None,
         extra_http_headers: typing.Optional[typing.Dict[str, str]] = None,
-        http_credentials: HttpCredentials = None,
-        ignore_https_errors: bool = None,
-        proxy: ProxySettings = None,
-        user_agent: str = None,
-        timeout: float = None,
-        storage_state: typing.Union[StorageState, str, pathlib.Path] = None
+        http_credentials: typing.Optional[HttpCredentials] = None,
+        ignore_https_errors: typing.Optional[bool] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        user_agent: typing.Optional[str] = None,
+        timeout: typing.Optional[float] = None,
+        storage_state: typing.Optional[
+            typing.Union[StorageState, str, pathlib.Path]
+        ] = None
     ) -> "APIRequestContext":
         """APIRequest.new_context
 
@@ -14251,7 +14504,7 @@ async def to_have_title(
         self,
         title_or_reg_exp: typing.Union[typing.Pattern[str], str],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """PageAssertions.to_have_title
 
@@ -14284,7 +14537,7 @@ async def not_to_have_title(
         self,
         title_or_reg_exp: typing.Union[typing.Pattern[str], str],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """PageAssertions.not_to_have_title
 
@@ -14309,7 +14562,7 @@ async def to_have_url(
         self,
         url_or_reg_exp: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """PageAssertions.to_have_url
 
@@ -14342,7 +14595,7 @@ async def not_to_have_url(
         self,
         url_or_reg_exp: typing.Union[typing.Pattern[str], str],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """PageAssertions.not_to_have_url
 
@@ -14376,9 +14629,9 @@ async def to_contain_text(
             str,
         ],
         *,
-        use_inner_text: bool = None,
-        timeout: float = None,
-        ignore_case: bool = None
+        use_inner_text: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        ignore_case: typing.Optional[bool] = None
     ) -> NoneType:
         """LocatorAssertions.to_contain_text
 
@@ -14435,9 +14688,9 @@ async def not_to_contain_text(
             str,
         ],
         *,
-        use_inner_text: bool = None,
-        timeout: float = None,
-        ignore_case: bool = None
+        use_inner_text: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        ignore_case: typing.Optional[bool] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_contain_text
 
@@ -14471,7 +14724,7 @@ async def to_have_attribute(
         name: str,
         value: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_attribute
 
@@ -14506,7 +14759,7 @@ async def not_to_have_attribute(
         name: str,
         value: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_attribute
 
@@ -14537,7 +14790,7 @@ async def to_have_class(
             str,
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_class
 
@@ -14588,7 +14841,7 @@ async def not_to_have_class(
             str,
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_class
 
@@ -14609,7 +14862,9 @@ async def not_to_have_class(
             )
         )
 
-    async def to_have_count(self, count: int, *, timeout: float = None) -> NoneType:
+    async def to_have_count(
+        self, count: int, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.to_have_count
 
         Ensures the `Locator` resolves to an exact number of DOM nodes.
@@ -14634,7 +14889,9 @@ async def to_have_count(self, count: int, *, timeout: float = None) -> NoneType:
             await self._impl_obj.to_have_count(count=count, timeout=timeout)
         )
 
-    async def not_to_have_count(self, count: int, *, timeout: float = None) -> NoneType:
+    async def not_to_have_count(
+        self, count: int, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_have_count
 
         The opposite of `locator_assertions.to_have_count()`.
@@ -14657,7 +14914,7 @@ async def to_have_css(
         name: str,
         value: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_css
 
@@ -14690,7 +14947,7 @@ async def not_to_have_css(
         name: str,
         value: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_css
 
@@ -14714,7 +14971,10 @@ async def not_to_have_css(
         )
 
     async def to_have_id(
-        self, id: typing.Union[str, typing.Pattern[str]], *, timeout: float = None
+        self,
+        id: typing.Union[str, typing.Pattern[str]],
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_id
 
@@ -14741,7 +15001,10 @@ async def to_have_id(
         )
 
     async def not_to_have_id(
-        self, id: typing.Union[str, typing.Pattern[str]], *, timeout: float = None
+        self,
+        id: typing.Union[str, typing.Pattern[str]],
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_id
 
@@ -14761,7 +15024,7 @@ async def not_to_have_id(
         )
 
     async def to_have_js_property(
-        self, name: str, value: typing.Any, *, timeout: float = None
+        self, name: str, value: typing.Any, *, timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_js_property
 
@@ -14793,7 +15056,7 @@ async def to_have_js_property(
         )
 
     async def not_to_have_js_property(
-        self, name: str, value: typing.Any, *, timeout: float = None
+        self, name: str, value: typing.Any, *, timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_js_property
 
@@ -14817,7 +15080,10 @@ async def not_to_have_js_property(
         )
 
     async def to_have_value(
-        self, value: typing.Union[str, typing.Pattern[str]], *, timeout: float = None
+        self,
+        value: typing.Union[str, typing.Pattern[str]],
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_value
 
@@ -14846,7 +15112,10 @@ async def to_have_value(
         )
 
     async def not_to_have_value(
-        self, value: typing.Union[str, typing.Pattern[str]], *, timeout: float = None
+        self,
+        value: typing.Union[str, typing.Pattern[str]],
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_value
 
@@ -14869,7 +15138,7 @@ async def to_have_values(
         self,
         values: typing.List[typing.Union[typing.Pattern[str], str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_values
 
@@ -14914,7 +15183,7 @@ async def not_to_have_values(
         self,
         values: typing.List[typing.Union[typing.Pattern[str], str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_values
 
@@ -14943,9 +15212,9 @@ async def to_have_text(
             str,
         ],
         *,
-        use_inner_text: bool = None,
-        timeout: float = None,
-        ignore_case: bool = None
+        use_inner_text: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        ignore_case: typing.Optional[bool] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_text
 
@@ -15000,9 +15269,9 @@ async def not_to_have_text(
             str,
         ],
         *,
-        use_inner_text: bool = None,
-        timeout: float = None,
-        ignore_case: bool = None
+        use_inner_text: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        ignore_case: typing.Optional[bool] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_text
 
@@ -15032,7 +15301,10 @@ async def not_to_have_text(
         )
 
     async def to_be_checked(
-        self, *, timeout: float = None, checked: bool = None
+        self,
+        *,
+        timeout: typing.Optional[float] = None,
+        checked: typing.Optional[bool] = None
     ) -> NoneType:
         """LocatorAssertions.to_be_checked
 
@@ -15057,7 +15329,9 @@ async def to_be_checked(
             await self._impl_obj.to_be_checked(timeout=timeout, checked=checked)
         )
 
-    async def not_to_be_checked(self, *, timeout: float = None) -> NoneType:
+    async def not_to_be_checked(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_be_checked
 
         The opposite of `locator_assertions.to_be_checked()`.
@@ -15073,7 +15347,9 @@ async def not_to_be_checked(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.not_to_be_checked(timeout=timeout)
         )
 
-    async def to_be_disabled(self, *, timeout: float = None) -> NoneType:
+    async def to_be_disabled(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.to_be_disabled
 
         Ensures the `Locator` points to a disabled element. Element is disabled if it has \"disabled\" attribute or is disabled
@@ -15099,7 +15375,9 @@ async def to_be_disabled(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.to_be_disabled(timeout=timeout)
         )
 
-    async def not_to_be_disabled(self, *, timeout: float = None) -> NoneType:
+    async def not_to_be_disabled(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_be_disabled
 
         The opposite of `locator_assertions.to_be_disabled()`.
@@ -15115,7 +15393,9 @@ async def not_to_be_disabled(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.not_to_be_disabled(timeout=timeout)
         )
 
-    async def to_be_editable(self, *, timeout: float = None) -> NoneType:
+    async def to_be_editable(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.to_be_editable
 
         Ensures the `Locator` points to an editable element.
@@ -15138,7 +15418,9 @@ async def to_be_editable(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.to_be_editable(timeout=timeout)
         )
 
-    async def not_to_be_editable(self, *, timeout: float = None) -> NoneType:
+    async def not_to_be_editable(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_be_editable
 
         The opposite of `locator_assertions.to_be_editable()`.
@@ -15154,7 +15436,7 @@ async def not_to_be_editable(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.not_to_be_editable(timeout=timeout)
         )
 
-    async def to_be_empty(self, *, timeout: float = None) -> NoneType:
+    async def to_be_empty(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.to_be_empty
 
         Ensures the `Locator` points to an empty editable element or to a DOM node that has no text.
@@ -15177,7 +15459,9 @@ async def to_be_empty(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.to_be_empty(timeout=timeout)
         )
 
-    async def not_to_be_empty(self, *, timeout: float = None) -> NoneType:
+    async def not_to_be_empty(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_be_empty
 
         The opposite of `locator_assertions.to_be_empty()`.
@@ -15193,7 +15477,9 @@ async def not_to_be_empty(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.not_to_be_empty(timeout=timeout)
         )
 
-    async def to_be_enabled(self, *, timeout: float = None) -> NoneType:
+    async def to_be_enabled(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.to_be_enabled
 
         Ensures the `Locator` points to an enabled element.
@@ -15216,7 +15502,9 @@ async def to_be_enabled(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.to_be_enabled(timeout=timeout)
         )
 
-    async def not_to_be_enabled(self, *, timeout: float = None) -> NoneType:
+    async def not_to_be_enabled(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_be_enabled
 
         The opposite of `locator_assertions.to_be_enabled()`.
@@ -15232,7 +15520,7 @@ async def not_to_be_enabled(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.not_to_be_enabled(timeout=timeout)
         )
 
-    async def to_be_hidden(self, *, timeout: float = None) -> NoneType:
+    async def to_be_hidden(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.to_be_hidden
 
         Ensures the `Locator` points to a hidden DOM node, which is the opposite of [visible](https://playwright.dev/python/docs/api/actionability#visible).
@@ -15255,7 +15543,9 @@ async def to_be_hidden(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.to_be_hidden(timeout=timeout)
         )
 
-    async def not_to_be_hidden(self, *, timeout: float = None) -> NoneType:
+    async def not_to_be_hidden(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_be_hidden
 
         The opposite of `locator_assertions.to_be_hidden()`.
@@ -15271,7 +15561,9 @@ async def not_to_be_hidden(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.not_to_be_hidden(timeout=timeout)
         )
 
-    async def to_be_visible(self, *, timeout: float = None) -> NoneType:
+    async def to_be_visible(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.to_be_visible
 
         Ensures the `Locator` points to a [visible](https://playwright.dev/python/docs/api/actionability#visible) DOM node.
@@ -15294,7 +15586,9 @@ async def to_be_visible(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.to_be_visible(timeout=timeout)
         )
 
-    async def not_to_be_visible(self, *, timeout: float = None) -> NoneType:
+    async def not_to_be_visible(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_be_visible
 
         The opposite of `locator_assertions.to_be_visible()`.
@@ -15310,7 +15604,9 @@ async def not_to_be_visible(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.not_to_be_visible(timeout=timeout)
         )
 
-    async def to_be_focused(self, *, timeout: float = None) -> NoneType:
+    async def to_be_focused(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.to_be_focused
 
         Ensures the `Locator` points to a focused DOM node.
@@ -15333,7 +15629,9 @@ async def to_be_focused(self, *, timeout: float = None) -> NoneType:
             await self._impl_obj.to_be_focused(timeout=timeout)
         )
 
-    async def not_to_be_focused(self, *, timeout: float = None) -> NoneType:
+    async def not_to_be_focused(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_be_focused
 
         The opposite of `locator_assertions.to_be_focused()`.
diff --git a/playwright/sync_api/_generated.py b/playwright/sync_api/_generated.py
--- a/playwright/sync_api/_generated.py
+++ b/playwright/sync_api/_generated.py
@@ -614,7 +614,7 @@ def request(self) -> "Request":
         """
         return mapping.from_impl(self._impl_obj.request)
 
-    def abort(self, error_code: str = None) -> NoneType:
+    def abort(self, error_code: typing.Optional[str] = None) -> NoneType:
         """Route.abort
 
         Aborts the route's request.
@@ -648,12 +648,12 @@ def abort(self, error_code: str = None) -> NoneType:
     def fulfill(
         self,
         *,
-        status: int = None,
+        status: typing.Optional[int] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        body: typing.Union[str, bytes] = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content_type: str = None,
-        response: "APIResponse" = None
+        body: typing.Optional[typing.Union[str, bytes]] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content_type: typing.Optional[str] = None,
+        response: typing.Optional["APIResponse"] = None
     ) -> NoneType:
         """Route.fulfill
 
@@ -708,10 +708,10 @@ def fulfill(
     def fallback(
         self,
         *,
-        url: str = None,
-        method: str = None,
+        url: typing.Optional[str] = None,
+        method: typing.Optional[str] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        post_data: typing.Union[str, bytes] = None
+        post_data: typing.Optional[typing.Union[str, bytes]] = None
     ) -> NoneType:
         """Route.fallback
 
@@ -793,10 +793,10 @@ def handle(route, request):
     def continue_(
         self,
         *,
-        url: str = None,
-        method: str = None,
+        url: typing.Optional[str] = None,
+        method: typing.Optional[str] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        post_data: typing.Union[str, bytes] = None
+        post_data: typing.Optional[typing.Union[str, bytes]] = None
     ) -> NoneType:
         """Route.continue_
 
@@ -922,7 +922,11 @@ def url(self) -> str:
         return mapping.from_maybe_impl(self._impl_obj.url)
 
     def expect_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager:
         """WebSocket.expect_event
 
@@ -951,7 +955,11 @@ def expect_event(
         )
 
     def wait_for_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> typing.Any:
         """WebSocket.wait_for_event
 
@@ -1073,7 +1081,7 @@ def insert_text(self, text: str) -> NoneType:
             self._sync(self._impl_obj.insert_text(text=text))
         )
 
-    def type(self, text: str, *, delay: float = None) -> NoneType:
+    def type(self, text: str, *, delay: typing.Optional[float] = None) -> NoneType:
         """Keyboard.type
 
         Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
@@ -1100,7 +1108,7 @@ def type(self, text: str, *, delay: float = None) -> NoneType:
             self._sync(self._impl_obj.type(text=text, delay=delay))
         )
 
-    def press(self, key: str, *, delay: float = None) -> NoneType:
+    def press(self, key: str, *, delay: typing.Optional[float] = None) -> NoneType:
         """Keyboard.press
 
         `key` can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)
@@ -1151,7 +1159,9 @@ def press(self, key: str, *, delay: float = None) -> NoneType:
 
 
 class Mouse(SyncBase):
-    def move(self, x: float, y: float, *, steps: int = None) -> NoneType:
+    def move(
+        self, x: float, y: float, *, steps: typing.Optional[int] = None
+    ) -> NoneType:
         """Mouse.move
 
         Dispatches a `mousemove` event.
@@ -1171,8 +1181,8 @@ def move(self, x: float, y: float, *, steps: int = None) -> NoneType:
     def down(
         self,
         *,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None
     ) -> NoneType:
         """Mouse.down
 
@@ -1193,8 +1203,8 @@ def down(
     def up(
         self,
         *,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None
     ) -> NoneType:
         """Mouse.up
 
@@ -1217,9 +1227,9 @@ def click(
         x: float,
         y: float,
         *,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None
     ) -> NoneType:
         """Mouse.click
 
@@ -1250,8 +1260,8 @@ def dblclick(
         x: float,
         y: float,
         *,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None
     ) -> NoneType:
         """Mouse.dblclick
 
@@ -1315,7 +1325,9 @@ def tap(self, x: float, y: float) -> NoneType:
 
 
 class JSHandle(SyncBase):
-    def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    def evaluate(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """JSHandle.evaluate
 
         Returns the return value of `expression`.
@@ -1350,7 +1362,9 @@ def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
             )
         )
 
-    def evaluate_handle(self, expression: str, arg: typing.Any = None) -> "JSHandle":
+    def evaluate_handle(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> "JSHandle":
         """JSHandle.evaluate_handle
 
         Returns the return value of `expression` as a `JSHandle`.
@@ -1628,7 +1642,9 @@ def is_visible(self) -> bool:
 
         return mapping.from_maybe_impl(self._sync(self._impl_obj.is_visible()))
 
-    def dispatch_event(self, type: str, event_init: typing.Dict = None) -> NoneType:
+    def dispatch_event(
+        self, type: str, event_init: typing.Optional[typing.Dict] = None
+    ) -> NoneType:
         """ElementHandle.dispatch_event
 
         The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element,
@@ -1675,7 +1691,9 @@ def dispatch_event(self, type: str, event_init: typing.Dict = None) -> NoneType:
             )
         )
 
-    def scroll_into_view_if_needed(self, *, timeout: float = None) -> NoneType:
+    def scroll_into_view_if_needed(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """ElementHandle.scroll_into_view_if_needed
 
         This method waits for [actionability](https://playwright.dev/python/docs/actionability) checks, then tries to scroll element into view, unless it is
@@ -1702,10 +1720,10 @@ def hover(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.hover
 
@@ -1756,14 +1774,14 @@ def click(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.click
 
@@ -1828,13 +1846,13 @@ def dblclick(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.dblclick
 
@@ -1895,14 +1913,16 @@ def dblclick(
 
     def select_option(
         self,
-        value: typing.Union[str, typing.List[str]] = None,
+        value: typing.Optional[typing.Union[str, typing.List[str]]] = None,
         *,
-        index: typing.Union[int, typing.List[int]] = None,
-        label: typing.Union[str, typing.List[str]] = None,
-        element: typing.Union["ElementHandle", typing.List["ElementHandle"]] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None
+        index: typing.Optional[typing.Union[int, typing.List[int]]] = None,
+        label: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        element: typing.Optional[
+            typing.Union["ElementHandle", typing.List["ElementHandle"]]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> typing.List[str]:
         """ElementHandle.select_option
 
@@ -1973,11 +1993,11 @@ def tap(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.tap
 
@@ -2033,9 +2053,9 @@ def fill(
         self,
         value: str,
         *,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        force: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.fill
 
@@ -2072,7 +2092,12 @@ def fill(
             )
         )
 
-    def select_text(self, *, force: bool = None, timeout: float = None) -> NoneType:
+    def select_text(
+        self,
+        *,
+        force: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """ElementHandle.select_text
 
         This method waits for [actionability](https://playwright.dev/python/docs/actionability) checks, then focuses the element and selects all its text
@@ -2095,7 +2120,7 @@ def select_text(self, *, force: bool = None, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.select_text(force=force, timeout=timeout))
         )
 
-    def input_value(self, *, timeout: float = None) -> str:
+    def input_value(self, *, timeout: typing.Optional[float] = None) -> str:
         """ElementHandle.input_value
 
         Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
@@ -2128,8 +2153,8 @@ def set_input_files(
             typing.List[FilePayload],
         ],
         *,
-        timeout: float = None,
-        no_wait_after: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.set_input_files
 
@@ -2175,9 +2200,9 @@ def type(
         self,
         text: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.type
 
@@ -2225,9 +2250,9 @@ def press(
         self,
         key: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.press
 
@@ -2277,11 +2302,11 @@ def set_checked(
         self,
         checked: bool,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.set_checked
 
@@ -2335,11 +2360,11 @@ def set_checked(
     def check(
         self,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.check
 
@@ -2391,11 +2416,11 @@ def check(
     def uncheck(
         self,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """ElementHandle.uncheck
 
@@ -2475,15 +2500,15 @@ def bounding_box(self) -> typing.Optional[FloatRect]:
     def screenshot(
         self,
         *,
-        timeout: float = None,
-        type: Literal["jpeg", "png"] = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        quality: int = None,
-        omit_background: bool = None,
-        animations: Literal["allow", "disabled"] = None,
-        caret: Literal["hide", "initial"] = None,
-        scale: Literal["css", "device"] = None,
-        mask: typing.List["Locator"] = None
+        timeout: typing.Optional[float] = None,
+        type: typing.Optional[Literal["jpeg", "png"]] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        quality: typing.Optional[int] = None,
+        omit_background: typing.Optional[bool] = None,
+        animations: typing.Optional[Literal["allow", "disabled"]] = None,
+        caret: typing.Optional[Literal["hide", "initial"]] = None,
+        scale: typing.Optional[Literal["css", "device"]] = None,
+        mask: typing.Optional[typing.List["Locator"]] = None
     ) -> bytes:
         """ElementHandle.screenshot
 
@@ -2594,7 +2619,7 @@ def query_selector_all(self, selector: str) -> typing.List["ElementHandle"]:
         )
 
     def eval_on_selector(
-        self, selector: str, expression: str, arg: typing.Any = None
+        self, selector: str, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> typing.Any:
         """ElementHandle.eval_on_selector
 
@@ -2639,7 +2664,7 @@ def eval_on_selector(
         )
 
     def eval_on_selector_all(
-        self, selector: str, expression: str, arg: typing.Any = None
+        self, selector: str, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> typing.Any:
         """ElementHandle.eval_on_selector_all
 
@@ -2694,7 +2719,7 @@ def wait_for_element_state(
             "disabled", "editable", "enabled", "hidden", "stable", "visible"
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """ElementHandle.wait_for_element_state
 
@@ -2732,9 +2757,11 @@ def wait_for_selector(
         self,
         selector: str,
         *,
-        state: Literal["attached", "detached", "hidden", "visible"] = None,
-        timeout: float = None,
-        strict: bool = None
+        state: typing.Optional[
+            Literal["attached", "detached", "hidden", "visible"]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None
     ) -> typing.Optional["ElementHandle"]:
         """ElementHandle.wait_for_selector
 
@@ -2793,7 +2820,10 @@ def wait_for_selector(
 
 class Accessibility(SyncBase):
     def snapshot(
-        self, *, interesting_only: bool = None, root: "ElementHandle" = None
+        self,
+        *,
+        interesting_only: typing.Optional[bool] = None,
+        root: typing.Optional["ElementHandle"] = None
     ) -> typing.Optional[typing.Dict]:
         """Accessibility.snapshot
 
@@ -2899,8 +2929,8 @@ def set_files(
             typing.List[FilePayload],
         ],
         *,
-        timeout: float = None,
-        no_wait_after: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """FileChooser.set_files
 
@@ -3000,9 +3030,11 @@ def goto(
         self,
         url: str,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        referer: str = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None,
+        referer: typing.Optional[str] = None
     ) -> typing.Optional["Response"]:
         """Frame.goto
 
@@ -3060,11 +3092,13 @@ def goto(
     def expect_navigation(
         self,
         *,
-        url: typing.Union[
-            str, typing.Pattern[str], typing.Callable[[str], bool]
+        url: typing.Optional[
+            typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]]
+        ] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
         ] = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["Response"]:
         """Frame.expect_navigation
 
@@ -3117,8 +3151,10 @@ def wait_for_url(
         self,
         url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]],
         *,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        timeout: float = None
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Frame.wait_for_url
 
@@ -3158,9 +3194,11 @@ def wait_for_url(
 
     def wait_for_load_state(
         self,
-        state: Literal["domcontentloaded", "load", "networkidle"] = None,
+        state: typing.Optional[
+            Literal["domcontentloaded", "load", "networkidle"]
+        ] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Frame.wait_for_load_state
 
@@ -3216,7 +3254,9 @@ def frame_element(self) -> "ElementHandle":
 
         return mapping.from_impl(self._sync(self._impl_obj.frame_element()))
 
-    def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    def evaluate(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """Frame.evaluate
 
         Returns the return value of `expression`.
@@ -3268,7 +3308,9 @@ def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
             )
         )
 
-    def evaluate_handle(self, expression: str, arg: typing.Any = None) -> "JSHandle":
+    def evaluate_handle(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> "JSHandle":
         """Frame.evaluate_handle
 
         Returns the return value of `expression` as a `JSHandle`.
@@ -3321,7 +3363,7 @@ def evaluate_handle(self, expression: str, arg: typing.Any = None) -> "JSHandle"
         )
 
     def query_selector(
-        self, selector: str, *, strict: bool = None
+        self, selector: str, *, strict: typing.Optional[bool] = None
     ) -> typing.Optional["ElementHandle"]:
         """Frame.query_selector
 
@@ -3377,9 +3419,11 @@ def wait_for_selector(
         self,
         selector: str,
         *,
-        strict: bool = None,
-        timeout: float = None,
-        state: Literal["attached", "detached", "hidden", "visible"] = None
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        state: typing.Optional[
+            Literal["attached", "detached", "hidden", "visible"]
+        ] = None
     ) -> typing.Optional["ElementHandle"]:
         """Frame.wait_for_selector
 
@@ -3445,7 +3489,11 @@ def run(playwright):
         )
 
     def is_checked(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_checked
 
@@ -3477,7 +3525,11 @@ def is_checked(
         )
 
     def is_disabled(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_disabled
 
@@ -3509,7 +3561,11 @@ def is_disabled(
         )
 
     def is_editable(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_editable
 
@@ -3541,7 +3597,11 @@ def is_editable(
         )
 
     def is_enabled(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_enabled
 
@@ -3573,7 +3633,11 @@ def is_enabled(
         )
 
     def is_hidden(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_hidden
 
@@ -3606,7 +3670,11 @@ def is_hidden(
         )
 
     def is_visible(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Frame.is_visible
 
@@ -3642,10 +3710,10 @@ def dispatch_event(
         self,
         selector: str,
         type: str,
-        event_init: typing.Dict = None,
+        event_init: typing.Optional[typing.Dict] = None,
         *,
-        strict: bool = None,
-        timeout: float = None
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Frame.dispatch_event
 
@@ -3710,9 +3778,9 @@ def eval_on_selector(
         self,
         selector: str,
         expression: str,
-        arg: typing.Any = None,
+        arg: typing.Optional[typing.Any] = None,
         *,
-        strict: bool = None
+        strict: typing.Optional[bool] = None
     ) -> typing.Any:
         """Frame.eval_on_selector
 
@@ -3766,7 +3834,7 @@ def eval_on_selector(
         )
 
     def eval_on_selector_all(
-        self, selector: str, expression: str, arg: typing.Any = None
+        self, selector: str, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> typing.Any:
         """Frame.eval_on_selector_all
 
@@ -3826,8 +3894,10 @@ def set_content(
         self,
         html: str,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> NoneType:
         """Frame.set_content
 
@@ -3871,10 +3941,10 @@ def is_detached(self) -> bool:
     def add_script_tag(
         self,
         *,
-        url: str = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content: str = None,
-        type: str = None
+        url: typing.Optional[str] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content: typing.Optional[str] = None,
+        type: typing.Optional[str] = None
     ) -> "ElementHandle":
         """Frame.add_script_tag
 
@@ -3911,9 +3981,9 @@ def add_script_tag(
     def add_style_tag(
         self,
         *,
-        url: str = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content: str = None
+        url: typing.Optional[str] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content: typing.Optional[str] = None
     ) -> "ElementHandle":
         """Frame.add_style_tag
 
@@ -3950,15 +4020,15 @@ def click(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.click
 
@@ -4032,14 +4102,14 @@ def dblclick(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.dblclick
 
@@ -4113,12 +4183,12 @@ def tap(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.tap
 
@@ -4183,10 +4253,10 @@ def fill(
         selector: str,
         value: str,
         *,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        force: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.fill
 
@@ -4239,8 +4309,8 @@ def locator(
         self,
         selector: str,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """Frame.locator
 
@@ -4300,7 +4370,11 @@ def frame_locator(self, selector: str) -> "FrameLocator":
         return mapping.from_impl(self._impl_obj.frame_locator(selector=selector))
 
     def focus(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Frame.focus
 
@@ -4327,7 +4401,11 @@ def focus(
         )
 
     def text_content(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Frame.text_content
 
@@ -4359,7 +4437,11 @@ def text_content(
         )
 
     def inner_text(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Frame.inner_text
 
@@ -4391,7 +4473,11 @@ def inner_text(
         )
 
     def inner_html(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Frame.inner_html
 
@@ -4423,7 +4509,12 @@ def inner_html(
         )
 
     def get_attribute(
-        self, selector: str, name: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        name: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Frame.get_attribute
 
@@ -4463,11 +4554,11 @@ def hover(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.hover
 
@@ -4525,13 +4616,13 @@ def drag_and_drop(
         source: str,
         target: str,
         *,
-        source_position: Position = None,
-        target_position: Position = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        timeout: float = None,
-        trial: bool = None
+        source_position: typing.Optional[Position] = None,
+        target_position: typing.Optional[Position] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.drag_and_drop
 
@@ -4585,15 +4676,17 @@ def drag_and_drop(
     def select_option(
         self,
         selector: str,
-        value: typing.Union[str, typing.List[str]] = None,
-        *,
-        index: typing.Union[int, typing.List[int]] = None,
-        label: typing.Union[str, typing.List[str]] = None,
-        element: typing.Union["ElementHandle", typing.List["ElementHandle"]] = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        force: bool = None
+        value: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        *,
+        index: typing.Optional[typing.Union[int, typing.List[int]]] = None,
+        label: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        element: typing.Optional[
+            typing.Union["ElementHandle", typing.List["ElementHandle"]]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> typing.List[str]:
         """Frame.select_option
 
@@ -4666,7 +4759,11 @@ def select_option(
         )
 
     def input_value(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Frame.input_value
 
@@ -4711,9 +4808,9 @@ def set_input_files(
             typing.List[FilePayload],
         ],
         *,
-        strict: bool = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.set_input_files
 
@@ -4760,10 +4857,10 @@ def type(
         selector: str,
         text: str,
         *,
-        delay: float = None,
-        strict: bool = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.type
 
@@ -4816,10 +4913,10 @@ def press(
         selector: str,
         key: str,
         *,
-        delay: float = None,
-        strict: bool = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.press
 
@@ -4878,12 +4975,12 @@ def check(
         self,
         selector: str,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.check
 
@@ -4944,12 +5041,12 @@ def uncheck(
         self,
         selector: str,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.uncheck
 
@@ -5028,9 +5125,9 @@ def wait_for_function(
         self,
         expression: str,
         *,
-        arg: typing.Any = None,
-        timeout: float = None,
-        polling: typing.Union[float, Literal["raf"]] = None
+        arg: typing.Optional[typing.Any] = None,
+        timeout: typing.Optional[float] = None,
+        polling: typing.Optional[typing.Union[float, Literal["raf"]]] = None
     ) -> "JSHandle":
         """Frame.wait_for_function
 
@@ -5107,12 +5204,12 @@ def set_checked(
         selector: str,
         checked: bool,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Frame.set_checked
 
@@ -5205,8 +5302,8 @@ def locator(
         self,
         selector: str,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """FrameLocator.locator
 
@@ -5300,7 +5397,9 @@ def url(self) -> str:
         """
         return mapping.from_maybe_impl(self._impl_obj.url)
 
-    def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    def evaluate(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """Worker.evaluate
 
         Returns the return value of `expression`.
@@ -5331,7 +5430,9 @@ def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
             )
         )
 
-    def evaluate_handle(self, expression: str, arg: typing.Any = None) -> "JSHandle":
+    def evaluate_handle(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> "JSHandle":
         """Worker.evaluate_handle
 
         Returns the return value of `expression` as a `JSHandle`.
@@ -5371,10 +5472,10 @@ class Selectors(SyncBase):
     def register(
         self,
         name: str,
-        script: str = None,
+        script: typing.Optional[str] = None,
         *,
-        path: typing.Union[str, pathlib.Path] = None,
-        content_script: bool = None
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content_script: typing.Optional[bool] = None
     ) -> NoneType:
         """Selectors.register
 
@@ -5533,7 +5634,7 @@ def default_value(self) -> str:
         """
         return mapping.from_maybe_impl(self._impl_obj.default_value)
 
-    def accept(self, prompt_text: str = None) -> NoneType:
+    def accept(self, prompt_text: typing.Optional[str] = None) -> NoneType:
         """Dialog.accept
 
         Returns when the dialog has been accepted.
@@ -6278,9 +6379,11 @@ def opener(self) -> typing.Optional["Page"]:
 
     def frame(
         self,
-        name: str = None,
+        name: typing.Optional[str] = None,
         *,
-        url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]] = None
+        url: typing.Optional[
+            typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]]
+        ] = None
     ) -> typing.Optional["Frame"]:
         """Page.frame
 
@@ -6353,7 +6456,7 @@ def set_default_timeout(self, timeout: float) -> NoneType:
         )
 
     def query_selector(
-        self, selector: str, *, strict: bool = None
+        self, selector: str, *, strict: typing.Optional[bool] = None
     ) -> typing.Optional["ElementHandle"]:
         """Page.query_selector
 
@@ -6409,9 +6512,11 @@ def wait_for_selector(
         self,
         selector: str,
         *,
-        timeout: float = None,
-        state: Literal["attached", "detached", "hidden", "visible"] = None,
-        strict: bool = None
+        timeout: typing.Optional[float] = None,
+        state: typing.Optional[
+            Literal["attached", "detached", "hidden", "visible"]
+        ] = None,
+        strict: typing.Optional[bool] = None
     ) -> typing.Optional["ElementHandle"]:
         """Page.wait_for_selector
 
@@ -6477,7 +6582,11 @@ def run(playwright):
         )
 
     def is_checked(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_checked
 
@@ -6509,7 +6618,11 @@ def is_checked(
         )
 
     def is_disabled(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_disabled
 
@@ -6541,7 +6654,11 @@ def is_disabled(
         )
 
     def is_editable(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_editable
 
@@ -6573,7 +6690,11 @@ def is_editable(
         )
 
     def is_enabled(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_enabled
 
@@ -6605,7 +6726,11 @@ def is_enabled(
         )
 
     def is_hidden(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_hidden
 
@@ -6638,7 +6763,11 @@ def is_hidden(
         )
 
     def is_visible(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> bool:
         """Page.is_visible
 
@@ -6674,10 +6803,10 @@ def dispatch_event(
         self,
         selector: str,
         type: str,
-        event_init: typing.Dict = None,
+        event_init: typing.Optional[typing.Dict] = None,
         *,
-        timeout: float = None,
-        strict: bool = None
+        timeout: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.dispatch_event
 
@@ -6738,7 +6867,9 @@ def dispatch_event(
             )
         )
 
-    def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    def evaluate(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """Page.evaluate
 
         Returns the value of the `expression` invocation.
@@ -6794,7 +6925,9 @@ def evaluate(self, expression: str, arg: typing.Any = None) -> typing.Any:
             )
         )
 
-    def evaluate_handle(self, expression: str, arg: typing.Any = None) -> "JSHandle":
+    def evaluate_handle(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> "JSHandle":
         """Page.evaluate_handle
 
         Returns the value of the `expression` invocation as a `JSHandle`.
@@ -6850,9 +6983,9 @@ def eval_on_selector(
         self,
         selector: str,
         expression: str,
-        arg: typing.Any = None,
+        arg: typing.Optional[typing.Any] = None,
         *,
-        strict: bool = None
+        strict: typing.Optional[bool] = None
     ) -> typing.Any:
         """Page.eval_on_selector
 
@@ -6905,7 +7038,7 @@ def eval_on_selector(
         )
 
     def eval_on_selector_all(
-        self, selector: str, expression: str, arg: typing.Any = None
+        self, selector: str, expression: str, arg: typing.Optional[typing.Any] = None
     ) -> typing.Any:
         """Page.eval_on_selector_all
 
@@ -6950,10 +7083,10 @@ def eval_on_selector_all(
     def add_script_tag(
         self,
         *,
-        url: str = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content: str = None,
-        type: str = None
+        url: typing.Optional[str] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content: typing.Optional[str] = None,
+        type: typing.Optional[str] = None
     ) -> "ElementHandle":
         """Page.add_script_tag
 
@@ -6991,9 +7124,9 @@ def add_script_tag(
     def add_style_tag(
         self,
         *,
-        url: str = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        content: str = None
+        url: typing.Optional[str] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        content: typing.Optional[str] = None
     ) -> "ElementHandle":
         """Page.add_style_tag
 
@@ -7083,7 +7216,11 @@ def run(playwright):
         )
 
     def expose_binding(
-        self, name: str, callback: typing.Callable, *, handle: bool = None
+        self,
+        name: str,
+        callback: typing.Callable,
+        *,
+        handle: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.expose_binding
 
@@ -7194,8 +7331,10 @@ def set_content(
         self,
         html: str,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> NoneType:
         """Page.set_content
 
@@ -7228,9 +7367,11 @@ def goto(
         self,
         url: str,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        referer: str = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None,
+        referer: typing.Optional[str] = None
     ) -> typing.Optional["Response"]:
         """Page.goto
 
@@ -7292,8 +7433,10 @@ def goto(
     def reload(
         self,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> typing.Optional["Response"]:
         """Page.reload
 
@@ -7325,9 +7468,11 @@ def reload(
 
     def wait_for_load_state(
         self,
-        state: Literal["domcontentloaded", "load", "networkidle"] = None,
+        state: typing.Optional[
+            Literal["domcontentloaded", "load", "networkidle"]
+        ] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Page.wait_for_load_state
 
@@ -7375,8 +7520,10 @@ def wait_for_url(
         self,
         url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]],
         *,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        timeout: float = None
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Page.wait_for_url
 
@@ -7417,7 +7564,11 @@ def wait_for_url(
         )
 
     def wait_for_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> typing.Any:
         """Page.wait_for_event
 
@@ -7455,8 +7606,10 @@ def wait_for_event(
     def go_back(
         self,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> typing.Optional["Response"]:
         """Page.go_back
 
@@ -7491,8 +7644,10 @@ def go_back(
     def go_forward(
         self,
         *,
-        timeout: float = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None
+        timeout: typing.Optional[float] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
+        ] = None
     ) -> typing.Optional["Response"]:
         """Page.go_forward
 
@@ -7527,10 +7682,10 @@ def go_forward(
     def emulate_media(
         self,
         *,
-        media: Literal["print", "screen"] = None,
-        color_scheme: Literal["dark", "light", "no-preference"] = None,
-        reduced_motion: Literal["no-preference", "reduce"] = None,
-        forced_colors: Literal["active", "none"] = None
+        media: typing.Optional[Literal["print", "screen"]] = None,
+        color_scheme: typing.Optional[Literal["dark", "light", "no-preference"]] = None,
+        reduced_motion: typing.Optional[Literal["no-preference", "reduce"]] = None,
+        forced_colors: typing.Optional[Literal["active", "none"]] = None
     ) -> NoneType:
         """Page.emulate_media
 
@@ -7629,7 +7784,10 @@ def bring_to_front(self) -> NoneType:
         return mapping.from_maybe_impl(self._sync(self._impl_obj.bring_to_front()))
 
     def add_init_script(
-        self, script: str = None, *, path: typing.Union[str, pathlib.Path] = None
+        self,
+        script: typing.Optional[str] = None,
+        *,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> NoneType:
         """Page.add_init_script
 
@@ -7672,7 +7830,7 @@ def route(
             typing.Callable[["Route", "Request"], typing.Any],
         ],
         *,
-        times: int = None
+        times: typing.Optional[int] = None
     ) -> NoneType:
         """Page.route
 
@@ -7747,9 +7905,11 @@ def handle_route(route):
     def unroute(
         self,
         url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]],
-        handler: typing.Union[
-            typing.Callable[["Route"], typing.Any],
-            typing.Callable[["Route", "Request"], typing.Any],
+        handler: typing.Optional[
+            typing.Union[
+                typing.Callable[["Route"], typing.Any],
+                typing.Callable[["Route", "Request"], typing.Any],
+            ]
         ] = None,
     ) -> NoneType:
         """Page.unroute
@@ -7776,9 +7936,9 @@ def route_from_har(
         self,
         har: typing.Union[pathlib.Path, str],
         *,
-        url: typing.Union[str, typing.Pattern[str]] = None,
-        not_found: Literal["abort", "fallback"] = None,
-        update: bool = None
+        url: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        not_found: typing.Optional[Literal["abort", "fallback"]] = None,
+        update: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.route_from_har
 
@@ -7817,17 +7977,17 @@ def route_from_har(
     def screenshot(
         self,
         *,
-        timeout: float = None,
-        type: Literal["jpeg", "png"] = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        quality: int = None,
-        omit_background: bool = None,
-        full_page: bool = None,
-        clip: FloatRect = None,
-        animations: Literal["allow", "disabled"] = None,
-        caret: Literal["hide", "initial"] = None,
-        scale: Literal["css", "device"] = None,
-        mask: typing.List["Locator"] = None
+        timeout: typing.Optional[float] = None,
+        type: typing.Optional[Literal["jpeg", "png"]] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        quality: typing.Optional[int] = None,
+        omit_background: typing.Optional[bool] = None,
+        full_page: typing.Optional[bool] = None,
+        clip: typing.Optional[FloatRect] = None,
+        animations: typing.Optional[Literal["allow", "disabled"]] = None,
+        caret: typing.Optional[Literal["hide", "initial"]] = None,
+        scale: typing.Optional[Literal["css", "device"]] = None,
+        mask: typing.Optional[typing.List["Locator"]] = None
     ) -> bytes:
         """Page.screenshot
 
@@ -7909,7 +8069,7 @@ def title(self) -> str:
 
         return mapping.from_maybe_impl(self._sync(self._impl_obj.title()))
 
-    def close(self, *, run_before_unload: bool = None) -> NoneType:
+    def close(self, *, run_before_unload: typing.Optional[bool] = None) -> NoneType:
         """Page.close
 
         If `runBeforeUnload` is `false`, does not run any unload handlers and waits for the page to be closed. If
@@ -7950,15 +8110,15 @@ def click(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None,
-        strict: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.click
 
@@ -8034,14 +8194,14 @@ def dblclick(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.dblclick
 
@@ -8117,12 +8277,12 @@ def tap(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.tap
 
@@ -8189,10 +8349,10 @@ def fill(
         selector: str,
         value: str,
         *,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        force: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.fill
 
@@ -8247,8 +8407,8 @@ def locator(
         self,
         selector: str,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """Page.locator
 
@@ -8310,7 +8470,11 @@ def frame_locator(self, selector: str) -> "FrameLocator":
         return mapping.from_impl(self._impl_obj.frame_locator(selector=selector))
 
     def focus(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Page.focus
 
@@ -8339,7 +8503,11 @@ def focus(
         )
 
     def text_content(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Page.text_content
 
@@ -8371,7 +8539,11 @@ def text_content(
         )
 
     def inner_text(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Page.inner_text
 
@@ -8403,7 +8575,11 @@ def inner_text(
         )
 
     def inner_html(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Page.inner_html
 
@@ -8435,7 +8611,12 @@ def inner_html(
         )
 
     def get_attribute(
-        self, selector: str, name: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        name: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Page.get_attribute
 
@@ -8475,11 +8656,11 @@ def hover(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.hover
 
@@ -8539,13 +8720,13 @@ def drag_and_drop(
         source: str,
         target: str,
         *,
-        source_position: Position = None,
-        target_position: Position = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        timeout: float = None,
-        strict: bool = None,
-        trial: bool = None
+        source_position: typing.Optional[Position] = None,
+        target_position: typing.Optional[Position] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.drag_and_drop
 
@@ -8599,15 +8780,17 @@ def drag_and_drop(
     def select_option(
         self,
         selector: str,
-        value: typing.Union[str, typing.List[str]] = None,
-        *,
-        index: typing.Union[int, typing.List[int]] = None,
-        label: typing.Union[str, typing.List[str]] = None,
-        element: typing.Union["ElementHandle", typing.List["ElementHandle"]] = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        force: bool = None,
-        strict: bool = None
+        value: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        *,
+        index: typing.Optional[typing.Union[int, typing.List[int]]] = None,
+        label: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        element: typing.Optional[
+            typing.Union["ElementHandle", typing.List["ElementHandle"]]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None
     ) -> typing.List[str]:
         """Page.select_option
 
@@ -8683,7 +8866,11 @@ def select_option(
         )
 
     def input_value(
-        self, selector: str, *, strict: bool = None, timeout: float = None
+        self,
+        selector: str,
+        *,
+        strict: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
     ) -> str:
         """Page.input_value
 
@@ -8728,9 +8915,9 @@ def set_input_files(
             typing.List[FilePayload],
         ],
         *,
-        timeout: float = None,
-        strict: bool = None,
-        no_wait_after: bool = None
+        timeout: typing.Optional[float] = None,
+        strict: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.set_input_files
 
@@ -8777,10 +8964,10 @@ def type(
         selector: str,
         text: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.type
 
@@ -8835,10 +9022,10 @@ def press(
         selector: str,
         key: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        strict: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.press
 
@@ -8911,12 +9098,12 @@ def check(
         self,
         selector: str,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.check
 
@@ -8979,12 +9166,12 @@ def uncheck(
         self,
         selector: str,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.uncheck
 
@@ -9072,9 +9259,9 @@ def wait_for_function(
         self,
         expression: str,
         *,
-        arg: typing.Any = None,
-        timeout: float = None,
-        polling: typing.Union[float, Literal["raf"]] = None
+        arg: typing.Optional[typing.Any] = None,
+        timeout: typing.Optional[float] = None,
+        polling: typing.Optional[typing.Union[float, Literal["raf"]]] = None
     ) -> "JSHandle":
         """Page.wait_for_function
 
@@ -9154,19 +9341,19 @@ def pause(self) -> NoneType:
     def pdf(
         self,
         *,
-        scale: float = None,
-        display_header_footer: bool = None,
-        header_template: str = None,
-        footer_template: str = None,
-        print_background: bool = None,
-        landscape: bool = None,
-        page_ranges: str = None,
-        format: str = None,
-        width: typing.Union[str, float] = None,
-        height: typing.Union[str, float] = None,
-        prefer_css_page_size: bool = None,
-        margin: PdfMargins = None,
-        path: typing.Union[str, pathlib.Path] = None
+        scale: typing.Optional[float] = None,
+        display_header_footer: typing.Optional[bool] = None,
+        header_template: typing.Optional[str] = None,
+        footer_template: typing.Optional[str] = None,
+        print_background: typing.Optional[bool] = None,
+        landscape: typing.Optional[bool] = None,
+        page_ranges: typing.Optional[str] = None,
+        format: typing.Optional[str] = None,
+        width: typing.Optional[typing.Union[str, float]] = None,
+        height: typing.Optional[typing.Union[str, float]] = None,
+        prefer_css_page_size: typing.Optional[bool] = None,
+        margin: typing.Optional[PdfMargins] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> bytes:
         """Page.pdf
 
@@ -9279,7 +9466,11 @@ def pdf(
         )
 
     def expect_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager:
         """Page.expect_event
 
@@ -9317,7 +9508,7 @@ def expect_console_message(
         self,
         predicate: typing.Optional[typing.Callable[["ConsoleMessage"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["ConsoleMessage"]:
         """Page.expect_console_message
 
@@ -9348,7 +9539,7 @@ def expect_download(
         self,
         predicate: typing.Optional[typing.Callable[["Download"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["Download"]:
         """Page.expect_download
 
@@ -9379,7 +9570,7 @@ def expect_file_chooser(
         self,
         predicate: typing.Optional[typing.Callable[["FileChooser"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["FileChooser"]:
         """Page.expect_file_chooser
 
@@ -9409,11 +9600,13 @@ def expect_file_chooser(
     def expect_navigation(
         self,
         *,
-        url: typing.Union[
-            str, typing.Pattern[str], typing.Callable[[str], bool]
+        url: typing.Optional[
+            typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]]
+        ] = None,
+        wait_until: typing.Optional[
+            Literal["commit", "domcontentloaded", "load", "networkidle"]
         ] = None,
-        wait_until: Literal["commit", "domcontentloaded", "load", "networkidle"] = None,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["Response"]:
         """Page.expect_navigation
 
@@ -9469,7 +9662,7 @@ def expect_popup(
         self,
         predicate: typing.Optional[typing.Callable[["Page"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["Page"]:
         """Page.expect_popup
 
@@ -9502,7 +9695,7 @@ def expect_request(
             str, typing.Pattern[str], typing.Callable[["Request"], bool]
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["Request"]:
         """Page.expect_request
 
@@ -9545,7 +9738,7 @@ def expect_request_finished(
         self,
         predicate: typing.Optional[typing.Callable[["Request"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["Request"]:
         """Page.expect_request_finished
 
@@ -9578,7 +9771,7 @@ def expect_response(
             str, typing.Pattern[str], typing.Callable[["Response"], bool]
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["Response"]:
         """Page.expect_response
 
@@ -9622,7 +9815,7 @@ def expect_websocket(
         self,
         predicate: typing.Optional[typing.Callable[["WebSocket"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["WebSocket"]:
         """Page.expect_websocket
 
@@ -9653,7 +9846,7 @@ def expect_worker(
         self,
         predicate: typing.Optional[typing.Callable[["Worker"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["Worker"]:
         """Page.expect_worker
 
@@ -9685,12 +9878,12 @@ def set_checked(
         selector: str,
         checked: bool,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        strict: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        strict: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Page.set_checked
 
@@ -10076,7 +10269,7 @@ def new_page(self) -> "Page":
         return mapping.from_impl(self._sync(self._impl_obj.new_page()))
 
     def cookies(
-        self, urls: typing.Union[str, typing.List[str]] = None
+        self, urls: typing.Optional[typing.Union[str, typing.List[str]]] = None
     ) -> typing.List[Cookie]:
         """BrowserContext.cookies
 
@@ -10125,7 +10318,7 @@ def clear_cookies(self) -> NoneType:
         return mapping.from_maybe_impl(self._sync(self._impl_obj.clear_cookies()))
 
     def grant_permissions(
-        self, permissions: typing.List[str], *, origin: str = None
+        self, permissions: typing.List[str], *, origin: typing.Optional[str] = None
     ) -> NoneType:
         """BrowserContext.grant_permissions
 
@@ -10178,7 +10371,9 @@ def clear_permissions(self) -> NoneType:
 
         return mapping.from_maybe_impl(self._sync(self._impl_obj.clear_permissions()))
 
-    def set_geolocation(self, geolocation: Geolocation = None) -> NoneType:
+    def set_geolocation(
+        self, geolocation: typing.Optional[Geolocation] = None
+    ) -> NoneType:
         """BrowserContext.set_geolocation
 
         Sets the context's geolocation. Passing `null` or `undefined` emulates position unavailable.
@@ -10234,7 +10429,10 @@ def set_offline(self, offline: bool) -> NoneType:
         )
 
     def add_init_script(
-        self, script: str = None, *, path: typing.Union[str, pathlib.Path] = None
+        self,
+        script: typing.Optional[str] = None,
+        *,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> NoneType:
         """BrowserContext.add_init_script
 
@@ -10270,7 +10468,11 @@ def add_init_script(
         )
 
     def expose_binding(
-        self, name: str, callback: typing.Callable, *, handle: bool = None
+        self,
+        name: str,
+        callback: typing.Callable,
+        *,
+        handle: typing.Optional[bool] = None
     ) -> NoneType:
         """BrowserContext.expose_binding
 
@@ -10410,7 +10612,7 @@ def route(
             typing.Callable[["Route", "Request"], typing.Any],
         ],
         *,
-        times: int = None
+        times: typing.Optional[int] = None
     ) -> NoneType:
         """BrowserContext.route
 
@@ -10487,9 +10689,11 @@ def handle_route(route):
     def unroute(
         self,
         url: typing.Union[str, typing.Pattern[str], typing.Callable[[str], bool]],
-        handler: typing.Union[
-            typing.Callable[["Route"], typing.Any],
-            typing.Callable[["Route", "Request"], typing.Any],
+        handler: typing.Optional[
+            typing.Union[
+                typing.Callable[["Route"], typing.Any],
+                typing.Callable[["Route", "Request"], typing.Any],
+            ]
         ] = None,
     ) -> NoneType:
         """BrowserContext.unroute
@@ -10518,9 +10722,9 @@ def route_from_har(
         self,
         har: typing.Union[pathlib.Path, str],
         *,
-        url: typing.Union[str, typing.Pattern[str]] = None,
-        not_found: Literal["abort", "fallback"] = None,
-        update: bool = None
+        url: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        not_found: typing.Optional[Literal["abort", "fallback"]] = None,
+        update: typing.Optional[bool] = None
     ) -> NoneType:
         """BrowserContext.route_from_har
 
@@ -10557,7 +10761,11 @@ def route_from_har(
         )
 
     def expect_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager:
         """BrowserContext.expect_event
 
@@ -10602,7 +10810,7 @@ def close(self) -> NoneType:
         return mapping.from_maybe_impl(self._sync(self._impl_obj.close()))
 
     def storage_state(
-        self, *, path: typing.Union[str, pathlib.Path] = None
+        self, *, path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> StorageState:
         """BrowserContext.storage_state
 
@@ -10622,7 +10830,11 @@ def storage_state(
         return mapping.from_impl(self._sync(self._impl_obj.storage_state(path=path)))
 
     def wait_for_event(
-        self, event: str, predicate: typing.Callable = None, *, timeout: float = None
+        self,
+        event: str,
+        predicate: typing.Optional[typing.Callable] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> typing.Any:
         """BrowserContext.wait_for_event
 
@@ -10661,7 +10873,7 @@ def expect_page(
         self,
         predicate: typing.Optional[typing.Callable[["Page"], bool]] = None,
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> EventContextManager["Page"]:
         """BrowserContext.expect_page
 
@@ -10713,7 +10925,9 @@ def new_cdp_session(self, page: typing.Union["Page", "Frame"]) -> "CDPSession":
 
 
 class CDPSession(SyncBase):
-    def send(self, method: str, params: typing.Dict = None) -> typing.Dict:
+    def send(
+        self, method: str, params: typing.Optional[typing.Dict] = None
+    ) -> typing.Dict:
         """CDPSession.send
 
         Parameters
@@ -10824,40 +11038,44 @@ def is_connected(self) -> bool:
     def new_context(
         self,
         *,
-        viewport: ViewportSize = None,
-        screen: ViewportSize = None,
-        no_viewport: bool = None,
-        ignore_https_errors: bool = None,
-        java_script_enabled: bool = None,
-        bypass_csp: bool = None,
-        user_agent: str = None,
-        locale: str = None,
-        timezone_id: str = None,
-        geolocation: Geolocation = None,
-        permissions: typing.List[str] = None,
+        viewport: typing.Optional[ViewportSize] = None,
+        screen: typing.Optional[ViewportSize] = None,
+        no_viewport: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None,
+        java_script_enabled: typing.Optional[bool] = None,
+        bypass_csp: typing.Optional[bool] = None,
+        user_agent: typing.Optional[str] = None,
+        locale: typing.Optional[str] = None,
+        timezone_id: typing.Optional[str] = None,
+        geolocation: typing.Optional[Geolocation] = None,
+        permissions: typing.Optional[typing.List[str]] = None,
         extra_http_headers: typing.Optional[typing.Dict[str, str]] = None,
-        offline: bool = None,
-        http_credentials: HttpCredentials = None,
-        device_scale_factor: float = None,
-        is_mobile: bool = None,
-        has_touch: bool = None,
-        color_scheme: Literal["dark", "light", "no-preference"] = None,
-        reduced_motion: Literal["no-preference", "reduce"] = None,
-        forced_colors: Literal["active", "none"] = None,
-        accept_downloads: bool = None,
-        default_browser_type: str = None,
-        proxy: ProxySettings = None,
-        record_har_path: typing.Union[str, pathlib.Path] = None,
-        record_har_omit_content: bool = None,
-        record_video_dir: typing.Union[str, pathlib.Path] = None,
-        record_video_size: ViewportSize = None,
-        storage_state: typing.Union[StorageState, str, pathlib.Path] = None,
-        base_url: str = None,
-        strict_selectors: bool = None,
-        service_workers: Literal["allow", "block"] = None,
-        record_har_url_filter: typing.Union[str, typing.Pattern[str]] = None,
-        record_har_mode: Literal["full", "minimal"] = None,
-        record_har_content: Literal["attach", "embed", "omit"] = None
+        offline: typing.Optional[bool] = None,
+        http_credentials: typing.Optional[HttpCredentials] = None,
+        device_scale_factor: typing.Optional[float] = None,
+        is_mobile: typing.Optional[bool] = None,
+        has_touch: typing.Optional[bool] = None,
+        color_scheme: typing.Optional[Literal["dark", "light", "no-preference"]] = None,
+        reduced_motion: typing.Optional[Literal["no-preference", "reduce"]] = None,
+        forced_colors: typing.Optional[Literal["active", "none"]] = None,
+        accept_downloads: typing.Optional[bool] = None,
+        default_browser_type: typing.Optional[str] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        record_har_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_har_omit_content: typing.Optional[bool] = None,
+        record_video_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_video_size: typing.Optional[ViewportSize] = None,
+        storage_state: typing.Optional[
+            typing.Union[StorageState, str, pathlib.Path]
+        ] = None,
+        base_url: typing.Optional[str] = None,
+        strict_selectors: typing.Optional[bool] = None,
+        service_workers: typing.Optional[Literal["allow", "block"]] = None,
+        record_har_url_filter: typing.Optional[
+            typing.Union[str, typing.Pattern[str]]
+        ] = None,
+        record_har_mode: typing.Optional[Literal["full", "minimal"]] = None,
+        record_har_content: typing.Optional[Literal["attach", "embed", "omit"]] = None
     ) -> "BrowserContext":
         """Browser.new_context
 
@@ -11033,40 +11251,44 @@ def new_context(
     def new_page(
         self,
         *,
-        viewport: ViewportSize = None,
-        screen: ViewportSize = None,
-        no_viewport: bool = None,
-        ignore_https_errors: bool = None,
-        java_script_enabled: bool = None,
-        bypass_csp: bool = None,
-        user_agent: str = None,
-        locale: str = None,
-        timezone_id: str = None,
-        geolocation: Geolocation = None,
-        permissions: typing.List[str] = None,
+        viewport: typing.Optional[ViewportSize] = None,
+        screen: typing.Optional[ViewportSize] = None,
+        no_viewport: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None,
+        java_script_enabled: typing.Optional[bool] = None,
+        bypass_csp: typing.Optional[bool] = None,
+        user_agent: typing.Optional[str] = None,
+        locale: typing.Optional[str] = None,
+        timezone_id: typing.Optional[str] = None,
+        geolocation: typing.Optional[Geolocation] = None,
+        permissions: typing.Optional[typing.List[str]] = None,
         extra_http_headers: typing.Optional[typing.Dict[str, str]] = None,
-        offline: bool = None,
-        http_credentials: HttpCredentials = None,
-        device_scale_factor: float = None,
-        is_mobile: bool = None,
-        has_touch: bool = None,
-        color_scheme: Literal["dark", "light", "no-preference"] = None,
-        forced_colors: Literal["active", "none"] = None,
-        reduced_motion: Literal["no-preference", "reduce"] = None,
-        accept_downloads: bool = None,
-        default_browser_type: str = None,
-        proxy: ProxySettings = None,
-        record_har_path: typing.Union[str, pathlib.Path] = None,
-        record_har_omit_content: bool = None,
-        record_video_dir: typing.Union[str, pathlib.Path] = None,
-        record_video_size: ViewportSize = None,
-        storage_state: typing.Union[StorageState, str, pathlib.Path] = None,
-        base_url: str = None,
-        strict_selectors: bool = None,
-        service_workers: Literal["allow", "block"] = None,
-        record_har_url_filter: typing.Union[str, typing.Pattern[str]] = None,
-        record_har_mode: Literal["full", "minimal"] = None,
-        record_har_content: Literal["attach", "embed", "omit"] = None
+        offline: typing.Optional[bool] = None,
+        http_credentials: typing.Optional[HttpCredentials] = None,
+        device_scale_factor: typing.Optional[float] = None,
+        is_mobile: typing.Optional[bool] = None,
+        has_touch: typing.Optional[bool] = None,
+        color_scheme: typing.Optional[Literal["dark", "light", "no-preference"]] = None,
+        forced_colors: typing.Optional[Literal["active", "none"]] = None,
+        reduced_motion: typing.Optional[Literal["no-preference", "reduce"]] = None,
+        accept_downloads: typing.Optional[bool] = None,
+        default_browser_type: typing.Optional[str] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        record_har_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_har_omit_content: typing.Optional[bool] = None,
+        record_video_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_video_size: typing.Optional[ViewportSize] = None,
+        storage_state: typing.Optional[
+            typing.Union[StorageState, str, pathlib.Path]
+        ] = None,
+        base_url: typing.Optional[str] = None,
+        strict_selectors: typing.Optional[bool] = None,
+        service_workers: typing.Optional[Literal["allow", "block"]] = None,
+        record_har_url_filter: typing.Optional[
+            typing.Union[str, typing.Pattern[str]]
+        ] = None,
+        record_har_mode: typing.Optional[Literal["full", "minimal"]] = None,
+        record_har_content: typing.Optional[Literal["attach", "embed", "omit"]] = None
     ) -> "Page":
         """Browser.new_page
 
@@ -11260,10 +11482,10 @@ def new_browser_cdp_session(self) -> "CDPSession":
     def start_tracing(
         self,
         *,
-        page: "Page" = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        screenshots: bool = None,
-        categories: typing.List[str] = None
+        page: typing.Optional["Page"] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        screenshots: typing.Optional[bool] = None,
+        categories: typing.Optional[typing.List[str]] = None
     ) -> NoneType:
         """Browser.start_tracing
 
@@ -11351,22 +11573,24 @@ def executable_path(self) -> str:
     def launch(
         self,
         *,
-        executable_path: typing.Union[str, pathlib.Path] = None,
-        channel: str = None,
-        args: typing.List[str] = None,
-        ignore_default_args: typing.Union[bool, typing.List[str]] = None,
-        handle_sigint: bool = None,
-        handle_sigterm: bool = None,
-        handle_sighup: bool = None,
-        timeout: float = None,
+        executable_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        channel: typing.Optional[str] = None,
+        args: typing.Optional[typing.List[str]] = None,
+        ignore_default_args: typing.Optional[
+            typing.Union[bool, typing.List[str]]
+        ] = None,
+        handle_sigint: typing.Optional[bool] = None,
+        handle_sigterm: typing.Optional[bool] = None,
+        handle_sighup: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
         env: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
-        headless: bool = None,
-        devtools: bool = None,
-        proxy: ProxySettings = None,
-        downloads_path: typing.Union[str, pathlib.Path] = None,
-        slow_mo: float = None,
-        traces_dir: typing.Union[str, pathlib.Path] = None,
-        chromium_sandbox: bool = None,
+        headless: typing.Optional[bool] = None,
+        devtools: typing.Optional[bool] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        downloads_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        slow_mo: typing.Optional[float] = None,
+        traces_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        chromium_sandbox: typing.Optional[bool] = None,
         firefox_user_prefs: typing.Optional[
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None
@@ -11482,53 +11706,57 @@ def launch_persistent_context(
         self,
         user_data_dir: typing.Union[str, pathlib.Path],
         *,
-        channel: str = None,
-        executable_path: typing.Union[str, pathlib.Path] = None,
-        args: typing.List[str] = None,
-        ignore_default_args: typing.Union[bool, typing.List[str]] = None,
-        handle_sigint: bool = None,
-        handle_sigterm: bool = None,
-        handle_sighup: bool = None,
-        timeout: float = None,
+        channel: typing.Optional[str] = None,
+        executable_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        args: typing.Optional[typing.List[str]] = None,
+        ignore_default_args: typing.Optional[
+            typing.Union[bool, typing.List[str]]
+        ] = None,
+        handle_sigint: typing.Optional[bool] = None,
+        handle_sigterm: typing.Optional[bool] = None,
+        handle_sighup: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
         env: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
-        headless: bool = None,
-        devtools: bool = None,
-        proxy: ProxySettings = None,
-        downloads_path: typing.Union[str, pathlib.Path] = None,
-        slow_mo: float = None,
-        viewport: ViewportSize = None,
-        screen: ViewportSize = None,
-        no_viewport: bool = None,
-        ignore_https_errors: bool = None,
-        java_script_enabled: bool = None,
-        bypass_csp: bool = None,
-        user_agent: str = None,
-        locale: str = None,
-        timezone_id: str = None,
-        geolocation: Geolocation = None,
-        permissions: typing.List[str] = None,
+        headless: typing.Optional[bool] = None,
+        devtools: typing.Optional[bool] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        downloads_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        slow_mo: typing.Optional[float] = None,
+        viewport: typing.Optional[ViewportSize] = None,
+        screen: typing.Optional[ViewportSize] = None,
+        no_viewport: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None,
+        java_script_enabled: typing.Optional[bool] = None,
+        bypass_csp: typing.Optional[bool] = None,
+        user_agent: typing.Optional[str] = None,
+        locale: typing.Optional[str] = None,
+        timezone_id: typing.Optional[str] = None,
+        geolocation: typing.Optional[Geolocation] = None,
+        permissions: typing.Optional[typing.List[str]] = None,
         extra_http_headers: typing.Optional[typing.Dict[str, str]] = None,
-        offline: bool = None,
-        http_credentials: HttpCredentials = None,
-        device_scale_factor: float = None,
-        is_mobile: bool = None,
-        has_touch: bool = None,
-        color_scheme: Literal["dark", "light", "no-preference"] = None,
-        reduced_motion: Literal["no-preference", "reduce"] = None,
-        forced_colors: Literal["active", "none"] = None,
-        accept_downloads: bool = None,
-        traces_dir: typing.Union[str, pathlib.Path] = None,
-        chromium_sandbox: bool = None,
-        record_har_path: typing.Union[str, pathlib.Path] = None,
-        record_har_omit_content: bool = None,
-        record_video_dir: typing.Union[str, pathlib.Path] = None,
-        record_video_size: ViewportSize = None,
-        base_url: str = None,
-        strict_selectors: bool = None,
-        service_workers: Literal["allow", "block"] = None,
-        record_har_url_filter: typing.Union[str, typing.Pattern[str]] = None,
-        record_har_mode: Literal["full", "minimal"] = None,
-        record_har_content: Literal["attach", "embed", "omit"] = None
+        offline: typing.Optional[bool] = None,
+        http_credentials: typing.Optional[HttpCredentials] = None,
+        device_scale_factor: typing.Optional[float] = None,
+        is_mobile: typing.Optional[bool] = None,
+        has_touch: typing.Optional[bool] = None,
+        color_scheme: typing.Optional[Literal["dark", "light", "no-preference"]] = None,
+        reduced_motion: typing.Optional[Literal["no-preference", "reduce"]] = None,
+        forced_colors: typing.Optional[Literal["active", "none"]] = None,
+        accept_downloads: typing.Optional[bool] = None,
+        traces_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        chromium_sandbox: typing.Optional[bool] = None,
+        record_har_path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_har_omit_content: typing.Optional[bool] = None,
+        record_video_dir: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        record_video_size: typing.Optional[ViewportSize] = None,
+        base_url: typing.Optional[str] = None,
+        strict_selectors: typing.Optional[bool] = None,
+        service_workers: typing.Optional[Literal["allow", "block"]] = None,
+        record_har_url_filter: typing.Optional[
+            typing.Union[str, typing.Pattern[str]]
+        ] = None,
+        record_har_mode: typing.Optional[Literal["full", "minimal"]] = None,
+        record_har_content: typing.Optional[Literal["attach", "embed", "omit"]] = None
     ) -> "BrowserContext":
         """BrowserType.launch_persistent_context
 
@@ -11745,8 +11973,8 @@ def connect_over_cdp(
         self,
         endpoint_url: str,
         *,
-        timeout: float = None,
-        slow_mo: float = None,
+        timeout: typing.Optional[float] = None,
+        slow_mo: typing.Optional[float] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None
     ) -> "Browser":
         """BrowserType.connect_over_cdp
@@ -11791,8 +12019,8 @@ def connect(
         self,
         ws_endpoint: str,
         *,
-        timeout: float = None,
-        slow_mo: float = None,
+        timeout: typing.Optional[float] = None,
+        slow_mo: typing.Optional[float] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None
     ) -> "Browser":
         """BrowserType.connect
@@ -11957,11 +12185,11 @@ class Tracing(SyncBase):
     def start(
         self,
         *,
-        name: str = None,
-        title: str = None,
-        snapshots: bool = None,
-        screenshots: bool = None,
-        sources: bool = None
+        name: typing.Optional[str] = None,
+        title: typing.Optional[str] = None,
+        snapshots: typing.Optional[bool] = None,
+        screenshots: typing.Optional[bool] = None,
+        sources: typing.Optional[bool] = None
     ) -> NoneType:
         """Tracing.start
 
@@ -12003,7 +12231,7 @@ def start(
             )
         )
 
-    def start_chunk(self, *, title: str = None) -> NoneType:
+    def start_chunk(self, *, title: typing.Optional[str] = None) -> NoneType:
         """Tracing.start_chunk
 
         Start a new trace chunk. If you'd like to record multiple traces on the same `BrowserContext`, use
@@ -12036,7 +12264,9 @@ def start_chunk(self, *, title: str = None) -> NoneType:
             self._sync(self._impl_obj.start_chunk(title=title))
         )
 
-    def stop_chunk(self, *, path: typing.Union[str, pathlib.Path] = None) -> NoneType:
+    def stop_chunk(
+        self, *, path: typing.Optional[typing.Union[str, pathlib.Path]] = None
+    ) -> NoneType:
         """Tracing.stop_chunk
 
         Stop the trace chunk. See `tracing.start_chunk()` for more details about multiple trace chunks.
@@ -12049,7 +12279,9 @@ def stop_chunk(self, *, path: typing.Union[str, pathlib.Path] = None) -> NoneTyp
 
         return mapping.from_maybe_impl(self._sync(self._impl_obj.stop_chunk(path=path)))
 
-    def stop(self, *, path: typing.Union[str, pathlib.Path] = None) -> NoneType:
+    def stop(
+        self, *, path: typing.Optional[typing.Union[str, pathlib.Path]] = None
+    ) -> NoneType:
         """Tracing.stop
 
         Stop tracing.
@@ -12103,7 +12335,9 @@ def last(self) -> "Locator":
         """
         return mapping.from_impl(self._impl_obj.last)
 
-    def bounding_box(self, *, timeout: float = None) -> typing.Optional[FloatRect]:
+    def bounding_box(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> typing.Optional[FloatRect]:
         """Locator.bounding_box
 
         This method returns the bounding box of the element, or `null` if the element is not visible. The bounding box is
@@ -12142,11 +12376,11 @@ def bounding_box(self, *, timeout: float = None) -> typing.Optional[FloatRect]:
     def check(
         self,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.check
 
@@ -12201,14 +12435,14 @@ def click(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        click_count: int = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        click_count: typing.Optional[int] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.click
 
@@ -12273,13 +12507,13 @@ def dblclick(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        delay: float = None,
-        button: Literal["left", "middle", "right"] = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        delay: typing.Optional[float] = None,
+        button: typing.Optional[Literal["left", "middle", "right"]] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.dblclick
 
@@ -12339,7 +12573,11 @@ def dblclick(
         )
 
     def dispatch_event(
-        self, type: str, event_init: typing.Dict = None, *, timeout: float = None
+        self,
+        type: str,
+        event_init: typing.Optional[typing.Dict] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """Locator.dispatch_event
 
@@ -12391,7 +12629,11 @@ def dispatch_event(
         )
 
     def evaluate(
-        self, expression: str, arg: typing.Any = None, *, timeout: float = None
+        self,
+        expression: str,
+        arg: typing.Optional[typing.Any] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> typing.Any:
         """Locator.evaluate
 
@@ -12432,7 +12674,9 @@ def evaluate(
             )
         )
 
-    def evaluate_all(self, expression: str, arg: typing.Any = None) -> typing.Any:
+    def evaluate_all(
+        self, expression: str, arg: typing.Optional[typing.Any] = None
+    ) -> typing.Any:
         """Locator.evaluate_all
 
         The method finds all elements matching the specified locator and passes an array of matched elements as a first argument
@@ -12470,7 +12714,11 @@ def evaluate_all(self, expression: str, arg: typing.Any = None) -> typing.Any:
         )
 
     def evaluate_handle(
-        self, expression: str, arg: typing.Any = None, *, timeout: float = None
+        self,
+        expression: str,
+        arg: typing.Optional[typing.Any] = None,
+        *,
+        timeout: typing.Optional[float] = None
     ) -> "JSHandle":
         """Locator.evaluate_handle
 
@@ -12514,9 +12762,9 @@ def fill(
         self,
         value: str,
         *,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        force: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.fill
 
@@ -12557,8 +12805,8 @@ def locator(
         self,
         selector: str,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """Locator.locator
 
@@ -12613,7 +12861,9 @@ def frame_locator(self, selector: str) -> "FrameLocator":
 
         return mapping.from_impl(self._impl_obj.frame_locator(selector=selector))
 
-    def element_handle(self, *, timeout: float = None) -> "ElementHandle":
+    def element_handle(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> "ElementHandle":
         """Locator.element_handle
 
         Resolves given locator to the first matching DOM element. If no elements matching the query are visible, waits for them
@@ -12665,8 +12915,8 @@ def nth(self, index: int) -> "Locator":
     def filter(
         self,
         *,
-        has_text: typing.Union[str, typing.Pattern[str]] = None,
-        has: "Locator" = None
+        has_text: typing.Optional[typing.Union[str, typing.Pattern[str]]] = None,
+        has: typing.Optional["Locator"] = None
     ) -> "Locator":
         """Locator.filter
 
@@ -12703,7 +12953,7 @@ def filter(
             self._impl_obj.filter(has_text=has_text, has=has._impl_obj if has else None)
         )
 
-    def focus(self, *, timeout: float = None) -> NoneType:
+    def focus(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """Locator.focus
 
         Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
@@ -12735,12 +12985,12 @@ def drag_to(
         self,
         target: "Locator",
         *,
-        force: bool = None,
-        no_wait_after: bool = None,
-        timeout: float = None,
-        trial: bool = None,
-        source_position: Position = None,
-        target_position: Position = None
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        trial: typing.Optional[bool] = None,
+        source_position: typing.Optional[Position] = None,
+        target_position: typing.Optional[Position] = None
     ) -> NoneType:
         """Locator.drag_to
 
@@ -12783,7 +13033,7 @@ def drag_to(
         )
 
     def get_attribute(
-        self, name: str, *, timeout: float = None
+        self, name: str, *, timeout: typing.Optional[float] = None
     ) -> typing.Optional[str]:
         """Locator.get_attribute
 
@@ -12812,10 +13062,10 @@ def hover(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.hover
 
@@ -12860,7 +13110,7 @@ def hover(
             )
         )
 
-    def inner_html(self, *, timeout: float = None) -> str:
+    def inner_html(self, *, timeout: typing.Optional[float] = None) -> str:
         """Locator.inner_html
 
         Returns the `element.innerHTML`.
@@ -12880,7 +13130,7 @@ def inner_html(self, *, timeout: float = None) -> str:
             self._sync(self._impl_obj.inner_html(timeout=timeout))
         )
 
-    def inner_text(self, *, timeout: float = None) -> str:
+    def inner_text(self, *, timeout: typing.Optional[float] = None) -> str:
         """Locator.inner_text
 
         Returns the `element.innerText`.
@@ -12900,7 +13150,7 @@ def inner_text(self, *, timeout: float = None) -> str:
             self._sync(self._impl_obj.inner_text(timeout=timeout))
         )
 
-    def input_value(self, *, timeout: float = None) -> str:
+    def input_value(self, *, timeout: typing.Optional[float] = None) -> str:
         """Locator.input_value
 
         Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
@@ -12923,7 +13173,7 @@ def input_value(self, *, timeout: float = None) -> str:
             self._sync(self._impl_obj.input_value(timeout=timeout))
         )
 
-    def is_checked(self, *, timeout: float = None) -> bool:
+    def is_checked(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_checked
 
         Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
@@ -12943,7 +13193,7 @@ def is_checked(self, *, timeout: float = None) -> bool:
             self._sync(self._impl_obj.is_checked(timeout=timeout))
         )
 
-    def is_disabled(self, *, timeout: float = None) -> bool:
+    def is_disabled(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_disabled
 
         Returns whether the element is disabled, the opposite of [enabled](https://playwright.dev/python/docs/actionability#enabled).
@@ -12963,7 +13213,7 @@ def is_disabled(self, *, timeout: float = None) -> bool:
             self._sync(self._impl_obj.is_disabled(timeout=timeout))
         )
 
-    def is_editable(self, *, timeout: float = None) -> bool:
+    def is_editable(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_editable
 
         Returns whether the element is [editable](https://playwright.dev/python/docs/actionability#editable).
@@ -12983,7 +13233,7 @@ def is_editable(self, *, timeout: float = None) -> bool:
             self._sync(self._impl_obj.is_editable(timeout=timeout))
         )
 
-    def is_enabled(self, *, timeout: float = None) -> bool:
+    def is_enabled(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_enabled
 
         Returns whether the element is [enabled](https://playwright.dev/python/docs/actionability#enabled).
@@ -13003,7 +13253,7 @@ def is_enabled(self, *, timeout: float = None) -> bool:
             self._sync(self._impl_obj.is_enabled(timeout=timeout))
         )
 
-    def is_hidden(self, *, timeout: float = None) -> bool:
+    def is_hidden(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_hidden
 
         Returns whether the element is hidden, the opposite of [visible](https://playwright.dev/python/docs/actionability#visible).
@@ -13023,7 +13273,7 @@ def is_hidden(self, *, timeout: float = None) -> bool:
             self._sync(self._impl_obj.is_hidden(timeout=timeout))
         )
 
-    def is_visible(self, *, timeout: float = None) -> bool:
+    def is_visible(self, *, timeout: typing.Optional[float] = None) -> bool:
         """Locator.is_visible
 
         Returns whether the element is [visible](https://playwright.dev/python/docs/actionability#visible).
@@ -13047,9 +13297,9 @@ def press(
         self,
         key: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.press
 
@@ -13098,15 +13348,15 @@ def press(
     def screenshot(
         self,
         *,
-        timeout: float = None,
-        type: Literal["jpeg", "png"] = None,
-        path: typing.Union[str, pathlib.Path] = None,
-        quality: int = None,
-        omit_background: bool = None,
-        animations: Literal["allow", "disabled"] = None,
-        caret: Literal["hide", "initial"] = None,
-        scale: Literal["css", "device"] = None,
-        mask: typing.List["Locator"] = None
+        timeout: typing.Optional[float] = None,
+        type: typing.Optional[Literal["jpeg", "png"]] = None,
+        path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
+        quality: typing.Optional[int] = None,
+        omit_background: typing.Optional[bool] = None,
+        animations: typing.Optional[Literal["allow", "disabled"]] = None,
+        caret: typing.Optional[Literal["hide", "initial"]] = None,
+        scale: typing.Optional[Literal["css", "device"]] = None,
+        mask: typing.Optional[typing.List["Locator"]] = None
     ) -> bytes:
         """Locator.screenshot
 
@@ -13176,7 +13426,9 @@ def screenshot(
             )
         )
 
-    def scroll_into_view_if_needed(self, *, timeout: float = None) -> NoneType:
+    def scroll_into_view_if_needed(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """Locator.scroll_into_view_if_needed
 
         This method waits for [actionability](https://playwright.dev/python/docs/actionability) checks, then tries to scroll element into view, unless it is
@@ -13196,14 +13448,16 @@ def scroll_into_view_if_needed(self, *, timeout: float = None) -> NoneType:
 
     def select_option(
         self,
-        value: typing.Union[str, typing.List[str]] = None,
+        value: typing.Optional[typing.Union[str, typing.List[str]]] = None,
         *,
-        index: typing.Union[int, typing.List[int]] = None,
-        label: typing.Union[str, typing.List[str]] = None,
-        element: typing.Union["ElementHandle", typing.List["ElementHandle"]] = None,
-        timeout: float = None,
-        no_wait_after: bool = None,
-        force: bool = None
+        index: typing.Optional[typing.Union[int, typing.List[int]]] = None,
+        label: typing.Optional[typing.Union[str, typing.List[str]]] = None,
+        element: typing.Optional[
+            typing.Union["ElementHandle", typing.List["ElementHandle"]]
+        ] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        force: typing.Optional[bool] = None
     ) -> typing.List[str]:
         """Locator.select_option
 
@@ -13268,7 +13522,12 @@ def select_option(
             )
         )
 
-    def select_text(self, *, force: bool = None, timeout: float = None) -> NoneType:
+    def select_text(
+        self,
+        *,
+        force: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """Locator.select_text
 
         This method waits for [actionability](https://playwright.dev/python/docs/actionability) checks, then focuses the element and selects all its text
@@ -13301,8 +13560,8 @@ def set_input_files(
             typing.List[FilePayload],
         ],
         *,
-        timeout: float = None,
-        no_wait_after: bool = None
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.set_input_files
 
@@ -13342,11 +13601,11 @@ def tap(
         modifiers: typing.Optional[
             typing.List[Literal["Alt", "Control", "Meta", "Shift"]]
         ] = None,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.tap
 
@@ -13398,7 +13657,9 @@ def tap(
             )
         )
 
-    def text_content(self, *, timeout: float = None) -> typing.Optional[str]:
+    def text_content(
+        self, *, timeout: typing.Optional[float] = None
+    ) -> typing.Optional[str]:
         """Locator.text_content
 
         Returns the `node.textContent`.
@@ -13422,9 +13683,9 @@ def type(
         self,
         text: str,
         *,
-        delay: float = None,
-        timeout: float = None,
-        no_wait_after: bool = None
+        delay: typing.Optional[float] = None,
+        timeout: typing.Optional[float] = None,
+        no_wait_after: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.type
 
@@ -13471,11 +13732,11 @@ def type(
     def uncheck(
         self,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.uncheck
 
@@ -13551,8 +13812,10 @@ def all_text_contents(self) -> typing.List[str]:
     def wait_for(
         self,
         *,
-        timeout: float = None,
-        state: Literal["attached", "detached", "hidden", "visible"] = None
+        timeout: typing.Optional[float] = None,
+        state: typing.Optional[
+            Literal["attached", "detached", "hidden", "visible"]
+        ] = None
     ) -> NoneType:
         """Locator.wait_for
 
@@ -13589,11 +13852,11 @@ def set_checked(
         self,
         checked: bool,
         *,
-        position: Position = None,
-        timeout: float = None,
-        force: bool = None,
-        no_wait_after: bool = None,
-        trial: bool = None
+        position: typing.Optional[Position] = None,
+        timeout: typing.Optional[float] = None,
+        force: typing.Optional[bool] = None,
+        no_wait_after: typing.Optional[bool] = None,
+        trial: typing.Optional[bool] = None
     ) -> NoneType:
         """Locator.set_checked
 
@@ -13800,14 +14063,14 @@ def delete(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.delete
 
@@ -13872,9 +14135,9 @@ def head(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.head
 
@@ -13923,9 +14186,9 @@ def get(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.get
 
@@ -13974,14 +14237,14 @@ def patch(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.patch
 
@@ -14046,14 +14309,14 @@ def put(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.put
 
@@ -14118,14 +14381,14 @@ def post(
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.post
 
@@ -14189,16 +14452,16 @@ def fetch(
         params: typing.Optional[
             typing.Dict[str, typing.Union[str, float, bool]]
         ] = None,
-        method: str = None,
+        method: typing.Optional[str] = None,
         headers: typing.Optional[typing.Dict[str, str]] = None,
-        data: typing.Union[typing.Any, bytes, str] = None,
+        data: typing.Optional[typing.Union[typing.Any, bytes, str]] = None,
         form: typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] = None,
         multipart: typing.Optional[
             typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]
         ] = None,
-        timeout: float = None,
-        fail_on_status_code: bool = None,
-        ignore_https_errors: bool = None
+        timeout: typing.Optional[float] = None,
+        fail_on_status_code: typing.Optional[bool] = None,
+        ignore_https_errors: typing.Optional[bool] = None
     ) -> "APIResponse":
         """APIRequestContext.fetch
 
@@ -14259,7 +14522,7 @@ def fetch(
         )
 
     def storage_state(
-        self, *, path: typing.Union[str, pathlib.Path] = None
+        self, *, path: typing.Optional[typing.Union[str, pathlib.Path]] = None
     ) -> StorageState:
         """APIRequestContext.storage_state
 
@@ -14287,14 +14550,16 @@ class APIRequest(SyncBase):
     def new_context(
         self,
         *,
-        base_url: str = None,
+        base_url: typing.Optional[str] = None,
         extra_http_headers: typing.Optional[typing.Dict[str, str]] = None,
-        http_credentials: HttpCredentials = None,
-        ignore_https_errors: bool = None,
-        proxy: ProxySettings = None,
-        user_agent: str = None,
-        timeout: float = None,
-        storage_state: typing.Union[StorageState, str, pathlib.Path] = None
+        http_credentials: typing.Optional[HttpCredentials] = None,
+        ignore_https_errors: typing.Optional[bool] = None,
+        proxy: typing.Optional[ProxySettings] = None,
+        user_agent: typing.Optional[str] = None,
+        timeout: typing.Optional[float] = None,
+        storage_state: typing.Optional[
+            typing.Union[StorageState, str, pathlib.Path]
+        ] = None
     ) -> "APIRequestContext":
         """APIRequest.new_context
 
@@ -14358,7 +14623,7 @@ def to_have_title(
         self,
         title_or_reg_exp: typing.Union[typing.Pattern[str], str],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """PageAssertions.to_have_title
 
@@ -14393,7 +14658,7 @@ def not_to_have_title(
         self,
         title_or_reg_exp: typing.Union[typing.Pattern[str], str],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """PageAssertions.not_to_have_title
 
@@ -14420,7 +14685,7 @@ def to_have_url(
         self,
         url_or_reg_exp: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """PageAssertions.to_have_url
 
@@ -14455,7 +14720,7 @@ def not_to_have_url(
         self,
         url_or_reg_exp: typing.Union[typing.Pattern[str], str],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """PageAssertions.not_to_have_url
 
@@ -14491,9 +14756,9 @@ def to_contain_text(
             str,
         ],
         *,
-        use_inner_text: bool = None,
-        timeout: float = None,
-        ignore_case: bool = None
+        use_inner_text: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        ignore_case: typing.Optional[bool] = None
     ) -> NoneType:
         """LocatorAssertions.to_contain_text
 
@@ -14552,9 +14817,9 @@ def not_to_contain_text(
             str,
         ],
         *,
-        use_inner_text: bool = None,
-        timeout: float = None,
-        ignore_case: bool = None
+        use_inner_text: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        ignore_case: typing.Optional[bool] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_contain_text
 
@@ -14590,7 +14855,7 @@ def to_have_attribute(
         name: str,
         value: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_attribute
 
@@ -14627,7 +14892,7 @@ def not_to_have_attribute(
         name: str,
         value: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_attribute
 
@@ -14660,7 +14925,7 @@ def to_have_class(
             str,
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_class
 
@@ -14713,7 +14978,7 @@ def not_to_have_class(
             str,
         ],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_class
 
@@ -14736,7 +15001,9 @@ def not_to_have_class(
             )
         )
 
-    def to_have_count(self, count: int, *, timeout: float = None) -> NoneType:
+    def to_have_count(
+        self, count: int, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.to_have_count
 
         Ensures the `Locator` resolves to an exact number of DOM nodes.
@@ -14761,7 +15028,9 @@ def to_have_count(self, count: int, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.to_have_count(count=count, timeout=timeout))
         )
 
-    def not_to_have_count(self, count: int, *, timeout: float = None) -> NoneType:
+    def not_to_have_count(
+        self, count: int, *, timeout: typing.Optional[float] = None
+    ) -> NoneType:
         """LocatorAssertions.not_to_have_count
 
         The opposite of `locator_assertions.to_have_count()`.
@@ -14784,7 +15053,7 @@ def to_have_css(
         name: str,
         value: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_css
 
@@ -14819,7 +15088,7 @@ def not_to_have_css(
         name: str,
         value: typing.Union[str, typing.Pattern[str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_css
 
@@ -14843,7 +15112,10 @@ def not_to_have_css(
         )
 
     def to_have_id(
-        self, id: typing.Union[str, typing.Pattern[str]], *, timeout: float = None
+        self,
+        id: typing.Union[str, typing.Pattern[str]],
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_id
 
@@ -14870,7 +15142,10 @@ def to_have_id(
         )
 
     def not_to_have_id(
-        self, id: typing.Union[str, typing.Pattern[str]], *, timeout: float = None
+        self,
+        id: typing.Union[str, typing.Pattern[str]],
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_id
 
@@ -14890,7 +15165,7 @@ def not_to_have_id(
         )
 
     def to_have_js_property(
-        self, name: str, value: typing.Any, *, timeout: float = None
+        self, name: str, value: typing.Any, *, timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_js_property
 
@@ -14924,7 +15199,7 @@ def to_have_js_property(
         )
 
     def not_to_have_js_property(
-        self, name: str, value: typing.Any, *, timeout: float = None
+        self, name: str, value: typing.Any, *, timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_js_property
 
@@ -14950,7 +15225,10 @@ def not_to_have_js_property(
         )
 
     def to_have_value(
-        self, value: typing.Union[str, typing.Pattern[str]], *, timeout: float = None
+        self,
+        value: typing.Union[str, typing.Pattern[str]],
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_value
 
@@ -14979,7 +15257,10 @@ def to_have_value(
         )
 
     def not_to_have_value(
-        self, value: typing.Union[str, typing.Pattern[str]], *, timeout: float = None
+        self,
+        value: typing.Union[str, typing.Pattern[str]],
+        *,
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_value
 
@@ -15002,7 +15283,7 @@ def to_have_values(
         self,
         values: typing.List[typing.Union[typing.Pattern[str], str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_values
 
@@ -15049,7 +15330,7 @@ def not_to_have_values(
         self,
         values: typing.List[typing.Union[typing.Pattern[str], str]],
         *,
-        timeout: float = None
+        timeout: typing.Optional[float] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_values
 
@@ -15080,9 +15361,9 @@ def to_have_text(
             str,
         ],
         *,
-        use_inner_text: bool = None,
-        timeout: float = None,
-        ignore_case: bool = None
+        use_inner_text: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        ignore_case: typing.Optional[bool] = None
     ) -> NoneType:
         """LocatorAssertions.to_have_text
 
@@ -15139,9 +15420,9 @@ def not_to_have_text(
             str,
         ],
         *,
-        use_inner_text: bool = None,
-        timeout: float = None,
-        ignore_case: bool = None
+        use_inner_text: typing.Optional[bool] = None,
+        timeout: typing.Optional[float] = None,
+        ignore_case: typing.Optional[bool] = None
     ) -> NoneType:
         """LocatorAssertions.not_to_have_text
 
@@ -15172,7 +15453,12 @@ def not_to_have_text(
             )
         )
 
-    def to_be_checked(self, *, timeout: float = None, checked: bool = None) -> NoneType:
+    def to_be_checked(
+        self,
+        *,
+        timeout: typing.Optional[float] = None,
+        checked: typing.Optional[bool] = None
+    ) -> NoneType:
         """LocatorAssertions.to_be_checked
 
         Ensures the `Locator` points to a checked input.
@@ -15196,7 +15482,7 @@ def to_be_checked(self, *, timeout: float = None, checked: bool = None) -> NoneT
             self._sync(self._impl_obj.to_be_checked(timeout=timeout, checked=checked))
         )
 
-    def not_to_be_checked(self, *, timeout: float = None) -> NoneType:
+    def not_to_be_checked(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.not_to_be_checked
 
         The opposite of `locator_assertions.to_be_checked()`.
@@ -15212,7 +15498,7 @@ def not_to_be_checked(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.not_to_be_checked(timeout=timeout))
         )
 
-    def to_be_disabled(self, *, timeout: float = None) -> NoneType:
+    def to_be_disabled(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.to_be_disabled
 
         Ensures the `Locator` points to a disabled element. Element is disabled if it has \"disabled\" attribute or is disabled
@@ -15238,7 +15524,7 @@ def to_be_disabled(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.to_be_disabled(timeout=timeout))
         )
 
-    def not_to_be_disabled(self, *, timeout: float = None) -> NoneType:
+    def not_to_be_disabled(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.not_to_be_disabled
 
         The opposite of `locator_assertions.to_be_disabled()`.
@@ -15254,7 +15540,7 @@ def not_to_be_disabled(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.not_to_be_disabled(timeout=timeout))
         )
 
-    def to_be_editable(self, *, timeout: float = None) -> NoneType:
+    def to_be_editable(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.to_be_editable
 
         Ensures the `Locator` points to an editable element.
@@ -15277,7 +15563,7 @@ def to_be_editable(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.to_be_editable(timeout=timeout))
         )
 
-    def not_to_be_editable(self, *, timeout: float = None) -> NoneType:
+    def not_to_be_editable(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.not_to_be_editable
 
         The opposite of `locator_assertions.to_be_editable()`.
@@ -15293,7 +15579,7 @@ def not_to_be_editable(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.not_to_be_editable(timeout=timeout))
         )
 
-    def to_be_empty(self, *, timeout: float = None) -> NoneType:
+    def to_be_empty(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.to_be_empty
 
         Ensures the `Locator` points to an empty editable element or to a DOM node that has no text.
@@ -15316,7 +15602,7 @@ def to_be_empty(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.to_be_empty(timeout=timeout))
         )
 
-    def not_to_be_empty(self, *, timeout: float = None) -> NoneType:
+    def not_to_be_empty(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.not_to_be_empty
 
         The opposite of `locator_assertions.to_be_empty()`.
@@ -15332,7 +15618,7 @@ def not_to_be_empty(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.not_to_be_empty(timeout=timeout))
         )
 
-    def to_be_enabled(self, *, timeout: float = None) -> NoneType:
+    def to_be_enabled(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.to_be_enabled
 
         Ensures the `Locator` points to an enabled element.
@@ -15355,7 +15641,7 @@ def to_be_enabled(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.to_be_enabled(timeout=timeout))
         )
 
-    def not_to_be_enabled(self, *, timeout: float = None) -> NoneType:
+    def not_to_be_enabled(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.not_to_be_enabled
 
         The opposite of `locator_assertions.to_be_enabled()`.
@@ -15371,7 +15657,7 @@ def not_to_be_enabled(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.not_to_be_enabled(timeout=timeout))
         )
 
-    def to_be_hidden(self, *, timeout: float = None) -> NoneType:
+    def to_be_hidden(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.to_be_hidden
 
         Ensures the `Locator` points to a hidden DOM node, which is the opposite of [visible](https://playwright.dev/python/docs/api/actionability#visible).
@@ -15394,7 +15680,7 @@ def to_be_hidden(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.to_be_hidden(timeout=timeout))
         )
 
-    def not_to_be_hidden(self, *, timeout: float = None) -> NoneType:
+    def not_to_be_hidden(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.not_to_be_hidden
 
         The opposite of `locator_assertions.to_be_hidden()`.
@@ -15410,7 +15696,7 @@ def not_to_be_hidden(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.not_to_be_hidden(timeout=timeout))
         )
 
-    def to_be_visible(self, *, timeout: float = None) -> NoneType:
+    def to_be_visible(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.to_be_visible
 
         Ensures the `Locator` points to a [visible](https://playwright.dev/python/docs/api/actionability#visible) DOM node.
@@ -15433,7 +15719,7 @@ def to_be_visible(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.to_be_visible(timeout=timeout))
         )
 
-    def not_to_be_visible(self, *, timeout: float = None) -> NoneType:
+    def not_to_be_visible(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.not_to_be_visible
 
         The opposite of `locator_assertions.to_be_visible()`.
@@ -15449,7 +15735,7 @@ def not_to_be_visible(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.not_to_be_visible(timeout=timeout))
         )
 
-    def to_be_focused(self, *, timeout: float = None) -> NoneType:
+    def to_be_focused(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.to_be_focused
 
         Ensures the `Locator` points to a focused DOM node.
@@ -15472,7 +15758,7 @@ def to_be_focused(self, *, timeout: float = None) -> NoneType:
             self._sync(self._impl_obj.to_be_focused(timeout=timeout))
         )
 
-    def not_to_be_focused(self, *, timeout: float = None) -> NoneType:
+    def not_to_be_focused(self, *, timeout: typing.Optional[float] = None) -> NoneType:
         """LocatorAssertions.not_to_be_focused
 
         The opposite of `locator_assertions.to_be_focused()`.
diff --git a/scripts/generate_api.py b/scripts/generate_api.py
--- a/scripts/generate_api.py
+++ b/scripts/generate_api.py
@@ -68,12 +68,11 @@ def process_type(value: Any, param: bool = False) -> str:
         value = re.sub(
             r"^typing.Union\[(.+), NoneType\]$", r"typing.Union[\1] = None", value
         )
-
-        value = re.sub(r"^typing.Optional\[([^,]+)\]$", r"\1 = None", value)
-        value = re.sub(r"typing.Optional\[(Literal\[[^\]]+\])\]", r"\1 = None", value)
         value = re.sub(
             r"^typing.Optional\[(.+)\]$", r"typing.Optional[\1] = None", value
         )
+        if not re.match(r"typing.Optional\[.*\] = None", value):
+            value = re.sub(r"(.*) = None", r"typing.Optional[\1] = None", value)
     return value
 
 


Test patch: