Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of nested declare causes issues in Typescript #1

Open
mboughaba opened this issue Sep 9, 2024 · 0 comments
Open

Usage of nested declare causes issues in Typescript #1

mboughaba opened this issue Sep 9, 2024 · 0 comments

Comments

@mboughaba
Copy link

mboughaba commented Sep 9, 2024

Dear,

When importing the lib in typescript: import { encode as windows1257Encode } from 'windows-1257

We get error below:

TS1038: A 'declare' modifier cannot be used in an already ambient context.

This is because we've got nested declare

declare module 'windows-1257' {
    // [...]
 
  export declare function encode(
    text: string,
    options?: EncodeOptions
  ): Uint16Array;
  
  // [...]
}

This prevents from using the library in Typescript

Open issue in 1252
mathiasbynens/windows-1252#10

1251:
mathiasbynens/windows-1251#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant