webwallgl 1.3.5 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/webwallgl.d.ts CHANGED
@@ -2,8 +2,15 @@
2
2
  //
3
3
  // ⚠️ 维护约束:函数签名是**手写的契约面**,全部类型来自 api/types.ts
4
4
  // (tsc 自动生成到 dist/lib/types,构建时由 build:lib 拷贝拼接)。
5
- // 改 api/mount.ts / api/source.ts 的**函数签名**时必须同步本文件 ——
6
- // 类型本体(MountOptions/SceneInstance/Source 等)改 api/types.ts 即可自动带出。
5
+ // 改 api/index.ts 的**导出清单**或 mount/source/media-source 的**函数签名**时
6
+ // 必须同步本文件 —— 类型本体(MountOptions/SceneInstance/Source/MediaSourceInit
7
+ // 等)改 api/types.ts 即可自动带出。
8
+ //
9
+ // 只在 types.ts 里定义类型:别处(如 media-source.ts)定义的类型不进
10
+ // tsconfig.lib-types.json 的编译范围,本文件 import 它会解析失败。
11
+ //
12
+ // 漏声明一个运行时导出的后果不是"类型弱一点",而是消费方 import 直接
13
+ // TS2305 编译不过(verify-arch 会比对 api/index.ts 与本文件的导出清单)。
7
14
  //
8
15
  // ⚠️ 必须 import 后再 export,不能写成 `export { type X } from "./types"`:
9
16
  // 后者只做转发导出,**不把名字引入本文件作用域**,下面的函数签名会引用到
@@ -22,7 +29,19 @@ import type {
22
29
  PointerSource,
23
30
  AudioSource,
24
31
  MediaSource,
32
+ MediaSnapshot,
33
+ MediaColor,
34
+ MediaColorInit,
35
+ MediaControl,
36
+ MediaPlaybackState,
37
+ MediaSourceInit,
38
+ MediaSourceControls,
25
39
  DiagnosticLevel,
40
+ AntiAliasingMode,
41
+ ParticleQuality,
42
+ PostQuality,
43
+ QualityOptions,
44
+ ResolvedQuality,
26
45
  } from "./types";
27
46
 
28
47
  export type {
@@ -38,7 +57,19 @@ export type {
38
57
  PointerSource,
39
58
  AudioSource,
40
59
  MediaSource,
60
+ MediaSnapshot,
61
+ MediaColor,
62
+ MediaColorInit,
63
+ MediaControl,
64
+ MediaPlaybackState,
65
+ MediaSourceInit,
66
+ MediaSourceControls,
41
67
  DiagnosticLevel,
68
+ AntiAliasingMode,
69
+ ParticleQuality,
70
+ PostQuality,
71
+ QualityOptions,
72
+ ResolvedQuality,
42
73
  };
43
74
 
44
75
  export declare function mount(
@@ -60,3 +91,28 @@ export declare function bytesSource(
60
91
  project?: unknown,
61
92
  key?: string,
62
93
  ): Source;
94
+
95
+ export declare function mediaSource(
96
+ urlOrFile: string | File | Blob,
97
+ options?: { type?: "video" | "gif" | "image"; key?: string },
98
+ ): Source;
99
+
100
+ export declare function sniffMediaType(
101
+ url: string,
102
+ ): "video" | "gif" | "image" | null;
103
+
104
+ /** 从 Source.key 末段抽出工坊 ID(视差白名单 / 脚本 __workshopId 回填用) */
105
+ export declare function workshopIdFromSourceKey(
106
+ key?: string | null,
107
+ ): string | undefined;
108
+
109
+ export declare function createMediaSource(
110
+ init?: MediaSourceInit,
111
+ controls?: MediaSourceControls,
112
+ ): MediaSource & { set(patch: MediaSourceInit): void };
113
+
114
+ export declare function mediaColor(
115
+ r: MediaColorInit,
116
+ g?: number,
117
+ b?: number,
118
+ ): MediaColor;