mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 12:21:57 +00:00
allow for arbitrary grouping of property values and intro PropertyPage
This commit is contained in:
18
lib/properties/PropertyPage.ts
Normal file
18
lib/properties/PropertyPage.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { PackagePropertyPage } from "../types"
|
||||
import { PropertyGroup } from "./PropertyGroup"
|
||||
|
||||
export class PropertyPage {
|
||||
private constructor(readonly data: PackagePropertyPage) {}
|
||||
static of(options: {
|
||||
name: string
|
||||
description: string | null
|
||||
groups: PropertyGroup[]
|
||||
}) {
|
||||
return new PropertyPage({
|
||||
type: "page",
|
||||
name: options.name,
|
||||
description: options.description,
|
||||
value: options.groups.map((x) => x.data),
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user