JavaScript API Reference¶
Auto-generated from JSDoc comments in
brinkhaus-tools.js.
Classes¶
BrSettings¶
Kind: global class
- BrSettings
- new BrSettings(name)
- .get(key, defaultValue) ⇒
* - .set(key, value)
- .exists(key) ⇒
boolean - .deleteKey(key) ⇒
boolean - .save()
- .reload()
- .toJSON()
new BrSettings(name)¶
| Param | Type | Default | Description |
|---|---|---|---|
| name | string |
"default" |
Settings namespace (used as localStorage key prefix) |
brSettings.get(key, defaultValue) ⇒ *¶
Get a value by dot-notation key.
Kind: instance method of BrSettings
| Param | Type | Description |
|---|---|---|
| key | string |
e.g. "layout.gridCols" |
| defaultValue | * |
brSettings.set(key, value)¶
Set a value by dot-notation key. Auto-creates intermediate objects.
Kind: instance method of BrSettings
| Param | Type |
|---|---|
| key | string |
| value | * |
brSettings.exists(key) ⇒ boolean¶
Check if a key exists.
Kind: instance method of BrSettings
| Param | Type |
|---|---|
| key | string |
brSettings.deleteKey(key) ⇒ boolean¶
Delete a key.
Kind: instance method of BrSettings
| Param | Type |
|---|---|
| key | string |
brSettings.save()¶
Save to localStorage (quota-safe).
Kind: instance method of BrSettings
brSettings.reload()¶
Reload from localStorage.
Kind: instance method of BrSettings
brSettings.toJSON()¶
Get all data as plain object.
Kind: instance method of BrSettings
BrVersion¶
Kind: global class
new BrVersion([data])¶
| Param | Type | Description |
|---|---|---|
| [data] | object |
{version, build, branch, ...} |
brVersion.getStatus()¶
Grand Unified Log Strategy (see brinkhaustools/docs/architecture/ grand-unified-log-strategy.md): label the fields this class itself exposes getters for with an i18n key so consuming UIs can translate them, while passing through any other caller-supplied field as-is.
Kind: instance method of BrVersion
BrApp¶
Kind: global class
- BrApp
- new BrApp(opts)
- instance
- static
new BrApp(opts)¶
| Param | Type | Description |
|---|---|---|
| opts | object |
{name, settingsName, logBufferSize, version} |
brApp.connectBackend(url, [intervalMs])¶
Connect to a backend self-diagnosis endpoint.
Kind: instance method of BrApp
| Param | Type | Default | Description |
|---|---|---|---|
| url | string |
e.g. "/selfDiagnosis.json" | |
| [intervalMs] | number |
5000 |
BrApp.init(opts) ⇒ BrApp¶
Initialize the app. Shorthand for new BrApp(opts).
Kind: static method of BrApp
| Param | Type |
|---|---|
| opts | object |