import { Each, RootStore, decomposeCompound, simpleCompound } from "atom.io/internal"; import { primitive } from "atom.io/foundations/json"; import { OList } from "atom.io/transceivers/o-list"; import { UList } from "atom.io/transceivers/u-list"; import { AtomEffect, TransactionToken } from "atom.io"; import { Canonical } from "atom.io/foundations/canonical"; //#region src/experiments/realms/o-list-disposed-key-cleanup-effect.d.ts declare function filterOutInPlace(arr: T[], toRemove: T): T[]; declare const oListDisposedKeyCleanupEffect: AtomEffect>; //#endregion //#region src/experiments/realms/realm.d.ts declare const $validatedKey: unique symbol; type ValidKey = K & { [$validatedKey]?: true; }; declare class Realm { store: RootStore; deallocateTX: TransactionToken<(claim: ValidKey>) => void>; claimTX: TransactionToken<, CompoundTypedKey>, A extends Above>(newProvenance: A, claim: ValidKey, exclusive?: `exclusive`) => void>; /** * @param store - The store to which the realm will be attached */ constructor(store?: RootStore); /** * Make space for a new subject of the realm * @param provenance - A key for an owner {@link Above} the new subject in the realm's {@link Hierarchy} * @param key - A unique identifier for the new subject * @param attachmentStyle - The attachment style of new subject to its owner(s). `any` means that if any owners remain, the subject will be retained. `all` means that the subject be retained only if all owners remain . * @returns * The subject's key, given status as a true {@link ValidKey} */ allocate, A extends Above>(provenance: A, key: V, attachmentStyle?: `all` | `any`): ValidKey; /** * Fuse two reagents into a compound * @param type - the name of the compound that is being fused * @param reagentA - the left reagent of the compound * @param reagentB - the right reagent of the compound * @returns * The compound's key, given status as a {@link ValidKey} */ fuse, T extends (C extends CompoundTypedKey ? t : never), A extends (C extends CompoundTypedKey ? v : never), B extends (C extends CompoundTypedKey ? m : never)>(type: T, reagentA: SingularTypedKey, reagentB: SingularTypedKey): ValidKey>; /** * Remove a subject from the realm * @param claim - The subject to be deallocated */ deallocate>(claim: ValidKey): void; /** * Transfer a subject of the realm from one owner to another * @param newProvenance - A key for an owner {@link Above} the new subject in the realm's {@link Hierarchy} * @param claim - The subject to be claimed * @param exclusive - Whether the subjects previous owners should be detached from it * @returns * The subject's key, given status as a true {@link ValidKey} */ claim, CompoundTypedKey>, A extends Above>(newProvenance: A, claim: ValidKey, exclusive?: `exclusive`): void; } declare class Anarchy { store: RootStore; deallocateTX: TransactionToken<(key: Canonical) => void>; claimTX: TransactionToken<(newProvenance: Canonical, key: Canonical, exclusive?: `exclusive`) => void>; /** * @param store - The store to which the anarchy-realm will be attached */ constructor(store?: RootStore); /** * Declare a new entity * @param provenance - A key for an owner of the entity * @param key - A unique identifier for the new entity * @param attachmentStyle - The attachment style of new entity to its owner(s). `any` means that if any owners remain, the subject will be retained. `all` means that the subject be retained only if all owners remain . */ allocate(provenance: Canonical, key: Canonical, attachmentStyle?: `all` | `any`): void; /** * Remove an entity * @param key - The entity to be deallocated */ deallocate(key: Canonical): void; /** * Transfer an entity from one owner to another * @param newProvenance - A key for an owner of the entity * @param key - The entity to be claimed * @param exclusive - Whether the entity's previous owners should be detached from it */ claim(newProvenance: Canonical, key: Canonical, exclusive?: `exclusive`): void; /** * Fuse two reagents into a compound * @param type - the name of the compound that is being fused * @param reagentA - the left reagent of the compound * @param reagentB - the right reagent of the compound * @returns * The compound's key, given status as a {@link ValidKey} */ fuse(type: T, reagentA: SingularTypedKey, reagentB: SingularTypedKey): ValidKey>; } type T$ = `T$`; type TypeTag = `${T$}--${T}`; type SingularTypedKey = `${T}::${string}`; type CompoundTypedKey = `${TypeTag}==${SingularTypedKey}++${SingularTypedKey}`; type TypedKey = CompoundTypedKey | SingularTypedKey; type Scope = SingularTypedKey[]; type MutualFealty = { above: Scope; below: CompoundTypedKey; }; type ExclusiveFealty = { above: TypedKey | `root`; below: Scope; }; type Fealty = ExclusiveFealty | MutualFealty; type Hierarchy = Each; type Vassal = { [K in keyof H]: H[K] extends MutualFealty ? H[K][`below`] : H[K] extends { below: Array; } ? V extends TypedKey ? V : never : never; }[keyof H]; type Above = { [K in keyof H]: H[K] extends MutualFealty ? TK extends H[K][`below`] ? H[K][`above`] : never : H[K] extends { below: Array; } ? TK extends V ? H[K] extends ExclusiveFealty ? H[K][`above`] : never : never : never; }[keyof H]; type Below = { [K in keyof H]: H[K] extends MutualFealty ? TK extends H[K][`above`] ? H[K][`below`] : TK extends H[K][`above`][number] ? H[K][`below`] : never : H[K] extends { above: infer V; } ? TK extends V ? H[K] extends ExclusiveFealty ? H[K][`below`][number] : never : never : never; }[keyof H]; type Mutuals = { [K in keyof H]: H[K] extends MutualFealty ? TK extends H[K][`above`][number] ? [mutual: Exclude, below: H[K][`below`]] : never : never; }[keyof H]; type CompoundFrom = { [K in keyof H]: H[K] extends MutualFealty ? H[K][`below`] : never; }[keyof H]; //#endregion //#region src/experiments/realms/u-list-disposed-key-cleanup-effect.d.ts declare const uListDisposedKeyCleanupEffect: AtomEffect>; //#endregion export { $validatedKey, Above, Anarchy, Below, CompoundFrom, CompoundTypedKey, Hierarchy, Mutuals, Realm, SingularTypedKey, T$, TypeTag, TypedKey, ValidKey, Vassal, decomposeCompound, filterOutInPlace, oListDisposedKeyCleanupEffect, simpleCompound, uListDisposedKeyCleanupEffect }; //# sourceMappingURL=index.d.ts.map