-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
When I create a brand new project with bolt-uxp using with react it shows a bunch of type safety errors pop up. The project still builds and runs but the errors are annoying. There are a bunch of things wrong with it, rather than spell it all out, here is my suggestion:
- Rename
vite-env.d.tstouxp-env.d.ts - Consolidate all augmentations to this file.
- Use the definitions below (it works in my codebase)
/// <reference types="vite/client" />
declare global {
interface Window {
webview: import("@adobe/cc-ext-uxp-types/uxp/index").HTMLWebViewElement;
}
/**
* UXP Webview Element Type
* Extends HTMLElement with UXP-specific webview properties and methods
*/
interface UXPHTMLWebViewElement extends HTMLElement {
uxpAllowInspector: string;
src: string;
postMessage: (msg: any) => void;
}
}
// Augment the JSX namespace for react-jsx runtime
declare module "react/jsx-runtime" {
namespace JSX {
interface IntrinsicElements {
"uxp-panel": import("react").DetailedHTMLProps<
import("react").HTMLAttributes<HTMLElement> & { panelid?: string },
HTMLElement
>;
"webview": import("react").DetailedHTMLProps<
import("react").HTMLAttributes<UXPHTMLWebViewElement>,
UXPHTMLWebViewElement
>;
}
}
}
export {};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels