Skip to content

Documentation / @sw-file-lib/xml / xml-schema / record

Function: record() ​

ts
function record<T>(itemSchema: T): T extends ObjectSchema<any, InferShape<any>> ? ObjectRecordSchema<ObjectShape<T>, T, InferShape<ObjectShape<T>>, Record<string, Infer<T>>> : RecordSchema<T, Record<string, Infer<T>>>;

Defined in: packages/xml/src/xml-schema/classes/record.ts:276

Creates a schema that parses child tag names as keys and their elements as values.

Type Parameters ​

Type Parameter
T extends ElementSchema<any>

Parameters ​

ParameterType
itemSchemaT

Returns ​

T extends ObjectSchema<any, InferShape<any>> ? ObjectRecordSchema<ObjectShape<T>, T, InferShape<ObjectShape<T>>, Record<string, Infer<T>>> : RecordSchema<T, Record<string, Infer<T>>>