Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types for TypeScript #120

Open
tkrotoff opened this issue Feb 2, 2024 · 1 comment
Open

Add types for TypeScript #120

tkrotoff opened this issue Feb 2, 2024 · 1 comment

Comments

@tkrotoff
Copy link

tkrotoff commented Feb 2, 2024

This package doesn't have any types :-/

@Syno0
Copy link

Syno0 commented Oct 7, 2024

I made a brightcove-react-player-loader.d.ts, there are certainly some errors in it but it does the job to be compatible with Typescript

declare module '@brightcove/react-player-loader' {
  import type { ReactElement } from 'react'
  import { Component } from 'react'

  interface ReactPlayerLoaderProps {
    [key: string]: string
    baseUrl?: string
    attrs?: React.HTMLAttributes<HTMLDivElement>
    manualReloadFromPropChanges?: boolean
  }

  export default class ReactPlayerLoader extends Component<ReactPlayerLoaderProps> {
    constructor(props: ReactPlayerLoaderProps)

    loadPlayer(): void
    componentWillUnmount(): void
    render(): ReactElement
  }

  export function expose(name: string, implementation: string): void

  export const EMBED_TAG_NAME_VIDEO: string
  export const EMBED_TAG_NAME_VIDEOJS: string
  export const EMBED_TYPE_IN_PAGE: string
  export const EMBED_TYPE_IFRAME: string
  export const REF_NODE_INSERT_APPEND: string
  export const REF_NODE_INSERT_PREPEND: string
  export const REF_NODE_INSERT_BEFORE: string
  export const REF_NODE_INSERT_AFTER: string
  export const REF_NODE_INSERT_REPLACE: string
  export const VERSION: string

  export const UPDATEABLE_PROPS: string[]
  export function logError(err: string): void
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants