Preview:```ts
/**
- @abstract
*/
export class Queue {
constructor() {}
}
const q = new Queue()```
You can choose specific lines to embed by selecting them before copying the link.
25 messages · Page 1 of 1 (latest)
Preview:```ts
/**
const q = new Queue()```
Why doesnt TypeScript read that its an abstract class and error me, or am i doing smth wrong?
@reef skiff These are the supported JSDoc tags: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html @abstract is not among them.
What JSDoc does TypeScript-powered JavaScript support?
Thanks.. thats sad though. so no abstract support?
https://github.com/microsoft/TypeScript/issues/17227
It looks like there mostly isn't considered enough demand for abstract classes in JS.
I think it's also just a bit more complex in JS - if I write
abstract class Base {
abstract baseMethod(): string
}
that generates class Base {} in JS - the abstract method goes away completely.
It seems like it'd be a lot harder to have that sort of pattern in JS + JSDoc comments: you can't mark a non-existent method as abstract.
im confused
thats typescript?
oh right. i thought abstract classes in TS give no output
unless you have non-abstract stuff in it
interesting
but JS is not getting compiled, i would be satisfied with something as simple as an error message
but im still confused by your statement xD
My point is how do you write an "abstract class with an abstract method" in JS code?
Then how are you going to do it with JS + doc comments?
/**
* @abstract
*/
class Queue {
constructor() {
}
/**
* @abstract
*/
foobar() {
}
}
😄
Yeah, but there's actually a foobar method there, unlike the generated TS.
Yea I get that, but thats fine, thats the same as typescript giving types but in the output there aint no types.
That seems minor but it seems like it would matter for interop reasons.
I just want it in my IDE, to make it error basically