Skip to content

Add explicit type annotation to CONSTANT export - #986

Draft
Lang-Qiu wants to merge 1 commit into
zen-browser:mainfrom
Lang-Qiu:auto-pr/type_annotations-1780777694
Draft

Add explicit type annotation to CONSTANT export#986
Lang-Qiu wants to merge 1 commit into
zen-browser:mainfrom
Lang-Qiu:auto-pr/type_annotations-1780777694

Conversation

@Lang-Qiu

@Lang-Qiu Lang-Qiu commented Jun 6, 2026

Copy link
Copy Markdown

Problem

The exported constant CONSTANT in src/constants/index.ts lacked an explicit type annotation. This could lead to ambiguous types in TypeScript, making the code harder to understand and maintain, potentially causing issues with type inference and readability.

Changes

  • Introduced a Constants interface to define the shape of the CONSTANT object, specifying the types for I18N, CHECKSUMS, and PUBLIC_ROUTES based on their respective imports.
  • Added an explicit type annotation to the CONSTANT variable using the new interface, ensuring type safety and clarity.

Verification

  • Confirm TypeScript compilation completes without errors (e.g., run tsc or similar build process).
  • Run existing tests (if available) to ensure no functionality changes or regressions.
  • Review the diff to verify the changes align with the intended improvement in type annotations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants