Skip to content

Commit

Permalink
Export types at top level of /fn entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jgerigmeyer committed Feb 29, 2024
1 parent f86150b commit 7a88ba1
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
34 changes: 34 additions & 0 deletions types/src/index-fn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,37 @@ export * from "./deltaE/index.js";
export { default as deltaEMethods } from "./deltaE/index.js";
export * from "./variations.js";
export * from "./spaces/index-fn.js";

export type {
ColorConstructor,
ColorObject,
ColorTypes,
Coords,
PlainColorObject,
} from "./color.js";

export type { White } from "./adapt.js";

export type { CAT } from "./CATs.js";

export type { Display } from "./display.js";

export type {
Range,
RangeOptions,
MixOptions,
StepsOptions,
} from "./interpolation.js";

export type { Options as ParseOptions } from "./parse.js";

export type { RGBOptions } from "./rgbspace.js";

export type { Options as SerializeOptions } from "./serialize.js";

export type {
Format as SpaceFormat,
CoordMeta,
Ref,
Options as SpaceOptions,
} from "./space.js";
32 changes: 32 additions & 0 deletions types/test/type-fn-accessibility.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Testing whether types can be accessed from the /fn import

import {
// Re-exported from src/color.d.ts
ColorConstructor,
ColorObject,
ColorTypes,
Coords,
PlainColorObject,
// Re-exported from src/adapt.d.ts
White,
// Re-exported from src/CATs.d.ts
CAT,
// Re-exported from src/display.d.ts
Display,
// Re-exported from src/interpolation.d.ts
Range,
RangeOptions,
MixOptions,
StepsOptions,
// Re-exported from src/parse.d.ts
ParseOptions,
// Re-exported from src/rgbspace.d.ts
RGBOptions,
// Re-exported from src/serialize.d.ts
SerializeOptions,
// Re-exported from src/space.d.ts
SpaceFormat,
CoordMeta,
Ref,
SpaceOptions,
} from "colorjs.io/fn";
6 changes: 5 additions & 1 deletion types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": { "colorjs.io": ["."], "colorjs.io/*": ["./*"] }
"paths": {
"colorjs.io": ["."],
"colorjs.io/fn": ["./src/index-fn.js"],
"colorjs.io/*": ["./*"]
}
}
}

0 comments on commit 7a88ba1

Please sign in to comment.