Skip to content

Commit

Permalink
Ensure correct type exports (#2)
Browse files Browse the repository at this point in the history
* Correctly export types

* Ensure better type export name
  • Loading branch information
leo authored May 23, 2024
1 parent 5a1de63 commit a71403d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,12 @@
"test": "bun test",
"prepare": "husky"
},
"files": [
"dist"
],
"files": ["dist"],
"repository": "ronin-co/react-ronin",
"homepage": "https://github.com/ronin-co/react-ronin",
"keywords": [
"ronin",
"react",
"client",
"database",
"orm"
],
"keywords": ["ronin", "react", "client", "database", "orm"],
"lint-staged": {
"**/*": [
"bunx @biomejs/biome format --write"
]
"**/*": ["bunx @biomejs/biome format --write"]
},
"exports": {
".": {
Expand All @@ -44,6 +34,12 @@
"require": "./dist/components.js"
}
},
"typesVersions": {
"*": {
"*": ["dist/index.d.ts"],
"components": ["dist/components.d.mts"]
}
},
"dependencies": {
"ronin": "3.0.5"
},
Expand Down
8 changes: 4 additions & 4 deletions src/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { FunctionComponent, ReactHTML, ReactNode } from "react";

type ValueOf<T> = T[keyof T];

export type Content =
export type RichTextContent =
| {
type:
| "doc"
Expand All @@ -13,7 +13,7 @@ export type Content =
| "listItem";
// If the node is empty in the editor, it won't have `content` set. For
// example, you might add a new empty paragraph inside the editor.
content?: Content[];
content?: RichTextContent[];
attrs: {
language: string | null;
};
Expand All @@ -33,7 +33,7 @@ export type Content =
| {
type: "heading";
// If the node is empty in the editor, it won't have `content` set.
content?: Content[];
content?: RichTextContent[];
attrs: {
level: 1 | 2 | 3 | 4;
};
Expand Down Expand Up @@ -61,7 +61,7 @@ export const RichText = ({
data,
components,
}: {
data: Content | Content[];
data: RichTextContent | RichTextContent[];
components?: ReactHTML;
}) => {
const items = Array.isArray(data) ? data : [data];
Expand Down

0 comments on commit a71403d

Please sign in to comment.