Appearance
browser
Interfaces
IDownload()
Defined in: src/browser/download.ts:5
ts
IDownload(
content,
type?,
filename?): Promise<boolean>;Defined in: src/browser/download.ts:6
Parameters
| Parameter | Type |
|---|---|
content | BlobPart | BlobPart[] |
type? | string |
filename? | string |
Returns
Promise<boolean>
Properties
| Property | Type | Defined in |
|---|---|---|
base | (url, filename?) => Promise<boolean> | src/browser/download.ts:7 |
IGetBase64ImageOptions
Defined in: src/browser/getBase64Image.ts:3
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
height? | number | - | src/browser/getBase64Image.ts:5 |
left? | number | - | src/browser/getBase64Image.ts:6 |
top? | number | - | src/browser/getBase64Image.ts:7 |
type? | string | MIME type of resulting image, for example image/png or image/jpeg. Defaults to image/png. | src/browser/getBase64Image.ts:12 |
width? | number | - | src/browser/getBase64Image.ts:4 |
IWsAsyncConfigs
Defined in: src/browser/wsAsyncRequestProvider.ts:31
Async/idempotent WebSocket request provider configs.
It supports reconnect and matching responses by generated request id.
Properties
| Property | Type | Defined in |
|---|---|---|
generateIdempotencyKey? | () => number | src/browser/wsAsyncRequestProvider.ts:37 |
onError? | (error) => void | src/browser/wsAsyncRequestProvider.ts:34 |
onMessage? | (response) => boolean | void | src/browser/wsAsyncRequestProvider.ts:33 |
onReconnect? | (error, run) => any | src/browser/wsAsyncRequestProvider.ts:35 |
onSuccessConnect? | () => void | src/browser/wsAsyncRequestProvider.ts:36 |
reconnect? | boolean | src/browser/wsAsyncRequestProvider.ts:32 |
IWsSeriesConfigs
Defined in: src/browser/wsSeriesRequestProvider.ts:15
Properties
| Property | Type | Defined in |
|---|---|---|
onError? | (error) => void | src/browser/wsSeriesRequestProvider.ts:16 |
onMessage? | (response) => boolean | void | src/browser/wsSeriesRequestProvider.ts:17 |
onReconnect? | () => any | src/browser/wsSeriesRequestProvider.ts:18 |
Type Aliases
TAfterReturningCallback
ts
type TAfterReturningCallback = () => void | Promise<void>;Defined in: src/routerProvider.ts:37
Returns
void | Promise<void>
TBackLocationResponse
ts
type TBackLocationResponse = {
locked: boolean;
};Defined in: src/routerProvider.ts:72
Properties
locked
ts
locked: boolean;Defined in: src/routerProvider.ts:73
TLinkProps
ts
type TLinkProps = {
active?: boolean;
activeAsParent?: boolean;
component?: React.ElementType;
onClick?: (event) => void | boolean | Promise<void | boolean>;
options?: Partial<TUrlProps>;
timeout?: number;
} & React.HTMLProps<HTMLAnchorElement>;Defined in: src/routerProvider.ts:45
Type Declaration
| Name | Type | Defined in |
|---|---|---|
active? | boolean | src/routerProvider.ts:49 |
activeAsParent? | boolean | src/routerProvider.ts:50 |
component? | React.ElementType | src/routerProvider.ts:51 |
onClick()? | (event) => void | boolean | Promise<void | boolean> | src/routerProvider.ts:47 |
options? | Partial<TUrlProps> | src/routerProvider.ts:46 |
timeout? | number | src/routerProvider.ts:48 |
TLocationNavigationOptions
ts
type TLocationNavigationOptions = {
quiet?: boolean;
};Defined in: src/routerProvider.ts:38
Properties
quiet?
ts
optional quiet?: boolean;Defined in: src/routerProvider.ts:39
TLocationOptions
ts
type TLocationOptions = TLocationNavigationOptions & {
onBeforeUnload?: | TLockWatcherFn
| TLockWatcher
| null;
};Defined in: src/routerProvider.ts:41
Type Declaration
| Name | Type | Defined in |
|---|---|---|
onBeforeUnload? | | TLockWatcherFn | TLockWatcher | null | src/routerProvider.ts:42 |
TLockWatcher
ts
type TLockWatcher = TLockWatcherOptions & {
callback: TLockWatcherFn;
};Defined in: src/routerProvider.ts:34
Type Declaration
| Name | Type | Defined in |
|---|---|---|
callback | TLockWatcherFn | src/routerProvider.ts:35 |
TLockWatcherFn
ts
type TLockWatcherFn = (loc) => any | Promise<any>;Defined in: src/routerProvider.ts:33
Parameters
| Parameter | Type |
|---|---|
loc | TUrlProps |
Returns
any | Promise<any>
TLockWatcherOptions
ts
type TLockWatcherOptions = {
backwards?: boolean;
forwards?: boolean;
};Defined in: src/routerProvider.ts:29
Properties
backwards?
ts
optional backwards?: boolean;Defined in: src/routerProvider.ts:30
forwards?
ts
optional forwards?: boolean;Defined in: src/routerProvider.ts:31
TPushLocation
ts
type TPushLocation = (extendsLocation, options?) => Promise<TUrlProps>;Defined in: src/routerProvider.ts:54
Parameters
| Parameter | Type |
|---|---|
extendsLocation | Partial<TUrlProps> |
options? | TLocationOptions |
Returns
Promise<TUrlProps>
TRoute
ts
type TRoute = {
index: number;
params: TParams;
} & TRouterState & Record<string, any>;Defined in: src/routerProvider.ts:66
Type Declaration
| Name | Type | Defined in |
|---|---|---|
index | number | src/routerProvider.ts:67 |
params | TParams | src/routerProvider.ts:68 |
TRouteArgs
ts
type TRouteArgs<T> = [string, TRouteHandler<T> | T];Defined in: src/routerProvider.ts:28
Type Parameters
| Type Parameter |
|---|
T |
TRouteHandler
ts
type TRouteHandler<T> = (params, location) => T | undefined | null;Defined in: src/routerProvider.ts:27
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
params | TParams |
location | TUrlProps |
Returns
T | undefined | null
TRouteProps
ts
type TRouteProps = {
active: boolean;
route: TRoute;
};Defined in: src/routerProvider.ts:23
Properties
active
ts
active: boolean;Defined in: src/routerProvider.ts:25
route
ts
route: TRoute;Defined in: src/routerProvider.ts:24
TRouter
ts
type TRouter = ReturnType<TRouterProvider>;Defined in: src/routerProvider.ts:1107
TRouterProvider
ts
type TRouterProvider = typeof routerProvider;Defined in: src/routerProvider.ts:1106
TRouterProviderOptions
ts
type TRouterProviderOptions = {
Component: React.ElementType;
createApi: <T, E>(store, shape) => { [K in keyof E]: (payload: Parameters<E[K]>[1]) => void };
createElement: (...args) => any;
createStore: <T>(initial) => StoreWritable<T>;
forwardRef: (...args) => any;
useEffect: (...args) => void;
window: Window;
};Defined in: src/routerProvider.ts:247
The router provider options.
Param
The window.
Param
The component.
Param
The useEffect.
Param
The createElement.
Param
The forwardRef.
Param
The createStore.
Param
The createApi.
Example
ts
routerProviderBase({ window: window, Component: Component, useEffect: useEffect, createElement: createElement, forwardRef: forwardRef, createStore: createStore, createApi: createApi }); // => <Router />Properties
Component
ts
Component: React.ElementType;Defined in: src/routerProvider.ts:249
createApi
ts
createApi: <T, E>(store, shape) => { [K in keyof E]: (payload: Parameters<E[K]>[1]) => void };Defined in: src/routerProvider.ts:254
Type Parameters
| Type Parameter |
|---|
T |
E extends Record<string, (state, payload) => T> |
Parameters
| Parameter | Type |
|---|---|
store | StoreWritable<T> |
shape | E |
Returns
{ [K in keyof E]: (payload: Parameters<E[K]>[1]) => void }
createElement
ts
createElement: (...args) => any;Defined in: src/routerProvider.ts:251
Parameters
| Parameter | Type |
|---|---|
...args | any[] |
Returns
any
createStore
ts
createStore: <T>(initial) => StoreWritable<T>;Defined in: src/routerProvider.ts:253
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
initial | T |
Returns
forwardRef
ts
forwardRef: (...args) => any;Defined in: src/routerProvider.ts:252
Parameters
| Parameter | Type |
|---|---|
...args | any[] |
Returns
any
useEffect
ts
useEffect: (...args) => void;Defined in: src/routerProvider.ts:250
Parameters
| Parameter | Type |
|---|---|
...args | any[] |
Returns
void
window
ts
window: Window;Defined in: src/routerProvider.ts:248
TRouterState
ts
type TRouterState = {
depth: number;
history: (TUrlProps | null)[];
location: TUrlProps;
prev: null | TUrlProps;
};Defined in: src/routerProvider.ts:59
Properties
depth
ts
depth: number;Defined in: src/routerProvider.ts:60
history
ts
history: (TUrlProps | null)[];Defined in: src/routerProvider.ts:63
location
ts
location: TUrlProps;Defined in: src/routerProvider.ts:62
prev
ts
prev: null | TUrlProps;Defined in: src/routerProvider.ts:61
Variables
DEFAULT_LOCK_WATCHER_OPTIONS
ts
const DEFAULT_LOCK_WATCHER_OPTIONS: {
backwards: boolean;
forwards: boolean;
};Defined in: src/routerProvider.ts:86
The default lock watcher options.
Type Declaration
| Name | Type | Default value | Defined in |
|---|---|---|---|
backwards | boolean | true | src/routerProvider.ts:88 |
forwards | boolean | false | src/routerProvider.ts:87 |
download
ts
const download: IDownload;Defined in: src/browser/download.ts:22
Triggers a file download in the browser using a temporary <a> element.
Param
The content to download. Can be a string, ArrayBuffer, BlobPart, or an array of BlobPart.
Param
Optional MIME type for the created blob.
Param
Optional filename for the downloaded file.
Returns
A promise that resolves to true if the download was successful.
Example
ts
await download('hello world', 'text/plain', 'hello.txt');getViewportSize
ts
const getViewportSize: () => [number, number];Defined in: src/browser/getViewportSize.ts:12
Gets viewport size for the current window.
Returns
[number, number]
{ width, height } of the current viewport.
Example
ts
const { width, height } = getViewportSize();ready
ts
const ready: TReadyFn;Defined in: src/browser/ready.ts:14
DOM ready helper for the current window. Executes the callback immediately if the document is already ready, or queues it until it becomes ready.
Param
Function to call when the DOM is ready.
Example
ts
ready(() => console.log('DOM is ready'));script
ts
const script: IScript;Defined in: src/browser/script.ts:20
Loads a script by URL (with optional query options) and resolves when loaded.
Param
The URL of the script to load.
Param
The options for the script.
Returns
A promise that resolves when the script is loaded.
Example
ts
await script('https://cdn.example.com/lib.js');toArrayBuffer
ts
const toArrayBuffer: (blob) => Promise<ArrayBuffer>;Defined in: src/browser/blob/index.ts:9
Parameters
| Parameter | Type |
|---|---|
blob | Blob |
Returns
Promise<ArrayBuffer>
toBase64Url
ts
const toBase64Url: (blob) => Promise<string>;Defined in: src/browser/blob/index.ts:8
Parameters
| Parameter | Type |
|---|---|
blob | Blob |
Returns
Promise<string>
toText
ts
const toText: (blob) => Promise<string>;Defined in: src/browser/blob/index.ts:7
Parameters
| Parameter | Type |
|---|---|
blob | Blob |
Returns
Promise<string>
Functions
convertBlobToBase64()
ts
function convertBlobToBase64(blob): Promise<string>;Defined in: src/browser/convertBlobToBase64.ts:9
Reads a Blob and resolves with a base64 data URL string.
Parameters
| Parameter | Type | Description |
|---|---|---|
blob | Blob | The Blob to convert. |
Returns
Promise<string>
Promise resolved with a base64 data URL string.
Example
ts
const dataUrl = await convertBlobToBase64(new Blob(['hello']));convertUrlToBase64()
ts
function convertUrlToBase64(url): Promise<string>;Defined in: src/browser/convertUrlToBase64.ts:14
Converts a URL to a base64 data URL.
Implementation: URL -> Blob -> base64.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Resource URL. |
Returns
Promise<string>
Promise resolved with a base64 data URL string.
Example
ts
const base64 = await convertUrlToBase64('https://example.com/img.png');convertUrlToBlob()
ts
function convertUrlToBlob(url): Promise<Blob>;Defined in: src/browser/convertUrlToBlob.ts:9
Fetches a URL and resolves with its response body as a Blob.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Resource URL. |
Returns
Promise<Blob>
Promise resolved with a Blob.
Example
ts
const blob = await convertUrlToBlob('https://example.com/img.png');copyTextToClipboard()
ts
function copyTextToClipboard(text, win?): void;Defined in: src/copyTextToClipboard.ts:14
Copy text to clipboard.
Uses the modern navigator.clipboard.writeText API when available, and falls back to a hidden textarea + document.execCommand('copy') in older environments.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | Text content to copy. |
win? | { document?: any; navigator?: any; } | Optional window-like object, used mainly for testing. |
win.document? | any | - |
win.navigator? | any | - |
Returns
void
Example
ts
copyTextToClipboard('Hello, World!');
// Copies "Hello, World!" to the system clipboardcreateAnimationFrame()
ts
function createAnimationFrame(callback, interval?): () => void;Defined in: src/createAnimationFrame.ts:13
Creates an animation frame.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (balance) => void | The callback to call when the animation frame is ready. |
interval? | number | The interval to call the callback. |
Returns
The function to stop the animation frame.
() => void
Example
ts
const stop = createAnimationFrame((balance) => {
console.log('tick', balance);
}, 100);
stop(); // stops the animation frame loopdetection()
ts
function detection(userAgent, output?): string;Defined in: src/browser/detection.ts:21
Detects user agent tokens and versions from the given userAgent string.
Parameters
| Parameter | Type | Description |
|---|---|---|
userAgent | string | Raw user agent string. |
output? | string[] | Optional array to append detection tokens into. |
Returns
string
Space-separated string of detected tokens.
Example
ts
detection('Mozilla/5.0 ... Chrome/100'); // => 'chrome chrome-100'detectionByWindow()
ts
function detectionByWindow(windowObj, output?): string;Defined in: src/browser/detectionByWindow.ts:24
Detects environment flags based on window object and userAgent.
Parameters
| Parameter | Type | Description |
|---|---|---|
windowObj | IWindowLike | Window-like object. |
output? | string[] | Optional array to append detection tokens into. |
Returns
string
Space-separated string of detected tokens.
Example
ts
detectionByWindow(window); // => 'chrome chrome-100 multitouch'dynamic()
ts
function dynamic(url, options?): Promise<void>;Defined in: src/browser/dynamic.ts:16
Dynamically loads an external script with caching. Subsequent calls with the same resolved URL return the cached promise.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Script URL. |
options? | Record<string, any> | Optional URL extension options. |
Returns
Promise<void>
Promise resolved when the script is loaded.
Example
ts
await dynamic('https://cdn.example.com/lib.js');dynamicModule()
ts
function dynamicModule<TOptions, TResult>(init): (options?) => Promise<TResult>;Defined in: src/browser/dynamicModule.ts:10
Wraps async module initializer so that it is executed only once.
Type Parameters
| Type Parameter | Default type |
|---|---|
TOptions extends Record<string, any> | Record<string, any> |
TResult | any |
Parameters
| Parameter | Type | Description |
|---|---|---|
init | (options?) => TResult | Promise<TResult> | The initializer function. |
Returns
A function that returns a Promise resolved with the initializer result (cached after first call).
(options?) => Promise<TResult>
Example
ts
const loadLib = dynamicModule(() => import('./heavy-module'));
await loadLib(); // runs init only once; subsequent calls return the cached resultfrom()
ts
function from(content, type?): any;Defined in: src/browser/blob/from.ts:43
Normalizes input into a Blob.
Rules:
- Blob: returned as-is
- ArrayBuffer/buffer-like: stored as binary (
application/octet-binary) - Plain object: JSON-stringified (
application/json) - Other defined primitives: stringified as
text/plain
Parameters
| Parameter | Type | Description |
|---|---|---|
content | any | Any value to wrap into a Blob. |
type? | string | Optional MIME type override. |
Returns
any
A Blob instance containing the normalized content.
Example
ts
from('hello'); // => Blob (text/plain)
from({ a: 1 }); // => Blob (application/json)
from(new ArrayBuffer(4)); // => Blob (application/octet-binary)getBase64Image()
ts
function getBase64Image(url, options?): Promise<string>;Defined in: src/browser/getBase64Image.ts:24
Loads an image by URL and converts it to a base64 data URL using a canvas.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Image source URL. |
options | IGetBase64ImageOptions | Optional rendering options such as size, crop position and MIME type. |
Returns
Promise<string>
Promise resolved with the generated data URL string.
Example
ts
const dataUrl = await getBase64Image('https://example.com/img.png');getDataLink()
ts
function getDataLink(content, type?): string;Defined in: src/browser/getDataLink.ts:13
Creates a blob URL for the given content and MIME type using the native Blob constructor.
This function replaces the legacy blob/from helper by using the native Blob constructor directly.
Parameters
| Parameter | Type | Description |
|---|---|---|
content | BlobPart | BlobPart[] | Data to wrap into a Blob. Can be a string, ArrayBuffer, BlobPart, etc. |
type? | string | Optional MIME type for the created blob. |
Returns
string
A blob URL string created via URL.createObjectURL.
Example
ts
const url = getDataLink('hello', 'text/plain'); // => 'blob:...'getImageByUrl()
ts
function getImageByUrl(url): Promise<HTMLImageElement>;Defined in: src/browser/getImageByUrl.ts:10
Loads an image from the given URL and resolves with the created Image element.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Image source URL. |
Returns
Promise<HTMLImageElement>
Promise resolved with the loaded HTMLImageElement.
Example
ts
const img = await getImageByUrl('https://example.com/img.png');
img.naturalWidth; // => 800getImageNaturalSizeByUrl()
ts
function getImageNaturalSizeByUrl(url): Promise<[number, number]>;Defined in: src/browser/getImageNaturalSizeByUrl.ts:11
Loads an image by URL and resolves with its natural size.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Image source URL. |
Returns
Promise<[number, number]>
Promise resolved with a tuple [width, height].
Example
ts
const [w, h] = await getImageNaturalSizeByUrl('https://example.com/img.png');hashRouterProvider()
ts
function hashRouterProvider(options): {
$hashLocation: Store<TUrlProps>;
$hashPath: Store<string>;
$hashQuery: Store<TParams>;
$historyDepth: StoreWritable<number>;
$immeidateHashLocation: Store<TUrlProps>;
$immeidateHashPath: Store<string>;
$immeidateHashQuery: Store<TParams>;
$immeidateLocation: Store<TUrlProps>;
$immeidatePath: Store<string>;
$immeidateQuery: Store<TParams>;
$location: Store<TUrlProps>;
$path: Store<string>;
$prevHashLocation: Store<TUrlProps>;
$prevHashPath: Store<string>;
$prevHashQuery: Store<TParams>;
$prevLocation: Store<{
}>;
$prevPath: Store<string>;
$prevQuery: Store<TParams>;
$query: Store<TParams>;
$state: StoreWritable<TRouterState>;
$stateHash: Store<{
current: Partial<TUrlProps>;
depth: number;
history: TUrlProps[];
location: TUrlProps;
prev: Partial<TUrlProps>;
}>;
$trasitionState: StoreWritable<TRouterState>;
$trasitionStateHash: Store<{
depth: number;
history: TUrlProps[];
location: Partial<TUrlProps>;
prev: Partial<TUrlProps>;
}>;
backLocation: (...args) => Promise<any>;
backLocationThrottled: (...args) => Promise<void>;
backRepeat: (count, options?) => Promise<any>;
backToDepth: (...args) => Promise<any>;
backToStart: (options?) => Promise<any>;
getCurrentHashLocation: () => Partial<TUrlProps>;
getCurrentLocation: () => TUrlProps;
getFromHashLocation: () => Partial<TUrlProps>;
getFromLocation: () => TUrlProps;
getHistory: () => TUrlProps[];
getNextHashLocation: () => Partial<TUrlProps>;
getNextLocation: () => TUrlProps;
getPrevHashLocation: () => any;
getPrevLocation: () => any;
HashLink: ElementType<any, keyof IntrinsicElements>;
HashNavLink: ElementType<any, keyof IntrinsicElements>;
hashParamReplaceStorage: {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
hashParamStorage: {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
isTryClosingCurrentLocation: () => boolean;
isTryClosingLocation: (depth) => boolean;
isWaitingUnloadCurrentLocation: () => boolean;
isWaitingUnloadLocation: (depth) => boolean;
Link: ElementType<any, keyof IntrinsicElements>;
LinkProvider: (__namedParameters) => ElementType;
NavLink: ElementType<any, keyof IntrinsicElements>;
onBeforeUnload: (callback, options?) => () => void;
paramReplaceStorage: {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
paramStorage: {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
paramStorageProvider: ($query, pushLocation) => {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
pushHashLocation: (child, options?) => Promise<any>;
pushLocation: (extendsLocation, options?) => Promise<any>;
pushLocationThrottled: (...args) => Promise<void>;
pushParam: (query) => Promise<any>;
replaceHashLocation: (child, options?) => Promise<any>;
replaceLocation: (extendsLocation, options?) => Promise<any>;
replaceLocationThrottled: (...args) => Promise<void>;
replaceParam: (query) => Promise<any>;
routerByHashLocationProvider: <T>(routes, notFoundHandler?) => Store<T & {
index: number;
params: TParams;
} & TRouterState & Record<string, any>>;
routerByLocationProvider: <T>(routes, notFoundHandler?) => Store<T & {
index: number;
params: TParams;
} & TRouterState & Record<string, any>>;
routerForObservableMapProvider: <T>(_routes, notFoundHandler?) => (state) => T & {
index: number;
params: TParams;
} & TRouterState & Record<string, any>;
storagePushHashLocation: (child, options?) => Promise<any>;
storagePushLocation: (extendsLocation, options?) => Promise<any>;
storageReplaceHashLocation: (child, options?) => Promise<any>;
storageReplaceLocation: (extendsLocation, options?) => Promise<any>;
useRouteIsFocus: (effect, deps?) => void;
};Defined in: src/routerProvider.ts:1069
Parameters
| Parameter | Type |
|---|---|
options | TRouterProviderOptions |
Returns
| Name | Type | Defined in |
|---|---|---|
$hashLocation | Store<TUrlProps> | src/routerProvider.ts:973 |
$hashPath | Store<string> | src/routerProvider.ts:975 |
$hashQuery | Store<TParams> | src/routerProvider.ts:974 |
$historyDepth | StoreWritable<number> | src/routerProvider.ts:965 |
$immeidateHashLocation | Store<TUrlProps> | src/routerProvider.ts:980 |
$immeidateHashPath | Store<string> | src/routerProvider.ts:982 |
$immeidateHashQuery | Store<TParams> | src/routerProvider.ts:981 |
$immeidateLocation | Store<TUrlProps> | src/routerProvider.ts:977 |
$immeidatePath | Store<string> | src/routerProvider.ts:979 |
$immeidateQuery | Store<TParams> | src/routerProvider.ts:978 |
$location | Store<TUrlProps> | src/routerProvider.ts:970 |
$path | Store<string> | src/routerProvider.ts:972 |
$prevHashLocation | Store<TUrlProps> | src/routerProvider.ts:987 |
$prevHashPath | Store<string> | src/routerProvider.ts:989 |
$prevHashQuery | Store<TParams> | src/routerProvider.ts:988 |
$prevLocation | Store<{ }> | src/routerProvider.ts:984 |
$prevPath | Store<string> | src/routerProvider.ts:986 |
$prevQuery | Store<TParams> | src/routerProvider.ts:985 |
$query | Store<TParams> | src/routerProvider.ts:971 |
$state | StoreWritable<TRouterState> | src/routerProvider.ts:968 |
$stateHash | Store<{ current: Partial<TUrlProps>; depth: number; history: TUrlProps[]; location: TUrlProps; prev: Partial<TUrlProps>; }> | src/routerProvider.ts:969 |
$trasitionState | StoreWritable<TRouterState> | src/routerProvider.ts:966 |
$trasitionStateHash | Store<{ depth: number; history: TUrlProps[]; location: Partial<TUrlProps>; prev: Partial<TUrlProps>; }> | src/routerProvider.ts:967 |
backLocation() | (...args) => Promise<any> | src/routerProvider.ts:1021 |
backLocationThrottled() | (...args) => Promise<void> | src/routerProvider.ts:1065 |
backRepeat() | (count, options?) => Promise<any> | src/routerProvider.ts:1023 |
backToDepth() | (...args) => Promise<any> | src/routerProvider.ts:1022 |
backToStart() | (options?) => Promise<any> | src/routerProvider.ts:1024 |
getCurrentHashLocation() | () => Partial<TUrlProps> | src/routerProvider.ts:1006 |
getCurrentLocation() | () => TUrlProps | src/routerProvider.ts:1005 |
getFromHashLocation() | () => Partial<TUrlProps> | src/routerProvider.ts:1012 |
getFromLocation() | () => TUrlProps | src/routerProvider.ts:1009 |
getHistory() | () => TUrlProps[] | src/routerProvider.ts:1004 |
getNextHashLocation() | () => Partial<TUrlProps> | src/routerProvider.ts:1011 |
getNextLocation() | () => TUrlProps | src/routerProvider.ts:1008 |
getPrevHashLocation() | () => any | src/routerProvider.ts:1010 |
getPrevLocation() | () => any | src/routerProvider.ts:1007 |
HashLink | ElementType<any, keyof IntrinsicElements> | src/routerProvider.ts:1002 |
HashNavLink | ElementType<any, keyof IntrinsicElements> | src/routerProvider.ts:1003 |
hashParamReplaceStorage | { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:999 |
hashParamReplaceStorage.clear() | () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:896 |
hashParamReplaceStorage.get() | (key) => any | src/routerProvider.ts:893 |
hashParamReplaceStorage.getKeys() | () => string[] | src/routerProvider.ts:895 |
hashParamReplaceStorage.remove() | (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:894 |
hashParamReplaceStorage.set() | (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:892 |
hashParamReplaceStorage.watch() | (watcher) => Unsubscribe | src/routerProvider.ts:900 |
hashParamStorage | { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:997 |
hashParamStorage.clear() | () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:896 |
hashParamStorage.get() | (key) => any | src/routerProvider.ts:893 |
hashParamStorage.getKeys() | () => string[] | src/routerProvider.ts:895 |
hashParamStorage.remove() | (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:894 |
hashParamStorage.set() | (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:892 |
hashParamStorage.watch() | (watcher) => Unsubscribe | src/routerProvider.ts:900 |
isTryClosingCurrentLocation() | () => boolean | src/routerProvider.ts:1027 |
isTryClosingLocation() | (depth) => boolean | src/routerProvider.ts:1025 |
isWaitingUnloadCurrentLocation() | () => boolean | src/routerProvider.ts:1028 |
isWaitingUnloadLocation() | (depth) => boolean | src/routerProvider.ts:1026 |
Link | ElementType<any, keyof IntrinsicElements> | src/routerProvider.ts:1000 |
LinkProvider() | (__namedParameters) => ElementType | src/routerProvider.ts:991 |
NavLink | ElementType<any, keyof IntrinsicElements> | src/routerProvider.ts:1001 |
onBeforeUnload() | (callback, options?) => () => void | src/routerProvider.ts:1029 |
paramReplaceStorage | { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:998 |
paramReplaceStorage.clear() | () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:896 |
paramReplaceStorage.get() | (key) => any | src/routerProvider.ts:893 |
paramReplaceStorage.getKeys() | () => string[] | src/routerProvider.ts:895 |
paramReplaceStorage.remove() | (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:894 |
paramReplaceStorage.set() | (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:892 |
paramReplaceStorage.watch() | (watcher) => Unsubscribe | src/routerProvider.ts:900 |
paramStorage | { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:996 |
paramStorage.clear() | () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:896 |
paramStorage.get() | (key) => any | src/routerProvider.ts:893 |
paramStorage.getKeys() | () => string[] | src/routerProvider.ts:895 |
paramStorage.remove() | (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:894 |
paramStorage.set() | (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:892 |
paramStorage.watch() | (watcher) => Unsubscribe | src/routerProvider.ts:900 |
paramStorageProvider() | ($query, pushLocation) => { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:993 |
pushHashLocation() | (child, options?) => Promise<any> | src/routerProvider.ts:1015 |
pushLocation() | (extendsLocation, options?) => Promise<any> | src/routerProvider.ts:1013 |
pushLocationThrottled() | (...args) => Promise<void> | src/routerProvider.ts:1063 |
pushParam() | (query) => Promise<any> | src/routerProvider.ts:1057 |
replaceHashLocation() | (child, options?) => Promise<any> | src/routerProvider.ts:1016 |
replaceLocation() | (extendsLocation, options?) => Promise<any> | src/routerProvider.ts:1014 |
replaceLocationThrottled() | (...args) => Promise<void> | src/routerProvider.ts:1064 |
replaceParam() | (query) => Promise<any> | src/routerProvider.ts:1060 |
routerByHashLocationProvider() | <T>(routes, notFoundHandler?) => Store<T & { index: number; params: TParams; } & TRouterState & Record<string, any>> | src/routerProvider.ts:995 |
routerByLocationProvider() | <T>(routes, notFoundHandler?) => Store<T & { index: number; params: TParams; } & TRouterState & Record<string, any>> | src/routerProvider.ts:994 |
routerForObservableMapProvider() | <T>(_routes, notFoundHandler?) => (state) => T & { index: number; params: TParams; } & TRouterState & Record<string, any> | src/routerProvider.ts:992 |
storagePushHashLocation() | (child, options?) => Promise<any> | src/routerProvider.ts:1018 |
storagePushLocation() | (extendsLocation, options?) => Promise<any> | src/routerProvider.ts:1017 |
storageReplaceHashLocation() | (child, options?) => Promise<any> | src/routerProvider.ts:1020 |
storageReplaceLocation() | (extendsLocation, options?) => Promise<any> | src/routerProvider.ts:1019 |
useRouteIsFocus() | (effect, deps?) => void | src/routerProvider.ts:1031 |
jsonpRequest()
ts
function jsonpRequest(url, params?): Promise<unknown>;Defined in: src/browser/jsonpRequest.ts:18
Performs JSONP request by injecting a temporary <script> tag.
The callback function is placed on GLOBAL_CONTEXT so the remote endpoint can call it when it finishes.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Base request URL (without callback param). |
params? | Record<string, any> | Query params appended to the URL. |
Returns
Promise<unknown>
Promise resolved with the JSONP callback payload.
Example
ts
const data = await jsonpRequest('https://api.example.com/data', { id: 1 });mergeLocation()
ts
function mergeLocation(prev, exten): TUrlProps;Defined in: src/routerProvider.ts:100
Merges two URL properties.
Parameters
| Parameter | Type | Description |
|---|---|---|
prev | Partial<TUrlProps> | The previous URL properties. |
exten | Partial<TUrlProps> | - |
Returns
The merged URL properties.
Example
ts
mergeLocation({ path: '/user', query: { id: 1 } }, { path: '/user/1', query: { name: 'John' } }); // => { path: '/user/1', query: { id: 1, name: 'John' } }openLink()
ts
function openLink(url, timeout?): Promise<void>;Defined in: src/browser/openLink.ts:13
Opens the given URL in a new browser tab using a temporary <a> element. Returns a Promise that resolves after a short timeout, useful for tests or when waiting for the navigation to be scheduled.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | URL to open. |
timeout? | number | Timeout in ms before the promise resolves (default: 100). |
Returns
Promise<void>
Promise resolved after the given timeout.
Example
ts
await openLink('https://example.com'); // opens in new tabprovider()
ts
function provider<TResult>(fnName): (blob) => Promise<TResult>;Defined in: src/browser/blob/provider.ts:13
Creates a Blob -> Promise<TResult> converter based on FileReader method name.
Example: provider('readAsText') produces a function that reads a blob as text.
Type Parameters
| Type Parameter | Default type |
|---|---|
TResult | string | ArrayBuffer |
Parameters
| Parameter | Type | Description |
|---|---|---|
fnName | string | FileReader method name (e.g. readAsText, readAsDataURL). |
Returns
A function that reads a Blob using the given FileReader method.
(blob) => Promise<TResult>
Example
ts
const toText = provider('readAsText');
const text = await toText(blob); // => 'hello'routerByLocationProviderProvider()
ts
function routerByLocationProviderProvider<A>($state): <T>(routes, notFoundHandler?) => Store<T & {
index: number;
params: TParams;
} & TRouterState & Record<string, any>>;Defined in: src/routerProvider.ts:224
Creates a router for a location.
Type Parameters
| Type Parameter |
|---|
A extends TRouterState |
Parameters
| Parameter | Type | Description |
|---|---|---|
$state | Store<A> | The state. |
Returns
A router.
<T>(routes, notFoundHandler?) => Store<T & { index: number; params: TParams; } & TRouterState & Record<string, any>>
Example
ts
routerByLocationProviderProvider($state); // => <Router />routerForObservableMapProvider()
ts
function routerForObservableMapProvider<T>(_routes, notFoundHandler?): (state) => T & {
index: number;
params: TParams;
} & TRouterState & Record<string, any>;Defined in: src/routerProvider.ts:167
Creates a router for an observable map.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
_routes | TRouteArgs<T>[] | The routes. |
notFoundHandler? | TRouteHandler<T> | The not found handler. |
Returns
A router.
(state) => T & { index: number; params: TParams; } & TRouterState & Record<string, any>
Example
ts
routerForObservableMapProvider([['/user', (params, location) => <User />]], (params, location) => <NotFound />); // => <Router />routerProvider()
ts
function routerProvider(options): {
$hashLocation: Store<TUrlProps>;
$hashPath: Store<string>;
$hashQuery: Store<TParams>;
$historyDepth: StoreWritable<number>;
$immeidateHashLocation: Store<TUrlProps>;
$immeidateHashPath: Store<string>;
$immeidateHashQuery: Store<TParams>;
$immeidateLocation: Store<TUrlProps>;
$immeidatePath: Store<string>;
$immeidateQuery: Store<TParams>;
$location: Store<TUrlProps>;
$path: Store<string>;
$prevHashLocation: Store<TUrlProps>;
$prevHashPath: Store<string>;
$prevHashQuery: Store<TParams>;
$prevLocation: Store<{
}>;
$prevPath: Store<string>;
$prevQuery: Store<TParams>;
$query: Store<TParams>;
$state: StoreWritable<TRouterState>;
$stateHash: Store<{
current: Partial<TUrlProps>;
depth: number;
history: TUrlProps[];
location: TUrlProps;
prev: Partial<TUrlProps>;
}>;
$trasitionState: StoreWritable<TRouterState>;
$trasitionStateHash: Store<{
depth: number;
history: TUrlProps[];
location: Partial<TUrlProps>;
prev: Partial<TUrlProps>;
}>;
backLocation: (...args) => Promise<any>;
backLocationThrottled: (...args) => Promise<void>;
backRepeat: (count, options?) => Promise<any>;
backToDepth: (...args) => Promise<any>;
backToStart: (options?) => Promise<any>;
getCurrentHashLocation: () => Partial<TUrlProps>;
getCurrentLocation: () => TUrlProps;
getFromHashLocation: () => Partial<TUrlProps>;
getFromLocation: () => TUrlProps;
getHistory: () => TUrlProps[];
getNextHashLocation: () => Partial<TUrlProps>;
getNextLocation: () => TUrlProps;
getPrevHashLocation: () => any;
getPrevLocation: () => any;
HashLink: ElementType<any, keyof IntrinsicElements>;
HashNavLink: ElementType<any, keyof IntrinsicElements>;
hashParamReplaceStorage: {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
hashParamStorage: {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
isTryClosingCurrentLocation: () => boolean;
isTryClosingLocation: (depth) => boolean;
isWaitingUnloadCurrentLocation: () => boolean;
isWaitingUnloadLocation: (depth) => boolean;
Link: ElementType<any, keyof IntrinsicElements>;
LinkProvider: (__namedParameters) => ElementType;
NavLink: ElementType<any, keyof IntrinsicElements>;
onBeforeUnload: (callback, options?) => () => void;
paramReplaceStorage: {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
paramStorage: {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
paramStorageProvider: ($query, pushLocation) => {
clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
get: (key) => any;
getKeys: () => string[];
remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; };
watch: (watcher) => Unsubscribe;
};
pushHashLocation: (child, options?) => Promise<any>;
pushLocation: (extendsLocation, options?) => Promise<any>;
pushLocationThrottled: (...args) => Promise<void>;
pushParam: (query) => Promise<any>;
replaceHashLocation: (child, options?) => Promise<any>;
replaceLocation: (extendsLocation, options?) => Promise<any>;
replaceLocationThrottled: (...args) => Promise<void>;
replaceParam: (query) => Promise<any>;
routerByHashLocationProvider: <T>(routes, notFoundHandler?) => Store<T & {
index: number;
params: TParams;
} & TRouterState & Record<string, any>>;
routerByLocationProvider: <T>(routes, notFoundHandler?) => Store<T & {
index: number;
params: TParams;
} & TRouterState & Record<string, any>>;
routerForObservableMapProvider: <T>(_routes, notFoundHandler?) => (state) => T & {
index: number;
params: TParams;
} & TRouterState & Record<string, any>;
storagePushHashLocation: (child, options?) => Promise<any>;
storagePushLocation: (extendsLocation, options?) => Promise<any>;
storageReplaceHashLocation: (child, options?) => Promise<any>;
storageReplaceLocation: (extendsLocation, options?) => Promise<any>;
useRouteIsFocus: (effect, deps?) => void;
};Defined in: src/routerProvider.ts:1047
Parameters
| Parameter | Type |
|---|---|
options | TRouterProviderOptions |
Returns
| Name | Type | Defined in |
|---|---|---|
$hashLocation | Store<TUrlProps> | src/routerProvider.ts:973 |
$hashPath | Store<string> | src/routerProvider.ts:975 |
$hashQuery | Store<TParams> | src/routerProvider.ts:974 |
$historyDepth | StoreWritable<number> | src/routerProvider.ts:965 |
$immeidateHashLocation | Store<TUrlProps> | src/routerProvider.ts:980 |
$immeidateHashPath | Store<string> | src/routerProvider.ts:982 |
$immeidateHashQuery | Store<TParams> | src/routerProvider.ts:981 |
$immeidateLocation | Store<TUrlProps> | src/routerProvider.ts:977 |
$immeidatePath | Store<string> | src/routerProvider.ts:979 |
$immeidateQuery | Store<TParams> | src/routerProvider.ts:978 |
$location | Store<TUrlProps> | src/routerProvider.ts:970 |
$path | Store<string> | src/routerProvider.ts:972 |
$prevHashLocation | Store<TUrlProps> | src/routerProvider.ts:987 |
$prevHashPath | Store<string> | src/routerProvider.ts:989 |
$prevHashQuery | Store<TParams> | src/routerProvider.ts:988 |
$prevLocation | Store<{ }> | src/routerProvider.ts:984 |
$prevPath | Store<string> | src/routerProvider.ts:986 |
$prevQuery | Store<TParams> | src/routerProvider.ts:985 |
$query | Store<TParams> | src/routerProvider.ts:971 |
$state | StoreWritable<TRouterState> | src/routerProvider.ts:968 |
$stateHash | Store<{ current: Partial<TUrlProps>; depth: number; history: TUrlProps[]; location: TUrlProps; prev: Partial<TUrlProps>; }> | src/routerProvider.ts:969 |
$trasitionState | StoreWritable<TRouterState> | src/routerProvider.ts:966 |
$trasitionStateHash | Store<{ depth: number; history: TUrlProps[]; location: Partial<TUrlProps>; prev: Partial<TUrlProps>; }> | src/routerProvider.ts:967 |
backLocation() | (...args) => Promise<any> | src/routerProvider.ts:1021 |
backLocationThrottled() | (...args) => Promise<void> | src/routerProvider.ts:1065 |
backRepeat() | (count, options?) => Promise<any> | src/routerProvider.ts:1023 |
backToDepth() | (...args) => Promise<any> | src/routerProvider.ts:1022 |
backToStart() | (options?) => Promise<any> | src/routerProvider.ts:1024 |
getCurrentHashLocation() | () => Partial<TUrlProps> | src/routerProvider.ts:1006 |
getCurrentLocation() | () => TUrlProps | src/routerProvider.ts:1005 |
getFromHashLocation() | () => Partial<TUrlProps> | src/routerProvider.ts:1012 |
getFromLocation() | () => TUrlProps | src/routerProvider.ts:1009 |
getHistory() | () => TUrlProps[] | src/routerProvider.ts:1004 |
getNextHashLocation() | () => Partial<TUrlProps> | src/routerProvider.ts:1011 |
getNextLocation() | () => TUrlProps | src/routerProvider.ts:1008 |
getPrevHashLocation() | () => any | src/routerProvider.ts:1010 |
getPrevLocation() | () => any | src/routerProvider.ts:1007 |
HashLink | ElementType<any, keyof IntrinsicElements> | src/routerProvider.ts:1002 |
HashNavLink | ElementType<any, keyof IntrinsicElements> | src/routerProvider.ts:1003 |
hashParamReplaceStorage | { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:999 |
hashParamReplaceStorage.clear() | () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:896 |
hashParamReplaceStorage.get() | (key) => any | src/routerProvider.ts:893 |
hashParamReplaceStorage.getKeys() | () => string[] | src/routerProvider.ts:895 |
hashParamReplaceStorage.remove() | (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:894 |
hashParamReplaceStorage.set() | (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:892 |
hashParamReplaceStorage.watch() | (watcher) => Unsubscribe | src/routerProvider.ts:900 |
hashParamStorage | { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:997 |
hashParamStorage.clear() | () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:896 |
hashParamStorage.get() | (key) => any | src/routerProvider.ts:893 |
hashParamStorage.getKeys() | () => string[] | src/routerProvider.ts:895 |
hashParamStorage.remove() | (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:894 |
hashParamStorage.set() | (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:892 |
hashParamStorage.watch() | (watcher) => Unsubscribe | src/routerProvider.ts:900 |
isTryClosingCurrentLocation() | () => boolean | src/routerProvider.ts:1027 |
isTryClosingLocation() | (depth) => boolean | src/routerProvider.ts:1025 |
isWaitingUnloadCurrentLocation() | () => boolean | src/routerProvider.ts:1028 |
isWaitingUnloadLocation() | (depth) => boolean | src/routerProvider.ts:1026 |
Link | ElementType<any, keyof IntrinsicElements> | src/routerProvider.ts:1000 |
LinkProvider() | (__namedParameters) => ElementType | src/routerProvider.ts:991 |
NavLink | ElementType<any, keyof IntrinsicElements> | src/routerProvider.ts:1001 |
onBeforeUnload() | (callback, options?) => () => void | src/routerProvider.ts:1029 |
paramReplaceStorage | { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:998 |
paramReplaceStorage.clear() | () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:896 |
paramReplaceStorage.get() | (key) => any | src/routerProvider.ts:893 |
paramReplaceStorage.getKeys() | () => string[] | src/routerProvider.ts:895 |
paramReplaceStorage.remove() | (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:894 |
paramReplaceStorage.set() | (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:892 |
paramReplaceStorage.watch() | (watcher) => Unsubscribe | src/routerProvider.ts:900 |
paramStorage | { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:996 |
paramStorage.clear() | () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:896 |
paramStorage.get() | (key) => any | src/routerProvider.ts:893 |
paramStorage.getKeys() | () => string[] | src/routerProvider.ts:895 |
paramStorage.remove() | (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:894 |
paramStorage.set() | (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; } | src/routerProvider.ts:892 |
paramStorage.watch() | (watcher) => Unsubscribe | src/routerProvider.ts:900 |
paramStorageProvider() | ($query, pushLocation) => { clear: () => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; get: (key) => any; getKeys: () => string[]; remove: (key) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; set: (key, v?) => { set: (key: string, v?: any) => ...; get: (key: string) => any; remove: (key: string) => ...; getKeys: () => string[]; clear: () => ...; watch: (watcher: (state: Record<string, any>) => any) => Unsubscribe; }; watch: (watcher) => Unsubscribe; } | src/routerProvider.ts:993 |
pushHashLocation() | (child, options?) => Promise<any> | src/routerProvider.ts:1015 |
pushLocation() | (extendsLocation, options?) => Promise<any> | src/routerProvider.ts:1013 |
pushLocationThrottled() | (...args) => Promise<void> | src/routerProvider.ts:1063 |
pushParam() | (query) => Promise<any> | src/routerProvider.ts:1057 |
replaceHashLocation() | (child, options?) => Promise<any> | src/routerProvider.ts:1016 |
replaceLocation() | (extendsLocation, options?) => Promise<any> | src/routerProvider.ts:1014 |
replaceLocationThrottled() | (...args) => Promise<void> | src/routerProvider.ts:1064 |
replaceParam() | (query) => Promise<any> | src/routerProvider.ts:1060 |
routerByHashLocationProvider() | <T>(routes, notFoundHandler?) => Store<T & { index: number; params: TParams; } & TRouterState & Record<string, any>> | src/routerProvider.ts:995 |
routerByLocationProvider() | <T>(routes, notFoundHandler?) => Store<T & { index: number; params: TParams; } & TRouterState & Record<string, any>> | src/routerProvider.ts:994 |
routerForObservableMapProvider() | <T>(_routes, notFoundHandler?) => (state) => T & { index: number; params: TParams; } & TRouterState & Record<string, any> | src/routerProvider.ts:992 |
storagePushHashLocation() | (child, options?) => Promise<any> | src/routerProvider.ts:1018 |
storagePushLocation() | (extendsLocation, options?) => Promise<any> | src/routerProvider.ts:1017 |
storageReplaceHashLocation() | (child, options?) => Promise<any> | src/routerProvider.ts:1020 |
storageReplaceLocation() | (extendsLocation, options?) => Promise<any> | src/routerProvider.ts:1019 |
useRouteIsFocus() | (effect, deps?) => void | src/routerProvider.ts:1031 |
runFrame()
ts
function runFrame(callback, interval?): () => void;Defined in: src/browser/runFrame.ts:14
Runs callback on each animation frame and accumulates elapsed time until interval ms is reached, then calls callback(balance) and resets the balance.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
callback | (delta) => void | undefined | Function called with the accumulated time delta in ms. |
interval | number | 0 | Minimum interval between calls in ms (default: 0, every frame). |
Returns
A function that stops the animation loop.
() => void
Example
ts
const stop = runFrame((delta) => console.log(delta), 100);
stop(); // stops the loopwsAsyncRequestProvider()
ts
function wsAsyncRequestProvider<TResponse>(wsUrl, configs?): any;Defined in: src/browser/wsAsyncRequestProvider.ts:52
Provides an async WebSocket request API over a single connection. Internally queues requests until the socket is connected and resolves promises when corresponding responses arrive, matched by idempotency key.
Type Parameters
| Type Parameter | Default type |
|---|---|
TResponse | any |
Parameters
| Parameter | Type | Description |
|---|---|---|
wsUrl | string | WebSocket URL. |
configs? | IWsAsyncConfigs | Optional configuration (reconnect, handlers). |
Returns
any
An async request(method, data) function with .close() and .reset() methods.
Example
ts
const request = wsAsyncRequestProvider('wss://example.com/ws');
const response = await request('getUser', { id: 1 });wsConnect()
ts
function wsConnect(wsUrl): Promise<WebSocket>;Defined in: src/browser/wsConnect.ts:13
Creates a WebSocket connection and resolves with the opened socket.
Parameters
| Parameter | Type | Description |
|---|---|---|
wsUrl | string | WebSocket URL (ws:// or wss://). |
Returns
Promise<WebSocket>
Promise resolved with the opened WebSocket instance.
Example
ts
const socket = await wsConnect('wss://example.com/ws');wsSeriesRequestProvider()
ts
function wsSeriesRequestProvider<TResponse>(wsUrl, configs?): (method, data?) => Promise<TResponse>;Defined in: src/browser/wsSeriesRequestProvider.ts:33
Provides a simple sequential WebSocket request API over a single connection. Requests are executed one-by-one: the next request is sent only after the previous response is received.
Type Parameters
| Type Parameter | Default type |
|---|---|
TResponse | any |
Parameters
| Parameter | Type | Description |
|---|---|---|
wsUrl | string | WebSocket URL. |
configs? | IWsSeriesConfigs | Optional configuration (error/message/reconnect handlers). |
Returns
An async request(method, data) function.
(method, data?) => Promise<TResponse>
Example
ts
const request = wsSeriesRequestProvider('wss://example.com/ws');
const response = await request('getUser', { id: 1 });References
cookieStorageProvider
Re-exports cookieStorageProvider
getViewportSizeProvider
Re-exports getViewportSizeProvider
localStorageProvider
Re-exports localStorageProvider
readyProvider
Re-exports readyProvider
setStyleSheet
Re-exports setStyleSheet
storageInit
Re-exports storageInit
stylesRenderProvider
Re-exports stylesRenderProvider
TCookieStorage
Re-exports TCookieStorage
TCookieWindowContext
Re-exports TCookieWindowContext
TLocalStorage
Re-exports TLocalStorage
TLocalStorageEvent
Re-exports TLocalStorageEvent
TLocalStorageWindowContext
Re-exports TLocalStorageWindowContext
TParams
Re-exports TParams
TReadyDocumentContext
Re-exports TReadyDocumentContext
TReadyFn
Re-exports TReadyFn
TReadyUnsubscribe
Re-exports TReadyUnsubscribe
TReadyWindowContext
Re-exports TReadyWindowContext
TRouteMapper
Re-exports TRouteMapper
TSetStyleSheetDocument
Re-exports TSetStyleSheetDocument
TStyleItem
Re-exports TStyleItem
TStylesRenderDocument
Re-exports TStylesRenderDocument
TUrlProps
Re-exports TUrlProps
TViewportWindowContext
Re-exports TViewportWindowContext