UNPKG

@lisn.js/react

Version:
1 lines 828 B
{"version":3,"file":"types.cjs","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import { RefObject, ElementType, ComponentPropsWithoutRef } from \"react\";\n\nimport { Widget } from \"lisn.js\";\n\nexport type WidgetComponentRef<W extends Widget> = {\n getWidget: () => W | null;\n getWidgets: () => W[];\n};\n\nexport type WidgetComponentProps<T extends ElementType, W extends Widget, C> = {\n as?: T;\n config?: C;\n widgetRef?: RefObject<WidgetComponentRef<W> | null>;\n} & ComponentPropsWithoutRef<T>;\n\nexport type GenericComponentProps<T extends ElementType> = {\n as?: T;\n} & ComponentPropsWithoutRef<T>;\n\nexport type MultiWidgetComponentProps<\n T extends ElementType,\n W extends Widget,\n C,\n> = WidgetComponentProps<T, W, C> & {\n config?: C | C[];\n};\n"],"mappings":"","ignoreList":[]}