type declarations would be nice, cause after activating typescript in webpack encore the console outputs something like this; a bit annoying:
ERROR Failed to compile with 1 errors 9:03:45 PM
error in /[...]/assets/bootstrap.ts
[tsl] ERROR in /[...]/assets/bootstrap.ts(1,34)
TS7016: Could not find a declaration file for module '@symfony/stimulus-bridge'. '/[...]/node_modules/@symfony/stimulus-bridge/dist/index.js' implicitly has an 'any' type.
Cause its only one function that is exported something like this should work:
declare module "@symfony/stimulus-bridge" {
import { Application } from "stimulus";
// Actually stimulus serves its own types, but for the webpack context https://www.npmjs.com/package/@types/webpack-env is required.
export function startStimulusApp(context: __WebpackModuleApi.RequireContext): Application;
}
You can use this as a workaround. IIRC: For usage as implementation the declare module is not required, just the types reference in the package.json to the index.d.ts or similar file.
Hey,
type declarations would be nice, cause after activating typescript in webpack encore the console outputs something like this; a bit annoying:
Cause its only one function that is exported something like this should work:
You can use this as a workaround. IIRC: For usage as implementation the
declare module
is not required, just thetypes
reference in thepackage.json
to theindex.d.ts
or similar file.Cheers!