diff --git a/src/core/index.ts b/src/core/index.ts index fca58d1..26e34e4 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -1,7 +1,19 @@ import { Color, Camera2D, Camera3D } from './types'; export type { Color, Vec2, Vec3, Vec4, Rect, Camera2D, Camera3D, Texture, Font, Sound, Music, Quat, Ray, BoundingBox, Model, Mat4, RayHit, FrustumPlanes } from './types'; -export { Color, ColorConstants, Colors } from './colors'; +// GH #53 — `Color` is deliberately NOT re-exported from './colors' any more. +// `Color` is the RGBA TYPE (`./types`, re-exported above); './colors' exports a +// palette MAP that also happened to be called `Color`, so the name arrived at +// every consumer as both a type and a value. It shadowed the thing people +// actually annotate with. The palette has always had two other names — +// `Colors` and `ColorConstants` (the latter is literally `= Color`) — so +// nothing is lost by dropping the third. +// +// Verified before removing: no code in engine, shooter, editor, garden or jump +// reads the palette through the name `Color` (i.e. `Color.Red`). `jump` imports +// `Color` from here, but only ever in TYPE position (`const WHITE: Color = {...}`), +// which the type re-export above still serves. +export { ColorConstants, Colors } from './colors'; export { Key, MouseButton } from './keys'; // FFI declarations diff --git a/src/index.ts b/src/index.ts index 822ec69..c9543d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,7 +18,9 @@ export { openFileDialog, saveFileDialog, writeFile, fileExists, readFile, getScreenToWorld2D, getWorldToScreen2D, - Color, ColorConstants, Colors, Key, MouseButton, + // `Color` is not here: it is the RGBA type, re-exported as a type below. + // The palette map is `Colors` / `ColorConstants` (GH #53). + ColorConstants, Colors, Key, MouseButton, injectKeyDown, injectKeyUp, isAnyInputPressed, getPlatform, isMobile, isTV, Platform, injectGamepadAxis, injectGamepadButtonDown, injectGamepadButtonUp, runGame,