Skip to content

Provide a declaration file for TypeScript #6

Description

@zandivx

I'm completely new to the TypeScript/JavaScript ecosystem, so pardon me if my proposition is not correct or best practice. I tried to add your very helpful project as a dependency in a VS Code extension and found, that the language server could not deduce the type of the function when using import. I imported it the following way:

import vscodeVariables from 'vscode-variables';

Something like the following in dist/index.d.ts solves the problem locally:

declare module 'vscode-variables' {
    export default function variables(input: string, recursive?: boolean): string;
}

Is this the correct way to handle this issue? If so, could you maybe add this in an update of the distributed npm package?

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions