diff --git a/compat/client.d.ts b/compat/client.d.ts index 5daf8ea1e5..cdf7ee241e 100644 --- a/compat/client.d.ts +++ b/compat/client.d.ts @@ -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; diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index d6b7aa3156..7ceaa09e30 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -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'; diff --git a/compat/src/suspense-list.d.ts b/compat/src/suspense-list.d.ts index caa1eb6bff..0a3be0adc9 100644 --- a/compat/src/suspense-list.d.ts +++ b/compat/src/suspense-list.d.ts @@ -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 diff --git a/compat/src/suspense.d.ts b/compat/src/suspense.d.ts index 63f2d5400e..65c2a9372a 100644 --- a/compat/src/suspense.d.ts +++ b/compat/src/suspense.d.ts @@ -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 diff --git a/hooks/src/index.d.ts b/hooks/src/index.d.ts index 7bb441edb2..d7f77dbb49 100644 --- a/hooks/src/index.d.ts +++ b/hooks/src/index.d.ts @@ -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; diff --git a/jsx-runtime/src/index.d.ts b/jsx-runtime/src/index.d.ts index 03845a1a9d..46649e8bdf 100644 --- a/jsx-runtime/src/index.d.ts +++ b/jsx-runtime/src/index.d.ts @@ -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( diff --git a/src/internal.d.ts b/src/internal.d.ts index 0abfd37ab2..7733b0f279 100644 --- a/src/internal.d.ts +++ b/src/internal.d.ts @@ -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,