@journeyapps/reactor-lib-utils
Enumerations
| Enumeration | Description |
|---|---|
| MimeTypes | - |
| ReactorDateFormats | - |
Classes
| Class | Description |
|---|---|
| EventEmitter | Not to be confused with node's EventEmitter. This is a typed emitter |
| Mutex | Mutex maintains a queue of Promise-returning functions that are executed sequentially (whereas normally they would execute their async code concurrently). |
| ReactorPath | - |
Interfaces
ComputeDateTimePartsOptions
Properties
| Property | Type |
|---|---|
_debugLocale? | boolean |
date | ReactorDateType |
format | ReactorDateFormats |
local | boolean |
Disposable
Methods
dispose()
dispose(): any;
Returns
any
FileSelectionParams
Properties
| Property | Type |
|---|---|
mimeTypes? | string[] |
single? | boolean |
MutexContext
Extends
Methods
exclusiveLock()
exclusiveLock<T>(promiseFn): Promise<T>;
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
promiseFn | PromiseFunction<T> |
Returns
Promise<T>
sharedLock()
sharedLock<T>(promiseFn): Promise<T>;
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
promiseFn | SharedPromiseFunction<T> |
Returns
Promise<T>
Inherited from
SharedMutexContext
Extended by
Methods
sharedLock()
sharedLock<T>(promiseFn): Promise<T>;
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
promiseFn | SharedPromiseFunction<T> |
Returns
Promise<T>
Type Aliases
IFunc
type IFunc<I, O> = (...args) => Promise<O>;
Type Parameters
| Type Parameter |
|---|
I extends any[] |
O |
Parameters
| Parameter | Type |
|---|---|
...args | I |
Returns
Promise<O>
PromiseFunction
type PromiseFunction<T> = (context) => Promise<T>;
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
context | MutexContext |
Returns
Promise<T>
ReactorDateType
type ReactorDateType = Date | DateTime | string;
SharedPromiseFunction
type SharedPromiseFunction<T> = (context) => Promise<T>;
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
context | SharedMutexContext |
Returns
Promise<T>
Subscriber
type Subscriber<E> = {
handler: SubscriberCallback<E>;
id: string;
};
Type Parameters
| Type Parameter |
|---|
E |
Properties
| Property | Type |
|---|---|
handler | SubscriberCallback<E> |
id | string |
SubscriberCallback
type SubscriberCallback<E> = (event) => void;
Type Parameters
| Type Parameter |
|---|
E |
Parameters
| Parameter | Type |
|---|---|
event | E |
Returns
void
ThrottleOptions
type ThrottleOptions = {
leading?: boolean;
wait_ms?: number;
};
Properties
| Property | Type |
|---|---|
leading? | boolean |
wait_ms? | number |
Variables
aHexToRgba
const aHexToRgba: (hex) => string & MemoizedFunction;
#11223344 => rgba(17, 34, 51, 0.27)
asColor
const asColor: (color) => ColorInstance & MemoizedFunction;
colorToAHex
const colorToAHex: (str) => string & MemoizedFunction;
same as rgbaToAHex, but can also work with colour names like 'mediumpurple'
colorToHex
const colorToHex: (str) => string & MemoizedFunction;
getDarkenedColor
const getDarkenedColor: (color, ratio) => any & MemoizedFunction;
getIntlNumberFormatter
const getIntlNumberFormatter: (maximumFractionDigits) => NumberFormat & MemoizedFunction;
getTransparentColor
const getTransparentColor: (color, transparency) => any & MemoizedFunction;
isColor
const isColor: (color) => boolean & MemoizedFunction;
normalizeColorToHex
const normalizeColorToHex: (color) => string & MemoizedFunction;
rgbaToAHex
const rgbaToAHex: (str) => string & MemoizedFunction;
rgba(17, 34, 51, 0.27) => #11223344
Functions
| Function | Description |
|---|---|
| computeDateTimeParts | - |
| copyTextToClipboard | - |
| displayDateTime | - |
| emailDomainsMatch | - |
| formatNumber | - |
| getColorWithAlphaOptions | - |
| getEmailDomain | - |
| parseDateTypesToLuxon | - |
| readFileAsArrayBuffer | - |
| readFileAsText | - |
| retryWithBackoff | - |
| saveFile | - |
| selectFile | - |
| selectFiles | - |
| Takes any date as accepted by new Date(x) where x is the date and returns the date as a string in the format yyyy-mm-dd hh:mm:ss | |
| throttle | Given an execution function, return a throttled execution function which executes a maximum of once every wait_ms. |
| toRelative | - |
| trimString | If the provided string is longer than the maximum length, the string is returned with an ellipse |
| validateEmail | - |