|
| 1 | + |
| 2 | + |
| 3 | +# AppManager |
| 4 | + |
| 5 | +<div class="api-docs__separator" data-reactroot=""> |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +</div><div class="api-docs__import" data-reactroot=""> |
| 10 | + |
| 11 | +```ts |
| 12 | +import { AppManager } from "@hyper-fetch/core" |
| 13 | +``` |
| 14 | + |
| 15 | +</div><div class="api-docs__section"> |
| 16 | + |
| 17 | +## Description |
| 18 | + |
| 19 | +</div><div class="api-docs__description"><span class="api-docs__do-not-parse"> |
| 20 | + |
| 21 | +App manager handles main application states - focus and online. Those two values can answer questions: |
| 22 | +- Is the tab or current view instance focused and visible for user? |
| 23 | +- Is our application online or offline? |
| 24 | +With the app manager it is not a problem to get the valid answer for this question. |
| 25 | + |
| 26 | +</span></div><p class="api-docs__definition"> |
| 27 | + |
| 28 | +Defined in [managers/app/app.manager.ts:14](https://github.com/BetterTyped/hyper-fetch/blob/c44d728f/packages/core/src/managers/app/app.manager.ts#L14) |
| 29 | + |
| 30 | +</p><div class="api-docs__section"> |
| 31 | + |
| 32 | +## Parameters |
| 33 | + |
| 34 | +</div><div class="api-docs__parameters"><table><thead><tr><th>Name</th><th>Details</th></tr></thead><tbody><tr param-data="options"><td class="api-docs__param-name optional"> |
| 35 | + |
| 36 | +### options |
| 37 | + |
| 38 | +`Optional` |
| 39 | + |
| 40 | +</td><td class="api-docs__param-type"> |
| 41 | + |
| 42 | +`AppManagerOptionsType` |
| 43 | + |
| 44 | +</td></tr></tbody></table></div><div class="api-docs__section"> |
| 45 | + |
| 46 | +## Properties |
| 47 | + |
| 48 | +</div><div class="api-docs__properties"><div class="api-docs__property" property-data="emitter"><h3 class="api-docs__name"> |
| 49 | + |
| 50 | +### `emitter` |
| 51 | + |
| 52 | +</h3><div class="api-docs__section"> |
| 53 | + |
| 54 | +#### Description |
| 55 | + |
| 56 | +</div><div class="api-docs__description"><span class="api-docs__do-not-parse"> |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +</span></div><p class="api-docs__definition"> |
| 61 | + |
| 62 | +Defined in [managers/app/app.manager.ts:15](https://github.com/BetterTyped/hyper-fetch/blob/c44d728f/packages/core/src/managers/app/app.manager.ts#L15) |
| 63 | + |
| 64 | +</p><div class="api-docs__section"> |
| 65 | + |
| 66 | +#### Type |
| 67 | + |
| 68 | +</div><div class="api-docs__property-type"> |
| 69 | + |
| 70 | +```ts |
| 71 | +EventEmitter |
| 72 | +``` |
| 73 | + |
| 74 | +</div><hr/></div><div class="api-docs__property" property-data="events"><h3 class="api-docs__name"> |
| 75 | + |
| 76 | +### `events` |
| 77 | + |
| 78 | +</h3><div class="api-docs__section"> |
| 79 | + |
| 80 | +#### Description |
| 81 | + |
| 82 | +</div><div class="api-docs__description"><span class="api-docs__do-not-parse"> |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +</span></div><p class="api-docs__definition"> |
| 87 | + |
| 88 | +Defined in [managers/app/app.manager.ts:16](https://github.com/BetterTyped/hyper-fetch/blob/c44d728f/packages/core/src/managers/app/app.manager.ts#L16) |
| 89 | + |
| 90 | +</p><div class="api-docs__section"> |
| 91 | + |
| 92 | +#### Type |
| 93 | + |
| 94 | +</div><div class="api-docs__property-type"> |
| 95 | + |
| 96 | +```ts |
| 97 | +{ emitBlur: () => void; emitFocus: () => void; emitOffline: () => void; emitOnline: () => void; onBlur: (callback: () => void) => VoidFunction; onFocus: (callback: () => void) => VoidFunction; onOffline: (callback: () => void) => VoidFunction; onOnline: (callback: () => void) => VoidFunction } |
| 98 | +``` |
| 99 | + |
| 100 | +</div><hr/></div><div class="api-docs__property" property-data="isBrowser"><h3 class="api-docs__name"> |
| 101 | + |
| 102 | +### `isBrowser` |
| 103 | + |
| 104 | +</h3><div class="api-docs__section"> |
| 105 | + |
| 106 | +#### Description |
| 107 | + |
| 108 | +</div><div class="api-docs__description"><span class="api-docs__do-not-parse"> |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | +</span></div><p class="api-docs__definition"> |
| 113 | + |
| 114 | +Defined in [managers/app/app.manager.ts:18](https://github.com/BetterTyped/hyper-fetch/blob/c44d728f/packages/core/src/managers/app/app.manager.ts#L18) |
| 115 | + |
| 116 | +</p><div class="api-docs__section"> |
| 117 | + |
| 118 | +#### Type |
| 119 | + |
| 120 | +</div><div class="api-docs__property-type"> |
| 121 | + |
| 122 | +```ts |
| 123 | +boolean |
| 124 | +``` |
| 125 | + |
| 126 | +</div><hr/></div><div class="api-docs__property" property-data="isFocused"><h3 class="api-docs__name"> |
| 127 | + |
| 128 | +### `isFocused` |
| 129 | + |
| 130 | +</h3><div class="api-docs__section"> |
| 131 | + |
| 132 | +#### Description |
| 133 | + |
| 134 | +</div><div class="api-docs__description"><span class="api-docs__do-not-parse"> |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | +</span></div><p class="api-docs__definition"> |
| 139 | + |
| 140 | +Defined in [managers/app/app.manager.ts:20](https://github.com/BetterTyped/hyper-fetch/blob/c44d728f/packages/core/src/managers/app/app.manager.ts#L20) |
| 141 | + |
| 142 | +</p><div class="api-docs__section"> |
| 143 | + |
| 144 | +#### Type |
| 145 | + |
| 146 | +</div><div class="api-docs__property-type"> |
| 147 | + |
| 148 | +```ts |
| 149 | +boolean |
| 150 | +``` |
| 151 | + |
| 152 | +</div><hr/></div><div class="api-docs__property" property-data="isOnline"><h3 class="api-docs__name"> |
| 153 | + |
| 154 | +### `isOnline` |
| 155 | + |
| 156 | +</h3><div class="api-docs__section"> |
| 157 | + |
| 158 | +#### Description |
| 159 | + |
| 160 | +</div><div class="api-docs__description"><span class="api-docs__do-not-parse"> |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | +</span></div><p class="api-docs__definition"> |
| 165 | + |
| 166 | +Defined in [managers/app/app.manager.ts:19](https://github.com/BetterTyped/hyper-fetch/blob/c44d728f/packages/core/src/managers/app/app.manager.ts#L19) |
| 167 | + |
| 168 | +</p><div class="api-docs__section"> |
| 169 | + |
| 170 | +#### Type |
| 171 | + |
| 172 | +</div><div class="api-docs__property-type"> |
| 173 | + |
| 174 | +```ts |
| 175 | +boolean |
| 176 | +``` |
| 177 | + |
| 178 | +</div><hr/></div><div class="api-docs__property" property-data="options"><h3 class="api-docs__name"> |
| 179 | + |
| 180 | +### `options` |
| 181 | + |
| 182 | +</h3><div class="api-docs__section"> |
| 183 | + |
| 184 | +#### Description |
| 185 | + |
| 186 | +</div><div class="api-docs__description"><span class="api-docs__do-not-parse"> |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | +</span></div><p class="api-docs__definition"> |
| 191 | + |
| 192 | +Defined in [managers/app/app.manager.ts:22](https://github.com/BetterTyped/hyper-fetch/blob/c44d728f/packages/core/src/managers/app/app.manager.ts#L22) |
| 193 | + |
| 194 | +</p><div class="api-docs__section"> |
| 195 | + |
| 196 | +#### Type |
| 197 | + |
| 198 | +</div><div class="api-docs__property-type"> |
| 199 | + |
| 200 | +```ts |
| 201 | +AppManagerOptionsType |
| 202 | +``` |
| 203 | + |
| 204 | +</div><hr/></div></div><div class="api-docs__section"> |
| 205 | + |
| 206 | +## Methods |
| 207 | + |
| 208 | +</div><div class="api-docs__methods"><div class="api-docs__method" method-data="setFocused"><h3 class="api-docs__name"> |
| 209 | + |
| 210 | +### `setFocused()` |
| 211 | + |
| 212 | +</h3><div class="api-docs__section"> |
| 213 | + |
| 214 | +#### Preview |
| 215 | + |
| 216 | +</div><div class="api-docs__preview fn"> |
| 217 | + |
| 218 | +```ts |
| 219 | +setFocused(isFocused) |
| 220 | +``` |
| 221 | + |
| 222 | +</div><div class="api-docs__section"> |
| 223 | + |
| 224 | +#### Description |
| 225 | + |
| 226 | +</div><div class="api-docs__description"><span class="api-docs__do-not-parse"> |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | +</span></div><p class="api-docs__definition"> |
| 231 | + |
| 232 | +Defined in [managers/app/app.manager.ts:57](https://github.com/BetterTyped/hyper-fetch/blob/c44d728f/packages/core/src/managers/app/app.manager.ts#L57) |
| 233 | + |
| 234 | +</p><div class="api-docs__section"> |
| 235 | + |
| 236 | +#### Parameters |
| 237 | + |
| 238 | +</div><div class="api-docs__parameters"><table><thead><tr><th>Name</th><th>Details</th></tr></thead><tbody><tr param-data="isFocused"><td class="api-docs__param-name required"> |
| 239 | + |
| 240 | +#### isFocused |
| 241 | + |
| 242 | +`Required` |
| 243 | + |
| 244 | +</td><td class="api-docs__param-type"> |
| 245 | + |
| 246 | +`boolean` |
| 247 | + |
| 248 | +</td></tr></tbody></table></div><div class="api-docs__section"> |
| 249 | + |
| 250 | +#### Return |
| 251 | + |
| 252 | +</div><div class="api-docs__returns"> |
| 253 | + |
| 254 | +```ts |
| 255 | +void |
| 256 | +``` |
| 257 | + |
| 258 | +</div><hr/></div><div class="api-docs__method" method-data="setOnline"><h3 class="api-docs__name"> |
| 259 | + |
| 260 | +### `setOnline()` |
| 261 | + |
| 262 | +</h3><div class="api-docs__section"> |
| 263 | + |
| 264 | +#### Preview |
| 265 | + |
| 266 | +</div><div class="api-docs__preview fn"> |
| 267 | + |
| 268 | +```ts |
| 269 | +setOnline(isOnline) |
| 270 | +``` |
| 271 | + |
| 272 | +</div><div class="api-docs__section"> |
| 273 | + |
| 274 | +#### Description |
| 275 | + |
| 276 | +</div><div class="api-docs__description"><span class="api-docs__do-not-parse"> |
| 277 | + |
| 278 | + |
| 279 | + |
| 280 | +</span></div><p class="api-docs__definition"> |
| 281 | + |
| 282 | +Defined in [managers/app/app.manager.ts:67](https://github.com/BetterTyped/hyper-fetch/blob/c44d728f/packages/core/src/managers/app/app.manager.ts#L67) |
| 283 | + |
| 284 | +</p><div class="api-docs__section"> |
| 285 | + |
| 286 | +#### Parameters |
| 287 | + |
| 288 | +</div><div class="api-docs__parameters"><table><thead><tr><th>Name</th><th>Details</th></tr></thead><tbody><tr param-data="isOnline"><td class="api-docs__param-name required"> |
| 289 | + |
| 290 | +#### isOnline |
| 291 | + |
| 292 | +`Required` |
| 293 | + |
| 294 | +</td><td class="api-docs__param-type"> |
| 295 | + |
| 296 | +`boolean` |
| 297 | + |
| 298 | +</td></tr></tbody></table></div><div class="api-docs__section"> |
| 299 | + |
| 300 | +#### Return |
| 301 | + |
| 302 | +</div><div class="api-docs__returns"> |
| 303 | + |
| 304 | +```ts |
| 305 | +void |
| 306 | +``` |
| 307 | + |
| 308 | +</div><hr/></div></div> |
0 commit comments