Skip to content

types: the ./catalog export ships no declaration file #85

Description

@eddyloewen

Goal

Importing `@webtides/element-library/catalog` type-checks in a strict TypeScript project without a local shim.

Context

The package ships `types/` for the component subpaths, but the `./catalog` export in `package.json` maps only to `./catalog.js`. Under `strict` with `moduleResolution: bundler`, `import catalog from '@webtides/element-library/catalog'` fails with TS7016 (could not find a declaration file). Needed in loewen-digital/sveltekit-ai-starter-template (issue #6 there), which wires the catalog into `@webtides/element-js-ssr-renderer` for SvelteKit; the template carries a `declare module` shim until this lands.

Acceptance criteria

  • `import catalog from '@webtides/element-library/catalog'` resolves a typed default export (a `Catalog`: tag → lazy loader) under `strict` and `moduleResolution: bundler`.
  • No consumer-side `declare module` needed.

Proposal (non-binding)

Emit `types/catalog.d.ts` from the existing JSDoc (`@type {import("@webtides/element-js-ssr-renderer").Catalog}`) and add `types` to the `./catalog` export condition.

Out of scope

Types for the renderer's own subpaths (webtides/element-js-ssr-renderer#13).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions