open-index/open-npm huggingface dataset:
npm package: @posva/event-emitter
Description: Type safe and light event emitter / pubsub class
Author: Eduardo San Martin Morote
Latest version: 1.0.3

# EventEmitter [![ci](https://github.com/posva/event-emitter/actions/workflows/ci.yml/badge.svg)](https://github.com/posva/event-emitter/actions/workflows/ci.yml) [![npm package](https://badgen.net/npm/v/@posva/event-emitter?)](https://www.npmjs.com/package/@posva/event-emitter) [![codecov](https://codecov.io/github/posva/event-emitter/graph/badge.svg?token=37fOzdCXYi)](https://codecov.io/github/posva/event-emitter) [![thanks](https://badgen.net/badge/thanks/♥/pink)](https://esm.dev/open-source)

> Typed event and lightweight event emitter with a class based API

- ⛓️ **Typed**: Powerful autocompletion and type checking
- 📦 **Class based**: Add event emitting to your classes
- 💨 **Lightweight**: 188 bytes min+brotli
- 🌐 **Runtime Agnostic**: Works everywhere: Browser, node, Bun...

## Installation

```sh
npm i @posva/event-emitter
```

## Usage

```ts
import { EventEmitter } from '@posva/event-emitter'

const emitter = new EventEmitter<{
  // Define the events you want to emit and their arguments
  start: []
  // non tuples are also supported
  end: { reason: string }

  // You can also define multiple arguments
  sum: [number, number]
}>()

// no arguments
emitter.emit('start')
// object payload
emitter.emit('end', { reason: 'finished' })
// multiple arguments
emitter.emit('sum', 1, 2)

emitter.on('end', ({ reason }) => console.log('ended:', reason))

// You can also listen to all events

emitter.on('*', (event, payload) => {
  if (event === 'end') {
    // payload is always an array
    const [{ reason }] = payload
  } else if (event === 'sum') {
    const [a, b] = payload
  }
})
```

Since `EventEmitter` is a class, you can extend it in your own classes:

```ts
class CardGame extends EventEmitter<{
  start: []
  end: { winner: string }
  draw: [player: string, card: string]
  play: [player: string, card: string]
}> {
  start() {
    this.emit('start')
  }

  end(winner: string) {
    this.emit('end', { winner })
  }
}
```

## API

