Registry / testing / grpc-typed

grpc-typed

JSON →
library1.0.0jsnpmunverified

Provides TypeScript type definitions for the gRPC Node.js library, enabling type-safe gRPC service definitions and client/server implementations. Version 1.0.0 includes basic types for gRPC service methods, metadata, and error handling. It wraps the core grpc package and only adds types; no runtime functionality. The package is intended for use with grpc v1.x and is unlikely to receive frequent updates. Compare to @grpc/grpc-js which is the maintained successor with built-in types.

npm install grpc-typed
INSTALL
IMPORT
SIG · GRPC-TYPED
G
grpc-typed
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ServiceDefinition
import { ServiceDefinition } from 'grpc-typed'
const { ServiceDefinition } = require('grpc-typed')
ESM syntax; CommonJS require may fail if module resolution is not configured.
MethodDefinition
import { MethodDefinition } from 'grpc-typed'
Type-only export; used for defining gRPC method signatures.
Metadata
import type { Metadata } from 'grpc-typed'
import { Metadata } from 'grpc-typed'
Metadata class from @grpc/grpc-js; grpc-typed may re-export type only.

Defines a typed gRPC service using grpc-typed type definitions for gRPC v1.x.

import * as grpc from 'grpc'; import { ServiceDefinition, MethodDefinition } from 'grpc-typed'; interface IGreeterService { sayHello: MethodDefinition<{ name: string }, { message: string }>; } const GreeterService: ServiceDefinition<IGreeterService> = { sayHello: { path: '/helloworld.Greeter/SayHello', requestStream: false, responseStream: false, requestSerialize: grpc.serializeObject, requestDeserialize: grpc.deserializeObject, responseSerialize: grpc.serializeObject, responseDeserialize: grpc.deserializeObject, }, }; export { GreeterService };
Debug
Known issues
deprecatedPackage grpc is deprecated; use @grpc/grpc-js instead.
fix
Migrate to @grpc/grpc-js which has built-in TypeScript types.
affects: >=1.0.0
gotchaNo type declarations for streaming methods; requestStream and responseStream may not be correctly typed.
fix
Manually cast or extend MethodDefinition for streaming.
affects: 1.0.0
breakingVersion 1.0.0 does not include types for interceptors or call credentials.
fix
Use additional type packages or integrate with grpc interceptors manually.
affects: 1.0.0
deprecatedgrpc-typed is no longer maintained; consider using @grpc/proto-loader or generate types from protobuf.
fix
Switch to @grpc/proto-loader with gRPC-Tools for auto-generated types.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'grpc-typed' or its corresponding type declarations.
Package not installed or used with @grpc/grpc-js instead of grpc.
fix
Install grpc-typed: npm install grpc-typed; or migrate to @grpc/grpc-js.
TypeError: grpc.serializeObject is not a function
Using grpc v1.x serialize utilities when using @grpc/grpc-js v1.6+.
fix
Use grpc.serializeObject or generate serializers via protobuf.
Module '"grpc-typed"' has no exported member 'ServiceDefinition'.
Import syntax mismatch; TypeScript may not resolve types correctly.
fix
Ensure tsconfig includes node_modules types and use correct import path.
'MethodDefinition' only refers to a type, but is being used as a value here.
Using type-only export as a runtime value.
fix
Use import type { MethodDefinition } from 'grpc-typed' and do not use it in runtime.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
grpcrequiredCore gRPC runtime dependency; grpc-typed only provides types
Agent activity
6 hits · last 30 days
node
6
Resources
grpc-typed — npm install grpc-typed · libregistry