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
NameDescription

type

Type

The type of the asset

props

T.Validator<Props>

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

packages/tlschema/src/assets/TLBaseAsset.ts

canvasUiColorTypeValidatorcreatePresenceStateDerivation