Skip to content

Commit

Permalink
fix: Ensure resolution of core types goes through typesVersions resol…
Browse files Browse the repository at this point in the history
…ution
  • Loading branch information
rschristian committed Nov 27, 2024
1 parent 65b4f6b commit 4d629c0
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 8 deletions.
4 changes: 3 additions & 1 deletion compat/client.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as preact from '../src';
// Intentionally not using a relative path to take advantage of
// the TS version resolution mechanism
import * as preact from 'preact';

export function createRoot(container: preact.ContainerNode): {
render(children: preact.ComponentChild): void;
Expand Down
4 changes: 3 additions & 1 deletion compat/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as _hooks from '../../hooks';
import * as preact from '../../src';
// Intentionally not using a relative path to take advantage of
// the TS version resolution mechanism
import * as preact from 'preact';
import { JSXInternal } from '../../src/jsx';
import * as _Suspense from './suspense';
import * as _SuspenseList from './suspense-list';
Expand Down
4 changes: 3 additions & 1 deletion compat/src/suspense-list.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Component, ComponentChild, ComponentChildren } from '../../src';
// Intentionally not using a relative path to take advantage of
// the TS version resolution mechanism
import { Component, ComponentChild, ComponentChildren } from 'preact';

//
// SuspenseList
Expand Down
4 changes: 3 additions & 1 deletion compat/src/suspense.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Component, ComponentChild, ComponentChildren } from '../../src';
// Intentionally not using a relative path to take advantage of
// the TS version resolution mechanism
import { Component, ComponentChild, ComponentChildren } from 'preact';

//
// Suspense/lazy
Expand Down
4 changes: 3 additions & 1 deletion hooks/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ErrorInfo, PreactContext, Ref, RefObject } from '../..';
// Intentionally not using a relative path to take advantage of
// the TS version resolution mechanism
import { ErrorInfo, PreactContext, Ref, RefObject } from 'preact';

type Inputs = ReadonlyArray<unknown>;

Expand Down
6 changes: 4 additions & 2 deletions jsx-runtime/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
export { Fragment } from '../../';
// Intentionally not using a relative path to take advantage of
// the TS version resolution mechanism
export { Fragment } from 'preact';
import {
ComponentType,
ComponentChild,
ComponentChildren,
VNode,
Attributes
} from '../../';
} from 'preact';
import { JSXInternal } from '../../src/jsx';

export function jsx(
Expand Down
4 changes: 3 additions & 1 deletion src/internal.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as preact from './index';
// Intentionally not using a relative path to take advantage of
// the TS version resolution mechanism
import * as preact from 'preact';

export enum HookType {
useState = 1,
Expand Down

0 comments on commit 4d629c0

Please sign in to comment.