react-livestream icon indicating copy to clipboard operation
react-livestream copied to clipboard

Typescript Support?

Open csulit opened this issue 4 years ago • 1 comments

csulit avatar Jan 24 '21 06:01 csulit

Pop this in a global .d.ts file for solid linting:

declare module 'react-livestream' {
  import React from 'react';

  type AcceptedPlatforms = 'youtube' | 'mixer' | 'twitch';

  interface BaseProps {
    platform: AcceptedPlatforms;
    offlineComponent?: React.ReactNode;
  }

  interface YoutubePlayerProps extends BaseProps {
    platform: 'youtube';
    youtubeApiKey: string;
    youtubeChannelId: string;
  }

  interface TwitchPlayerProps extends BaseProps {
    platform: 'twitch';
    twitchDataUrl: string;
    twitchUserName: string;
  }

  type LivestreamComponentProps = YoutubePlayerProps | TwitchPlayerProps;

  export default class ReactLivestream extends React.Component<LivestreamComponentProps> {}
}

bramirez96 avatar Oct 15 '21 01:10 bramirez96