Documentation of interfaces lacks examples of ES6 syntax
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- documentation
Research direction
Start with the linked Types in the Closure Type System wiki page and the Structural Interfaces chapter, especially the nominal interfaces section. Add a concise ES6 class-syntax example showing an interface and an implementing class, based on the example in the issue. Done means the relevant interface documentation includes a clear, accurate ES6 or ESNext usage example.
Written by the indexing model from the issue text.
Description
ES6 or ESNext is very popular nowadays, it would be nice to add some examples to the documentation of interfaces on how to use them with ES6 class syntax.
The documentation of interfaces can be found roughly here:
Somewhere in there, it would be nice to have a usage example along the lines of:
/**
* @interface
*/
class ISerializable {
constructor() {
/** @type {string} */
this.id;
}
/**
* @returns {string}
*/
serialize() {}
}
/**
* @implements {ISerializable}
*/
class Car {
constructor() {
this.id = 'FJS904328JS';
}
serialize() {
return '{ "id": "FJS904328JS"}'
}
}
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/closure-compiler
-
internal-issue-created triage-done
Difficulty 1/5 Under an hour Newbie friendliness 62/100
google/closure-compiler#3473 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
google/closure-compiler#4344 ·
-
google/closure-compiler#4339 · 1 comment · 1 assignee ·
-
google/closure-compiler#4322 · 2 comments · 1 reaction · 2 assignees ·
-
google/closure-compiler#4312 · 1 comment · 1 assignee ·
All issues in google/closure-compiler
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·