Skip to content

Commit f63d853

Browse files
committed
Docs, export utils from ESM package
1 parent 5bc913d commit f63d853

File tree

16 files changed

+72
-31
lines changed

16 files changed

+72
-31
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules\\typescript\\lib"
3+
}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ hsv(244, 100%, 100%, 0.6)
6464

6565
[typedocs](https://kurkle.github.io/color/)
6666

67+
**note** The docs are for the ESM module. UMD module only exports the [default export](https://kurkle.github.io/color/globals.html#_default)
68+
6769
## Benchmarks
6870

6971
[benchmarks](https://kurkle.github.io/color/dev/bench/)

color.d.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function hexParse(str: string): {
3636
*/
3737
export function hexString(v: RGBA): string | RGBA;
3838
/**
39-
* Rounds to decimal to nearest integer
39+
* Rounds decimal to nearest integer
4040
* @param {number} v - the number to round
4141
*/
4242
export function round(v: number): number;
@@ -137,9 +137,15 @@ export class Color {
137137
* @param {Color|RGBA|string|number[]} input
138138
*/
139139
constructor(input: string | number[] | Color | RGBA);
140-
/** @type {RGBA} */
140+
/**
141+
* @type {RGBA}
142+
* @hidden
143+
**/
141144
_rgb: RGBA;
142-
/** @type {boolean} */
145+
/**
146+
* @type {boolean}
147+
* @hidden
148+
**/
143149
_valid: boolean;
144150
/**
145151
* `true` if this is a valid color

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kurkle/color",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
44
"description": "css color parsing, manupulation and conversion",
55
"main": "dist/color.js",
66
"module": "dist/color.esm.js",

packed.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function unpack(obj) {
4545
return unpacked;
4646
}
4747

48+
/** @hidden */
4849
export const names = unpack({
4950
OiceXe: 'f0f8ff',
5051
antiquewEte: 'faebd7',

rollup.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import visualizer from 'rollup-plugin-visualizer';
66
import {version, homepage} from './package.json';
77

88
const input = 'src/index.js';
9+
const inputESM = 'src/index.esm.js';
910
const banner = `/*!
1011
* @kurkle/color v${version}
1112
* ${homepage}
@@ -53,7 +54,7 @@ export default [
5354
}
5455
},
5556
{
56-
input: input,
57+
input: inputESM,
5758
plugins: [
5859
cleanup({
5960
sourcemap: true
@@ -68,7 +69,7 @@ export default [
6869
}
6970
},
7071
{
71-
input: input,
72+
input: inputESM,
7273
plugins: [
7374
terser({
7475
output: {

src/byte.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
22
* @packageDocumentation
3-
* @module helpers
3+
* @module utils
44
*/
55

66
/**
7-
* Rounds to decimal to nearest integer
7+
* Rounds decimal to nearest integer
88
* @param {number} v - the number to round
99
*/
1010
export function round(v) {

src/hex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @packageDocumentation
3-
* @module helpers
3+
* @module utils
44
*/
55

66
/**

src/hue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @packageDocumentation
3-
* @module helpers
3+
* @module utils
44
*/
55

66
import {b2n, n2p, n2b, p2b} from './byte';

0 commit comments

Comments
 (0)