Predicate whether the target is undefined.
Predicate whether the target is null.
Predicate whether the target is null | undefined.
Predicate whether the target is never.
Predicate whether the target is any.
Predicate whether the target is boolean.
Predicate whether the target is string.
Predicate whether the target is number.
Predicate whether the target is symbol.
Predicate whether the target is of type function.
Predicate whether the target is Union type.
Predicate whether the target is Array.
Predicate whether the target is Tuple.
Predicate whether the target is Array or Tuple.
Predicate whether the target is Record.
Extracts the predicate of a guarded function
Checks if type T has the specified type U.
Checks if type T does not have the specified type U.
Strict version of Omit, K must be subset of typeof T.
Given a type { a?: string, b: number }, return { a: string, b?: number }.
ObjectValues
ObjectValues
FunctionKeys
NonFunctionKeys
ReadonlyKeys
WritableKeys
RequiredKeys
OptionalKeys
PickKeysByValue
PickByValue
PickKeysByValue
PickByValueExact
OmitByValue
OmitByValueExact
ObjectIntersection
ObjectDifference
ObjectComplement
ObjectSymmetricDifference
ObjectOverwrite
ObjectAssign
Alias for ObjectAssign, defined for semantic of ObjectMergeN.
ObjectUnionize
If the Target is an empty Record/Object, then return never.
ObjectNamedKeys
Brand
Strict version of builtin Extract, U must be subset of T.
Strict version of builtin Exclude, U must be subset of T.
SetIntersection (same as Extract)
SetDifference (same as Exclude)
SetComplement
SetSymmetricDifference
UnionToIntersection
AtomLike that can take any as input and any as output.
AtomLike that can take I as input.
AtomLike that can emit O as output.
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/
The type of acceptNonAtom
The type of acceptNonAtom
Target will be considered AtomLike when its isAtom property is true, etc. Data, Mutation, DataMediator, MutationMediator.
Target will be considered MutationLike when its isMutation property is true, etc. Mutation or MutationMediator.
anything
whether the target is an Atom instance
DriverFactory :: (options?: {}) => { inputs: object, outputs: object }
A simple copy of the driver instance, plainobject has inputs, outputs or others.
If target is an Atom instance or Mediator instance, return its atomType, otherwise return undefined.
anything
Check whether the given targets are both Atom instance and in same Atom type.
whether the given targets are in same type of Atom.
Curried version of isSameTypeOfAtom.
Curried version of isSameTypeOfAtom.
Check whether the given targets are both Mediator instance and in same Mediator type.
whether the given targets are in same type of Mediator.
Curried version of isSameTypeOfMediator.
Curried version of isSameTypeOfMediator.
forceWrap - true: items will be wrapped in Data. See {@link forceWrapToData}.
forceWrap - false: Mutations will be transform to Data, Datas will not be handled, other values will be wrapped in Data. See {@link wrapToData}.
Curried version of makeDataInArray.
forceWrap - true: items will be wrapped in Data. See {@link forceWrapToData}.
forceWrap - false: Mutations will be transform to Data, Datas will not be handled, other values will be wrapped in Data. See {@link wrapToData}.
Curried version of makeDataInObject.
forceWrap - true: items will be wrapped in Mutation.
forceWrap - false: Datas will be transform to Mutation, Mutations will not be handled, other values will be wrapped in Mutation.
forceWrap - true: items will be wrapped in Mutation.
forceWrap - false: Datas will be transform to Mutation, Mutations will not be handled, other values will be wrapped in Mutation.
forceWrap - true: functions will be wrapped in Mutation, other values will be wrapped in Data.
forceWrap - false: Atoms will not be handled, functions will be wrapped in Mutation, other values will be wrapped in Data.
forceWrap - true: functions will be wrapped in Mutation, other values will be wrapped in Data.
forceWrap - false: Atoms will not be handled, functions will be wrapped in Mutation, other values will be wrapped in Data.
Trigger
Function Trigger Agent is designed to be passed to createFunctionTrigger function
as part of its options.
Create mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
Mediator Representative
of specified Mediator Representative.
Create mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
Mediator Representative
of specified Mediator Representative.
Create mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
Mediator Representative
of specified Mediator Representative.
Create mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
Mediator Representative
of specified Mediator Representative.
Create mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
Mediator Representative
of specified Mediator Representative.
Create mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
Mediator Representative
of specified Mediator Representative.
Create trigger mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
of trigger mediator representative.
Create trigger mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
of trigger mediator representative.
Create replay mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
of replay mediator representative.
Create replay mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
of replay mediator representative.
Create flat mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
of flat mediator representative.
Create flat mediator of given atom, then return tuple of given atom & created mediator.
Atom, i.e. Data or Mutation
of flat mediator representative.
Curried version of mutationToDataS.
Curried version of mutationToData.
Curried version of dataToData.
Curried version of atomToData.
Curried version of dataToMutationS.
Curried version of dataToMutation.
Curried version of mutationToMutation.
Curried version of atomToMutation.
Automatically pipe two atom
downstreamAtom
Automatically compose two atom
downstreamAtom
anything
whether the target is an Mediator instance
anything
whether the target is an Data Mediator instance
anything
whether the target is an Mutation Mediator instance
anything
whether the target is a FlatMediator instance
Make a flat mediator which will flatten the data and mutation of the given atom.
Make a flat mediator which will flatten the data and mutation of the given atom.
Make a flat mediator which will flatten the data and mutation of the given atom.
Make a flat mediator which will flatten the data and mutation of the given atom.
anything
whether the target is a ReplayMediator instance
Make a replay mediator with specified replayTime but without autoTrigger.
Make a replay mediator with specified replayTime but without autoTrigger.
Make a replay mediator with specified replayTime but without autoTrigger.
Make a replay mediator with specified replayTime but without autoTrigger.
Make a replay mediator with specified replayTime but without autoTrigger.
Make a replay mediator with specified replay time and auto trigger.
Make a replay mediator with specified replay time and auto trigger.
Make a replay mediator with specified replay time and auto trigger.
Make a replay mediator with specified replay time and auto trigger.
Make a replay mediator with specified replay time and auto trigger.
anything
whether the target is a TriggerMediator instance
anything
whether the target is Meta instance
anything
whether the targe is a Vacuo instance
anything
whether the target is a Void instance
anything
whether the target is a Pausor instance
anything
whether the target is a Terminator instance
anything
whether the target is a Particle instance
anything
whether the target is a Chaos instance
whether the target is a valid mutator of datar
Predicate whether the target is a valid datar of mutator, i.e. Chaos or Datar.
tache :: (...sources: any[]) => ReturnType<PrepareOutput>
MM Tache
The type of acceptNonAtom
The type of customizeTypes
The type of MutationLiftPosition
The type of acceptNonAtom
The type of customizeTypes
The type of MutationLiftPosition
TacheMaker
TacheMaker
[{ transformation, options }, ...]
ArraySSTache :: (source) => Array<Data<any>>
{ [key: string]: { transformation, options? } }
ObjectSSTache :: (source) => Record<string, Data<any>>
TacheMaker
TacheMaker
same as MutationOptions
SSTache :: (source) => Data<any>
A bunch of predicates, a predicate is a function that takes a value and returns boolean.
A bunch of cases, each case is corresponding to a predicate, when predicates return true, the corresponding case will be returned as final value.
The target's value will be passed to predicates.
Data
A bunch of predicates, a predicate is a function that takes a value and returns boolean.
A bunch of cases, each case is corresponding to a predicate, when predicates return true, the corresponding case will be returned as final value.
The target's value will be passed to predicates.
Data
Converge source atoms to a single Data.
The value emitted by target atom will only be triggered when timer atom has at least one value.
which value is used as debounce time(in milliseconds)
which value will be debounced with specified time
Data
Takes a default value and a target atom as argument, emit given default value if value of target atom isVoid.
Atom
Data
transform Funtion which will be applied to target value before distinct comparison.
Atom
Data
transform Funtion which will be applied to target value before distinct comparison.
Atom
Data
effectT transfer the value's emittion authority to the effect function,
so developer can control whether, when and what value will be emitted.
A function that controls the value's emittion. When there is a target value received, the effect function will be invoked. It takes an emit function as first argument, invoke it with the value to emit it. And takes the target value as second argument, an value set function whose value will be emitted just after effect function's execution.
Atom
Data
Hold target atom's latest value until there is a value from condition atom.
Replace nil value(i.e. undefined, null) with VOID.
Skip specified number of value.
Skip target atom's value until there is a value from condition atom.
Skip target atom's value while condition atom's value is true.
switch Tache will emits a "to" value when "from" value comes.
If there is not "to" value to emit when "from" value comes, it will emit a TERMINATOR which will stop the stream.
promiseSwitch Tache will emits a "to" value when "from" value comes.
If there is no "to" value to emit when "from" value comes, it will make a promise that to emit "to" value when it comes later.
Take sepcified number of values from the target atom. Default to take 0.
Take before atom's value before there is a value from after atom and switch to it.
Take target atom's value until there is a value from condition atom.
Take target atom's value while condition atom's value is true.
Do something with the target, then pass target through.
the value target will only triggered when timer atom has at least one value
Atom, which value is used as throttle time(in milliseconds)
Atom, which value will be throttled with specified time
Returned atom will emits specified number of target's value as an array.
Returned atom will emits the previous and current value of target atom as an array.
anything
whether the value is a Vain instance
Set or get global variable.
Different proxy can use same type of event on same element, so the proxy's can live in different sandbox such as contentScript & injectScript.
element id
event type on element
name of proxy instance
ElementBasedMessageProxy
same as value of class attribute on HTML tags
formatted class string
Format target string to standard class string using neatenClassString, then split it to array by space.
class string
array of classnames
array of classnames
PlainObject which use classname as key and exist of classname as value
Equal to pipe(classStringToClassArray, classArrayToClassObject).
class string
PlainObject which use classname as key and exist of classname as value
Classname in target object which value is false will be ignored.
array of classnames
array of classnames
class string
Same as pipe(classObjectToClassArray, classArrayToClassString).
class string
target, type of classString | classArray | classObject
class string
target, type of classString | classArray | classObject
array of classnames
target, type of classString | classArray | classObject
PlainObject which use classname as key and exist of classname as value
Curried.
classString | classArray | classObject
Curried.
typeof param class, says classString | classArray | classObject
Curried.
typeof param class, says classString | classArray | classObject
Curried.
typeof param class, says classString | classArray | classObject
Curried.
typeof param class, says classString | classArray | classObject
Curried.
typeof param class, says classString | classArray | classObject
Curried.
typeof param class, says classString | classArray | classObject
Curried.
whether target class contains contained class
no return value
element's id or selector
polling interval (in ms)
no return value
Predicate whether the enviroment is Wexin Mini Program (MINA: MINA is not App).
NOTE: typeof operator can operate on non-exist variable.
Predicate whether the enviroment is Web.
Predicate whether the enviroment is Browser.
Predicate whether the enviroment is Node.js.
(sync version of adaptMultiPlatformAsync) Run different function according to the environment.
(async version of adaptMultiPlatform) Run different function according to the environment.
"event.detail" is always of type object which has an "eventType" property in it, "eventType"'s value equals to name of custom type.
(strict) judge whether two pathname are equal.
(loose) judge whether two pathname are equal.
judge whether two pathname are equal.
mode of comparing
whether two pathname are equal
search string
query string
query object
query string
anything
whether the target is a RequestEngine Class
anything
whether the target is a RequestEngine instance
Register default engines.
Predicate whether the target is type of ResponseCode.
Invoke target function immediately.
Invoke target function in setTimeout.
anything
whether the target is a ScopeManager instance.
timestamp UUID
timestamp UUID
random UUID
random UUID
generate v4 UUID through object URL API
获取当前运行时唯一的字符串,可用于标识组件
default to mobius
default to cigaret
A string that is unique to the current runtime
I
O, omega
K, Kestrel
KI, Kite = KI = CK
C, Cardinal
T, Thrush = CI
V, Vireo = BCT
W, join
on
B, Bluebird
Z
判断一个参数是否是 ArgPlaceHolder
Simple curry function - loose version
Loose simple curry will pass all of the args it received to target function, even if the arg's length is greater than target function's arity.
Simple curry function - strict version
Strict simple curry will take exactly the required args that target function needs, redundant args will be ignored.
Internal curry function - loose version
Loose internal curry will pass all of the args it received to target function, even if the arg's length is greater than target function's arity.
Internal curry function - strict version
Strict internal curry will take exactly the required args that target function needs, redundant args will be ignored.
Internal curryN function - loose version
Loose internal curry will pass all of the args it received to target function, even if the arg's length is greater than specified arity.
Internal curryN function - strict version
Strict internal curry will take exactly the required arity that specified, redundant args will be ignored.
Return a new function which bind to a cache map. When the function is called, it will first check the cache map, if the result is found, return it. Otherwise, call the function and cache the result.
Use spread operator to spread the iterable target into the array.
Returns the length of targetArray.
Returns a copy of targetArray in which last element has been removed.
New array's length is targetArray.length - 1.
Returns a copy of targetArray in which inserts the given item as new last item.
New array's length is targetArray.length + 1.
Returns a new array containing the contents of the given array, followed by the given element.
Returns a copy of targetArray in which inserts the given item as new fist item.
New array's length is targetArray's length + 1.
Returns a new array with the given element at the front, followed by the contents of the array.
Returns a copy of targetArray in which first element has been removed.
New array's length is targetArray's length - 1.
Returns the first element of targetArray.
Returns the tail of targetArray.
Returns the init of targetArray.
Returns the last element of targetArray.
Returns a copy of a section of an array.
Returns a copy of a section of an array.
Returns a copy of a section of an array.
Combines two array. appendedArray will be appended to the end of targetArray.
Adds all the elements of an array into a string, separated by the specified separator string.
Predicate whether the target array includes the searchElement.
Returns a new array containing only one copy of each element in the original array.
Combines two arrays into one array (no duplicates) composed of the elements of each array.
Combines two arrays into one array (no duplicates) composed of those elements common to both arrays.
compareFunction is expected to return
Shuffle the target array.
Applies a function to the value at the given index of an array, returning a new copy of the array with the element at the given index replaced with the result of the function application.
Returns a new copy of the array with the element at the provided index replaced with the given value.
进行类型检测的常用手段包括:
typeof operator can operate on non-exist variable.Predicate whether the targetget is a Object, use instanceof operator to check.
Predicate whether the targetget is a general object, use typeof operator to check.
A general object is an object that is:
null, not a function, not a primitive.Any other object is a general object:
Array instance, Map instance, WeakMap instance, Set instance, Date instance, etc.Predicate whether the targetget is a plain object.
A plain object is an object that is:
null, not a function, not a primitive type,Array, not a RegExp, not a Date, not a Map, not a Set, not a WeakMap,window, not a DOM element, not an Error,null and undefined are considered empty values'' is the empty value for String[] is the empty value for Array{} is the empty value for PlainObjectisEmpty property is trueCheck target and Window is both defined
before use the instanceof operator to check target is instanceof Window.
Check target and Element is both defined
before use the instanceof operator to check target is instanceof Element.
Check target and Node is both defined
before use the instanceof operator to check target is instanceof Node.
Check target and HTMLElement is both defined
before use the instanceof operator to check target is instanceof HTMLElement.
Check target and HTMLCollection is both defined
before use the instanceof operator to check target is instanceof HTMLCollection.
Check target and Document is both defined
before use the instanceof operator to check target is instanceof Document.
Check target and EventTarget is both defined
before use the instanceof operator to check target is instanceof EventTarget.
Logic NOT, invert a boolean value to its opposite.
The boolean value to invert.
Logic AND.
Logic OR.
Logic NAND.
Logic NOR.
Logic XOR.
Logic XNOR.
Take a function that returns a boolean value, return a complement function that return the opposite boolean value.
i.e. whenever target function return true, the complement function will return false, and vice versa.
The target function's type.
The function returns boolean.
Predicate whether the target value is exactly true.
Predicate whether the target value is exactly false.
Predicate whether the target value is a truthy value.
Predicate whether the target value is a falsy value.
Use === to check whether two value are equal.
Use == to check whether two value are equal.
Use Object.is to check whether two value are equal.
Invoke the conditional function with the target value, according to the predicate result.
The return type of thenFn.
The return type of elseFn.
Value of type any, the value will be converted to boolean using bool function.
If pred is of type NormalFunction, it will be invoked with provided x.
then the invoke result will be converted to boolean using bool function.
The function to be invoked if pred result is truthy.
The function to be invoked if pred result is falsy.
The target value, which will be pass to pred | thenFn | elseFn.
Invoke the target function with target value, when the predicate result is truthy.
The type of the target value.
The return type of whenFn.
Value of type any, the value will be converted to boolean using bool function.
If pred is of type NormalFunction, and x is provided, it will be invoked with provided x.
then the invoke result will be converted to boolean using bool function.
Invoke the target function with target value, unless the predicate result is truthy.
The type of the target value.
The return type of unlessFn.
Value of type any, the value will be converted to boolean using bool function.
If pred is of type NormalFunction, and x is provided, it will be invoked with provided x.
then the invoke result will be converted to boolean using bool function.
The function to be invoked if pred result is falsy.
If x is provided, it will be passed to unlessFn.
IIF: Immediate If Function
Type of the trueValue.
Type of the falseValue.
Value of type any, the value will be converted to boolean using bool function.
If cond is of type NormalFunction, it will be invoked with provided trueValue
then the invoke result will be converted to boolean using bool function.
未提供 catcher 或 catchallValue 的情况下,若 tryer 抛出异常,则返回 undefined
Generate a one-off function for a given function.
The function to generate a one-off function for.
The callback to call when the one-off function is called twice or more.
Throttled function
Throttled function
target
Delete target's key one by one.
Predicate whether the target is a failed promise result.
Giving a array, filter non-FailedPromiseResult items.
Giving a array, filter FailedPromiseResult items, with extra index property
which indicate the index of the item in the original array.
GC, aka. Garbage Clean, used by mediator to release memories.
GC, aka. Garbage Clean, used by mediator to release memories.
Global Vacuo instance.
Global Void instance.
Global Pausor instance.
Global Terminator instance.
Global Chaos instance.
namespace UUID(MD5)
namespace UUID(SHA-1)
Convert any value to true or false.
Get an array type which at least has one element.
example - For usecases, see https://github.com/ts-essentials/ts-essentials#nonemptyarray