import { Vain } from './vain'; /****************************************************************************************************** * Metas * * Vacuo -> A value that can serve as the value (for Datar, or transformation for Mutator) * of Datar and Mutator at the same time. * * Void -> Void's role in Atom world is same as undefined & null 's role in normal JavaScript world. * It is designed to replace values that can be converted to false, such as undefined & null. * So falsy values can flowing through the Atoms as normal values flowing. * For the typical usages, please check nilToVoidT & defaultT. * * Pausor -> Pausor is designed as a signal for "stop" of Atom Flow. * Data or Mutation receives Pausor will update there own value (or transformation), * but will not pass the updated value to the next Atom. * * Terminator -> Terminator is designed as a signal for "interruption" of Atom Flow. * Mutation will not mutate (trigger an transformation to update the downstream data's value) * a Data or Datar which value is Terminator. * Data will not mutate (update own value to income transformation's result) a Mutation or Mutator or Transformation * which result is Terminator. * For the typical usages, please check filterT or skipT or takeT. ******************************************************************************************************/ /** * Number of signal is finite. Using a `enum` to group them is reasonable. */ export declare enum MetaType { Vacuo = "[meta Vacuo]", Void = "[meta Void]", Pausor = "[meta Pausor]", Terminator = "[meta Terminator]" } /****************************************************************************************************** * * Meta Predicatess * ******************************************************************************************************/ /** * @param target anything * @return { boolean } whether the target is Meta instance */ export declare const isMeta: (target: any) => target is Meta; /** * @param target anything * @return { boolean } whether the targe is a Vacuo instance */ export declare const isVacuo: (target: any) => target is Vacuo; /** * @param target anything * @return { boolean } whether the target is a Void instance */ export declare const isVoid: (target: any) => target is Void; /** * @param target anything * @return { boolean } whether the target is a Pausor instance */ export declare const isPausor: (target: any) => target is Pausor; /** * @param target anything * @return { boolean } whether the target is a Terminator instance */ export declare const isTerminator: (target: any) => target is Terminator; /****************************************************************************************************** * * Meta Classes * ******************************************************************************************************/ /** * Base meta class. */ export declare abstract class Meta extends Vain { isMeta: true; constructor(); abstract get metaType(): MetaType; } export declare type OrMeta = T | Meta; export declare type ExcludeMeta = Exclude; /** *—————————————————————————————————————————————— Vacuo Meta ———————————————————————————————————————————————————— */ /** * A value that can serve as the value (for Datar, or transformation for Mutator) * of Datar and Mutator at the same time. * Base on feature of "JavaScript Function is also an Object", * Vacuo can be both Datar's and Mutator's value, * says Empty Datar and Empty Mutator respectively. * * Content security policy compatible version of Vacuo. * The "class Vacuo extends Function" syntax can not use in strict browsers. * reference: https://developer.chrome.com/docs/apps/contentSecurityPolicy/ */ export declare type Vacuo = ((...args: any[]) => Vacuo) & { __type__: 'Vacuo'; } & Meta; export declare const makeVacuo: () => Vacuo; /** * Global Vacuo instance. * @see {@link makeVacuo} */ export declare const VACUO: Vacuo; /** *—————————————————————————————————————————————— Void Meta ———————————————————————————————————————————————————— */ /** * Void's role in Atom world is same as undefined & null 's role in normal JavaScript world. * It is designed to replace values that can be converted to false, such as undefined & null. * So falsy values can flowing through the Atoms as normal values flowing. * For the typical usages, please check nilToVoidT & defaultT. */ export declare class Void extends Meta { isVoid: true; isFalsy: true; constructor(); get type(): MetaType; get metaType(): MetaType; } /** * Global Void instance. * @see {@link Void} */ export declare const VOID: Void; /** *—————————————————————————————————————————————— Pausor Meta ———————————————————————————————————————————————————— */ /** * Pausor is designed as a signal for "stop" of Atom Flow. * Data or Mutation receives Pausor will update there own value (or transformation), * but will not pass the updated value to the next Atom. */ export declare class Pausor extends Meta { isPausor: true; constructor(); get type(): MetaType; get metaType(): MetaType; } /** * Global Pausor instance. * @see {@link Pausor} */ export declare const PAUSOR: Pausor; /** *—————————————————————————————————————————————— Terminator Meta ———————————————————————————————————————————————————— */ /** * Terminator is designed as a signal for "interruption" of Atom Flow. * Mutation will not mutate (trigger an transformation to update the downstream data's value) * a Data or Datar which value is Terminator. * Data will not mutate (update own value to income transformation's result) a Mutation or Mutator or Transformation * which result is Terminator. * For the typical usages, please check filterT or skipT or takeT. */ export declare class Terminator extends Meta { isTerminator: true; constructor(); get type(): MetaType; get metaType(): MetaType; } /** * Global Terminator instance. * @see {@link Terminator} */ export declare const TERMINATOR: Terminator; //# sourceMappingURL=metas.d.ts.map