-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmodels.js
59 lines (49 loc) · 1.54 KB
/
models.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// @flow
// Automatically generated by typewriter. Do not edit.
// http://www.github.com/natdm/typewriter
// Data should all parse right.
// It's hard to get them to do that.
// @strict
export type Data = {|
map_string_to_int: override_map_name, // I am a map of strings and ints
map_string_to_ints: { [key: string]: Array<number> }, // I am a map of strings to a slice of ints
map_string_to_maps: ?override_map_name2, // I am a map of strings to maps
peeps: People,
external_embedded: DataType,
"kebab-case": string
|}
// Embedded will take all types from the embedded types and insert them in to the new type.
export type Embedded = {
name: string,
age: number
}
// EmbeddedGormModelTest represents a model that has an embedded type in it.
export type EmbeddedGormModelTest = {
name: string,
description: string,
edit_event: boolean,
del_bid: boolean,
add_bid: boolean,
billing: boolean
}
export type ExternalEmbedded = {
name: string
}
export type Items = Array<Item>
export type MyInvalidJsType = {
"some-property": string, // wow, why did we do this? totally valid JS though
"property/another": string, // this is simply absurd
"properties#additional": string, // darn, it's all over our code!
"属性": string// 我们没有时间啊!
}
// Nested defaults to the closest "Object" type in any language. Utilize the `tw` tag if needed.
export type Nested = {
person: Object
}
// People is a map of strings to person
export type People = { [key: string]: Person }
// Person ...
export type Person = {
name: string,
age: number
}