Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export types at top level of /fn entrypoint. #466

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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/*": ["./*"]
}
}
}