/** * Copied from https://github.com/lit/lit/blob/main/packages/labs/react/src/create-component.ts. * * Waiting for https://github.com/lit/lit/issues/2546 to be resovled before going back to * `@lit-labs/react`. */ import * as ReactModule from 'react'; declare type GlobalEvent = EventType extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[EventType] : Event; declare type Events = { [P in keyof S]?: (e: GlobalEvent) => unknown; }; declare type Constructor = { new (): T; }; /** * Creates a React component for a custom element. Properties are distinguished * from attributes automatically, and events can be configured so they are * added to the custom element as event listeners. * * @param React The React module, typically imported from the `react` npm * package. * @param tagName The custom element tag name registered via * `customElements.define`. * @param elementClass The custom element class registered via * `customElements.define`. * @param events An object listing events to which the component can listen. The * object keys are the event property names passed in via React props and the * object values are the names of the corresponding events generated by the * custom element. For example, given `{onactivate: 'activate'}` an event * function may be passed via the component's `onactivate` prop and will be * called when the custom element fires its `activate` event. * @param displayName A React component display name, used in debugging * messages. Default value is inferred from the name of custom element class * registered via `customElements.define`. */ export declare const createComponent: >(React: typeof ReactModule, tagName: string, elementClass: Constructor, events?: E | undefined, displayName?: string | undefined) => ReactModule.ForwardRefExoticComponent> & Events & ReactModule.HTMLAttributes>>> & ReactModule.RefAttributes>; export {}; //# sourceMappingURL=createComponent.d.ts.map