createAssetValidator
Public function
Create a validator for an asset record type.
Signature
function createAssetValidator<Type extends string, Props extends JsonObject>(
type: Type,
props: T.Validator<Props>
): T.ObjectValidator<{
id: TLAssetId
typeName: 'asset'
type: Type
props: Props
meta: JsonObject
}>
Parameters
Name | Description |
---|---|
|
The type of the asset |
|
The validator for the asset's props |
Returns
T.ObjectValidator<{
id: TLAssetId
typeName: 'asset'
type: Type
props: Props
meta: JsonObject
}>
References
T.Validator, T.ObjectValidator, TLAssetId
Source