Pure TypeScript interfaces and type definitions for FluxGPU - zero dependencies
npm install @fluxgpu/contractsbash
pnpm add @fluxgpu/contracts
`
Usage
`typescript
import type { CommandBuffer, ResourceId, Opcode } from '@fluxgpu/contracts';
import { FluxError, ErrorCode } from '@fluxgpu/contracts';
// Create a command
const command: CommandBuffer = {
id: 'cmd-001' as ResourceId,
opcode: Opcode.CreateBuffer,
payload: new Uint8Array([1, 2, 3]),
dependencies: [],
};
// Handle errors
throw new FluxError(ErrorCode.InvalidResource, 'Buffer not found');
`
Key Types
| Type | Description |
|------|-------------|
| CommandBuffer | Represents a GPU command with dependencies |
| ResourceId | Branded type for resource identification |
| Opcode | Enum of all supported GPU operations |
| FluxError` | Typed error with error codes |