Skip to content

Commit

Permalink
Add explicit types to exported constants
Browse files Browse the repository at this point in the history
  • Loading branch information
yzrmn committed Nov 20, 2024
1 parent 7001c03 commit 1e92ed8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/redgeometry-app/src/ecs-modules/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { World } from "../ecs/world.js";
import type { ComputedTransformComponent, TransformComponent } from "./transform.js";

export type CameraBundle = [CameraComponent, TransformComponent];
export const CAMERA_BUNDLE_IDS = ["camera", "transform"] satisfies ComponentIdsOf<CameraBundle>;
export const CAMERA_BUNDLE_IDS: ComponentIdsOf<CameraBundle> = ["camera", "transform"];

export type CameraComponent = {
componentId: "camera";
Expand Down
2 changes: 1 addition & 1 deletion packages/redgeometry-app/src/ecs-modules/mesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import MESH_WGSL from "./shader/mesh.wgsl";
import { transformSystem, type ComputedTransformComponent, type TransformComponent } from "./transform.js";

export type MeshBundle = [MeshComponent, MaterialComponent, TransformComponent];
export const MESH_BUNDLE_IDS = ["mesh", "material", "transform"] satisfies ComponentIdsOf<MeshBundle>;
export const MESH_BUNDLE_IDS: ComponentIdsOf<MeshBundle> = ["mesh", "material", "transform"];

const MESH_MAX_ENTRIES_PER_MATERIAL = 50000;

Expand Down
8 changes: 4 additions & 4 deletions packages/redgeometry/src/core/path-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ export const DEFAULT_PATH_CLIP_OPTIONS: Readonly<PathClipOptions> = {
};

// Threshold for acute (179.9999 degrees) and obtuse (0.0001 degrees) angles.
export const COS_ACUTE = -0.99999999999847689;
export const COS_OBTUSE = 0.99999999999847689;
export const COS_ACUTE: number = -0.99999999999847689;
export const COS_OBTUSE: number = 0.99999999999847689;

// Threshold for curve splitting (to avoid tiny tail curves).
export const MIN_PARAMETER = 5e-7;
export const MAX_PARAMETER = 1 - MIN_PARAMETER;
export const MIN_PARAMETER: number = 5e-7;
export const MAX_PARAMETER: number = 1 - MIN_PARAMETER;

export function createPathFlatten(options: PathQualityOptions): PathFlatten2 {
switch (options.flattenMode) {
Expand Down
2 changes: 1 addition & 1 deletion packages/redgeometry/src/utility/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Log } from "./log.js";
import { formatString, type FormatParameters } from "./string.js";

// Global log object
export const log = new Log({
export const log: Log = new Log({
errorFn: console.error,
warnFn: console.warn,
infoFn: console.info,
Expand Down

0 comments on commit 1e92ed8

Please sign in to comment.