mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
chore(test): Tests protobuf.d.ts
Applies runtime assertions to ensure that returned values adhere to their qualified type.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// Everything below is located in the js-namespace
|
||||
package js;
|
||||
|
||||
// Represents a JavaScript value.
|
||||
// Contains exactly one or zero fields.
|
||||
message Value {
|
||||
oneof type {
|
||||
sint32 integer = 1;
|
||||
double double = 2;
|
||||
string string = 3;
|
||||
bool boolean = 4;
|
||||
bool null = 5;
|
||||
Array array = 6;
|
||||
Object object = 7;
|
||||
// if none is set: undefined
|
||||
}
|
||||
}
|
||||
|
||||
// Represents a JavaScript array.
|
||||
// Contains zero to N values.
|
||||
message Array {
|
||||
repeated Value values = 1;
|
||||
}
|
||||
|
||||
// Represents a JavaScript object.
|
||||
// Contains zero to N keys with associated values.
|
||||
message Object {
|
||||
repeated Value keys = 1;
|
||||
repeated Value values = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user