config: Add simple device config schema
This commit is contained in:
parent
89047636a7
commit
edb2e3fecc
1 changed files with 18 additions and 0 deletions
18
src/config/device.ts
Normal file
18
src/config/device.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import * as YAML from 'yaml'
|
||||||
|
|
||||||
|
export interface DeviceInfo {
|
||||||
|
name: string
|
||||||
|
vendor: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeviceConfig {
|
||||||
|
device: DeviceInfo
|
||||||
|
namespaces?: Array<string>
|
||||||
|
sepolicy_dirs: Array<string>
|
||||||
|
includes: Array<string>
|
||||||
|
filters: { [name: string]: Array<string> }
|
||||||
|
}
|
||||||
|
|
||||||
|
export function parseDeviceConfig(config: string) {
|
||||||
|
return YAML.parse(config) as DeviceConfig
|
||||||
|
}
|
Loading…
Reference in a new issue