Skip to content

Commit 15f100c

Browse files
committed
add explicit return types
1 parent 318b8d4 commit 15f100c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

livekit-rtc/livekit/rtc/participant.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@
4545
from .log import logger
4646

4747
from .rpc import RpcInvocationData
48-
from .data_stream import TextStreamWriter, FileStreamWriter, STREAM_CHUNK_SIZE
48+
from .data_stream import (
49+
TextStreamWriter,
50+
FileStreamWriter,
51+
FileStreamInfo,
52+
STREAM_CHUNK_SIZE,
53+
)
4954

5055

5156
class PublishTrackError(Exception):
@@ -550,7 +555,7 @@ async def stream_text(
550555
topic: str = "",
551556
extensions: Dict[str, str] = {},
552557
reply_to_id: str | None = None,
553-
):
558+
) -> TextStreamWriter:
554559
writer = TextStreamWriter(
555560
self,
556561
topic=topic,
@@ -571,7 +576,7 @@ async def stream_file(
571576
extensions: Dict[str, str] = {},
572577
stream_id: str | None = None,
573578
destination_identities: List[str] = [],
574-
):
579+
) -> FileStreamWriter:
575580
writer = FileStreamWriter(
576581
self,
577582
file_name=file_name,
@@ -592,7 +597,7 @@ async def send_file(
592597
destination_identities: List[str] = [],
593598
extensions: Dict[str, str] = {},
594599
stream_id: str | None = None,
595-
):
600+
) -> FileStreamInfo:
596601
file_size = os.path.getsize(file_path)
597602
file_name = os.path.basename(file_path)
598603
mime_type, _ = mimetypes.guess_type(file_path)
@@ -615,6 +620,8 @@ async def send_file(
615620
await writer.write(bytes)
616621
await writer.close()
617622

623+
return writer.info
624+
618625
async def publish_track(
619626
self, track: LocalTrack, options: TrackPublishOptions = TrackPublishOptions()
620627
) -> LocalTrackPublication:

0 commit comments

Comments
 (0)