Skip to content

Commit

Permalink
add explicit return types
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Jan 16, 2025
1 parent 318b8d4 commit 15f100c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions livekit-rtc/livekit/rtc/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@
from .log import logger

from .rpc import RpcInvocationData
from .data_stream import TextStreamWriter, FileStreamWriter, STREAM_CHUNK_SIZE
from .data_stream import (
TextStreamWriter,
FileStreamWriter,
FileStreamInfo,
STREAM_CHUNK_SIZE,
)


class PublishTrackError(Exception):
Expand Down Expand Up @@ -550,7 +555,7 @@ async def stream_text(
topic: str = "",
extensions: Dict[str, str] = {},
reply_to_id: str | None = None,
):
) -> TextStreamWriter:
writer = TextStreamWriter(
self,
topic=topic,
Expand All @@ -571,7 +576,7 @@ async def stream_file(
extensions: Dict[str, str] = {},
stream_id: str | None = None,
destination_identities: List[str] = [],
):
) -> FileStreamWriter:
writer = FileStreamWriter(
self,
file_name=file_name,
Expand All @@ -592,7 +597,7 @@ async def send_file(
destination_identities: List[str] = [],
extensions: Dict[str, str] = {},
stream_id: str | None = None,
):
) -> FileStreamInfo:
file_size = os.path.getsize(file_path)
file_name = os.path.basename(file_path)
mime_type, _ = mimetypes.guess_type(file_path)
Expand All @@ -615,6 +620,8 @@ async def send_file(
await writer.write(bytes)
await writer.close()

return writer.info

async def publish_track(
self, track: LocalTrack, options: TrackPublishOptions = TrackPublishOptions()
) -> LocalTrackPublication:
Expand Down

0 comments on commit 15f100c

Please sign in to comment.