-
Notifications
You must be signed in to change notification settings - Fork 8
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
package published incorrectly and fails type checking in consuming projects #190
package published incorrectly and fails type checking in consuming projects #190
Comments
From what I could understand, it seems that the problem is when TypeScript is generating the declaration file, more specifically the return type of velcroHook: import("ember-modifier/.").FunctionBasedModifier<{
Element: HTMLElement | SVGElement;
Args: {
Named: import("ember-modifier/-private/signature").EmptyObject;
Positional: [];
};
}>; However, if add the following lines on the component's index.ts file import type { FunctionBasedModifier } from 'ember-modifier';
import type { EmptyObject } from 'ember-modifier/-private/signature.js'; Then this appears to serve as a "hint" to typescript, and the generated declaration is: import { FunctionBasedModifier } from 'ember-modifier';
import { EmptyObject } from 'ember-modifier/-private/signature.js';
// ...
velcroHook: FunctionBasedModifier<{
Element: HTMLElement | SVGElement;
Args: {
Named: EmptyObject;
Positional: [];
};
}>; I lack the knowledge to instruct typescript to generate the correct declaration, but hopefully this helps. |
Another find: in the consuming app, if I go into -velcroHook: import("ember-modifier/.").FunctionBasedModifier<{
+velcroHook: import("ember-modifier").FunctionBasedModifier<{
Args: {
Positional: unknown[];
Named: import("ember-modifier/-private/signature").EmptyObject;
};
Element: HookSignature;
}>; then the typecheck on the app works! |
From npm, the currently published assets:
Idk what happened to that ember-modifier import, but that's not a valid syntax, afaik
The text was updated successfully, but these errors were encountered: