import { Vain } from '../vain'; import { AnyStringRecord } from '../../@types'; import type { Particle, Datar, Mutator, MutatorTransformation } from '../particles'; import type { AtomType, Trigger, AtomTriggerRegisterOptions, TriggerController, AtomLike, BaseAtom, DataLike, MutationLike, DataOptions, MutationOptions, SubscribeOptions, ValueConsumer, DatarConsumer, DataConsumer, DataSubscription, TransformationConsumer, MutatorConsumer, MutationConsumer, MutationSubscription } from '../atoms'; /****************************************************************************************************** * * Mediator Predicatess * ******************************************************************************************************/ /** * @param tar anything * @return whether the target is an Mediator instance */ export declare const isMediator: (tar: any) => tar is BaseMediator; /** * @param tar anything * @return whether the target is an Data Mediator instance */ export declare const isDataMediator: (tar: any) => tar is DataMediator; /** * @param tar anything * @return whether the target is an Mutation Mediator instance */ export declare const isMutationMediator:

(tar: any) => tar is MutationMediator; /****************************************************************************************************** * * Mediator Classes * ******************************************************************************************************/ /** * */ declare type Unary = (input: I) => O; /** * */ interface _MediatorTypeSymbol /** private */ { _type: 'MediatorType'; } export declare type MediatorTypeMaker = T & _MediatorTypeSymbol; export declare type MediatorType = string & _MediatorTypeSymbol; /** * */ export declare abstract class BaseMediator extends Vain { _atom: A; constructor(atom: A); /****************************************************************************************************** * Mediator's propertys and methods ******************************************************************************************************/ /** * */ get isMediator(): true; abstract get mediatorType(): MediatorType; /****************************************************************************************************** * Atom's propertys and methods ******************************************************************************************************/ /** * */ get atom(): A; get atomType(): AtomType; get particleName(): string; get particle(): Particle; get metaName(): string; get meta(): any; get options(): AnyStringRecord; get isAtom(): boolean; get isData(): boolean; get isMutation(): boolean; get isEmpty(): boolean; pipe(): this; pipe(fn1: Unary): A; pipe(fn1: Unary, fn2: Unary): B; pipe(fn1: Unary, fn2: Unary, fn3: Unary): C; pipe(fn1: Unary, fn2: Unary, fn3: Unary, fn4: Unary): D; pipe(fn1: Unary, fn2: Unary, fn3: Unary, fn4: Unary, fn5: Unary): E; pipe(fn1: Unary, fn2: Unary, fn3: Unary, fn4: Unary, fn5: Unary, fn6: Unary): F; pipe(fn1: Unary, fn2: Unary, fn3: Unary, fn4: Unary, fn5: Unary, fn6: Unary, fn7: Unary): G; pipe(fn1: Unary, fn2: Unary, fn3: Unary, fn4: Unary, fn5: Unary, fn6: Unary, fn7: Unary, fn8: Unary): H; pipe(fn1: Unary, fn2: Unary, fn3: Unary, fn4: Unary, fn5: Unary, fn6: Unary, fn7: Unary, fn8: Unary, fn9: Unary): I; pipe(fn1: Unary, fn2: Unary, fn3: Unary, fn4: Unary, fn5: Unary, fn6: Unary, fn7: Unary, fn8: Unary, fn9: Unary, fn10: Unary): J; pipe(fn1: Unary, fn2: Unary, fn3: Unary, fn4: Unary, fn5: Unary, fn6: Unary, fn7: Unary, fn8: Unary, fn9: Unary, fn10: Unary, ...fns: Array>): any; compose(): this; compose(fn1: Unary): A; compose(fn2: Unary, fn1: Unary): B; compose(fn3: Unary, fn2: Unary, fn1: Unary): C; compose(fn4: Unary, fn3: Unary, fn2: Unary, fn1: Unary): D; compose(fn5: Unary, fn4: Unary, fn3: Unary, fn2: Unary, fn1: Unary): E; compose(fn6: Unary, fn5: Unary, fn4: Unary, fn3: Unary, fn2: Unary, fn1: Unary): F; compose(fn7: Unary, fn6: Unary, fn5: Unary, fn4: Unary, fn3: Unary, fn2: Unary, fn1: Unary): G; compose(fn8: Unary, fn7: Unary, fn6: Unary, fn5: Unary, fn4: Unary, fn3: Unary, fn2: Unary, fn1: Unary): H; compose(fn9: Unary, fn8: Unary, fn7: Unary, fn6: Unary, fn5: Unary, fn4: Unary, fn3: Unary, fn2: Unary, fn1: Unary): I; compose(fn10: Unary, fn9: Unary, fn8: Unary, fn7: Unary, fn6: Unary, fn5: Unary, fn4: Unary, fn3: Unary, fn2: Unary, fn1: Unary): J; release(): void; } /****************************************************************************************************** * * DataMediator * ******************************************************************************************************/ /** * */ export declare abstract class DataMediator extends BaseMediator> implements AtomLike { setOptions(key: K, value: Required[K]): void; get datar(): Datar; get value(): V; subscribe(consumer: DatarConsumer): DataSubscription; subscribe(consumer: DatarConsumer, options: SubscribeOptions & { isExtracted: false; }): DataSubscription; subscribe(consumer: ValueConsumer, options: SubscribeOptions & { isExtracted: true; }): DataSubscription; subscribe(consumer: DataConsumer, options?: SubscribeOptions): DataSubscription; subscribeValue(consumer: ValueConsumer, options?: SubscribeOptions): DataSubscription; getSubscriptionByConsumer(consumer: DataConsumer): DataSubscription | undefined; getSubscriptionByHostAtom(hostAtom: AtomLike): DataSubscription | undefined; getSubscription(consumerOrHostAtom: DataConsumer | AtomLike): DataSubscription | undefined; unsubscribe(target: DataConsumer | DataSubscription | AtomLike): boolean; unsubscribeAll(): boolean; trigger(datar?: Datar): void; triggerValue(value?: Datar['value']): void; observe(mutation: MutationLike): MutationSubscription; unobserve(mutation: MutationLike): boolean; unobserveAll(): boolean; beObservedBy(mutation: MutationLike): DataSubscription; mutate

(mutator: MutationLike | Mutator | MutatorTransformation | ((...args: any[]) => V), mutation?: MutationLike): this; registerTrigger(trigger: Trigger>, options?: AtomTriggerRegisterOptions): TriggerController; release(): void; } /****************************************************************************************************** * * MutationMediator * ******************************************************************************************************/ /** * */ export declare abstract class MutationMediator

