Skip to content

Commit

Permalink
Merge pull request #4345 from preactjs/types/compat-client
Browse files Browse the repository at this point in the history
feat: Add compat/client types
  • Loading branch information
rschristian committed Apr 23, 2024
2 parents f0c3e1d + bb064a3 commit c1addc2
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
@@ -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
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
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 c1addc2

Please sign in to comment.