# @types/jschannel

> TypeScript definitions for jschannel

Latest version **1.0.6** (published 2023-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/jschannel
pnpm add @types/jschannel
yarn add @types/jschannel
bun add @types/jschannel
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-11-21 |
| First published | 2017-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51439 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/jschannel
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jschannel
- npm.io page: https://npm.io/package/@types/jschannel

## Recent versions

- 1.0.6 (latest) — 2023-11-21
- 1.0.2 (ts3.6) — 2021-07-08
- 1.0.1 (ts2.4) — 2018-10-15
- 1.0.5 — 2023-11-07
- 1.0.4 — 2023-10-18
- 1.0.3 — 2023-09-15
- 1.0.0 — 2017-11-30

## README

# Installation
> `npm install --save @types/jschannel`

# Summary
This package contains type definitions for jschannel (https://github.com/yochannah/jschannel).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jschannel.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jschannel/index.d.ts)
````ts
export as namespace Channel;

export function build(config: ChannelConfiguration): MessagingChannel;

export interface MessagingChannel {
    unbind: (method: string, doNotPublish?: boolean) => boolean;
    bind: (
        method: string,
        callback?: (transaction: MessageTransaction, params: any) => void,
        doNotPublish?: boolean,
    ) => MessagingChannel;
    call: (message: Message) => void;
    notify: (message: Message) => void;
    destroy: () => void;
}

export interface Message {
    method: string;
    success?: ((result: any) => void) | undefined;
    params?: any;
    timeout?: number | undefined;
    error?: ((error: any, message: string) => void) | undefined;
}

export interface ChannelConfiguration {
    window: Window;
    origin: string;
    scope: string;
    debugOutput?: boolean | undefined;
    postMessageObserver?: ((origin: string, message: Message) => void) | undefined;
    gotMessageObserver?: ((origin: string, message: Message) => void) | undefined;
    onReady?: ((channel: MessagingChannel) => void) | undefined;
    reconnect?: boolean | undefined;
    publish?: boolean | undefined;
    remote?: string | readonly string[] | undefined;
}

export interface MessageTransaction {
    delayReturn: (delay: boolean) => boolean;
    complete: (result: any) => void;
    error: (error: any, message: string) => void;
    invoke: (callbackName: string, params: any) => void;
    completed: () => boolean;
}

````

### Additional Details
 * Last updated: Mon, 20 Nov 2023 23:36:24 GMT
 * Dependencies: none

# Credits
These definitions were written by [Yitzchok Gottlieb](https://github.com/yitzchok), and [McFlat](https://github.com/McFlat).

---
_Source: https://npm.io/package/@types/jschannel · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
