mirror of https://github.com/grpc/grpc-node.git
ConstructorParameters is already a TypeScript builtin
This commit is contained in:
parent
2d1cb15dec
commit
677741d442
|
@ -604,9 +604,8 @@ function generateRootFile(formatter: TextFormatter, root: Protobuf.Root, options
|
|||
generateServiceImports(formatter, root, options);
|
||||
formatter.writeLine('');
|
||||
|
||||
formatter.writeLine('type ConstructorArguments<Constructor> = Constructor extends new (...args: infer Args) => any ? Args: never;');
|
||||
formatter.writeLine('type SubtypeConstructor<Constructor, Subtype> = {');
|
||||
formatter.writeLine(' new(...args: ConstructorArguments<Constructor>): Subtype;');
|
||||
formatter.writeLine(' new(...args: ConstructorParameters<Constructor>): Subtype;');
|
||||
formatter.writeLine('};');
|
||||
formatter.writeLine('');
|
||||
|
||||
|
|
|
@ -4,9 +4,8 @@ import { ServiceDefinition, EnumTypeDefinition, MessageTypeDefinition } from '@g
|
|||
import { OperationsClient as _google_longrunning_OperationsClient } from './google/longrunning/Operations';
|
||||
import { EchoClient as _google_showcase_v1beta1_EchoClient } from './google/showcase/v1beta1/Echo';
|
||||
|
||||
type ConstructorArguments<Constructor> = Constructor extends new (...args: infer Args) => any ? Args: never;
|
||||
type SubtypeConstructor<Constructor, Subtype> = {
|
||||
new(...args: ConstructorArguments<Constructor>): Subtype;
|
||||
new(...args: ConstructorParameters<Constructor>): Subtype;
|
||||
};
|
||||
|
||||
export interface ProtoGrpcType {
|
||||
|
|
Loading…
Reference in New Issue