Comments (5)
Related to this topic:
the html examples (from the test folder) make reference to Faust2WebAudio
, which is not declared anywhere, apart from the webpack config file. You have first to find it (outside the dist and src folders), and next to look at src/index.ts
to discover that it's a kind of namespace that covers the Faust
and FaustAudioWorkletNode
imports (if I'm right).
And of course, typescript complains about Faust2WebAudio
type...
from faust2webaudio.
Hi @dfober
Actually, the dist/index.d.ts
will be detected and used automatically when the package is installed as a NPM package:
import { Faust, FaustAudioWorkletNode, FaustScriptProcessorNode } from "faust2webaudio";
Here, as the src/
folder is also included in the NPM package, the imported types will be resolved. And no need to re-declare the Faust
interface, which is redundant and harder to maintain.
It is also possible, I believe, to generate an .d.ts
file that contains all the types by tsc --emitDeclarationOnly
. But I don't feel necessary...
For the second question. The package is now wrapped as an UMD module, which means it will detect current environment and make the module work for. If the module is included in a <script />
, It will expose Faust2WebAudio
as its namespace (defined in webpack.config.js
), if it is imported in a Node.js dev environment, There will be nothing exposed.
from faust2webaudio.
I'll try the import strategy. However, it doesn't solve my main problem: looking at the package, it's quite impossible to figure out what are the available types, classes et methods, unless I browse all the source code.
Note also that I don't use webpack, only typescript.
from faust2webaudio.
I tried: tsc ./src/index.ts --emitDeclarationOnly -d --target ES6
will generate .d.ts
file for each ts file.
from faust2webaudio.
Yes, I already tried...
Thanks
from faust2webaudio.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faust2webaudio.