Browse Source

gen-docs WIP

Daniel Zlotin 6 years ago
parent
commit
66e39817e3

+ 34
- 34
docs/api/Navigation.md View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 ## Properties
4 4
 
5
-- Element (any)
5
+- Element (`React.ComponentType<object>`)
6 6
 
7 7
 ## Methods
8 8
 
@@ -14,11 +14,11 @@ Every navigation component in your app must be registered with a unique name.
14 14
 The component itself is a traditional React component extending React.Component.
15 15
 
16 16
 #### Arguments
17
-- componentName (string)
18
-- getComponentClassFunc (ComponentProvider)
17
+- componentName (`string`)
18
+- getComponentClassFunc (`ComponentProvider`)
19 19
 
20 20
 #### Returns
21
-- (void)
21
+- (`void`)
22 22
 
23 23
 ### `setRoot(layout: any): Promise<any>`
24 24
 
@@ -27,10 +27,10 @@ The component itself is a traditional React component extending React.Component.
27 27
 Reset the app to a new layout
28 28
 
29 29
 #### Arguments
30
-- layout (any)
30
+- layout (`any`)
31 31
 
32 32
 #### Returns
33
-- (Promise<any>)
33
+- (`Promise<any>`)
34 34
 
35 35
 ### `setDefaultOptions(options: any): void`
36 36
 
@@ -39,10 +39,10 @@ Reset the app to a new layout
39 39
 Set default options to all screens. Useful for declaring a consistent style across the app.
40 40
 
41 41
 #### Arguments
42
-- options (any)
42
+- options (`any`)
43 43
 
44 44
 #### Returns
45
-- (void)
45
+- (`void`)
46 46
 
47 47
 ### `mergeOptions(componentId: string, options: any): void`
48 48
 
@@ -51,11 +51,11 @@ Set default options to all screens. Useful for declaring a consistent style acro
51 51
 Change a component's navigation options
52 52
 
53 53
 #### Arguments
54
-- componentId (string)
55
-- options (any)
54
+- componentId (`string`)
55
+- options (`any`)
56 56
 
57 57
 #### Returns
58
-- (void)
58
+- (`void`)
59 59
 
60 60
 ### `showModal(layout: any): Promise<any>`
61 61
 
@@ -64,10 +64,10 @@ Change a component's navigation options
64 64
 Show a screen as a modal.
65 65
 
66 66
 #### Arguments
67
-- layout (any)
67
+- layout (`any`)
68 68
 
69 69
 #### Returns
70
-- (Promise<any>)
70
+- (`Promise<any>`)
71 71
 
72 72
 ### `dismissModal(componentId: string): Promise<any>`
73 73
 
@@ -76,10 +76,10 @@ Show a screen as a modal.
76 76
 Dismiss a modal by componentId. The dismissed modal can be anywhere in the stack.
77 77
 
78 78
 #### Arguments
79
-- componentId (string)
79
+- componentId (`string`)
80 80
 
81 81
 #### Returns
82
-- (Promise<any>)
82
+- (`Promise<any>`)
83 83
 
84 84
 ### `dismissAllModals(): Promise<any>`
85 85
 
@@ -88,7 +88,7 @@ Dismiss a modal by componentId. The dismissed modal can be anywhere in the stack
88 88
 Dismiss all Modals
89 89
 
90 90
 #### Returns
91
-- (Promise<any>)
91
+- (`Promise<any>`)
92 92
 
93 93
 ### `push(componentId: string, layout: any): Promise<any>`
94 94
 
@@ -97,11 +97,11 @@ Dismiss all Modals
97 97
 Push a new layout into this screen's navigation stack.
98 98
 
99 99
 #### Arguments
100
-- componentId (string)
101
-- layout (any)
100
+- componentId (`string`)
101
+- layout (`any`)
102 102
 
103 103
 #### Returns
104
-- (Promise<any>)
104
+- (`Promise<any>`)
105 105
 
106 106
 ### `pop(componentId: string, params: any): Promise<any>`
107 107
 
@@ -110,11 +110,11 @@ Push a new layout into this screen's navigation stack.
110 110
 Pop a component from the stack, regardless of it's position.
111 111
 
