Skip to content

Commit

Permalink
chore(api): generate types + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Jul 22, 2024
1 parent f865381 commit fbc8c08
Show file tree
Hide file tree
Showing 2 changed files with 314 additions and 209 deletions.
69 changes: 48 additions & 21 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ External docs: https://nodejs.org/api/events.html
<!-- This file is generated by bin/docs-generator/api-module.js -->
<!-- Do not edit this file directly. -->

# [application](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L13)
# [application](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L14)


Provides Application level methods
Expand All @@ -25,25 +25,44 @@ External docs: https://nodejs.org/api/events.html
import { createWindow } from 'socket:application'
```

## [MAX_WINDOWS](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L38)
## [MAX_WINDOWS](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L62)

This is a `VariableDeclaration` named `MAX_WINDOWS` in `api/application.js`, it's exported but undocumented.


## [ApplicationWindowList](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L40)
## [ApplicationWindowList](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L64)

This is a `ClassDeclaration` named `ApplicationWindowList` in `api/application.js`, it's exported but undocumented.


## [`getCurrentWindowIndex()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L165)
## [`addEventListener(type, listener, |boolean)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L191)

Add an application event `type` callback `listener` with `options`.

| Argument | Type | Default | Optional | Description |
| :--- | :--- | :---: | :---: | :--- |
| type | string | | false | |
| listener | function(Event \| MessageEvent \| CustomEvent \| ApplicationURLEvent): boolean | | false | |
| |boolean | { once?: boolean | } options | false | |

## [`removeEventListener(type, listener)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L200)

Remove an application event `type` callback `listener` with `options`.

| Argument | Type | Default | Optional | Description |
| :--- | :--- | :---: | :---: | :--- |
| type | string | | false | |
| listener | function(Event \| MessageEvent \| CustomEvent \| ApplicationURLEvent): boolean | | false | |

## [`getCurrentWindowIndex()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L208)

Returns the current window index

| Return Value | Type | Description |
| :--- | :--- | :--- |
| Not specified | number | |

## [`createWindow(opts)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L200)
## [`createWindow(opts)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L243)

Creates a new window and returns an instance of ApplicationWindow.

Expand Down Expand Up @@ -81,23 +100,23 @@ Creates a new window and returns an instance of ApplicationWindow.
| :--- | :--- | :--- |
| Not specified | Promise<ApplicationWindow> | |

### [`radius()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L227)
### [`radius()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L270)



### [`margin()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L232)
### [`margin()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L275)



## [`getScreenSize()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L320)
## [`getScreenSize()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L363)

Returns the current screen size.

| Return Value | Type | Description |
| :--- | :--- | :--- |
| Not specified | Promise<{ width: number, height: number | >} |

## [`getWindows(indices)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L351)
## [`getWindows(indices)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L394)

Returns the ApplicationWindow instances for the given indices or all windows if no indices are provided.

Expand All @@ -109,7 +128,7 @@ Returns the ApplicationWindow instances for the given indices or all windows if
| :--- | :--- | :--- |
| Not specified | Promise<ApplicationWindowList> | |

## [`getWindow(index)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L405)
## [`getWindow(index)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L448)

Returns the ApplicationWindow instance for the given index

Expand All @@ -121,15 +140,15 @@ Returns the ApplicationWindow instance for the given index
| :--- | :--- | :--- |
| Not specified | Promise<ApplicationWindow> | the ApplicationWindow instance or null if the window does not exist |

## [`getCurrentWindow()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L415)
## [`getCurrentWindow()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L458)

Returns the ApplicationWindow instance for the current window.

| Return Value | Type | Description |
| :--- | :--- | :--- |
| Not specified | Promise<ApplicationWindow> | |

## [`exit(code)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L424)
## [`exit(code)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L467)

Quits the backend process and then quits the render process, the exit code used is the final exit code to the OS.

Expand All @@ -141,7 +160,7 @@ Quits the backend process and then quits the render process, the exit code used
| :--- | :--- | :--- |
| Not specified | Promise<ipc.Result> | |

## [`setSystemMenu(options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L521)
## [`setSystemMenu(options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L564)

Set the native menu for the app.

Expand Down Expand Up @@ -236,11 +255,11 @@ Set the native menu for the app.
| :--- | :--- | :--- |
| Not specified | Promise<ipc.Result> | |
## [`setTrayMenu()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L528)
## [`setTrayMenu()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L571)
An alias to setSystemMenu for creating a tary menu
## [`setSystemMenuItemEnabled(value)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L537)
## [`setSystemMenuItemEnabled(value)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L580)
Set the enabled state of the system menu.
Expand All @@ -252,23 +271,31 @@ Set the enabled state of the system menu.
| :--- | :--- | :--- |
| Not specified | Promise<ipc.Result> | |
## [runtimeVersion](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L545)
## [`isPaused()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L588)
Predicate function to determine if application is in a "paused" state.
| Return Value | Type | Description |
| :--- | :--- | :--- |
| Not specified | boolean | |
## [runtimeVersion](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L596)
Socket Runtime version.
## [debug](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L551)
## [debug](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L602)
Runtime debug flag.
## [config](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L557)
## [config](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L608)
Application configuration.
## [backend](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L562)
## [backend](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L613)
The application's backend instance.
### [`open(opts)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L568)
### [`open(opts)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L619)
Expand All @@ -281,7 +308,7 @@ The application's backend instance.
| :--- | :--- | :--- |
| Not specified | Promise<ipc.Result> | |
### [`close()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L576)
### [`close()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/application.js#L627)
Expand Down
Loading

0 comments on commit fbc8c08

Please sign in to comment.