open-index/open-npm huggingface dataset:
npm package: @protoc-gen-go-wasmjs/runtime
Description: Runtime utilities for protoc-gen-go-wasmjs generated code
Author: Sri Panyam
Latest version: 0.0.33

# @protoc-gen-go-wasmjs/runtime

Runtime utilities for TypeScript code generated by [protoc-gen-go-wasmjs](https://github.com/panyam/protoc-gen-go-wasmjs).

## Installation

```bash
npm install @protoc-gen-go-wasmjs/runtime
# or
pnpm add @protoc-gen-go-wasmjs/runtime
# or
yarn add @protoc-gen-go-wasmjs/runtime
```

## Usage

This package provides shared runtime utilities used by generated TypeScript clients. You typically don't need to import these directly - they're imported automatically by generated code.

### Browser Service Manager

Handles WASM service calls in browser environments:

```typescript
import { BrowserServiceManager } from '@protoc-gen-go-wasmjs/runtime/browser';

const manager = new BrowserServiceManager();
manager.registerService('MyService', myServiceImplementation);
await manager.startProcessing();
```

### Schema Types

Type definitions for protobuf schema handling:

```typescript
import { FieldType, FieldSchema, MessageSchema } from '@protoc-gen-go-wasmjs/runtime/schema';
```

### Client Types

Common interfaces for WASM clients:

```typescript
import { WASMResponse, WasmError } from '@protoc-gen-go-wasmjs/runtime/client';
```

### Factory Types

Interfaces for message factory patterns:

```typescript
import { FactoryResult, FactoryInterface } from '@protoc-gen-go-wasmjs/runtime/types';
```

### Patch Types

Types for stateful proxy operations:

```typescript
import { PatchOperation, MessagePatch, PatchBatch } from '@protoc-gen-go-wasmjs/runtime/types';
```

## Tree Shaking

This package is designed for optimal tree shaking. Import only what you need:

```typescript
// Import everything (not recommended)
import * from '@protoc-gen-go-wasmjs/runtime';

// Import specific modules (recommended)
import { BrowserServiceManager } from '@protoc-gen-go-wasmjs/runtime/browser';
import { FieldType } from '@protoc-gen-go-wasmjs/runtime/schema';
```

## TypeScript Support

Full TypeScript support with complete type definitions included.

## License

Apache-2.0