Skip to content

Proposal: Integrate TypeScript Definitions into basic-auth #69

Closed

Description

@Phillip9587

Summary

Currently, TypeScript users of basic-auth rely on the external @types/basic-auth package for type definitions. To improve maintainability, developer experience, and ensure type definitions stay in sync with the library, this proposal suggests migrating the type definitions directly into the basic-auth package.

Benefits

  • Improved Maintainability: Type definitions will be updated alongside the core library, reducing the risk of outdated or mismatched types.
  • Better Developer Experience: Users won’t need to install an additional @types/basic-auth package.
  • Increased Adoption: Built-in types may encourage more developers to use the library with TypeScript.

Proposed Changes

  1. Add a index.d.ts file with the current type definitions from @types/basic-auth.
  2. Update package.json to include "types": "index.d.ts".
  3. Ensure types align with the latest API and are well-documented.
  4. Remove the need for @types/basic-auth and update documentation accordingly.
  5. Deprecate @types/basic-auth

Activity

  1. Phillip9587 commented on Apr 13, 2026

    @Phillip9587
    ContributorAuthor

    The package is now implemented in TypeScript (#93)

  2. XinGOfCloude18 commented on Aug 12, 2026

    @XinGOfCloude18

    Summary

    Currently, TypeScript users of basic-auth rely on the external @types/basic-auth package for type definitions. To improve maintainability, developer experience, and ensure type definitions stay in sync with the library, this proposal suggests migrating the type definitions directly into the basic-auth package.

    Benefits

    • Improved Maintainability: Type definitions will be updated alongside the core library, reducing the risk of outdated or mismatched types.
    • Better Developer Experience: Users won’t need to install an additional @types/basic-auth package.
    • Increased Adoption: Built-in types may encourage more developers to use the library with TypeScript.

    Proposed Changes

    1. Add a index.d.ts file with the current type definitions from @types/basic-auth.
    2. Update package.json to include "types": "index.d.ts".
    3. Ensure types align with the latest API and are well-documented.
    4. Remove the need for @types/basic-auth and update documentation accordingly.
    5. Deprecate @types/basic-auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions