Skip to content

Types from @ember/helper do not include working types for uniqueIdΒ #20947

@NullVoxPopuli

Description

@NullVoxPopuli

🐞 Describe the Bug

missing types

πŸ”¬ Minimal Reproduction

just import it in a ts/gts file

πŸ˜• Actual Behavior

no types

πŸ€” Expected Behavior

types

🌍 Environment

  • Ember: - 6.7.0-alpha.1
  • TS - 5.8.3
  • @glint/core - 2.0.0-alpha.2

βž• Additional Context

This happens because uniqueId is a re-export from @ember/-internals/glimmer

@ember/-internals/glimmer is in the published types/ directory, but this index.d.ts in that folder is missing all the sub-modules

Image

In particular:

// in: ember-source/types/stable/@ember/-internals/glimmer/index.d.ts
export { uniqueId } from "@ember/-internals/glimmer/lib/helpers/unique-id";

so this file is defined:

declare module '@ember/-internals/glimmer/lib/helpers/unique-id' {
    /**
    @module ember
    */
    const _default: object;
    export default _default;
    export function uniqueId(): string;
}

the @module is wrong.. idk what's going on with that.

but anyway,
referencing a declare module is one thing -- but it first has to be loaded in to the TS program in order to be correctly referenced in the first place.

That referencing happens in ember-source/types/stable/index.d.ts

And does include 'unique-id':

Image

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