react-text-to-speech
Advanced tools
Comparing version 0.6.7 to 0.6.8
@@ -27,3 +27,2 @@ import React, { DetailedHTMLProps, HTMLAttributes, ReactNode } from 'react'; | ||
export type { IconProps } from './icons.js'; | ||
declare function Speech({ text, pitch, rate, volume, lang, startBtn, pauseBtn, stopBtn, useStopOverPause, onError, children, props }: SpeechProps): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined; | ||
export default Speech; | ||
export default function Speech({ text, pitch, rate, volume, lang, startBtn, pauseBtn, stopBtn, useStopOverPause, onError, children, props }: SpeechProps): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined; |
import React, { useEffect, useState } from 'react'; | ||
import { HiMiniStop, HiVolumeOff, HiVolumeUp } from './icons.js'; | ||
function Speech({ text, pitch = 1, rate = 1, volume = 1, lang = '', startBtn = React.createElement(HiVolumeUp, null), pauseBtn = React.createElement(HiVolumeOff, null), stopBtn = React.createElement(HiMiniStop, null), useStopOverPause, onError = () => alert('Browser not supported! Try some other browser.'), children, props = {} }) { | ||
export default function Speech({ text, pitch = 1, rate = 1, volume = 1, lang = '', startBtn = React.createElement(HiVolumeUp, null), pauseBtn = React.createElement(HiVolumeOff, null), stopBtn = React.createElement(HiMiniStop, null), useStopOverPause, onError = () => alert('Browser not supported! Try some other browser.'), children, props = {} }) { | ||
const [speechStatus, setSpeechStatus] = useState('stopped'); | ||
@@ -52,2 +52,1 @@ const [useStop, setUseStop] = useState(); | ||
} | ||
export default Speech; |
{ | ||
"name": "react-text-to-speech", | ||
"version": "0.6.7", | ||
"version": "0.6.8", | ||
"description": "An easy to use react component for the Web Speech API.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -33,3 +33,3 @@ # react-text-to-speech | ||
function App() { | ||
export default function App() { | ||
return <Speech text='This library is awesome!' /> | ||
@@ -46,3 +46,3 @@ } | ||
function App() { | ||
export default function App() { | ||
// 'news' holds response from some News API | ||
@@ -49,0 +49,0 @@ const news = [ |
Sorry, the diff of this file is not supported yet
14569
102