The Pillarbox custom player should be accessible through the main entry point of the generated typings. Otherwise, it is not possible to cast the player once initialized, as shown in the following code snippet:
import { default as pillarbox, Player as PillarBoxPlayer } from "@srgssr/pillarbox-web";
const player = pillarbox('my-player') as PillarBoxPlayer; // Can't obtain this type
player.src({ src: 'urn:rts:video:6820736', type: 'srgssr/urn' });
The Player class is currently not exported in the main typings entry point. See the tsconfig.json file below:
The Pillarbox custom player should be accessible through the main entry point of the generated typings. Otherwise, it is not possible to cast the player once initialized, as shown in the following code snippet:
The
Player
class is currently not exported in the main typings entry point. See thetsconfig.json
file below:https://github.com/SRGSSR/pillarbox-web/blob/8353dd8e7d7943d3a9f3ea5b171ac71c31f59116/tsconfig.json#L10)
Suggestion
build.es.js
instead ofsrc/**/*
.package.json
defaulttypes
export accordingly.