@webmusic/kernel 0.2.0 → 0.4.0
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/LICENSE +202 -21
- package/NOTICE +2 -0
- package/README.md +103 -64
- package/dist/audio-context.cjs.map +1 -1
- package/dist/build-receipt.json +3 -3
- package/dist/chunk-27LH6QLZ.cjs +277 -0
- package/dist/chunk-27LH6QLZ.cjs.map +1 -0
- package/dist/chunk-3INDOVUC.cjs.map +1 -1
- package/dist/chunk-3RR2VIKA.js +393 -0
- package/dist/chunk-3RR2VIKA.js.map +1 -0
- package/dist/chunk-3YTKIKKX.cjs +378 -0
- package/dist/chunk-3YTKIKKX.cjs.map +1 -0
- package/dist/chunk-4RG4WQKC.js +360 -0
- package/dist/chunk-4RG4WQKC.js.map +1 -0
- package/dist/chunk-5AHVQXTF.cjs +620 -0
- package/dist/chunk-5AHVQXTF.cjs.map +1 -0
- package/dist/chunk-624KWJWZ.js +170 -0
- package/dist/chunk-624KWJWZ.js.map +1 -0
- package/dist/chunk-6HGFEKD3.cjs +851 -0
- package/dist/chunk-6HGFEKD3.cjs.map +1 -0
- package/dist/chunk-7ZTZZ5PN.cjs.map +1 -1
- package/dist/chunk-ALWV4P7D.js +726 -0
- package/dist/chunk-ALWV4P7D.js.map +1 -0
- package/dist/chunk-BADJJ6DV.cjs +143 -0
- package/dist/chunk-BADJJ6DV.cjs.map +1 -0
- package/dist/chunk-C3LMS36L.cjs +393 -0
- package/dist/chunk-C3LMS36L.cjs.map +1 -0
- package/dist/chunk-C3YWUZW3.cjs.map +1 -1
- package/dist/chunk-CR6OUWBJ.cjs +726 -0
- package/dist/chunk-CR6OUWBJ.cjs.map +1 -0
- package/dist/chunk-CYWDZLWC.js +2141 -0
- package/dist/chunk-CYWDZLWC.js.map +1 -0
- package/dist/chunk-DDOGX2D5.js +378 -0
- package/dist/chunk-DDOGX2D5.js.map +1 -0
- package/dist/chunk-DVN6E5U3.js +620 -0
- package/dist/chunk-DVN6E5U3.js.map +1 -0
- package/dist/chunk-EURMRU2S.js +208 -0
- package/dist/chunk-EURMRU2S.js.map +1 -0
- package/dist/chunk-EXDCK2VL.cjs +20 -0
- package/dist/chunk-EXDCK2VL.cjs.map +1 -0
- package/dist/chunk-G5EIUP52.js +114 -0
- package/dist/chunk-G5EIUP52.js.map +1 -0
- package/dist/chunk-GB4DGKLZ.js +143 -0
- package/dist/chunk-GB4DGKLZ.js.map +1 -0
- package/dist/chunk-GPOEAYOW.js +2147 -0
- package/dist/chunk-GPOEAYOW.js.map +1 -0
- package/dist/chunk-I4YMA5VM.cjs +120 -0
- package/dist/chunk-I4YMA5VM.cjs.map +1 -0
- package/dist/chunk-IVWHMDCB.cjs +4383 -0
- package/dist/chunk-IVWHMDCB.cjs.map +1 -0
- package/dist/chunk-JFCBJMA7.cjs +2147 -0
- package/dist/chunk-JFCBJMA7.cjs.map +1 -0
- package/dist/chunk-JLVSAZ3K.cjs +813 -0
- package/dist/chunk-JLVSAZ3K.cjs.map +1 -0
- package/dist/chunk-K7FYH6UG.cjs +208 -0
- package/dist/chunk-K7FYH6UG.cjs.map +1 -0
- package/dist/chunk-L4MYCETM.cjs +970 -0
- package/dist/chunk-L4MYCETM.cjs.map +1 -0
- package/dist/chunk-MNCMYNYL.js +970 -0
- package/dist/chunk-MNCMYNYL.js.map +1 -0
- package/dist/chunk-NT2BZ3QM.js +120 -0
- package/dist/chunk-NT2BZ3QM.js.map +1 -0
- package/dist/chunk-O7SA5GLC.js +277 -0
- package/dist/chunk-O7SA5GLC.js.map +1 -0
- package/dist/chunk-OCKAHITL.cjs +548 -0
- package/dist/chunk-OCKAHITL.cjs.map +1 -0
- package/dist/chunk-OTXYWCLA.js +206 -0
- package/dist/chunk-OTXYWCLA.js.map +1 -0
- package/dist/chunk-P6ZA63J7.js +548 -0
- package/dist/chunk-P6ZA63J7.js.map +1 -0
- package/dist/chunk-QLF3BOST.js +20 -0
- package/dist/chunk-QLF3BOST.js.map +1 -0
- package/dist/chunk-RCWFRZDR.js +4383 -0
- package/dist/chunk-RCWFRZDR.js.map +1 -0
- package/dist/chunk-RZBLPM3L.cjs +206 -0
- package/dist/chunk-RZBLPM3L.cjs.map +1 -0
- package/dist/chunk-TA3TNJZU.cjs +360 -0
- package/dist/chunk-TA3TNJZU.cjs.map +1 -0
- package/dist/chunk-TZSRPTQL.cjs +2141 -0
- package/dist/chunk-TZSRPTQL.cjs.map +1 -0
- package/dist/chunk-UMTPJ76S.cjs.map +1 -1
- package/dist/chunk-UY77FXDW.js +813 -0
- package/dist/chunk-UY77FXDW.js.map +1 -0
- package/dist/chunk-VFU3S7OC.js +851 -0
- package/dist/chunk-VFU3S7OC.js.map +1 -0
- package/dist/chunk-VY6WWZSW.cjs.map +1 -1
- package/dist/chunk-WN5DZOVT.cjs +170 -0
- package/dist/chunk-WN5DZOVT.cjs.map +1 -0
- package/dist/chunk-WOPW6WLR.cjs.map +1 -1
- package/dist/chunk-XBSIYUHM.cjs +114 -0
- package/dist/chunk-XBSIYUHM.cjs.map +1 -0
- package/dist/chunk-ZMU72HJS.cjs.map +1 -1
- package/dist/context-DSa0ymyN.d.cts +664 -0
- package/dist/context-DaxfAg3b.d.ts +664 -0
- package/dist/effect-chain-Cu03O5Y0.d.ts +91 -0
- package/dist/effect-chain-Do75T7uK.d.cts +91 -0
- package/dist/effect.cjs +16 -1
- package/dist/effect.cjs.map +1 -1
- package/dist/effect.d.cts +56 -14
- package/dist/effect.d.ts +56 -14
- package/dist/effect.js +16 -1
- package/dist/elements.cjs +37 -2
- package/dist/elements.cjs.map +1 -1
- package/dist/elements.d.cts +197 -8
- package/dist/elements.d.ts +197 -8
- package/dist/elements.js +36 -1
- package/dist/events.cjs.map +1 -1
- package/dist/index.cjs +555 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/index.js +566 -19
- package/dist/message.cjs +104 -0
- package/dist/message.cjs.map +1 -0
- package/dist/message.d.cts +738 -0
- package/dist/message.d.ts +738 -0
- package/dist/message.js +104 -0
- package/dist/meter.cjs.map +1 -1
- package/dist/module-control-C25BMtH7.d.ts +61 -0
- package/dist/module-control-yH6nTJM9.d.cts +61 -0
- package/dist/module-plugin-BnPmq1VP.d.ts +198 -0
- package/dist/module-plugin-CHb-5W0Y.d.cts +198 -0
- package/dist/module.cjs +263 -0
- package/dist/module.cjs.map +1 -0
- package/dist/module.d.cts +1112 -0
- package/dist/module.d.ts +1112 -0
- package/dist/module.js +263 -0
- package/dist/parameter-DwQzFmBR.d.cts +172 -0
- package/dist/parameter-DwQzFmBR.d.ts +172 -0
- package/dist/player.cjs.map +1 -1
- package/dist/processor-worklet.cjs +18 -0
- package/dist/processor-worklet.cjs.map +1 -0
- package/dist/processor-worklet.d.cts +166 -0
- package/dist/processor-worklet.d.ts +166 -0
- package/dist/processor-worklet.js +18 -0
- package/dist/processor-worklet.js.map +1 -0
- package/dist/processor.cjs +51 -0
- package/dist/processor.cjs.map +1 -0
- package/dist/processor.d.cts +397 -0
- package/dist/processor.d.ts +397 -0
- package/dist/processor.js +51 -0
- package/dist/processor.js.map +1 -0
- package/dist/project-types-BU4awMnL.d.ts +323 -0
- package/dist/project-types-DufCV8Ma.d.cts +323 -0
- package/dist/ring-C-i9N90a.d.cts +139 -0
- package/dist/ring-DkcMt2Eg.d.ts +139 -0
- package/dist/sequence.cjs +68 -0
- package/dist/sequence.cjs.map +1 -0
- package/dist/sequence.d.cts +303 -0
- package/dist/sequence.d.ts +303 -0
- package/dist/sequence.js +68 -0
- package/dist/sequence.js.map +1 -0
- package/dist/session.cjs +16 -0
- package/dist/session.cjs.map +1 -0
- package/dist/session.d.cts +407 -0
- package/dist/session.d.ts +407 -0
- package/dist/session.js +16 -0
- package/dist/session.js.map +1 -0
- package/dist/tick.cjs.map +1 -1
- package/dist/transport.cjs +50 -2
- package/dist/transport.cjs.map +1 -1
- package/dist/transport.d.cts +145 -1
- package/dist/transport.d.ts +145 -1
- package/dist/transport.js +51 -3
- package/dist/worker.cjs.map +1 -1
- package/package.json +61 -10
- package/dist/chunk-53YD73OY.js +0 -162
- package/dist/chunk-53YD73OY.js.map +0 -1
- package/dist/chunk-54JYWB5X.cjs +0 -1051
- package/dist/chunk-54JYWB5X.cjs.map +0 -1
- package/dist/chunk-BR63OD53.cjs +0 -1
- package/dist/chunk-BR63OD53.cjs.map +0 -1
- package/dist/chunk-ON64FRCF.js +0 -1051
- package/dist/chunk-ON64FRCF.js.map +0 -1
- package/dist/chunk-SM5YPDDI.cjs +0 -162
- package/dist/chunk-SM5YPDDI.cjs.map +0 -1
- package/dist/chunk-TEM2I2NN.js +0 -1
- package/dist/chunk-VVZX7DQ6.cjs +0 -254
- package/dist/chunk-VVZX7DQ6.cjs.map +0 -1
- package/dist/chunk-WNFGDB7B.js +0 -254
- package/dist/chunk-WNFGDB7B.js.map +0 -1
- package/dist/sync.cjs +0 -12
- package/dist/sync.cjs.map +0 -1
- package/dist/sync.d.cts +0 -307
- package/dist/sync.d.ts +0 -307
- package/dist/sync.js +0 -12
- /package/dist/{chunk-TEM2I2NN.js.map → message.js.map} +0 -0
- /package/dist/{sync.js.map → module.js.map} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { c as ParamDescriptor, i as ParamSurface } from './parameter-DwQzFmBR.js';
|
|
2
|
+
|
|
3
|
+
/** A built effect sub-graph: signal enters `input`, leaves `output`. */
|
|
4
|
+
interface EffectNodes {
|
|
5
|
+
readonly input: AudioNode;
|
|
6
|
+
readonly output: AudioNode;
|
|
7
|
+
/** Live, adjustable parameters (e.g. `frequency`, `wet`) for real-time control. */
|
|
8
|
+
params?: Record<string, AudioParam>;
|
|
9
|
+
dispose?(): void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The structural Effect contract. The single method `createAudioNodes` lets
|
|
13
|
+
* effects cross between the families by shape alone.
|
|
14
|
+
*/
|
|
15
|
+
interface Effect {
|
|
16
|
+
/** Optional label — UIs can caption controls with it. */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Real parameter units/ranges supplied by the recipe, never guessed by a UI. */
|
|
19
|
+
parameterDescriptors?: Readonly<Record<string, Partial<Omit<ParamDescriptor, 'id'>>>>;
|
|
20
|
+
/**
|
|
21
|
+
* Realize a fresh graph for each call; sharing a recipe does not share nodes.
|
|
22
|
+
* InsertChain also accepts its exact active-slot bundle as an alias, or an
|
|
23
|
+
* explicitly borrowed slot whose graph remains owned by the caller.
|
|
24
|
+
*/
|
|
25
|
+
createAudioNodes(context: BaseAudioContext): EffectNodes;
|
|
26
|
+
}
|
|
27
|
+
interface InsertSlot {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly recipe: Effect;
|
|
30
|
+
/** Borrowed bundles are never disposed by this chain. */
|
|
31
|
+
readonly ownership?: 'owned' | 'borrowed';
|
|
32
|
+
readonly parameterDescriptors?: Effect['parameterDescriptors'];
|
|
33
|
+
}
|
|
34
|
+
interface EffectInstance {
|
|
35
|
+
/** Stable realization identity; a slot replacement receives a new identity. */
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly slotId: string;
|
|
38
|
+
readonly recipe: Effect;
|
|
39
|
+
readonly nodes: EffectNodes;
|
|
40
|
+
readonly params: ParamSurface;
|
|
41
|
+
readonly ownership: 'owned' | 'borrowed';
|
|
42
|
+
}
|
|
43
|
+
interface InsertChainOptions {
|
|
44
|
+
readonly id?: string;
|
|
45
|
+
/** Retirement errors occur after commit and cannot invalidate the new graph. */
|
|
46
|
+
readonly onCleanupError?: (error: unknown) => void;
|
|
47
|
+
}
|
|
48
|
+
declare const COMPATIBILITY_EFFECT_SLOT = "$compat";
|
|
49
|
+
/**
|
|
50
|
+
* An ordered insert graph with stable ports in either a live or offline context.
|
|
51
|
+
* Logical replacement is transactional; Web Audio does not promise a hardware
|
|
52
|
+
* atomic switch or a crossfade. Callers own connections outside these ports.
|
|
53
|
+
*/
|
|
54
|
+
declare class InsertChain {
|
|
55
|
+
readonly context: BaseAudioContext;
|
|
56
|
+
private readonly options;
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly input: GainNode;
|
|
59
|
+
readonly output: GainNode;
|
|
60
|
+
private explicitSlots;
|
|
61
|
+
private compatibility?;
|
|
62
|
+
private active;
|
|
63
|
+
private edges;
|
|
64
|
+
private graphRevision;
|
|
65
|
+
private ended;
|
|
66
|
+
private editing;
|
|
67
|
+
private sequence;
|
|
68
|
+
private readonly listeners;
|
|
69
|
+
constructor(context: BaseAudioContext, options?: InsertChainOptions);
|
|
70
|
+
get slots(): readonly InsertSlot[];
|
|
71
|
+
get instances(): readonly EffectInstance[];
|
|
72
|
+
get revision(): number;
|
|
73
|
+
get disposed(): boolean;
|
|
74
|
+
/** Replace explicit slots only; the legacy compatibility slot remains first. */
|
|
75
|
+
replace(slots: readonly InsertSlot[]): void;
|
|
76
|
+
/** Add a slot or update it in place without reordering other declarations. */
|
|
77
|
+
setSlot(slot: InsertSlot): void;
|
|
78
|
+
removeSlot(id: string): void;
|
|
79
|
+
setCompatibility(recipe: Effect | undefined): void;
|
|
80
|
+
subscribe(listener: (chain: InsertChain) => void): () => void;
|
|
81
|
+
dispose(): void;
|
|
82
|
+
private assertEditable;
|
|
83
|
+
private update;
|
|
84
|
+
private parameters;
|
|
85
|
+
private parameterDescriptor;
|
|
86
|
+
private retire;
|
|
87
|
+
private report;
|
|
88
|
+
private notify;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { COMPATIBILITY_EFFECT_SLOT as C, type Effect as E, InsertChain as I, type EffectInstance as a, type EffectNodes as b, type InsertChainOptions as c, type InsertSlot as d };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { c as ParamDescriptor, i as ParamSurface } from './parameter-DwQzFmBR.cjs';
|
|
2
|
+
|
|
3
|
+
/** A built effect sub-graph: signal enters `input`, leaves `output`. */
|
|
4
|
+
interface EffectNodes {
|
|
5
|
+
readonly input: AudioNode;
|
|
6
|
+
readonly output: AudioNode;
|
|
7
|
+
/** Live, adjustable parameters (e.g. `frequency`, `wet`) for real-time control. */
|
|
8
|
+
params?: Record<string, AudioParam>;
|
|
9
|
+
dispose?(): void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The structural Effect contract. The single method `createAudioNodes` lets
|
|
13
|
+
* effects cross between the families by shape alone.
|
|
14
|
+
*/
|
|
15
|
+
interface Effect {
|
|
16
|
+
/** Optional label — UIs can caption controls with it. */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Real parameter units/ranges supplied by the recipe, never guessed by a UI. */
|
|
19
|
+
parameterDescriptors?: Readonly<Record<string, Partial<Omit<ParamDescriptor, 'id'>>>>;
|
|
20
|
+
/**
|
|
21
|
+
* Realize a fresh graph for each call; sharing a recipe does not share nodes.
|
|
22
|
+
* InsertChain also accepts its exact active-slot bundle as an alias, or an
|
|
23
|
+
* explicitly borrowed slot whose graph remains owned by the caller.
|
|
24
|
+
*/
|
|
25
|
+
createAudioNodes(context: BaseAudioContext): EffectNodes;
|
|
26
|
+
}
|
|
27
|
+
interface InsertSlot {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly recipe: Effect;
|
|
30
|
+
/** Borrowed bundles are never disposed by this chain. */
|
|
31
|
+
readonly ownership?: 'owned' | 'borrowed';
|
|
32
|
+
readonly parameterDescriptors?: Effect['parameterDescriptors'];
|
|
33
|
+
}
|
|
34
|
+
interface EffectInstance {
|
|
35
|
+
/** Stable realization identity; a slot replacement receives a new identity. */
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly slotId: string;
|
|
38
|
+
readonly recipe: Effect;
|
|
39
|
+
readonly nodes: EffectNodes;
|
|
40
|
+
readonly params: ParamSurface;
|
|
41
|
+
readonly ownership: 'owned' | 'borrowed';
|
|
42
|
+
}
|
|
43
|
+
interface InsertChainOptions {
|
|
44
|
+
readonly id?: string;
|
|
45
|
+
/** Retirement errors occur after commit and cannot invalidate the new graph. */
|
|
46
|
+
readonly onCleanupError?: (error: unknown) => void;
|
|
47
|
+
}
|
|
48
|
+
declare const COMPATIBILITY_EFFECT_SLOT = "$compat";
|
|
49
|
+
/**
|
|
50
|
+
* An ordered insert graph with stable ports in either a live or offline context.
|
|
51
|
+
* Logical replacement is transactional; Web Audio does not promise a hardware
|
|
52
|
+
* atomic switch or a crossfade. Callers own connections outside these ports.
|
|
53
|
+
*/
|
|
54
|
+
declare class InsertChain {
|
|
55
|
+
readonly context: BaseAudioContext;
|
|
56
|
+
private readonly options;
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly input: GainNode;
|
|
59
|
+
readonly output: GainNode;
|
|
60
|
+
private explicitSlots;
|
|
61
|
+
private compatibility?;
|
|
62
|
+
private active;
|
|
63
|
+
private edges;
|
|
64
|
+
private graphRevision;
|
|
65
|
+
private ended;
|
|
66
|
+
private editing;
|
|
67
|
+
private sequence;
|
|
68
|
+
private readonly listeners;
|
|
69
|
+
constructor(context: BaseAudioContext, options?: InsertChainOptions);
|
|
70
|
+
get slots(): readonly InsertSlot[];
|
|
71
|
+
get instances(): readonly EffectInstance[];
|
|
72
|
+
get revision(): number;
|
|
73
|
+
get disposed(): boolean;
|
|
74
|
+
/** Replace explicit slots only; the legacy compatibility slot remains first. */
|
|
75
|
+
replace(slots: readonly InsertSlot[]): void;
|
|
76
|
+
/** Add a slot or update it in place without reordering other declarations. */
|
|
77
|
+
setSlot(slot: InsertSlot): void;
|
|
78
|
+
removeSlot(id: string): void;
|
|
79
|
+
setCompatibility(recipe: Effect | undefined): void;
|
|
80
|
+
subscribe(listener: (chain: InsertChain) => void): () => void;
|
|
81
|
+
dispose(): void;
|
|
82
|
+
private assertEditable;
|
|
83
|
+
private update;
|
|
84
|
+
private parameters;
|
|
85
|
+
private parameterDescriptor;
|
|
86
|
+
private retire;
|
|
87
|
+
private report;
|
|
88
|
+
private notify;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { COMPATIBILITY_EFFECT_SLOT as C, type Effect as E, InsertChain as I, type EffectInstance as a, type EffectNodes as b, type InsertChainOptions as c, type InsertSlot as d };
|
package/dist/effect.cjs
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk27LH6QLZcjs = require('./chunk-27LH6QLZ.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkC3LMS36Lcjs = require('./chunk-C3LMS36L.cjs');
|
|
8
|
+
require('./chunk-5AHVQXTF.cjs');
|
|
9
|
+
require('./chunk-3INDOVUC.cjs');
|
|
10
|
+
require('./chunk-EXDCK2VL.cjs');
|
|
11
|
+
require('./chunk-7ZTZZ5PN.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.COMPATIBILITY_EFFECT_SLOT = _chunkC3LMS36Lcjs.COMPATIBILITY_EFFECT_SLOT; exports.InsertChain = _chunkC3LMS36Lcjs.InsertChain; exports.TransitionInsertChain = _chunk27LH6QLZcjs.TransitionInsertChain;
|
|
2
17
|
//# sourceMappingURL=effect.cjs.map
|
package/dist/effect.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users
|
|
1
|
+
{"version":3,"sources":["/private/tmp/claude-501/-Users-mamingchen-GitHub-public-WebMusic/77eac0d8-82c0-45c6-aba8-0cd73cfd2b1b/scratchpad/release-0.4.0/platform/kernel/dist/effect.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACF,8MAAC","file":"/private/tmp/claude-501/-Users-mamingchen-GitHub-public-WebMusic/77eac0d8-82c0-45c6-aba8-0cd73cfd2b1b/scratchpad/release-0.4.0/platform/kernel/dist/effect.cjs"}
|
package/dist/effect.d.cts
CHANGED
|
@@ -1,19 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { I as InsertChain, c as InsertChainOptions, d as InsertSlot } from './effect-chain-Do75T7uK.cjs';
|
|
2
|
+
export { C as COMPATIBILITY_EFFECT_SLOT, E as Effect, a as EffectInstance, b as EffectNodes } from './effect-chain-Do75T7uK.cjs';
|
|
3
|
+
import { TickSourceOptions } from './tick.cjs';
|
|
4
|
+
import './parameter-DwQzFmBR.cjs';
|
|
5
|
+
|
|
6
|
+
interface InsertTransitionOptions {
|
|
7
|
+
/** Linear crossfade in audio seconds. Default 0.02; finite and nonnegative. */
|
|
8
|
+
readonly fadeSeconds?: number;
|
|
9
|
+
/** Stop feeding the outgoing graph, then fade its tail over this duration. Default 0. */
|
|
10
|
+
readonly tailSeconds?: number;
|
|
11
|
+
}
|
|
12
|
+
interface TransitionInsertChainOptions extends InsertChainOptions {
|
|
13
|
+
/** Maximum simultaneously retiring generations. Default 8; positive integer. */
|
|
14
|
+
readonly maxRetiring?: number;
|
|
15
|
+
readonly tick?: TickSourceOptions;
|
|
16
|
+
}
|
|
17
|
+
interface RetiringInsertChain {
|
|
18
|
+
readonly chain: InsertChain;
|
|
19
|
+
/** Absolute audio-context time; suspension does not consume the tail budget. */
|
|
20
|
+
readonly retireAt: number;
|
|
8
21
|
}
|
|
9
22
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
23
|
+
* Explicit whole-generation effect changes with stable external ports. Each
|
|
24
|
+
* replacement builds fresh owned circuits; parameter/CV/automation identities
|
|
25
|
+
* stay with their generation, and are never silently copied to its successor.
|
|
26
|
+
* Ordinary InsertChain edits retain their existing reuse and immediate-cut rules.
|
|
12
27
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
declare class TransitionInsertChain {
|
|
29
|
+
readonly context: BaseAudioContext;
|
|
30
|
+
private readonly options;
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly input: GainNode;
|
|
33
|
+
readonly output: GainNode;
|
|
34
|
+
private active;
|
|
35
|
+
private previous;
|
|
36
|
+
private ticker?;
|
|
37
|
+
private readonly maxRetiring;
|
|
38
|
+
private serial;
|
|
39
|
+
private graphRevision;
|
|
40
|
+
private ended;
|
|
41
|
+
private editing;
|
|
42
|
+
constructor(context: BaseAudioContext, options?: TransitionInsertChainOptions);
|
|
43
|
+
get current(): InsertChain;
|
|
44
|
+
get retiring(): readonly RetiringInsertChain[];
|
|
45
|
+
get revision(): number;
|
|
46
|
+
get disposed(): boolean;
|
|
47
|
+
replace(slots: readonly InsertSlot[], options?: InsertTransitionOptions): void;
|
|
48
|
+
/** Release expired generations; useful after deterministic offline rendering. */
|
|
49
|
+
collect(): void;
|
|
50
|
+
dispose(): void;
|
|
51
|
+
private build;
|
|
52
|
+
private reserved;
|
|
53
|
+
private ramp;
|
|
54
|
+
private restore;
|
|
55
|
+
private release;
|
|
56
|
+
private assertAlive;
|
|
57
|
+
private assertEditable;
|
|
58
|
+
private report;
|
|
17
59
|
}
|
|
18
60
|
|
|
19
|
-
export type
|
|
61
|
+
export { InsertChain, InsertChainOptions, InsertSlot, type InsertTransitionOptions, type RetiringInsertChain, TransitionInsertChain, type TransitionInsertChainOptions };
|
package/dist/effect.d.ts
CHANGED
|
@@ -1,19 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { I as InsertChain, c as InsertChainOptions, d as InsertSlot } from './effect-chain-Cu03O5Y0.js';
|
|
2
|
+
export { C as COMPATIBILITY_EFFECT_SLOT, E as Effect, a as EffectInstance, b as EffectNodes } from './effect-chain-Cu03O5Y0.js';
|
|
3
|
+
import { TickSourceOptions } from './tick.js';
|
|
4
|
+
import './parameter-DwQzFmBR.js';
|
|
5
|
+
|
|
6
|
+
interface InsertTransitionOptions {
|
|
7
|
+
/** Linear crossfade in audio seconds. Default 0.02; finite and nonnegative. */
|
|
8
|
+
readonly fadeSeconds?: number;
|
|
9
|
+
/** Stop feeding the outgoing graph, then fade its tail over this duration. Default 0. */
|
|
10
|
+
readonly tailSeconds?: number;
|
|
11
|
+
}
|
|
12
|
+
interface TransitionInsertChainOptions extends InsertChainOptions {
|
|
13
|
+
/** Maximum simultaneously retiring generations. Default 8; positive integer. */
|
|
14
|
+
readonly maxRetiring?: number;
|
|
15
|
+
readonly tick?: TickSourceOptions;
|
|
16
|
+
}
|
|
17
|
+
interface RetiringInsertChain {
|
|
18
|
+
readonly chain: InsertChain;
|
|
19
|
+
/** Absolute audio-context time; suspension does not consume the tail budget. */
|
|
20
|
+
readonly retireAt: number;
|
|
8
21
|
}
|
|
9
22
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
23
|
+
* Explicit whole-generation effect changes with stable external ports. Each
|
|
24
|
+
* replacement builds fresh owned circuits; parameter/CV/automation identities
|
|
25
|
+
* stay with their generation, and are never silently copied to its successor.
|
|
26
|
+
* Ordinary InsertChain edits retain their existing reuse and immediate-cut rules.
|
|
12
27
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
declare class TransitionInsertChain {
|
|
29
|
+
readonly context: BaseAudioContext;
|
|
30
|
+
private readonly options;
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly input: GainNode;
|
|
33
|
+
readonly output: GainNode;
|
|
34
|
+
private active;
|
|
35
|
+
private previous;
|
|
36
|
+
private ticker?;
|
|
37
|
+
private readonly maxRetiring;
|
|
38
|
+
private serial;
|
|
39
|
+
private graphRevision;
|
|
40
|
+
private ended;
|
|
41
|
+
private editing;
|
|
42
|
+
constructor(context: BaseAudioContext, options?: TransitionInsertChainOptions);
|
|
43
|
+
get current(): InsertChain;
|
|
44
|
+
get retiring(): readonly RetiringInsertChain[];
|
|
45
|
+
get revision(): number;
|
|
46
|
+
get disposed(): boolean;
|
|
47
|
+
replace(slots: readonly InsertSlot[], options?: InsertTransitionOptions): void;
|
|
48
|
+
/** Release expired generations; useful after deterministic offline rendering. */
|
|
49
|
+
collect(): void;
|
|
50
|
+
dispose(): void;
|
|
51
|
+
private build;
|
|
52
|
+
private reserved;
|
|
53
|
+
private ramp;
|
|
54
|
+
private restore;
|
|
55
|
+
private release;
|
|
56
|
+
private assertAlive;
|
|
57
|
+
private assertEditable;
|
|
58
|
+
private report;
|
|
17
59
|
}
|
|
18
60
|
|
|
19
|
-
export type
|
|
61
|
+
export { InsertChain, InsertChainOptions, InsertSlot, type InsertTransitionOptions, type RetiringInsertChain, TransitionInsertChain, type TransitionInsertChainOptions };
|
package/dist/effect.js
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
TransitionInsertChain
|
|
3
|
+
} from "./chunk-O7SA5GLC.js";
|
|
4
|
+
import {
|
|
5
|
+
COMPATIBILITY_EFFECT_SLOT,
|
|
6
|
+
InsertChain
|
|
7
|
+
} from "./chunk-3RR2VIKA.js";
|
|
8
|
+
import "./chunk-DVN6E5U3.js";
|
|
9
|
+
import "./chunk-FJLY3RWZ.js";
|
|
10
|
+
import "./chunk-QLF3BOST.js";
|
|
11
|
+
import "./chunk-PXG64RU4.js";
|
|
12
|
+
export {
|
|
13
|
+
COMPATIBILITY_EFFECT_SLOT,
|
|
14
|
+
InsertChain,
|
|
15
|
+
TransitionInsertChain
|
|
16
|
+
};
|
|
2
17
|
//# sourceMappingURL=effect.js.map
|
package/dist/elements.cjs
CHANGED
|
@@ -8,7 +8,26 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var _chunkL4MYCETMcjs = require('./chunk-L4MYCETM.cjs');
|
|
28
|
+
require('./chunk-XBSIYUHM.cjs');
|
|
29
|
+
require('./chunk-BADJJ6DV.cjs');
|
|
30
|
+
require('./chunk-EXDCK2VL.cjs');
|
|
12
31
|
require('./chunk-7ZTZZ5PN.cjs');
|
|
13
32
|
|
|
14
33
|
|
|
@@ -20,5 +39,21 @@ require('./chunk-7ZTZZ5PN.cjs');
|
|
|
20
39
|
|
|
21
40
|
|
|
22
41
|
|
|
23
|
-
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
exports.HTMLElementBase = _chunkL4MYCETMcjs.HTMLElementBase; exports.WebMusicElement = _chunkL4MYCETMcjs.WebMusicElement; exports.adoptHostRule = _chunkL4MYCETMcjs.adoptHostRule; exports.boolAttr = _chunkL4MYCETMcjs.boolAttr; exports.cssSizeAttr = _chunkL4MYCETMcjs.cssSizeAttr; exports.defineOnce = _chunkL4MYCETMcjs.defineOnce; exports.elementFitOf = _chunkL4MYCETMcjs.elementFitOf; exports.fitElementHeight = _chunkL4MYCETMcjs.fitElementHeight; exports.getModuleContextState = _chunkL4MYCETMcjs.getModuleContextState; exports.hasModuleContextBoundary = _chunkL4MYCETMcjs.hasModuleContextBoundary; exports.moduleOwner = _chunkL4MYCETMcjs.moduleOwner; exports.notifyModuleChange = _chunkL4MYCETMcjs.notifyModuleChange; exports.notifyModuleContext = _chunkL4MYCETMcjs.notifyModuleContext; exports.numAttr = _chunkL4MYCETMcjs.numAttr; exports.observeCompanionInput = _chunkL4MYCETMcjs.observeCompanionInput; exports.observeElementModule = _chunkL4MYCETMcjs.observeElementModule; exports.observeElementSource = _chunkL4MYCETMcjs.observeElementSource; exports.observeElementTarget = _chunkL4MYCETMcjs.observeElementTarget; exports.observeModuleContext = _chunkL4MYCETMcjs.observeModuleContext; exports.observeModuleInput = _chunkL4MYCETMcjs.observeModuleInput; exports.observeModuleTarget = _chunkL4MYCETMcjs.observeModuleTarget; exports.provideModuleContext = _chunkL4MYCETMcjs.provideModuleContext; exports.requestModuleContext = _chunkL4MYCETMcjs.requestModuleContext; exports.upgradeProperties = _chunkL4MYCETMcjs.upgradeProperties; exports.upgradeProperty = _chunkL4MYCETMcjs.upgradeProperty;
|
|
24
59
|
//# sourceMappingURL=elements.cjs.map
|
package/dist/elements.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users
|
|
1
|
+
{"version":3,"sources":["/private/tmp/claude-501/-Users-mamingchen-GitHub-public-WebMusic/77eac0d8-82c0-45c6-aba8-0cd73cfd2b1b/scratchpad/release-0.4.0/platform/kernel/dist/elements.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,0jDAAC","file":"/private/tmp/claude-501/-Users-mamingchen-GitHub-public-WebMusic/77eac0d8-82c0-45c6-aba8-0cd73cfd2b1b/scratchpad/release-0.4.0/platform/kernel/dist/elements.cjs"}
|
package/dist/elements.d.cts
CHANGED
|
@@ -1,4 +1,178 @@
|
|
|
1
|
+
import { w as ModuleHandle, V as SourcePort, Q as PortFamily, z as ModulePortMap, C as CapabilityKey, O as PortDirection, u as ModuleContext } from './context-DSa0ymyN.cjs';
|
|
2
|
+
import './tick.cjs';
|
|
3
|
+
import './session.cjs';
|
|
4
|
+
import './parameter-DwQzFmBR.cjs';
|
|
5
|
+
import './transport.cjs';
|
|
6
|
+
import './effect-chain-Do75T7uK.cjs';
|
|
7
|
+
|
|
8
|
+
type ElementTargetState = 'ready' | 'missing' | 'invalid' | 'ambiguous';
|
|
9
|
+
/**
|
|
10
|
+
* Observe one unique selector match in the host's own Document/ShadowRoot.
|
|
11
|
+
* The callback runs immediately and after target replacement or late upgrade.
|
|
12
|
+
* The caller owns the returned cleanup for the host's connected lifetime.
|
|
13
|
+
* A custom target replacing a non-reflected object property can dispatch
|
|
14
|
+
* `webmusic:sourcechange` to request a fresh connection to the same element.
|
|
15
|
+
*/
|
|
16
|
+
declare function observeElementTarget(host: Element, selector: string, listener: (target: Element | undefined, state: ElementTargetState) => void): () => void;
|
|
17
|
+
|
|
18
|
+
type ModuleContextState = 'ready' | 'pending' | 'missing';
|
|
19
|
+
/** Provide a pending boundary until read() returns a context. Disposal revokes only this provider. */
|
|
20
|
+
declare function provideModuleContext(host: Element, read: () => ModuleContext | undefined): () => void;
|
|
21
|
+
declare function requestModuleContext(host: Element): ModuleContext | undefined;
|
|
22
|
+
declare function getModuleContextState(host: Element): ModuleContextState;
|
|
23
|
+
declare function hasModuleContextBoundary(host: Element): boolean;
|
|
24
|
+
declare function notifyModuleContext(host: Element): void;
|
|
25
|
+
declare function notifyModuleChange(host: Element): void;
|
|
26
|
+
/**
|
|
27
|
+
* The Element that exposes `module` (DEC-094), through any source relays it
|
|
28
|
+
* stands behind: the one that announced it with `notifyModuleChange`, as long
|
|
29
|
+
* as that Element still exposes it. Undefined for a module no Element owns.
|
|
30
|
+
*/
|
|
31
|
+
declare function moduleOwner(module: ModuleHandle | undefined): Element | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Follow the `module` an Element exposes (DEC-094): `callback` runs with the
|
|
34
|
+
* current module now, then each time the Element's `module` is another one.
|
|
35
|
+
* An Element announces a new module with `webmusic:modulechange`, or a new
|
|
36
|
+
* scope that makes one with `webmusic:contextchange`; this hears both, from
|
|
37
|
+
* the Element and what it holds, and reports only a change of identity, so a
|
|
38
|
+
* host binds to it without listening for either itself. Returns the release
|
|
39
|
+
* function.
|
|
40
|
+
*/
|
|
41
|
+
declare function observeElementModule(element: Element, callback: (module: ModuleHandle | undefined) => void): () => void;
|
|
42
|
+
/** Discovery is synchronous; observations re-evaluate after provider changes, upgrades and layout moves. */
|
|
43
|
+
declare function observeModuleContext(host: Element, callback: (context: ModuleContext | undefined, state: ModuleContextState) => void): () => void;
|
|
44
|
+
/** Observe an explicit same-root selector's .module and its public capability invalidations. */
|
|
45
|
+
declare function observeModuleTarget(host: Element, selector: string, callback: (target: ModuleHandle | undefined) => void): () => void;
|
|
46
|
+
/** What an input-observing Element currently borrows. */
|
|
47
|
+
interface ModuleInputState<F extends PortFamily> {
|
|
48
|
+
readonly module?: ModuleHandle;
|
|
49
|
+
readonly port?: ModulePortMap[F];
|
|
50
|
+
readonly error?: unknown;
|
|
51
|
+
}
|
|
52
|
+
interface ObserveModuleInputOptions<F extends PortFamily> {
|
|
53
|
+
family: F;
|
|
54
|
+
direction?: PortDirection;
|
|
55
|
+
/** Port name when the host has no `port` attribute. */
|
|
56
|
+
port: string;
|
|
57
|
+
/** Explicit object binding: a module binds it, null unbinds, undefined discovers. */
|
|
58
|
+
assigned?: ModuleHandle | null;
|
|
59
|
+
/** Host-level generation guard; a false result stops the observation. */
|
|
60
|
+
isCurrent?: () => boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the module an Element consumes — explicit object, then the `input`
|
|
64
|
+
* selector, then the nearest provider's target — and the named port of one
|
|
65
|
+
* family on it. `update` runs when the module or the port identity changes,
|
|
66
|
+
* including when a port detaches. The caller owns whatever it builds on the
|
|
67
|
+
* port (a tap, a subscription); this observation owns only its discovery.
|
|
68
|
+
*/
|
|
69
|
+
declare function observeModuleInput<F extends PortFamily>(host: Element, options: ObserveModuleInputOptions<F>, update: (state: ModuleInputState<F>) => void): () => void;
|
|
70
|
+
/** What a companion (a view or analysis that borrows a player) currently follows. */
|
|
71
|
+
interface CompanionInput {
|
|
72
|
+
/** Owner element: the `input` selector's target, or the owner a provider lends by containment. */
|
|
73
|
+
readonly element?: Element;
|
|
74
|
+
/** Module whose named source port is followed (explicit object or a `port` attribute). */
|
|
75
|
+
readonly module?: ModuleHandle;
|
|
76
|
+
/** The resolved source port, once its module publishes it. */
|
|
77
|
+
readonly port?: SourcePort<unknown>;
|
|
78
|
+
/** `pending`: a module was found but has not published the port yet. */
|
|
79
|
+
readonly state: ElementTargetState | 'pending';
|
|
80
|
+
readonly error?: unknown;
|
|
81
|
+
}
|
|
82
|
+
interface ObserveCompanionInputOptions {
|
|
83
|
+
/** Capability a provider scope lends to companions found by containment. */
|
|
84
|
+
readonly capability: CapabilityKey<unknown>;
|
|
85
|
+
/** Explicit object binding: a module binds its source port, null unbinds, undefined discovers. */
|
|
86
|
+
readonly assigned?: ModuleHandle | null;
|
|
87
|
+
/** Schema the followed source port must publish. */
|
|
88
|
+
readonly schemaId?: string;
|
|
89
|
+
/** Source port name when the host has no `port` attribute. */
|
|
90
|
+
readonly port?: string;
|
|
91
|
+
/** False when the host's `port` attribute names another family (an audio tap), so it never selects the source path. */
|
|
92
|
+
readonly portAttribute?: boolean;
|
|
93
|
+
readonly isCurrent?: () => boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolve what a companion follows, in the DEC-068 order: an explicit module
|
|
97
|
+
* (its named source port), then the `input` selector, then the owner the
|
|
98
|
+
* nearest provider lends. A `port` attribute selects the module path for a
|
|
99
|
+
* selector or containment too: the companion follows that module's source
|
|
100
|
+
* port instead of the owner element. Only discovery is owned here.
|
|
101
|
+
*/
|
|
102
|
+
declare function observeCompanionInput(host: Element, options: ObserveCompanionInputOptions, update: (input: CompanionInput) => void): () => void;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Give an Element's tag a default style the page can override (DEC-094): one
|
|
106
|
+
* rule per `key` in the root the Element is in — prepended to the document's
|
|
107
|
+
* head, or to the shadow root — written with the tag as a `:where()`
|
|
108
|
+
* selector so it has no specificity. This is what an inline style cannot
|
|
109
|
+
* be: a page's rule, the `hidden` attribute and a host's own inline style
|
|
110
|
+
* all still win. `rule` receives the escaped tag name and returns the CSS.
|
|
111
|
+
* A rule a page removed is added again. Returns whether this call added it.
|
|
112
|
+
*/
|
|
113
|
+
declare function adoptHostRule(element: Element, key: string, rule: (selector: string) => string): boolean;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* How an Element is made as tall as the box a host gives it (DEC-094). An
|
|
117
|
+
* Element that draws on a surface whose height it chooses declares one as
|
|
118
|
+
* the static `hostFit` of its class; a host applies it with
|
|
119
|
+
* {@link fitElementHeight} and needs to know nothing else about the Element.
|
|
120
|
+
*/
|
|
121
|
+
type ElementHeightFit =
|
|
122
|
+
/** A height token on the Element sizes `surface`, measured inside `content`: both are selectors in its shadow root, or in the Element. */
|
|
123
|
+
{
|
|
124
|
+
readonly kind: 'token';
|
|
125
|
+
readonly property: string;
|
|
126
|
+
readonly content: string;
|
|
127
|
+
readonly surface: string;
|
|
128
|
+
readonly least: number;
|
|
129
|
+
}
|
|
130
|
+
/** The Element's `height` attribute, in CSS pixels; `content`, when given, is measured to find what its tools take. */
|
|
131
|
+
| {
|
|
132
|
+
readonly kind: 'attribute';
|
|
133
|
+
readonly least: number;
|
|
134
|
+
readonly content?: string;
|
|
135
|
+
};
|
|
136
|
+
interface ElementFitOptions {
|
|
137
|
+
/** The fit to apply instead of the one the Element's class declares. */
|
|
138
|
+
readonly fit?: ElementHeightFit;
|
|
139
|
+
/**
|
|
140
|
+
* What the Element's height goes back to when the fit is released: the
|
|
141
|
+
* `height` attribute's value, or the token's, and `null` to remove it.
|
|
142
|
+
* `initial` is what it was when fitting began, which is the default.
|
|
143
|
+
*/
|
|
144
|
+
readonly restore?: (initial: string | null) => string | null;
|
|
145
|
+
/**
|
|
146
|
+
* Show all of the Element in a box too small for it (DEC-099). When the
|
|
147
|
+
* Element cannot be laid out as small as its box — its drawing is at its
|
|
148
|
+
* least height, it declares no fit and is taller than the box, or what it
|
|
149
|
+
* holds is wider than the box — it is laid out as large as it needs, in the
|
|
150
|
+
* box's proportions, and scaled down to the box, so nothing is cut off and
|
|
151
|
+
* nothing has to be scrolled into view. The fit then owns the Element's
|
|
152
|
+
* inline `width`, `height`, `transform` and `transform-origin` as well, and
|
|
153
|
+
* gives them back when released. With it, an Element that declares no fit
|
|
154
|
+
* is fitted too. Default false: the Element is left to its box's overflow.
|
|
155
|
+
*/
|
|
156
|
+
readonly contain?: boolean;
|
|
157
|
+
}
|
|
158
|
+
/** The fit an Element's class declares as its static `hostFit`, if it is a well-formed one. */
|
|
159
|
+
declare function elementFitOf(element: Element): ElementHeightFit | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Make an Element as tall as its box (DEC-094): the part that draws takes
|
|
162
|
+
* the height its tools and readouts leave, and follows the box when it is
|
|
163
|
+
* resized. The Element must already be inside `box`, by default its parent,
|
|
164
|
+
* which sets its width and has a height of its own. An Element that declares
|
|
165
|
+
* no fit, and is given none, keeps its own height. With `contain`, an
|
|
166
|
+
* Element that cannot be as small as its box is scaled down to it (DEC-099).
|
|
167
|
+
* Returns the release function, which gives the Element its own height back.
|
|
168
|
+
*
|
|
169
|
+
* The caller owns the release; the fit owns the Element's `height` attribute
|
|
170
|
+
* or height token until then, so nothing else should write it meanwhile.
|
|
171
|
+
*/
|
|
172
|
+
declare function fitElementHeight(element: HTMLElement, box?: HTMLElement | null, options?: ElementFitOptions): () => void;
|
|
173
|
+
|
|
1
174
|
declare const HTMLElementBase: typeof HTMLElement;
|
|
175
|
+
|
|
2
176
|
/** Cleanup owned by one connected lifetime of a {@link WebMusicElement}. */
|
|
3
177
|
type ElementCleanup = () => void;
|
|
4
178
|
/**
|
|
@@ -63,14 +237,29 @@ declare function boolAttr(el: Element, name: string, fallback?: boolean): boolea
|
|
|
63
237
|
declare function cssSizeAttr(el: Element, name: string): string | undefined;
|
|
64
238
|
/** Register `ctor` at `tag` once; a no-op outside the browser or if taken. */
|
|
65
239
|
declare function defineOnce(tag: string, ctor: CustomElementConstructor): void;
|
|
66
|
-
|
|
240
|
+
|
|
241
|
+
/** A selected element may exist before its non-reflected source is available. */
|
|
242
|
+
type ElementSourceState = ElementTargetState | 'unavailable';
|
|
243
|
+
interface ElementSourceOptions<T> {
|
|
244
|
+
/** An explicit value takes precedence. Only undefined enables selector lookup. */
|
|
245
|
+
readonly source?: unknown;
|
|
246
|
+
readonly selector?: string;
|
|
247
|
+
readonly property: string;
|
|
248
|
+
/** Domain validation belongs to the consumer; Kernel has no domain types. */
|
|
249
|
+
readonly accepts: (value: unknown) => value is T;
|
|
250
|
+
}
|
|
251
|
+
interface ElementSourceResolution<T> {
|
|
252
|
+
readonly state: ElementSourceState;
|
|
253
|
+
readonly source?: T;
|
|
254
|
+
readonly target?: Element;
|
|
255
|
+
readonly error?: unknown;
|
|
256
|
+
}
|
|
67
257
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* `webmusic:sourcechange` to request a fresh connection to the same element.
|
|
258
|
+
* Resolve an explicit source or a selected element's public object property.
|
|
259
|
+
* Captures one configuration; dispose and rebind when that configuration changes.
|
|
260
|
+
* Does not subscribe to, own, or dispose the borrowed domain source. Source
|
|
261
|
+
* changes on the same target use the existing webmusic:sourcechange protocol.
|
|
73
262
|
*/
|
|
74
|
-
declare function
|
|
263
|
+
declare function observeElementSource<T>(host: Element, options: ElementSourceOptions<T>, listener: (resolution: ElementSourceResolution<T>) => void): () => void;
|
|
75
264
|
|
|
76
|
-
export { type ElementCleanup, type ElementTargetState, HTMLElementBase, WebMusicElement, boolAttr, cssSizeAttr, defineOnce, numAttr, observeElementTarget, upgradeProperties, upgradeProperty };
|
|
265
|
+
export { type CompanionInput, type ElementCleanup, type ElementFitOptions, type ElementHeightFit, type ElementSourceOptions, type ElementSourceResolution, type ElementSourceState, type ElementTargetState, HTMLElementBase, type ModuleContextState, type ModuleInputState, type ObserveCompanionInputOptions, type ObserveModuleInputOptions, WebMusicElement, adoptHostRule, boolAttr, cssSizeAttr, defineOnce, elementFitOf, fitElementHeight, getModuleContextState, hasModuleContextBoundary, moduleOwner, notifyModuleChange, notifyModuleContext, numAttr, observeCompanionInput, observeElementModule, observeElementSource, observeElementTarget, observeModuleContext, observeModuleInput, observeModuleTarget, provideModuleContext, requestModuleContext, upgradeProperties, upgradeProperty };
|