Skip to content

Commit a6487b1

Browse files
committed
Update TypeAlias to make use of Pydantic.JsonValue for more exact typing
1 parent 3fe69dc commit a6487b1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

streamdeck/models/events/common.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from __future__ import annotations
22

33
from abc import ABC
4-
from typing import Annotated, Any, Generic, Literal, NamedTuple, Optional, Union
4+
from typing import Annotated, Generic, Literal, NamedTuple, Optional, Union
55

6-
from pydantic import Field
6+
from pydantic import Field, JsonValue
77
from typing_extensions import TypedDict, TypeVar
88

99
from streamdeck.models.events.base import ConfiguredBaseModel
@@ -28,8 +28,11 @@ class DeviceSpecificEventMixin:
2828
## Payload models and metadata used by multiple event models.
2929

3030

31-
PluginDefinedData = dict[str, Any]
32-
"""Data of arbitrary structure that is defined in and relevant to the plugin."""
31+
PluginDefinedData = dict[str, JsonValue]
32+
"""Data of arbitrary structure that is defined in and relevant to the plugin.
33+
34+
The root of the data structure will always be a dict of string keys, while the values can be any JSON-compatible type.
35+
"""
3336

3437

3538
EncoderControllerType = Literal["Encoder"]

0 commit comments

Comments
 (0)