Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compat/server.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// @ts-nocheck TS loses its mind over the mixed module systems here.
// It's not ideal, but works at runtime and we're not shipping mixed type definitions.

import { renderToString } from 'preact-render-to-string';
import { renderToPipeableStream } from 'preact-render-to-string/stream-node';
import { renderToReadableStream } from 'preact-render-to-string/stream';
Expand Down
9 changes: 6 additions & 3 deletions jsconfig-lint.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"extends": "./jsconfig.json",
"compilerOptions": {
"skipLibCheck": true,
"noEmit": true,
"typeRoots": ["./node_modules/@types", "./node_modules", "./types"]
// More modern settings as Vite & Vitest require them and TS doesn't allow
// silencing errors from `node_modules` alone.
"moduleResolution": "Node16",
"target": "ES2015",
"module": "Node16",
"checkJs": false
},
"include": [
"src/**/*",
Expand Down
19 changes: 9 additions & 10 deletions jsx-runtime/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import {
ComponentChild,
ComponentChildren,
VNode,
Attributes
Attributes,
HTMLAttributes,
SVGAttributes
} from 'preact';
import { JSXInternal } from '../../src/jsx';

export function jsx(
type: string,
props: JSXInternal.HTMLAttributes &
JSXInternal.SVGAttributes &
props: HTMLAttributes &
SVGAttributes &
Record<string, any> & { children?: ComponentChild },
key?: string
): VNode<any>;
Expand All @@ -25,8 +26,8 @@ export function jsx<P>(

export function jsxs(
type: string,
props: JSXInternal.HTMLAttributes &
JSXInternal.SVGAttributes &
props: HTMLAttributes &
SVGAttributes &
Record<string, any> & { children?: ComponentChild[] },
key?: string
): VNode<any>;
Expand All @@ -38,8 +39,8 @@ export function jsxs<P>(

export function jsxDEV(
type: string,
props: JSXInternal.HTMLAttributes &
JSXInternal.SVGAttributes &
props: HTMLAttributes &
SVGAttributes &
Record<string, any> & { children?: ComponentChildren },
key?: string
): VNode<any>;
Expand All @@ -58,5 +59,3 @@ export function jsxAttr(name: string, value: any): string | null;
export function jsxEscape<T>(
value: T
): string | null | VNode<any> | Array<string | null | VNode>;

export { JSXInternal as JSX };
58 changes: 0 additions & 58 deletions types/events.d.ts

This file was deleted.

9 changes: 9 additions & 0 deletions types/weak-key.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare global {
export interface WeakKeyTypes {
object: object;
}

export type WeakKey = WeakKeyTypes[keyof WeakKeyTypes];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vitest relies on it, copied from es5.d.ts

}

export {};
Loading