Comments (3)
While implementing this, I've found a few issues with passing fetch options, so I'm implementing a different solution now:
- The internal types don't depend on the dom lib, the
@types/web
package or anything else anymore. Instead, the smallest common denominator was extracted into and exported from the@d-fischer/cross-fetch
package. - If you need to pass fetch options that are specific to one platform, you can now augment the
TwitchApiCallFetchOptions
type (this is possible because it was changed to an interface) - This is a breaking change for all current users of the
fetchOptions
config option (but I'm pretty sure your approach would be too in some obscure way), so it will only be implemented in version 7.0.
Stay tuned for a new prerelease version within the next week.
from twurple.
As the types used are inherently global, do you have a better solution for this?
from twurple.
@d-fischer Sure! One way we can accomplish this would be to use and import the @types/web
package as a replacement for the triple slash lib directive to acquire the DOM types.
I've already tested this out with Twurple and it works perfectly! It no longer overrides the types globally. You can checkout how my reproduction is no longer showing any compile errors here. Just clone and switch branches with git checkout fix/using-@types/web
.
To add the package, we just run the following:
cd packages/api-call
# it's fine to add this as a devDependency
yarn add @typescript/lib-dom@npm:@types/web --dev
We then remove the directive /// <reference lib="dom" />
from both packages/api-call/src/apiCall.ts
and packages/api-call/src/TwitchApiCallOptions.ts
.
Finally, we just need to import the following at the top of the file (we only need to import it once):
// packages/api-call/src/TwitchApiCallOptions.ts
import '@typescript/lib-dom';
from twurple.
Related Issues (20)
- EventSub Conduit endpoints
- User extensions endpoints not allowing `channel:manage:extensions` scope
- Add missing HelixEventSubSubscriptionStatus values
- Unable to delete EventSubWS subscription (incorrect token type for api call) HOT 1
- EventSubListener failing to subscribe to topics if previous failures occured
- Add Channel Chat Settings Update Eventsub topic
- Typo in docs for chat example
- Feature Request: Automod EventSub Message Subscription Types HOT 4
- Can't get a channel's subscribers from an extension.
- EventSubChannelAdBreakBegin type not exported HOT 1
- HelixAdSchedule potentially have new Date(0) instead of nullable dates
- Implement unban requests for API and EventSub
- Implement suspicious users events HOT 1
- Feat: Add EventSub Channel VIP Add/Remove Events HOT 1
- Feat: Add User Emotes API Endpoint HOT 1
- Feat: Add EventSub Channel Points Automatic Reward Subscription Type HOT 2
- Feat: Add EventSub Channel Moderate Subscription Type HOT 1
- Feat: Add EventSub User Whisper Message Subscription Type
- Feature Request: support device code grant flow
- [Feature Request] EventSub AutomaticPointRedemptionAdd HOT 1
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 twurple.