From ad78f9a959606209146e80005b46633ce1aa4d0e Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Mon, 25 Aug 2025 23:56:08 +0200 Subject: [PATCH] Use and import as types.d.ts --- src/build.ts | 2 +- src/build/bcd.ts | 2 +- src/build/bcd/mapper.ts | 2 +- src/build/emitter.ts | 2 +- src/build/expose.ts | 2 +- src/build/helpers.ts | 2 +- src/build/legacy-namespace.ts | 2 +- src/build/patches.ts | 2 +- src/build/{types.ts => types.d.ts} | 0 src/build/webref/elements.ts | 2 +- src/build/widlprocess.ts | 2 +- 11 files changed, 10 insertions(+), 10 deletions(-) rename src/build/{types.ts => types.d.ts} (100%) diff --git a/src/build.ts b/src/build.ts index 533d4cc26..a24432629 100644 --- a/src/build.ts +++ b/src/build.ts @@ -1,4 +1,4 @@ -import * as Browser from "./build/types.js"; +import type * as Browser from "./build/types.d.ts"; import { promises as fs } from "fs"; import { merge, resolveExposure, arrayToMap } from "./build/helpers.js"; import { type CompilerBehavior, emitWebIdl } from "./build/emitter.js"; diff --git a/src/build/bcd.ts b/src/build/bcd.ts index c54ceac85..e64826c0e 100644 --- a/src/build/bcd.ts +++ b/src/build/bcd.ts @@ -1,4 +1,4 @@ -import * as Browser from "./types.js"; +import type * as Browser from "./types.d.ts"; import { CompatStatement, SimpleSupportStatement, diff --git a/src/build/bcd/mapper.ts b/src/build/bcd/mapper.ts index 1238cd684..791bc023f 100644 --- a/src/build/bcd/mapper.ts +++ b/src/build/bcd/mapper.ts @@ -5,7 +5,7 @@ import { SimpleSupportStatement, } from "bcd-idl-mapper"; import api from "bcd-idl-mapper"; -import * as Browser from "../types.js"; +import type * as Browser from "../types.d.ts"; import { filterMapRecord, isEmptyRecord } from "../utils/record.js"; import { mapDefined } from "../helpers.js"; import { hasStableImplementation } from "./stable.js"; diff --git a/src/build/emitter.ts b/src/build/emitter.ts index cd9f2cffe..7554fbdcb 100644 --- a/src/build/emitter.ts +++ b/src/build/emitter.ts @@ -1,4 +1,4 @@ -import * as Browser from "./types.js"; +import type * as Browser from "./types.d.ts"; import { mapToArray, distinct, diff --git a/src/build/expose.ts b/src/build/expose.ts index 0031d256c..634859738 100644 --- a/src/build/expose.ts +++ b/src/build/expose.ts @@ -1,4 +1,4 @@ -import * as Browser from "./types.js"; +import type * as Browser from "./types.d.ts"; import { getEmptyWebIDL, deepFilter, diff --git a/src/build/helpers.ts b/src/build/helpers.ts index 19272793a..739fec113 100644 --- a/src/build/helpers.ts +++ b/src/build/helpers.ts @@ -1,4 +1,4 @@ -import * as Browser from "./types.js"; +import type * as Browser from "./types.d.ts"; // Extended types used but not defined in the spec export const arrayBufferViewTypes = new Set([ diff --git a/src/build/legacy-namespace.ts b/src/build/legacy-namespace.ts index 6000ae6c8..8bdd92aa2 100644 --- a/src/build/legacy-namespace.ts +++ b/src/build/legacy-namespace.ts @@ -1,4 +1,4 @@ -import * as Browser from "./types.js"; +import type * as Browser from "./types.d.ts"; import { mapToArray, arrayToMap } from "./helpers.js"; export function collectLegacyNamespaceTypes( diff --git a/src/build/patches.ts b/src/build/patches.ts index 0b0da41df..1fd2f6eeb 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -1,5 +1,5 @@ import { parse, type Value, type Node } from "kdljs"; -import type { Enum, Event, Property, Interface, WebIdl } from "./types.js"; +import type { Enum, Event, Property, Interface, WebIdl } from "./types.d.ts"; import { readdir, readFile } from "fs/promises"; import { merge } from "./helpers.js"; diff --git a/src/build/types.ts b/src/build/types.d.ts similarity index 100% rename from src/build/types.ts rename to src/build/types.d.ts diff --git a/src/build/webref/elements.ts b/src/build/webref/elements.ts index 7e2b6ed44..3c69f8f96 100644 --- a/src/build/webref/elements.ts +++ b/src/build/webref/elements.ts @@ -1,5 +1,5 @@ import { listAll, Element as WebrefElement } from "@webref/elements"; -import { Interface, WebIdl } from "../types.js"; +import type { Interface, WebIdl } from "../types.d.ts"; import { addToArrayMap } from "../utils/map.js"; async function getInterfaceToElementMap(): Promise< diff --git a/src/build/widlprocess.ts b/src/build/widlprocess.ts index 94f228dfd..8a8e7bf49 100644 --- a/src/build/widlprocess.ts +++ b/src/build/widlprocess.ts @@ -1,5 +1,5 @@ import * as webidl2 from "webidl2"; -import * as Browser from "./types.js"; +import type * as Browser from "./types.d.ts"; import { getEmptyWebIDL } from "./helpers.js"; export function convert(text: string, commentMap: Record) {