Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Add TypeScript declaration files for proper TypeScript support #41

@christoph2806

Description

@christoph2806

Issue Description

The @etherisc/ui-kit package (v0.2.1) is missing TypeScript declaration files (.d.ts), causing TypeScript compilation errors in projects that use the package.

Current Behavior

When importing components from @etherisc/ui-kit in a TypeScript project:

import { Select, Button, DataTable } from '@etherisc/ui-kit';

TypeScript throws errors:

error TS7016: Could not find a declaration file for module '@etherisc/ui-kit'. 
'/workspace/node_modules/@etherisc/ui-kit/dist/ui-kit.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/etherisc__ui-kit` if it exists or add a new declaration (.d.ts) file containing `declare module '@etherisc/ui-kit';`

Expected Behavior

The package should include TypeScript declaration files so that:

  1. TypeScript projects can use the package without compilation errors
  2. Developers get proper type checking and IntelliSense support
  3. Component props are properly typed for better development experience

Environment

  • Package version: @etherisc/ui-kit@0.2.1
  • TypeScript version: Latest
  • Build tool: Vite with TypeScript

Suggested Solution

  1. Add TypeScript declarations to the build process

    • Include .d.ts files in the dist/ directory
    • Update package.json to reference the types: "types": "./dist/index.d.ts"
  2. Ensure proper exports

    • All components (Button, Select, DataTable, etc.) should have proper type exports
    • Hook functions (useToast, useToastContext) should have typed return values
  3. Example package.json structure:

    {
      "name": "@etherisc/ui-kit",
      "version": "0.2.1",
      "main": "./dist/ui-kit.umd.cjs",
      "module": "./dist/ui-kit.js",
      "types": "./dist/index.d.ts",
      "exports": {
        ".": {
          "types": "./dist/index.d.ts",
          "import": "./dist/ui-kit.js",
          "require": "./dist/ui-kit.umd.cjs"
        }
      }
    }

Additional Context

This issue prevents proper TypeScript integration and forces developers to either:

  • Use // @ts-ignore everywhere
  • Create custom declaration files that may become outdated
  • Disable TypeScript strict mode

Adding proper TypeScript support would greatly improve the developer experience and make the package more suitable for enterprise TypeScript projects.

Related

This follows up on issue #39 regarding the Select component export, which was resolved. Now we need the TypeScript declarations to complete the proper package support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions