Open codthing opened 3 years ago
declare module 'react-native-static-server' {
export default class StaticServer {
constructor(port: number, path?: string)
start: () => Promise<string>
stop: () => void
isRunning: () => Promise<boolean>
}
}
Here's what I'm using. I didn't send a PR because it seems the constructor parameters are a little wonky. So I just typed for the constructor for how I use it. Put this in index.d.ts
at the root of your project and you should be good to go.
I added typescript supports after 0.5.0 release. My PR was merged at last year but @fchasen didn't release it.
expo install react-native-static-server
Prompt that the module cannot be found
Version: win10
"expo": "~40.0.0"
"react": "16.13.1"
"react-dom": "16.13.1"
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz"
"react-native-static-server": "^0.5.0"