allow for arbitrary grouping of property values and intro PropertyPage

This commit is contained in:
Matt Hill
2023-05-03 14:56:41 -06:00
parent 8801760aa6
commit e645854d18
4 changed files with 36 additions and 16 deletions

View File

@@ -1,18 +1,16 @@
import { PackagePropertyGroup } from "../types"
import { PropertyPage } from "./PropertyPage"
import { PropertyString } from "./PropertyString"
export class PropertyGroup {
private constructor(readonly data: PackagePropertyGroup) {}
static of(options: {
description: string
value: (PropertyGroup | PropertyString)[]
name: string
header: string | null
values: (PropertyPage | PropertyString)[]
}) {
return new PropertyGroup({
type: "object",
name: options.name,
description: options.description,
value: options.value.map((x) => x.data),
header: options.header,
value: options.values.map((x) => x.data),
})
}
}