mirror of
https://github.com/react/react-native.git
synced 2026-09-28 13:23:09 +08:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56072 Changelog: [Internal] Splits `member.py` into multiple smaller files, each containing single member definition. Reviewed By: cipolleschi Differential Revision: D96282653 fbshipit-source-id: 25956dccaf266bf2be5b216ba554991f1bb221b8
31 lines
859 B
Python
31 lines
859 B
Python
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
from __future__ import annotations
|
|
|
|
from .base import Member, MemberKind
|
|
|
|
|
|
class FriendMember(Member):
|
|
def __init__(self, name: str, visibility: str = "public") -> None:
|
|
super().__init__(name, visibility)
|
|
|
|
@property
|
|
def member_kind(self) -> MemberKind:
|
|
return MemberKind.FRIEND
|
|
|
|
def to_string(
|
|
self,
|
|
indent: int = 0,
|
|
qualification: str | None = None,
|
|
hide_visibility: bool = False,
|
|
) -> str:
|
|
name = self._get_qualified_name(qualification)
|
|
result = " " * indent
|
|
if not hide_visibility:
|
|
result += self.visibility + " "
|
|
result += f"friend {name};"
|
|
return result
|