Permalink
Browse files

Other: Use typedefs in ext/descriptor (like everywhere else), see #757

  • Loading branch information...
dcodeIO committed Apr 13, 2017
1 parent b9f1790 commit 2a30df8bd5f20d91143a38c2232dafc3a6f3a7bd
Showing with 115 additions and 100 deletions.
  1. +1 −1 ext/descriptor/README.md
  2. +49 −49 ext/descriptor/index.d.ts
  3. +64 −50 ext/descriptor/index.js
  4. +1 −0 ext/descriptor/test.js
@@ -23,7 +23,7 @@ var buffer = descriptor.FileDescriptorSet.encode(fileDescriptorSet).finish();
var decoded = descriptor.FileDescriptorSet.decode(buffer);
// convert it back to a protobuf.js root
root = protobuf.Root.fromDescriptor(decoded, "proto2");
root = protobuf.Root.fromDescriptor(decoded);
// and start all over again
```
@@ -1,107 +1,107 @@
import * as $protobuf from "../..";
export interface IFileDescriptorSet {
file: IFileDescriptorProto[];
}
type FileDescriptorSetProperties = {
file: FileDescriptorProtoProperties[];
};
export interface IFileDescriptorProto {
type FileDescriptorProtoProperties = {
name?: string;
package?: string;
dependency?: any;
publicDependency?: any;
weakDependency?: any;
messageType?: IDescriptorProto[];
enumType?: IEnumDescriptorProto[];
service?: IServiceDescriptorProto[];
extension?: IFieldDescriptorProto[];
messageType?: DescriptorProtoProperties[];
enumType?: EnumDescriptorProtoProperties[];
service?: ServiceDescriptorProtoProperties[];
extension?: FieldDescriptorProtoProperties[];
options?: any;
sourceCodeInfo?: any;
syntax?: string;
}
};
export interface IDescriptorProto {
type DescriptorProtoProperties = {
name?: string;
field?: IFieldDescriptorProto[];
extension?: IFieldDescriptorProto[];
nestedType?: IDescriptorProto[];
enumType?: IEnumDescriptorProto[];
extensionRange?: IExtensionRange[];
oneofDecl?: IOneofDescriptorProto[];
options?: IMessageOptions;
reservedRange?: IReservedRange[];
field?: FieldDescriptorProtoProperties[];
extension?: FieldDescriptorProtoProperties[];
nestedType?: DescriptorProtoProperties[];
enumType?: EnumDescriptorProtoProperties[];
extensionRange?: ExtensionRangeProperties[];
oneofDecl?: OneofDescriptorProtoProperties[];
options?: MessageOptionsProperties;
reservedRange?: ReservedRangeProperties[];
reservedName?: string[];
}
};
export interface IMessageOptions {
type MessageOptionsProperties = {
mapEntry?: boolean;
}
};
export interface IExtensionRange {
type ExtensionRangeProperties = {
start?: number;
end?: number;
}
};
export interface IReservedRange {
type ReservedRangeProperties = {
start?: number;
end?: number;
}
};
export interface IFieldOptions {
type FieldOptionsProperties = {
packed?: boolean;
}
};
export interface IFieldDescriptorProto {
type FieldDescriptorProtoProperties = {
name?: string;
number?: number;
label?: IFieldDescriptorProto_Label;
type?: IFieldDescriptorProto_Type;
label?: FieldDescriptorProtoLabel;
type?: FieldDescriptorProtoType;
typeName?: string;
extendee?: string;
defaultValue?: any;
oneofIndex?: number;
jsonName?: any;
options?: IFieldOptions;
}
options?: FieldOptionsProperties;
};
type IFieldDescriptorProto_Label = number;
type FieldDescriptorProtoLabel = number;
type IFieldDescriptorProto_Type = number;
type FieldDescriptorProtoType = number;
export interface IEnumDescriptorProto {
type EnumDescriptorProtoProperties = {
name?: string;
value?: IEnumValueDescriptorProto[];
options?: IEnumOptions;
}
value?: EnumValueDescriptorProtoProperties[];
options?: EnumOptionsProperties;
};
export interface IEnumValueDescriptorProto {
type EnumValueDescriptorProtoProperties = {
name?: string;
number?: number;
options?: any;
}
};
export interface IEnumOptions {
type EnumOptionsProperties = {
allowAlias?: boolean;
}
};
export interface IOneofDescriptorProto {
type OneofDescriptorProtoProperties = {
name?: string;
options?: any;
}
};
export interface IServiceDescriptorProto {
type ServiceDescriptorProtoProperties = {
name?: string;
method?: IMethodDescriptorProto[];
method?: MethodDescriptorProtoProperties[];
options?: any;
}
};
export interface IMethodDescriptorProto {
type MethodDescriptorProtoProperties = {
name?: string;
inputType?: string;
outputType?: string;
options?: any;
clientStreaming?: boolean;
serverStreaming?: boolean;
}
};
export const FileDescriptorSet: $protobuf.Type;
export const FileDescriptorProto: $protobuf.Type;
export const DescriptorProto: $protobuf.Type;
Oops, something went wrong.

0 comments on commit 2a30df8

Please sign in to comment.