Skip to content

Commit 585b92b

Browse files
committed
add types to docstrings
1 parent 3a9a329 commit 585b92b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib_src/misc/colors.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
'use babel'
22

3+
/**
4+
*
5+
* @param {{ [P: string]: string }} selectors
6+
*/
37
export function getColors(selectors: { [P: string]: string }) {
48
// const grammar = atom.grammars.grammarForScopeName("source.julia") // TODO ?
59

610
const div = document.createElement('div')
711
div.classList.add('editor', 'editor-colors', 'julia-syntax-color-selector')
12+
13+
/**
14+
* @type { [P: string]: HTMLSpanElement }
15+
*/
816
const styled: { [P: string]: HTMLSpanElement } = {}
17+
/**
18+
* { [P: string]: string }
19+
*/
920
const color: { [P: string]: string } = {}
1021

1122
for (const style in selectors) {
@@ -32,6 +43,11 @@ export function getColors(selectors: { [P: string]: string }) {
3243
return color
3344
}
3445

46+
/**
47+
*
48+
* @param {string} rgb
49+
* @return {string}
50+
*/
3551
function rgb2hex(rgb: string): string {
3652
if (rgb.search("rgb") === -1) {
3753
return rgb
@@ -48,6 +64,10 @@ function rgb2hex(rgb: string): string {
4864
}
4965
}
5066

67+
/**
68+
*
69+
* @param {string} x
70+
*/
5171
function hex(x: string) {
5272
return ("0" + parseInt(x, 10).toString(16)).slice(-2)
5373
}

0 commit comments

Comments
 (0)