Skip to content

Commit

Permalink
feat: Add compat/client types
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Apr 22, 2024
1 parent e2c8a45 commit accb4c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions compat/client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as preact from '../src';

export function createRoot(container: preact.ContainerNode): {
render(children: preact.VNode<any>): void;
unmount(): void;
};

export function hydrateRoot(
container: preact.ContainerNode,
children: preact.VNode<any>
): typeof createRoot;
1 change: 1 addition & 0 deletions compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"require": "./dist/compat.js"
},
"./client": {
"types": "./client.d.ts",
"import": "./client.mjs",
"require": "./client.js"
},
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"require": "./jsx-runtime/dist/jsxRuntime.js"
},
"./compat/client": {
"types": "./compat/client.d.ts",
"import": "./compat/client.mjs",
"require": "./compat/client.js"
},
Expand Down Expand Up @@ -209,6 +210,7 @@
"dist",
"compat/dist",
"compat/src",
"compat/client.d.ts",
"compat/client.js",
"compat/client.mjs",
"compat/server.browser.js",
Expand Down

0 comments on commit accb4c7

Please sign in to comment.