Gavant / glint-template-types

MIT License
18 stars 20 forks source link

Upon importing, error: file is not a module #75

Open NullVoxPopuli opened 1 year ago

NullVoxPopuli commented 1 year ago

For example:

import type VerticalCollection from '@gavant/glint-template-types/types/@html-next/vertical-collection';

But that file is a declare module:

declare module '@html-next/vertical-collection/components/vertical-collection' {
    import NativeArray from '@ember/array/-private/native-array';
    import Component from '@ember/component';

    import { SignatureWithPositionedArg } from '@gavant/glint-template-types/utils/types';

    export interface VerticalCollectionArgs<T> {

and declare module doesn't have any exports (it defines exports within it)

So the error I get from

import type VerticalCollection from '@gavant/glint-template-types/types/@html-next/vertical-collection';
error TS2306: 
  File '<long path>@gavant/glint-template-types/types/@html-next/vertical-collection/.d.ts' 
    is not a module.

makes sense.

The solve for now is this:

import '@gavant/glint-template-types/types/@html-next/vertical-collection';

import type VerticalCollection from '@html-next/vertical-collection/components/vertical-collection';