Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Code base to Typescript #278

Merged
merged 22 commits into from
Sep 29, 2024
Merged

Convert Code base to Typescript #278

merged 22 commits into from
Sep 29, 2024

Conversation

murat-dogan
Copy link
Owner

No description provided.

import * as exceptions from './Exception';
import { DataChannel } from '../lib/index';

export default class RTCDataChannel extends EventTarget {
Copy link
Contributor

@ThaUnknown ThaUnknown Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd do:
npm i @types/webrtc -D
and

/// <reference types="@types/webrtc" />
export default class RTCDataChannel extends EventTarget implements globalThis.RTCDataChannel {

and use this implements keyword in all other W3C spec compliant classes, probably the best way to go around making sure the types are correct

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check that when I have time for this PR.

"strictNullChecks": false,
"noUnusedLocals": true,
"alwaysStrict": true,
"outDir": "./dist",
Copy link
Contributor

@ThaUnknown ThaUnknown Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"outDir": "./dist",
"outDir": "./dist",
"types": ["@types/webrtc"],

"rollup-plugin-esbuild": "^6.1.1",
"ts-api-utils": "^1.3.0",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsx was the right choice, ts-node has massive memory overhead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants