mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 02:11:56 +00:00
25 lines
700 B
TypeScript
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),
|
|
})
|
|
}
|
|
}
|