extends BaseMediator> implements AtomLike { setOptions(key: K, value: Required[K]): void; get mutator(): Mutator; get transformation(): MutatorTransformation; subscribe(consumer: MutatorConsumer): MutationSubscription; subscribe(consumer: MutatorConsumer, options: SubscribeOptions & { isExtracted: false; }): MutationSubscription; subscribe(consumer: TransformationConsumer, options: SubscribeOptions & { isExtracted: true; }): MutationSubscription; subscribe(consumer: MutationConsumer, options?: SubscribeOptions): MutationSubscription; subscribeTransformation(consumer: TransformationConsumer, options?: SubscribeOptions): MutationSubscription; trigger(mutator?: Mutator): void; triggerTransformation(transformation?: Mutator['transformation']): void; getSubscriptionByConsumer(consumer: MutationConsumer): MutationSubscription | undefined; getSubscriptionByHostAtom(hostAtom: AtomLike): MutationSubscription | undefined; getSubscription(consumerOrHostAtom: MutationConsumer | AtomLike): MutationSubscription | undefined; unsubscribe(target: MutationConsumer | MutationSubscription | AtomLike): boolean; unsubscribeAll(): boolean; observe(data: DataLike

): DataSubscription

; unobserve(data: DataLike

): boolean; unobserveAll(): boolean; beObservedBy(data: DataLike): MutationSubscription; mutate(datar: DataLike

| Datar

| P, data?: DataLike

): this; registerTrigger(trigger: Trigger | ((...args: any[]) => C) | C>, options?: AtomTriggerRegisterOptions): TriggerController; release(): void; } export {}; //# sourceMappingURL=base.mediators.d.ts.map