@sublane/core 0.3.0 → 0.3.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/package.json +1 -1
- package/src/contract.ts +5 -0
- package/src/runtime.ts +6 -0
package/package.json
CHANGED
package/src/contract.ts
CHANGED
|
@@ -169,6 +169,11 @@ export interface DetachedHandle {
|
|
|
169
169
|
unmount(): void | Promise<void>
|
|
170
170
|
/** 替换数据源(如切换 Clip 区间);不重挂 DOM */
|
|
171
171
|
setSource(source: TrackSource): void
|
|
172
|
+
/** 0.3.1 可选(缺口3):订阅 detached 渲染器**有效轨**的只读事件流(回显语义——
|
|
173
|
+
* 事件 = 渲染器实际持有的规范化 cue 视图;订阅即 reset,onUpdate/setSource → upsert)。
|
|
174
|
+
* injected-only 下宿主本持有注入数据,此成员的契约价值 = 以统一词汇表观测渲染器
|
|
175
|
+
* 的有效视图(规范化后含推断区间),并为未来 hybrid 模式预留同一订阅面。 */
|
|
176
|
+
subscribeCues?(listener: (event: CueStreamEvent) => void): () => void
|
|
172
177
|
}
|
|
173
178
|
|
|
174
179
|
/** detached 会话上下文:与 live PluginMountContext 同形,但编排器已将 emitConfigPatch
|
package/src/runtime.ts
CHANGED
|
@@ -175,6 +175,12 @@ export function createVideoSubtitleFramework({ ctx, plugins, storage: storagePor
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
return {
|
|
178
|
+
/** 0.3.1(缺口1):宿主访问 live 实例的唯一受支持通道——F-26 subscribeCues 消费入口。
|
|
179
|
+
* 快照语义:返回调用时刻的装配集(start 前为空;applyConfig 每次重建,旧快照冻结)。
|
|
180
|
+
* integration.md 曾承诺"经框架回调拿到实例引用"而代码缺位——本访问器补齐该行为。 */
|
|
181
|
+
instances(): ReadonlyMap<string, VideoSubtitlePluginInstance> {
|
|
182
|
+
return new Map([...running].map(([id, run]) => [id, run.instance]))
|
|
183
|
+
},
|
|
178
184
|
async start(): Promise<void> {
|
|
179
185
|
ctx.onInvalidated(() => {
|
|
180
186
|
stopped = true
|