export type TypeDefinition = InterfaceDefinition | EnumDefinition | ServiceDefinition; export type InterfaceDefinition = { type: 'I'; fields: { [fieldName: string]: FieldDefinition; }; oneofs?: { [oneofName: string]: OneofGroup; }; }; export type FieldDefinition = { type: string; mapKeyType?: string; array?: boolean; optional?: boolean; }; export type OneofGroup = { oneof: string[]; }; export type EnumDefinition = { type: 'E'; values: string[]; }; export type ServiceDefinition = { type: 'S'; key: string; methods: { [methodName: string]: ServiceMethod; }; }; export type ServiceMethod = { request: string; response: string; method: string; path: string; }; export type InterfaceDefinitionRaw = InterfaceDefinition & { package: string; }; export type EnumDefinitionRaw = EnumDefinition & { package: string; }; export type ServiceDefinitionRaw = ServiceDefinition & { package: string; }; export type TypeDefinitionRaw = InterfaceDefinitionRaw | EnumDefinitionRaw | ServiceDefinitionRaw;