@0xshariq/voxa-types
v1.0.0
Published
Shared TypeScript type definitions for Voxa HTTP Client ecosystem (CLI, API, SDKs)
Maintainers
Readme
@0xshariq/voxa-types
Shared TypeScript type definitions for the Voxa HTTP Client ecosystem.
Installation
npm install @0xshariq/voxa-types
# or
pnpm add @0xshariq/voxa-types
# or
yarn add @0xshariq/voxa-typesUsage
Import All Types
import type { VoxaConfig, HttpMethod, CacheConfig } from '@0xshariq/voxa-types';Import Specific Modules
// Client types
import type { VoxaConfig, VoxaResponse } from '@0xshariq/voxa-types/client';
// Cache types
import type { CacheConfig, CacheAdapter } from '@0xshariq/voxa-types/cache';
// Streaming types
import type { StreamingImageOptions, ImagePayload } from '@0xshariq/voxa-types/streaming';
// GraphQL types
import type { GraphQLConfig, GraphQLRequest } from '@0xshariq/voxa-types/graphql';Type Categories
Client Types
VoxaConfig- Main client configurationVoxaResponse- Response wrapper with metadataHttpMethod- Supported HTTP methodsRequestPriority- Request priority levels
Cache Types
CacheConfig- Cache configurationCacheAdapter- Custom cache adapter interfaceCacheEntry- Cache entry structure
Streaming Types
StreamingImageOptions- Image streaming configurationStreamingVideoOptions- Video streaming configurationImagePayload- Supported image typesVideoPayload- Supported video types
GraphQL Types
GraphQLConfig- GraphQL configurationGraphQLRequest- GraphQL query requestGraphQLResponse- GraphQL response structureGraphQLError- GraphQL error format
HTTP/2 Types
Http2PushConfig- HTTP/2 push configurationPushedResource- Pushed resource metadata
Common Types
RequestMetadata- Request tracking metadataRetryConfig- Retry configurationQueueConfig- Queue configurationCircuitBreakerConfig- Circuit breaker configuration- And more...
Usage in Projects
In CLI
import type { VoxaConfig } from '@0xshariq/voxa-types';
function createClient(config: VoxaConfig) {
// CLI implementation
}In API
import type { VoxaResponse, HttpMethod } from '@0xshariq/voxa-types';
async function handleRequest(method: HttpMethod): Promise<VoxaResponse> {
// API implementation
}In SDKs
import type { CacheConfig, StreamingImageOptions } from '@0xshariq/voxa-types';
class VoxaSDK {
constructor(
cache: CacheConfig,
streaming: StreamingImageOptions
) {
// SDK implementation
}
}License
MIT © Sharique Chaudhary
