Files
start-sdk/lib/properties/PropertyGroup.ts
2023-05-03 16:09:32 -06:00

25 lines
700 B
TypeScript

import { PackagePropertyGroup } from "../types"
import { PropertyPage } from "./PropertyPage"
import { PropertyString } from "./PropertyString"
/**
* A Property Group is a list of values, separated from other property groups by a whitespace divider with an optional header
*/
export class PropertyGroup {
private constructor(readonly data: PackagePropertyGroup) {}
/**
* Returns a new Property Group with the provided options
* @param options
* @returns
*/
static of(options: {
header: string | null
values: (PropertyPage | PropertyString)[]
}) {
return new PropertyGroup({
header: options.header,
value: options.values.map((x) => x.data),
})
}
}