112 112
 #### Arguments
113
-- componentId (string)
114
-- params (any)
113
+- componentId (`string`)
114
+- params (`any`)
115 115
 
116 116
 #### Returns
117
-- (Promise<any>)
117
+- (`Promise<any>`)
118 118
 
119 119
 ### `popTo(componentId: string): Promise<any>`
120 120
 
@@ -123,10 +123,10 @@ Pop a component from the stack, regardless of it's position.
123 123
 Pop the stack to a given component
124 124
 
125 125
 #### Arguments
126
-- componentId (string)
126
+- componentId (`string`)
127 127
 
128 128
 #### Returns
129
-- (Promise<any>)
129
+- (`Promise<any>`)
130 130
 
131 131
 ### `popToRoot(componentId: string): Promise<any>`
132 132
 
@@ -135,10 +135,10 @@ Pop the stack to a given component
135 135
 Pop the component's stack to root.
136 136
 
137 137
 #### Arguments
138
-- componentId (string)
138
+- componentId (`string`)
139 139
 
140 140
 #### Returns
141
-- (Promise<any>)
141
+- (`Promise<any>`)
142 142
 
143 143
 ### `setStackRoot(componentId: string, layout: any): Promise<any>`
144 144
 
@@ -147,11 +147,11 @@ Pop the component's stack to root.
147 147
 Sets new root component to stack.
148 148
 
149 149
 #### Arguments
150
-- componentId (string)
151
-- layout (any)
150
+- componentId (`string`)
151
+- layout (`any`)
152 152
 
153 153
 #### Returns
154
-- (Promise<any>)
154
+- (`Promise<any>`)
155 155
 
156 156
 ### `showOverlay(layout: any): Promise<any>`
157 157
 
@@ -160,10 +160,10 @@ Sets new root component to stack.
160 160
 Show overlay on top of the entire app
161 161
 
162 162
 #### Arguments
163
-- layout (any)
163
+- layout (`any`)
164 164
 
165 165
 #### Returns
166
-- (Promise<any>)
166
+- (`Promise<any>`)
167 167
 
168 168
 ### `dismissOverlay(componentId: string): Promise<any>`
169 169
 
@@ -172,10 +172,10 @@ Show overlay on top of the entire app
172 172
 dismiss overlay by componentId
173 173
 
174 174
 #### Arguments
175
-- componentId (string)
175
+- componentId (`string`)
176 176
 
177 177
 #### Returns
178
-- (Promise<any>)
178
+- (`Promise<any>`)
179 179
 
180 180
 ### `events(): EventsRegistry`
181 181
 
@@ -184,5 +184,5 @@ dismiss overlay by componentId
184 184
 Obtain the events registry instance
185 185
 
186 186
 #### Returns
187
-- (EventsRegistry)
187
+- (`EventsRegistry`)
188 188
 

+ 1
- 1
lib/src/Navigation.ts View File

@@ -13,7 +13,7 @@ import { ComponentEventsObserver } from './events/ComponentEventsObserver';
13 13
 import { CommandsObserver } from './events/CommandsObserver';
14 14
 
15 15
 export class Navigation {
16
-  public readonly Element;
16
+  public readonly Element: React.ComponentType<{ elementId: any; resizeMode: any; }>;
17 17
 
18 18
   private readonly store;
19 19
   private readonly nativeEventsReceiver;

+ 1
- 1
scripts/gen-docs/templates/class.hbs View File

@@ -4,7 +4,7 @@
4 4
 ## Properties
5 5
 
6 6
 {{#each properties}}
7
-- {{name}} ({{type}})
7
+- {{name}} (`{{type}}`)
8 8
 {{/each}}
9 9
 
10 10
 {{/if}}

+ 2
- 2
scripts/gen-docs/templates/method.hbs View File

@@ -9,10 +9,10 @@
9 9
 {{#if arguments}}
10 10
 #### Arguments
11 11
 {{#each arguments}}
12
-- {{name}} ({{type}})
12
+- {{name}} (`{{type}}`)
13 13
 {{/each}}
14 14
 
15 15
 {{/if}}
16 16
 #### Returns
17
-- ({{returnType}})
17
+- (`{{returnType}}`)
18 18