open-index/open-npm huggingface dataset:
npm package: @harmonia/app-client
Description: Harmonia packages allow communication between apps inside of iframes and their parent window.
Latest version: 1.0.4

# Harmonia - App Client

Harmonia packages allow communication between apps inside of iframes and their parent window.

`@harmonia/app-client` should be used inside the iframe to communicate with the parent window.

## Installing

```bash
> npm install @harmonia/app-client
```
or

```bash
> yarn add @harmonia/app-client
```

## Usage

### Connecting
First of all, a connection to the `HostApp` needs to be completed. 

```ts
 const Harmonia = require('@harmonia/app-client')
 const hostApp = await Harmonia.HostApp.connect()
  
 const payload = hostApp.initPayload
```

The `connect()` method will return a `initPayload` that may have required data to initiate the application. 

:warning: Note that if there is no `HostApp` to connect, an error will be thrown. In case this is not desirable for you, you should use a `try-catch` to wrap `Harmonia.HostApp.connect()`

### Communicating

#### Receivig Events
Use method `on` to listen to events sended from host app.

```ts
hostApp.on('init', (event) => {
  console.log(event)
})
```

#### Sending Events
To send events, use `hostApp.publish(event)`. 

```ts
hostApp.publish({
  type: 'my-event-type',
  data: {
    foo: {},
  },
})
```

:information_source: You can import and use `NativeEventType` to use Harmonia predefined event types, for example, `type: NativeEventType.RESIZE`
npm package: @harmonia/core
Description: Harmonia packages allow communication between apps inside of iframes and their parent window.
Latest version: 1.0.4

# Harmonia - Core

Harmonia packages allow communication between apps inside of iframes and their parent window.

`@harmonia/core` contains assets such as `types`, `classes` and `interfaces` shared between other Harmonia packages: [`@harmonia/app-client`](https://www.npmjs.com/package/@harmonia/app-client) and [`@harmonia/host-client`](https://www.npmjs.com/package/@harmonia/host-client)

It is added as a dependency from those other packages, so you should not have to install it manually.
npm package: @harmonia/host-client
Description: Harmonia packages allow communication between apps inside of iframes and their parent window.
Latest version: 1.0.4

# Harmonia - App Client

Harmonia packages allow communication between apps inside of iframes and their parent window.

`@harmonia/host-client` should be used by a window that has an iframe in it, and wants to communicate with the iframe content window.

## Installing

```bash
> npm install @harmonia/host-client
```
or

```bash
> yarn add @harmonia/host-client
```

## Usage

### Creating App
First of all, the `app` instance needs to be created. 
```ts
import Harmonia from '@harmonia/host-client'
this.app = await Harmonia.App.create(appConfig)
```

The `create()` method needs an `AppConfig` input. 

```ts
export interface AppConfig {
  containerElementId: string
  url: string
  name: string
  height: 'auto' | string
  width: string
  initPayload: any
  resizeEventDelayMs?: number
}
```

The `Harmonia.App.create(appConfig)` finds the HTML element with same ID as `appConfig.containerElementId`, them it creates an `iframe` with `appConfig.url` as `src` and appends this iframe as a child of the container. 
The method also returns an instance of the application to be used for communication. 

#### Dimensions
In `AppConfig` you can set the `height` and `width` of the iframe HTML element. 

- :arrow_up_down: You can set **height** as `"auto"` if you want the iframe to resize automatically and have the same height as its content. Or, you can set a fixed css value, e.g "1000px" or "100vh".  

- :left_right_arrow: For **width**, you can set a fixed css value, e.g "100%", "300px" or "100vw". 

### Communicating

#### Receivig Events
Use method `on` to listen to events sended from host app.

```ts
app.on('ready', (event) => {
  console.log(event)
})
```

#### Sending Events
To send events, use `app.publish(event)`. 

```ts
app.publish({
  type: 'my-event-type',
  data: {
    foo: {},
  },
})
```

:information_source: You can import and use `NativeEventType` to use Harmonia predefined event types, for example, `type: NativeEventType.RESIZE`
npm package: @harmonicinc/vosplayer-core
Description: VOS Player Core SDK
Author: Enson Choy
Latest version: 0.1.479

# VOS Player Core SDK

## Build
`yarn build`

The `dist` directory will be created with:
- `index.cjs` CommonJS
- `index.mjs` ES Module
- `index.js` Javascript IIFE for use with HTML script tag
- `*.js.map` Sourcemap files for reporting error line numbers
- `*.d.ts` Type definition files

## Usage
`import VosPlayer from '@harmonicinc/vosplayer-core'`