Most of the code can be discovered through the autocompletion but the API documentation is available at [https://event-emitter.esm.is](https://event-emitter.esm.is).

## Related

- [mitt](https://github.com/developit/mitt): this library is a fork of mitt with a class based API and better types

## License

[MIT](http://opensource.org/licenses/MIT)
npm package: @posva/vue-router-next
Description: ## Status: Alpha
Latest version: 4.0.0-alpha.0

# vue-router-next [![CircleCI](https://circleci.com/gh/vuejs/vue-router-next.svg?style=svg)](https://circleci.com/gh/vuejs/vue-router-next)

## Status: Alpha

The current codebase has most of the existing features on Vue Router v3.x and is usable. It supports all the [merged RFCs](https://github.com/vuejs/rfcs/pulls?q=is%3Apr+is%3Amerged+label%3Arouter).

Since the library is still unstable **and because we want feedback** on bugs and missing features, **it will probably go through a few breaking changes**.

## Known issues

### Breaking changes compared to vue-router@3.x

- `mode: 'history'` -> `history: createWebHistory()`
- Catch all routes (`/*`) must now be defined using a parameter with a custom regex: `/:catchAll(.*)`

### Missing features

- `keep-alive` is not yet supported
- Partail support of per-component navigation guards. No `beforeRouteEnter`

## Contributing

See [Contributing Guide](https://github.com/vuejs/vue-router-next/blob/master/.github/contributing.md).
npm package: @posva/vue-theme
Description: The design system for Vue.js.
Author: Evan You
Latest version: 1.0.1

# Vue Theme

This is the [VitePress](https://vitepress.vuejs.org/) theme for the official Vue documentation at `vuejs.org`.

Please note this theme is solely dedicated for `vuejs.org` and isn't meant to be used as a content-neutral theme. It does **not** follow semver and may contain hard-coded logic specific to the Vue documentation.

## Development Setup

This repo can be developed on its own since it is a self-contained VitePress theme. Make sure to use [pnpm](https://pnpm.io/) as the package manager when installing deps. A demo app is available in `/demo` and can be run with `npm run dev`:

```bash
$ pnpm install
$ npm run dev
```

## Developing with Real Content

To work on this theme in the context of the `vuejs.org` website requires cloning both repos and linking the theme into the docs repo:

1. Clone repositories:

   ```bash
   git clone git@github.com:vuejs/docs.git
   git clone git@github.com:vuejs/theme.git
   ```

2. Link theme into docs repo:

   ```bash
   # In ./theme
   pnpm install
   # Make @vue/theme available for global linking
   pnpm link --global

   # in ./docs
   pnpm install
   # Link teme
   pnpm link --global @vue/theme
   ```

3. Start VitePress server:

   ```bash
   # in ./docs
   pnpm run dev
   ```

### Available Scripts

Here is the list of available scripts that can be used during the development.

```bash
# Boot local dev server.
$ npm run dev

# Build demo, then serve locally. This is for testing
# production build in the local environment.
$ npm run serve

# Run lint via Prettier.
$ npm run lint

# Run type check via tsc.
$ npm run type
```

## License

[MIT](http://opensource.org/licenses/MIT)

Copyright (c) 2021-present Evan You
npm package: @posva/vuefire-bundler
Description: wrapper around rollup to bundle vuefire and vuexfire
Author: Eduardo San Martin Morote
Latest version: 1.1.4

# `@posva/vuefire-bundler`

> common config used to bundle vuefire and vuexfire

## Usage

```sh
node --eval 'require("@posva/vuefire-bundler")("MyLibrary")'
```

It can be added as a script in `package.json` file:

```json
{
  "scripts": {
    "build": "node --eval 'require(\"@posva/vuefire-bundler\")(\"Vuexfire\")'"
  }
}
```

## License

[MIT](http://opensource.org/licenses/MIT)
npm package: @posva/vuefire-core
Description: Shared code for vue + Firebase apps used by vuefire and vuexfire
Author: Eduardo San Martin Morote
Latest version: 2.3.4

# Vuefire Core

> Core logic used for vuefire and vuexfire

This library is intended for internal usage. You are free to use it to create your own plugins but keep in mind that the main target is a Vue plugin

## Installation

```sh
npm i @posva/vuefire-core
```

## Usage

```js
import { bindCollection, bindDocument, walkSet } from '@posva/vuefire-core'

// create an object of operations
const ops = {
  set: (target, path, value) => walkSet(target, path, value),
  add: (array, index, data) => array.splice(index, 0, data),
  remove: (array, index) => array.splice(index, 1),
}
const vm = new Vue({
  // options
})

const resolve = data => {
  console.log('reference bound:', data)
}

const reject = err => {
  console.log('error binding reference:', err)
}

// unbind is a function that tears down all listeners
const unbindItems = bindCollection(
  {
    // vm could be just an object
    vm,
    // key set on vm
    key: 'items',
    ops,
    collection: db.collection('items'),
    // this is to enable Promise based APIs
    // callback on success
    resolve,
    // callback on error
    reject,
  },
  // default options
  {
    maxRefDepth: 2,
  }
)

const unbindItem = bindDocument(
  {
    // same options as bindCollection except for collection -> document
    document: db.collection('items').doc('0'),
  },
  options
)

unbindItems()
bindCollection({
  // bind a different collection
  key: 'items',
})
```

## License

[MIT](http://opensource.org/licenses/MIT)
npm package: @posva/vuefire-test-helpers
Description: test helpers related to vue + firebase used by vuefire and vuexfire
Author: Eduardo San Martin Morote
Latest version: 1.2.3

# `@posva/vuefire-test-helpers`

> helpers used for tests in packages of vuefire repo

## Usage

```js
import utils from '@posva/vuefire-test-helpers'
```

## License

[MIT](http://opensource.org/licenses/MIT)
npm package: @poswap/sdk
Description: 🛠 An SDK for building applications on top of poswap.
Latest version: 1.0.1-1

# poswap SDK

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/poswap/poswap-sdk.git
```

Move into the poswap-sdk working directory

```sh
cd poswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @posx/hirector
Description: [![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![bundle][bundle-src]][bundle-href] [![JSDocs][jsdocs-src]][jsdocs-href] [![License][license-src]][license-href]
Author: Steven Lee
Latest version: 0.0.19

# pkg-placeholder

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![JSDocs][jsdocs-src]][jsdocs-href]
[![License][license-src]][license-href]

_description_

> **Note**:
> Replace `pkg-placeholder`, `_description_` and `antfu` globally to use this template.

## Sponsors

<p align="center">
  <a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
    <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
  </a>
</p>

## License

[MIT](./LICENSE) License © 2024-PRESENT [Anthony Fu](https://github.com/antfu)

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669
[npm-version-href]: https://npmjs.com/package/pkg-placeholder
[npm-downloads-src]: https://img.shields.io/npm/dm/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669
[npm-downloads-href]: https://npmjs.com/package/pkg-placeholder
[bundle-src]: https://img.shields.io/bundlephobia/minzip/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669&label=minzip
[bundle-href]: https://bundlephobia.com/result?p=pkg-placeholder
[license-src]: https://img.shields.io/github/license/antfu/pkg-placeholder.svg?style=flat&colorA=080f12&colorB=1fa669
[license-href]: https://github.com/antfu/pkg-placeholder/blob/main/LICENSE
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
[jsdocs-href]: https://www.jsdocs.io/package/pkg-placeholder
npm package: @posx/imin-cashdrawer
Description: Cashdrawer plugin for imin android POS
Author: posx team
Latest version: 5.0.8

# @posx/imin-cashdrawer

Cashdrawer plugin for imin android POS

## Install

```bash
npm install @posx/imin-cashdrawer
npx cap sync
```

## API

<docgen-index>

* [`open()`](#open)
* [`isOpen()`](#isopen)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### open()

```typescript
open() => Promise<{ success: boolean; }>
```

Open the cash drawer

**Returns:** <code>Promise&lt;{ success: boolean; }&gt;</code>

--------------------


### isOpen()

```typescript
isOpen() => Promise<{ isOpen: boolean; }>
```

Get cash drawer status

**Returns:** <code>Promise&lt;{ isOpen: boolean; }&gt;</code>

--------------------

</docgen-api>
npm package: @posx/yeahpay
Description: YeahPay payment integration library
Author: POSX Team
Latest version: 1.0.18

# @posx/yeahpay

YeahPay支付集成库，提供安全的支付接口封装，支持银行卡与二维码支付。

## ✨ 特性

- 🔐 安全加密（RSA+AES、SHA-256）
- 🏦 多种支付（银行卡、主扫、被扫）
- 🔄 异步查询与轮询
- 💰 退款与撤销
- 🧪 内置模拟，便于测试
- 📱 基于 Capacitor，无 CORS 限制
- 📝 TypeScript 类型完整

## 📦 安装

```bash
npm install @posx/yeahpay
```

**依赖要求：**
- 需要 Capacitor 环境（v5/v6/v7）
- 如果项目未安装，需额外安装：`npm install @capacitor/core`

**说明：** 本库使用 Capacitor HTTP 插件进行网络请求，避免浏览器 CORS 限制。

## 🚀 快速开始

### 基础配置

```typescript
import { YeahPayClient, IYeahPayApiConfig } from '@posx/yeahpay'

const config: IYeahPayApiConfig = {
  asyncUrl: 'https://your-yeahpay-server.com/async',
  appId: 'YOUR_APP_ID',
  deviceSn: 'YOUR_DEVICE_SERIAL',
  serverRsaPublic: 'YOUR_SERVER_RSA_PUBLIC_KEY',
  clientRsaPrivate: 'YOUR_CLIENT_RSA_PRIVATE_KEY',
  signatureKey: 'YOUR_SIGNATURE_KEY'
}

const client = new YeahPayClient(config)
```

### 简单示例

```typescript
// 银行卡支付
const pay = await client.createCardCharge({ amount: '10.50', bizOrderId: 'ORDER_' + Date.now() })
if (pay.success) {
  const q = await client.queryOrder({ bizOrderId: pay.data.bizOrderId })
  if (q.data.status === 2) console.log('支付成功')
}

// 二维码主扫
await client.createQRScanCharge({ amount: '25.00', bizOrderId: 'QR_' + Date.now(), authCode: '13319...' })

// 二维码被扫（示例以微信为例）
await client.createQRCodeCharge({ amount: '15.80', bizOrderId: 'QRCODE_' + Date.now(), payWay: 'WXZF' })
```

## 🔧 API 概览

```typescript
class YeahPayClient {
  constructor(config: IYeahPayApiConfig)
  createCardCharge(req: IYeahPayCreateChargeRequest): Promise<IYeahPayResponse>
  createQRScanCharge(req: IYeahPayCreateChargeRequest): Promise<IYeahPayResponse>
  createQRCodeCharge(req: IYeahPayCreateChargeRequest): Promise<IYeahPayResponse>
  queryOrder(req: IYeahPayQueryRequest): Promise<IYeahPayResponse>
  refundCardCharge(req: IYeahPayRefundRequest): Promise<IYeahPayResponse>
  cancelCardCharge(req: Omit<IYeahPayRefundRequest, 'amount'>): Promise<IYeahPayResponse>
  refundQRCharge(req: IYeahPayRefundRequest): Promise<IYeahPayResponse>
  settlement(bizSettlementFlowId: string): Promise<IYeahPayResponse>
  reprint(bizOrderId: string, bizRefundId?: string): Promise<IYeahPayResponse>
  simulateCreateCharge(req: IYeahPayCreateChargeRequest): Promise<IYeahPayResponse>
  simulateQueryOrder(req: IYeahPayQueryRequest): Promise<IYeahPayResponse>
}

interface IYeahPayApiConfig {
  asyncUrl: string; appId: string; deviceSn: string;
  serverRsaPublic: string; clientRsaPrivate: string; signatureKey: string;
}

interface IYeahPayResponse {
  success: boolean; code: string; message: string; data?: any; traceId?: string; isTestData?: boolean;
}
```

## 🧪 运行

```bash
# 测试
npm test

# 集成测试
npm run test:integration

# 构建
npm run build
```

### 示例

```bash
npx ts-node examples/basic-usage.ts
```

## 📄 许可证与支持

- 许可证：MIT（见 `LICENSE`）
- Issues：`https://github.com/your-org/pay-yeahpay/issues`

---

版本：v1.0.6  
最后更新：2024-08-30