Repository: remarkablemark/html-react-parser (ts)

Issue:
Wrong return types on attributesToProps
### Description
In the file `attributes-to-props.d.ts` the return types of `attributesToProps` function is a `Object` with `String` items.

https://github.com/remarkablemark/html-react-parser/blob/80bbea06fac6825f2667060f979fbd54b407e748/lib/attributes-to-props.d.ts#L3-L4

But in the `attributesToProps` function, `setStyleProp` is call to transform `CSSInline` to `StyleObject`.

https://github.com/remarkablemark/html-react-parser/blob/80bbea06fac6825f2667060f979fbd54b407e748/lib/attributes-to-props.js#L62

The return of the function is an `StyleObject` and not a `String`.

https://github.com/remarkablemark/html-react-parser/blob/80bbea06fac6825f2667060f979fbd54b407e748/lib/utilities.js#L76-L87

The result of this miss-typing is an error if you would like to get an `CSSProperty`.

<img width="452" alt="Capture d’écran 2021-04-16 à 10 42 51" src="https://user-images.githubusercontent.com/10879770/114997956-ba26e800-9ea0-11eb-8b0a-081d69d0cea5.png">

### Expected Behavior

Update `attributes-to-props.d.ts` with :

```ts
export type Attributes = Record<string, string>; 
export type Props = Record<string, string> & {
  style: Record<string, string>;
}; 
```


Pull request description:
fix(attributes-to-props): fix attributes-to-props type `Props`
Fixes #242

## What is the motivation for this pull request?

fix(attributes-to-props): fix attributes-to-props type `Props`

## What is the current behavior?

```ts
type Props = Record<string, string>;
```

## What is the new behavior?

```ts
type Props = Record<string, string> & {
  style: Record<string, string>;
}; 
```

## Checklist:

- [x] Tests
- [x] Types


Patch:
diff --git a/lib/attributes-to-props.d.ts b/lib/attributes-to-props.d.ts
index d793fe8..ec5147c 100644
--- a/lib/attributes-to-props.d.ts
+++ b/lib/attributes-to-props.d.ts
@@ -1,7 +1,10 @@
 // TypeScript Version: 4.1
 
 export type Attributes = Record<string, string>;
-export type Props = Attributes;
+
+export type Props = Record<string, string> & {
+  style: Record<string, string>;
+};
 
 /**
  * Converts HTML/SVG DOM attributes to React props.
diff --git a/tsconfig.json b/tsconfig.json
index 37e9f50..8607ec9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -20,6 +20,7 @@
     "index.d.ts",
     "lib/dom-to-react.d.ts",
     "test/types/index.tsx",
+    "test/types/lib/attributes-to-props.ts",
     "test/types/lib/dom-to-react.tsx"
   ]
 }


Test patch:
diff --git a/test/types/lib/attributes-to-props.ts b/test/types/lib/attributes-to-props.ts
new file mode 100644
index 0000000..fff8bae
--- /dev/null
+++ b/test/types/lib/attributes-to-props.ts
@@ -0,0 +1,17 @@
+import attributesToProps, {
+  Attributes,
+  Props
+} from 'html-react-parser/lib/attributes-to-props';
+
+let attributes: Attributes = {};
+
+attributes = {
+  class: 'my-class',
+  style: 'color: #bada55; line-height: 42;'
+};
+
+// $ExpectType Props
+const {
+  className,
+  style: { color, lineHeight }
+} = attributesToProps(attributes);