Skip to content

Commit 5ecfe1f

Browse files
committed
docs(motion): 更正 GsapTimeline 转出的假因果
1 parent 32effc9 commit 5ecfe1f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎app/src/motion/engine.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ export { gsap, useGSAP };
5353

5454
/**
5555
* `gsap.core.Timeline` 的**转出**(计划 T10 Interfaces 逐字:`export type { gsap }` 转不出命名空间成员)。
56-
* 为什么必须由本文件转出:`import { gsap } from "gsap"` 绑定的**值**会遮蔽 `gsap` 这个**全局命名空间**,
57-
* 使用方直接写 `gsap.core.Timeline` 过不了类型检查。测试底座只以 `import type` 取它(不进产物)。
56+
* ⚠️ **这是便利,不是类型检查的必需品**(T13b 按合并评审 I-2 更正了本段的旧说法):旧注释称
57+
* 「`import { gsap } from "gsap"` 绑定的**值**会遮蔽 `gsap` 这个**全局命名空间** ⇒ 使用方直接写
58+
* `gsap.core.Timeline` 过不了类型检查」—— **实测为假**(同一棵提交树上三个 tsc case):① 消费方
59+
* `import { gsap } from "./engine"` 后写 `gsap.core.Timeline` ⇒ **exit 0**;② **不 import 任何东西**
60+
* 直接写该类型 ⇒ **exit 0**;③ 阳性对照(同树 `app/src/**` 新文件里故意写错类型)⇒ **exit 2 / TS2322**
61+
* —— 前两个 0 **不是**「没检查」。它今天仍被两处以 `import type` 消费(`motion/controls.ts` /
62+
* `test/motionHarness.ts`,类型边不进产物),留着是因为**这个别名读起来稳、且是计划冻结的接口面**。
5863
*/
5964
export type GsapTimeline = gsap.core.Timeline;

0 commit comments

Comments
 (0)