@@ -11,7 +11,7 @@ import { QueryableRdfSource } from './rdfjs-support';
1111import { Consumable , each , flow , Flowable } from 'rx-flowable' ;
1212import { Future , tapComplete } from './engine/util' ;
1313import { MeldMessageType } from './ns/m-ld' ;
14- import { MeldApp , MeldConfig } from './config' ;
14+ import { MeldApp } from './config' ;
1515
1616/**
1717 * A convenience type for a struct with a `@insert` and `@delete` property, like
@@ -433,6 +433,32 @@ export interface MeldClone extends MeldStateMachine {
433433 close ( err ?: any ) : Promise < unknown > ;
434434}
435435
436+ /**
437+ * Some component of type `T` that is loaded from domain state. The current
438+ * value may change as the domain evolves; and may also be temporarily
439+ * unavailable during an update.
440+ * @internal
441+ */
442+ export interface StateManaged < T > {
443+ /**
444+ * Get the current or next available value, ready for use (or a rejection,
445+ * e.g. if the clone is shutting down).
446+ */
447+ ready ( ) : Promise < T > ;
448+ /**
449+ * Initialises the extensions against the given clone state. This method could
450+ * be used to read significant state into memory for the efficient
451+ * implementation of an extension's function.
452+ */
453+ readonly initialise ?: StateProc ;
454+ /**
455+ * Called to inform the extensions of an update to the state, _after_ it has
456+ * been applied. If available, this procedure will be called for every state
457+ * after that passed to {@link initialise}.
458+ */
459+ readonly onUpdate ?: UpdateProc < MeldPreUpdate > ;
460+ }
461+
436462/**
437463 * Extensions applied to a **m-ld** clone.
438464 *
@@ -444,9 +470,6 @@ export interface MeldClone extends MeldStateMachine {
444470 * to prevent outdated clones from acting incorrectly in ways that could cause
445471 * data corruption or compromise security. Consult the extension's documentation
446472 * for safe operation.
447- *
448- * @experimental
449- * @category Experimental
450473 */
451474export interface MeldExtensions {
452475 /**
@@ -470,25 +493,6 @@ export interface MeldExtensions {
470493 * @experimental
471494 */
472495 readonly transportSecurity ?: MeldTransportSecurity ;
473- /**
474- * Initialises the extensions against the given clone state. This method could
475- * be used to read significant state into memory for the efficient
476- * implementation of an extension's function.
477- */
478- readonly initialise ?: StateProc ;
479- /**
480- * Called to inform the extensions of an update to the state, _after_ it has
481- * been applied. If available, this procedure will be called for every state
482- * after that passed to {@link initialise}.
483- */
484- readonly onUpdate ?: UpdateProc < MeldPreUpdate > ;
485- }
486-
487- /**
488- * Required constructor form for **m-ld** extension classes
489- */
490- export interface ConstructMeldExtensions {
491- new ( config : MeldConfig , app : MeldApp ) : MeldExtensions ;
492496}
493497
494498/**
0 commit comments