import type { MountedCallback } from "../lifecycle"; import type { Molecule, MoleculeConstructor, MoleculeInterface, } from "../molecule"; import type { MoleculeScope } from "../scope"; import type { ScopeTuple } from "../types"; import { GetterSymbol, MoleculeInterfaceSymbol, MoleculeSymbol, TypeSymbol, GlobalScopeSymbol, type TypeInferSymbol, } from "./symbols"; /** * The value stored in the molecule cache */ export type MoleculeCacheValue = { deps: Deps; value: unknown; isMounted: boolean; path: (AnyScopeTuple | AnyMolecule)[]; instanceId: symbol; }; type Deps = { allScopes: Set; defaultScopes: Set; mountedCallbacks: Set; // Dependencies buddies: MoleculeCacheValue[]; }; export type { ScopeTuple, BindingTuple, BindingTuples, BindingMap, Bindings, Injectable, } from "../types"; export type AnyMoleculeScope = MoleculeScope; export type AnyScopeTuple = ScopeTuple; export type AnyMolecule = Molecule; export type AnyMoleculeInterface = MoleculeInterface; export type MoleculeInternal = { [GetterSymbol]: MoleculeConstructor; [TypeSymbol]: typeof MoleculeSymbol; [GlobalScopeSymbol]?: MoleculeScope; [TypeInferSymbol]?: T; displayName?: string; }; export type MoleculeInterfaceInternal = { [TypeSymbol]: typeof MoleculeInterfaceSymbol; [TypeInferSymbol]?: T; displayName?: string; };