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

Add file index.d.ts #1

Open
riccardoscalco opened this issue Jul 20, 2021 · 1 comment
Open

Add file index.d.ts #1

riccardoscalco opened this issue Jul 20, 2021 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@riccardoscalco
Copy link
Member

Related to hybridsjs/hybrids#173.

@riccardoscalco riccardoscalco added the help wanted Extra attention is needed label Jul 20, 2021
@riccardoscalco
Copy link
Member Author

Some updates: I made a svelte app where to import and test <trend-line>. Note that the web-component module is installed from the local disk:

"dependencies": {
  "@nextbitlabs/trend-line": "file:../trend-line",
  ...
},

My first attempt was to add file index.d.ts in module trend-line as suggested in hybridsjs/hybrids#173:

declare global {
    interface HTMLElementTagNameMap {
        'trend-line': TrendLine;
    }
}

But, with or without file index.d.ts, I do not see any error. Should I expect any error or warning from TypeScript?

I noted there is a config file for TypeScript:

{
  "extends": "@tsconfig/svelte/tsconfig.json",

  "include": ["src/**/*"],
  "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
}

I added the local path to module trend-line, but without success.

I definitively need to wrap my head around TS.

@nkint Do you have any suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant