Window Open Promise Reference
๐ช Promised Window.open();
.
Usage
๐ฆ Node
Install window-open-promise
as a dependency:
Import it and use it:
๐ฆ Deno
Import window-open-promise
using the npm:
prefix, and use it directly:
๐ Browser
Import window-open-promise
using esm.sh, and use it directly:
Useful links
- ๐ Documentation: TypeDoc generated documentation.
- โณ Changelog: List of changes between versions.
- โ Tests Coverage: Coveralls page with tests coverage.
Type Aliases
WindowOpenPromiseFeatures
WindowOpenPromise features.
WindowOpenPromiseOptions
WindowOpenPromise options.
Type declaration
Member | Type | Description |
---|---|---|
height | number | WindowOpenPromise height (minimum 100). |
left | number | WindowOpenPromise left position. |
menuBar | boolean | WindowOpenPromise renders the menu bar. |
noOpener | boolean | WindowOpenPromise canโt access itโs opener. |
resizable | boolean | WindowOpenPromise is resizable. |
scrollbars | boolean | WindowOpenPromise has scrollbars. |
target | string | WindowOpenPromise target. |
titleBar | boolean | WindowOpenPromise renders the title bar. |
toolBar | boolean | WindowOpenPromise renders the tool bar. |
top | number | WindowOpenPromise top position. |
url | string | WindowOpenPromise url. |
width | number | WindowOpenPromise width (minimum 100). |
Functions
featureJoin()
Joins given array of features with the FEATURE_SEPARATOR.
Type parameters
Type parameter |
---|
Item extends Strigifiable |
Parameters
Parameter | Type |
---|---|
iterable | Readonly <Iterable <Item >> |
Returns
`${string},${string}`
Joint string.
Example
featureMap()
Maps array of feature entries to valid values.
Parameters
Parameter | Type |
---|---|
iterable | Readonly <Iterable <EntryOf <WindowOpenPromiseFeatures >>> |
Returns
Readonly
<IterableIterator
<string
>>
Array of formatted features.
Example
featureParser()
Parses features object into features string.
Parameters
Parameter | Type | Description |
---|---|---|
features ? | WindowOpenPromiseFeatures | Features object. |
Returns
string
Parsed string.
Example
featureValueMapper()
Takes a feature value and returns a formatted feature value.
Parameters
Parameter | Type |
---|---|
value | unknown |
Returns
number
Feature value.
Example
windowOpenPromise()
Promised Window.open.
Parameters
Parameter | Type |
---|---|
global | Readonly <Pick <Window , "open" >> |
Returns
Function
Curried function with window
in context.
Curried function with window
set.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
options | WindowOpenPromiseOptions | EMPTY_OBJECT | WindowOpenPromise options. |
Returns
Promise
<Window
>
Promise with new window.