|
4 | 4 |
|
5 | 5 | from posthog.client import Client
|
6 | 6 | from posthog.exception_capture import Integrations # noqa: F401
|
| 7 | +from posthog.types import FeatureFlag, FlagsAndPayloads |
7 | 8 | from posthog.version import VERSION
|
8 | 9 |
|
9 | 10 | __version__ = VERSION
|
@@ -403,7 +404,7 @@ def get_feature_flag(
|
403 | 404 | only_evaluate_locally=False, # type: bool
|
404 | 405 | send_feature_flag_events=True, # type: bool
|
405 | 406 | disable_geoip=None, # type: Optional[bool]
|
406 |
| -): |
| 407 | +) -> Optional[FeatureFlag]: |
407 | 408 | """
|
408 | 409 | Get feature flag variant for users. Used with experiments.
|
409 | 410 | Example:
|
@@ -446,7 +447,7 @@ def get_all_flags(
|
446 | 447 | group_properties={}, # type: dict
|
447 | 448 | only_evaluate_locally=False, # type: bool
|
448 | 449 | disable_geoip=None, # type: Optional[bool]
|
449 |
| -): |
| 450 | +) -> Optional[dict[str, FeatureFlag]]: |
450 | 451 | """
|
451 | 452 | Get all flags for a given user.
|
452 | 453 | Example:
|
@@ -477,7 +478,7 @@ def get_feature_flag_payload(
|
477 | 478 | only_evaluate_locally=False,
|
478 | 479 | send_feature_flag_events=True,
|
479 | 480 | disable_geoip=None, # type: Optional[bool]
|
480 |
| -): |
| 481 | +) -> Optional[str]: |
481 | 482 | return _proxy(
|
482 | 483 | "get_feature_flag_payload",
|
483 | 484 | key=key,
|
@@ -519,7 +520,7 @@ def get_all_flags_and_payloads(
|
519 | 520 | group_properties={},
|
520 | 521 | only_evaluate_locally=False,
|
521 | 522 | disable_geoip=None, # type: Optional[bool]
|
522 |
| -): |
| 523 | +) -> FlagsAndPayloads: |
523 | 524 | return _proxy(
|
524 | 525 | "get_all_flags_and_payloads",
|
525 | 526 | distinct_id=distinct_id,
|
|
0 commit comments