83d8035dc2
* root + server * frontend * frontend-2 * dui3 * dui3 * tailwind theme * ui-components * preview service * viewer * viewer-sandbox * fileimport-service * webhook service * objectloader * shared * ui-components-nuxt * WIP full config * WIP full linter * eslint projectwide util * minor fix * removing redundant ci * clean up test errors * fixed prettier formatting * CI improvements * TSC lint fix * 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader * removed unnecessary void --------- Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
37 lines
864 B
TypeScript
37 lines
864 B
TypeScript
import { BaseBridge } from '~~/lib/bridge/base'
|
|
import type { IBinding } from '~~/lib/bindings/definitions/IBinding'
|
|
|
|
/**
|
|
* The name under which this binding will be registered.
|
|
*/
|
|
export const IConfigBindingKey = 'configBinding'
|
|
|
|
/**
|
|
* A test binding interface to ensure compatbility. Ideally all host environments would implement and register it.
|
|
*/
|
|
export interface IConfigBinding extends IBinding<IConfigBindingEvents> {
|
|
getConfig: () => Promise<Config>
|
|
updateConfig: (config: Config) => Promise<void>
|
|
}
|
|
|
|
export interface IConfigBindingEvents {
|
|
void: () => void
|
|
}
|
|
|
|
export type Config = {
|
|
darkTheme: boolean
|
|
}
|
|
|
|
export class MockedConfigBinding extends BaseBridge {
|
|
getConfig() {
|
|
return {
|
|
darkTheme: false
|
|
}
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
updateConfig(config: Config) {
|
|
// do nothing
|
|
}
|
|
}
|