AgoraIO-Extensions / AgoraIO-Extensions/agora-rtc-react

TypeScript: `setParameter` missing on `agora-rtc-react` default export

Aberta
#237 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
TypeScript
Estrelas
41
Forks
14
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

## Problem

The `agora-rtc-react` default export appears to be the underlying RTC SDK object at runtime, but the published TypeScript types do not include the static `setParameter` method. As a result, valid runtime calls fail type checking unless consumers import from `agora-rtc-sdk-ng` directly or use casts.

## Expected behavior

Consumers should be able to configure RTC SDK parameters using only the React SDK import:

```ts
import AgoraRTC from 'agora-rtc-react';

AgoraRTC.setParameter('ENABLE_AUDIO_PTS', true);
```

`setParameter` should be present on the default export type (or the default export type should be aligned with `agora-rtc-sdk-ng`’s public static API).

## Actual behavior

TypeScript reports that `setParameter` does not exist on the default export type (`IAgoraRTC` or equivalent), even though the runtime object supports the call.

Workarounds:

- Import `setParameter` from `agora-rtc-sdk-ng` / `agora-rtc-sdk-ng/esm`.
- Use a local type assertion to call `setParameter` on the React SDK default export.

## Use case

Conversational AI / transcript timing flows that require enabling `ENABLE_AUDIO_PTS` before publishing audio, without pulling in a second RTC package at the type or import level.

## Suggested resolution

- Add `setParameter(key: string, value: unknown): void` (or match the exact signature from `agora-rtc-sdk-ng`) to the default export typings, **or**
- Re-export / intersect the React SDK default export type with the RTC SDK static type so typings stay in sync as the base SDK evolves.

## Acceptance criteria

- `AgoraRTC.setParameter(...)` type-checks when `AgoraRTC` is imported from `agora-rtc-react`.
- No regression for existing hooks and named exports.
- Optional: a small type-only test or snippet in the repo that locks this in.

## Environment (example)

- Package: `agora-rtc-react` (version observed in app lockfile)
- TypeScript: strict / `noEmit` check in a Next.js app

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.