Builtin Library
README.md
assetType.shared.typeYaml
A type's type.yaml, parsed. Every block a type declares in its type.yaml
(settings:, inspector:) is read through this module, so one file read and
one YAML decode serve all of them.
local TypeYaml = require("@builtin::assetTypes.assetType.shared.typeYaml")
local folder, identity = TypeYaml.folder("material")
-- "/zero/source/libs/@builtin/assetTypes/material.assetType", "@builtin::assetTypes.material"
local doc = TypeYaml.of("material")
print(doc.suffix) -- ".material"
print(doc.inspector.type) -- "inspector.luau"
TypeYaml.folder(typeName)resolves the assetType and answers its folder path and identity, or(nil, nil)when no such type resolves.TypeYaml.of(typeName)answers the decoded document, or nil when the type does not resolve or itstype.yamldoes not decode to a table. The decode is cached per type and read again whenever the file's content version moves, or the type resolves to a different folder.TypeYaml.described(typeName)lists the files a type's assets must describe: each file itstype.yamldeclares with adescribedcontent check, with the keys and headings the check names and each key's byte limit.TypeYaml.PLACEHOLDERis the marker a template puts where a description is yet to be written.TypeYaml.describeBlock(typeName)answers thedescribe:block of thetype.yaml: the type's ownguidanceon what a description covers and the identities ofexampleswhose descriptions show the shape.