rx-player
rx-player copied to clipboard
Export other types from "rx-player/types"
As stated on issue #972, there were a few types that are not exported. Currently, still have some types that I had to duplicate on my project.
- IPositionUpdateItem;
- IBitrateEstimate;
Also, the importing of the interface IPlayerState is a bit cumbersome.
Current import:
import { IPlayerState } from 'rx-player/dist/_esm5.processed/core/api/get_player_state';
The following import doesn't work:
import { IPlayerState } from 'rx-player/src/core/api/get_player_state';
As a statement, VS Code always suggests weird imports, for instance code that is inside the dist folder:
import { IPlayerState } from 'rx-player/dist/_esm5.processed/core/api/get_player_state';
import Player, { IConstructorOptions, ILoadVideoOptions } from 'rx-player/dist/_esm5.processed/core/api';
Hi,
OK thank you, we will add types for positionUpdate, bitrateEstimate and even IPlayerState
in rx-player/types
, like all exported types should be.
As a statement, VS Code always suggests weird imports, for instance code that is inside the dist folder:
I guess the auto-import feature just looks at the type loadVideo
and the constructor rely on and then import it directly (which makes sense)...
I'll see what we can do though it will also depend on tsserver capabilities.
rx-player/types
is for now generated only at build time so it's difficult to just update the source of that type on our source files, but there should be solutions.