Giter VIP home page Giter VIP logo

Comments (7)

zoeleu avatar zoeleu commented on June 15, 2024 1

hey @matteoturini thanks for the suggestion, I have no problems accepting a PR with typings for this library and would welcome anybody to add support for this

it is not something I had planned originally, and I do not need it, so I'll leave it open for whoever wants to do it

btw, IDE's like VSCode can highly profit from typescript typings too.

from jutsu.

yyynnn avatar yyynnn commented on June 15, 2024 1

d.ts is absent from final build

Screenshot 2021-08-16 at 19 33 05

from jutsu.

this-fifo avatar this-fifo commented on June 15, 2024

hey @matteoturini thanks for the suggestion, I have no problems accepting a PR with typings for this library and would welcome anybody to add support for this

it is not something I had planned originally, and I do not need it, so I'll leave it open for whoever wants to do it

from jutsu.

Felix-Franz avatar Felix-Franz commented on June 15, 2024

You can use following typescript definition:

react-jutsu.d.ts:

declare module "react-jutsu" {
  import React, { ReactNode, ReactElement } from "react";
  export interface JutsuProps extends React.HTMLProps<HTMLDivElement> {
    
    // The meeting room name
    roomName: string;

    // The participant's displayed name
    displayName?: string;

    // The meeting room password
    password?: string;

    // Callback function executed after readyToClose event is fired
    onMeetingEnd?: () => void;

    // The meeting subject (what is displayed at the top)
    subject?: string;

    // Custom jitsi domain
    domain?: string;

    // component displayed while loading
    loadingComponent?: JSX.Element;
    
    // component displayed on error
    errorComponent?: JSX.Element;

    // Internally Jutsu is constructed inside 2 containers, you can add custom styles for each by specifying containerStyles and jitsiContainerstyles
    containerStyles?: CSSProperties;
    jitsiContainerStyles?: CSSProperties;

    // Configuration object to overwrite. Visit https://github.com/jitsi/jitsi-meet/blob/master/config.js
    configOverwrite?: any;
    
    // Interface configuration object to overwrite. Visit https://github.com/jitsi/jitsi-meet/blob/master/interface_config.js
    interfaceConfigOverwrite?: any;

    // Callback function to be called with an error as the only parameter if any.
    onError?: () => void;

    // Callback function to be called with the jitsi API client when instantiated.
    onJitsi?: () => void;

    // Any other prop passed to the component will be passed to jitsi API constructor as part of the options parameter.
    jwt?: any;
    devices?: any;
    userInfo?: any;
  }

  export const Jutsu: (props: JutsuProps) => ReactElement;
}

from jutsu.

zoeleu avatar zoeleu commented on June 15, 2024

You can use following typescript definition:

react-jutsu.d.ts:

declare module "react-jutsu" {
  import React, { ReactNode, ReactElement } from "react";
  export interface JutsuProps extends React.HTMLProps<HTMLDivElement> {
    
    // The meeting room name
    roomName: string;

    // The participant's displayed name
    displayName?: string;

    // The meeting room password
    password?: string;

    // Callback function executed after readyToClose event is fired
    onMeetingEnd?: () => void;

    // The meeting subject (what is displayed at the top)
    subject?: string;

    // Custom jitsi domain
    domain?: string;

    // component displayed while loading
    loadingComponent?: JSX.Element;
    
    // component displayed on error
    errorComponent?: JSX.Element;

    // Internally Jutsu is constructed inside 2 containers, you can add custom styles for each by specifying containerStyles and jitsiContainerstyles
    containerStyles?: CSSProperties;
    jitsiContainerStyles?: CSSProperties;

    // Configuration object to overwrite. Visit https://github.com/jitsi/jitsi-meet/blob/master/config.js
    configOverwrite?: any;
    
    // Interface configuration object to overwrite. Visit https://github.com/jitsi/jitsi-meet/blob/master/interface_config.js
    interfaceConfigOverwrite?: any;

    // Callback function to be called with an error as the only parameter if any.
    onError?: () => void;

    // Callback function to be called with the jitsi API client when instantiated.
    onJitsi?: () => void;

    // Any other prop passed to the component will be passed to jitsi API constructor as part of the options parameter.
    jwt?: any;
    devices?: any;
    userInfo?: any;
  }

  export const Jutsu: (props: JutsuProps) => ReactElement;
}

mind pushing this into the repo?

from jutsu.

this-fifo avatar this-fifo commented on June 15, 2024

Just published v3.0.3 with these typing definitions

from jutsu.

this-fifo avatar this-fifo commented on June 15, 2024

thank you @yyynnn, it seems like it's missing a step in the rollup configuration to include that in the build, I'm accepting PRs if anyone is willing to take a shot at this, otherwise I can work on it when I have some time.

from jutsu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.