mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
improve text to speech dependency (#1250)
* Generate .d.ts files from TypeScript for text-to-speech project * Remove module export for htmlToSpeechFile * Include test
This commit is contained in:
parent
a0d4e06d34
commit
ee3fec9d96
4 changed files with 6 additions and 41 deletions
31
packages/api/src/textToSpeech.d.ts
vendored
31
packages/api/src/textToSpeech.d.ts
vendored
|
|
@ -1,31 +0,0 @@
|
|||
declare module '@omnivore/text-to-speech-handler' {
|
||||
export function htmlToSpeechFile(htmlInput: HtmlInput): SpeechFile
|
||||
|
||||
export interface HtmlInput {
|
||||
title?: string
|
||||
content: string
|
||||
options: SSMLOptions
|
||||
}
|
||||
|
||||
export interface SSMLOptions {
|
||||
primaryVoice?: string
|
||||
secondaryVoice?: string
|
||||
rate?: string
|
||||
language?: string
|
||||
}
|
||||
|
||||
interface Utterance {
|
||||
idx: string
|
||||
wordOffset: number
|
||||
wordCount: number
|
||||
voice?: string
|
||||
text: string
|
||||
}
|
||||
|
||||
export interface SpeechFile {
|
||||
wordCount: number
|
||||
language: string
|
||||
defaultVoice: string
|
||||
utterances: Utterance[]
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "build/src/index.js",
|
||||
"types": "build/src/index.d.ts",
|
||||
"types": "build/src/htmlToSsml.d.ts",
|
||||
"files": [
|
||||
"build/src"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
TextToSpeechInput,
|
||||
} from './textToSpeech'
|
||||
import { File, Storage } from '@google-cloud/storage'
|
||||
import { endSsml, htmlToSpeechFile, startSsml } from './htmlToSsml'
|
||||
import { endSsml, startSsml } from './htmlToSsml'
|
||||
import crypto from 'crypto'
|
||||
import { createRedisClient } from './redis'
|
||||
|
||||
|
|
@ -236,9 +236,3 @@ export const textToSpeechStreamingHandler = Sentry.GCPFunction.wrapHttpFunction(
|
|||
}
|
||||
}
|
||||
)
|
||||
|
||||
module.exports = {
|
||||
htmlToSpeechFile,
|
||||
textToSpeechStreamingHandler,
|
||||
textToSpeechHandler,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
"compilerOptions": {
|
||||
"outDir": "build",
|
||||
"rootDir": ".",
|
||||
"lib": ["dom"]
|
||||
"lib": ["dom"],
|
||||
// Generate d.ts files
|
||||
"declaration": true
|
||||
},
|
||||
"include": ["src", "test"]
|
||||
"include": ["src", "test"],
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue