@react-opencv/fiber 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,36 @@
1
1
  import type { ReactNode } from "react";
2
+ import type signatures from "../data/opencv-signatures.json";
2
3
  export interface CvOpProps {
3
4
  children?: ReactNode;
4
5
  [param: string]: unknown;
5
6
  }
7
+ type SigKeys = keyof typeof signatures;
8
+ type CvElements = {
9
+ [K in SigKeys as `cv${K}`]: CvOpProps;
10
+ } & {
11
+ [K in SigKeys as `cv${Capitalize<K>}`]: CvOpProps;
12
+ } & {
13
+ [K in SigKeys as `cv_${K}`]: CvOpProps;
14
+ } & {
15
+ cvImage: CvOpProps;
16
+ cv_image: CvOpProps;
17
+ };
6
18
  declare module "react" {
7
19
  namespace JSX {
8
- interface IntrinsicElements {
9
- [key: string]: CvOpProps;
20
+ interface IntrinsicElements extends CvElements {
10
21
  }
11
22
  }
12
23
  }
24
+ declare module "react/jsx-runtime" {
25
+ namespace JSX {
26
+ interface IntrinsicElements extends CvElements {
27
+ }
28
+ }
29
+ }
30
+ declare module "react/jsx-dev-runtime" {
31
+ namespace JSX {
32
+ interface IntrinsicElements extends CvElements {
33
+ }
34
+ }
35
+ }
36
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { OpenCVProvider, useOpenCV } from "./components/OpenCVProvider";
1
+ export { OpenCvProvider, useOpenCv } from "./components/OpenCvProvider";
2
2
  export { CvCanvas } from "./fiber/CvCanvas";
3
3
  export type { CvCanvasProps } from "./fiber/CvCanvas";
4
4
  export type { CvOpProps } from "./fiber/types";