question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature]: export type definitions for the main component

See original GitHub issue

Description

Currently, the MasonryWall isn’t typed when using Volar (since the library registering through global app components). While this doesn’t affect functionality, it’d be nice to have in-editor type support for props.

Solution

One way of having typed global components is through custom.d.ts file:

import type { component } from '@yeger/vue-masonry-wall';

declare module 'vue' {
  export interface GlobalComponents {
    MasonryWall: typeof component;
  }
}

export {};

Additional context

No response

Preferences

  • I want to be assigned to and work on this issue myself

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
DerYegercommented, Sep 13, 2022

Also big thanks to @mahdiboomeri for informing me about the global components declaration!

1reaction
BenjaminOddoucommented, Sep 13, 2022

@DerYeger no more error now thanks !! 🙏😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Modules - TypeScript
Exporting a declaration ... Any declaration (such as a variable, function, class, type alias, or interface) can be exported by adding the export...
Read more >
Add Typescript type definitions for all components and services
We use this issue to keep track of the components and services that require Typescript type definitions. Components Accessibility EuiKeyboardAccessible ...
Read more >
Building TypeScript definitions on demand - Leonardo Faria
The solution​​ I am using the react-to-typescript-definitions package to create definitions from the compiled files. The tool can map most ...
Read more >
Cannot re-export a type when using the --isolatedModules ...
index.ts is just re-exporting everything so we can have a singular entry point and can do something like import Component, { ComponentType } ......
Read more >
export - JavaScript - MDN Web Docs
The export declaration is used to export values from a JavaScript module. Exported values can then be imported into other programs with the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found