Skip to content

Commit 3b32ea8

Browse files
committed
fix: use correct stricter type for attributes
1 parent 6045d80 commit 3b32ea8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/createElement.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, Markdown } from "./model";
22

33
export function createElement(
44
component: Component,
5-
attributes: {} | null,
5+
attributes: Record<string, unknown> | null,
66
...children: Markdown[]
77
): Markdown | Markdown[];
88
export function createElement(
@@ -12,7 +12,7 @@ export function createElement(
1212
): Markdown | Markdown[];
1313
export function createElement(
1414
typeOrComponent: string | Component,
15-
attributes: {} | null,
15+
attributes: Record<string, unknown> | null,
1616
...children: Markdown[]
1717
): Markdown | Markdown[] {
1818
if (typeof typeOrComponent !== "function") {

src/model.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type Markdown = string | number | undefined;
2-
export type Props = {};
2+
export type Props = Record<string, unknown>;
33
export type Component<ComponentProps extends Props = Props> = (
44
props: ComponentProps
55
) => Markdown | Markdown[];

0 commit comments

Comments
 (0)