Resource
The Resource interface represents digital assets within the Cadastry Chain system. It provides a structure for describing various types of digital resources such as images, videos, 3D models, and more.
Key Properties
| Property | Type | Description |
|---|
| type | string | The type of resource (e.g., 'image', 'mesh', 'sound', 'video', 'texture') |
| hash | string | Hash of the main file that represents this resource |
Specialized Resource Types
1. Image
Represents image resources.
| Property | Type | Description |
|---|
| class | string | "resource.image" |
| type | string | "image" |
| image | dimensions: Dimensions, variants?: [key: string]: ImageFile | Image specific properties |
ImageFile
| Property | Type | Description |
|---|
| file | File | File information for the image |
| dimensions | Dimensions | Dimensions of this specific image file |
| bits | number | Color depth in bits |
| colorSpace | string | Color space of the image (e.g., 'RGB', 'CMYK') |
| compression | string | Compression method used |
2. Mesh
Represents 3D mesh resources.
| Property | Type | Description |
|---|
| dimensions | Dimensions | Dimensions of the mesh |
| platform | string | Platform or software used to create the mesh |
| meshFiles | MeshFile[] | Different versions or LODs of the mesh |
MeshFile
| Property | Type | Description |
|---|
| file | File | File information for the mesh |
| dimensions | Dimensions | Dimensions of this specific mesh file |
| LOD | number | Level of Detail |
| polygons | number | Number of polygons in the mesh |
| vertices | number | Number of vertices in the mesh |
3. Sound
Represents audio resources.
| Property | Type | Description |
|---|
| format | string | Audio format (e.g., 'mp3', 'wav') |
| length | number | Duration of the sound in seconds |
| files | SoundFile[] | Different versions of the sound file |
SoundFile
| Property | Type | Description |
|---|
| file | File | File information for the sound |
| format | string | Specific format of this sound file |
| length | number | Duration of this specific sound file |
4. Texture
Represents texture resources for 3D models.
| Property | Type | Description |
|---|
| type | string | Type of texture (e.g., 'diffuse', 'normal') |
| slot | string | Slot or channel the texture is used in |
| mipmapCount | number | Number of mipmaps |
| levels | number | Number of detail levels |
| dimensions | Dimensions | Dimensions of the texture |
| filterMode | string | Texture filtering mode |
| wrapMode | string | Texture wrapping mode |
| linear | boolean | Whether linear filtering is used |
| transparent | boolean | Whether the texture has transparency |
| textureFiles | TextureFile[] | Different versions of the texture |
TextureFile
| Property | Type | Description |
|---|
| file | File | File information for the texture |
| dimensions | Dimensions | Dimensions of this specific texture file |
| format | string | Format of the texture file |
| mipmapCount | number | Number of mipmaps in this file |
| level | number | Detail level of this texture file |
| transparent | BooleanField | Whether this specific file has transparency |
5. Video
Represents video resources.
| Property | Type | Description |
|---|
| dimensions | Dimensions | Dimensions of the video |
| format | string | Video format (e.g., 'mp4', 'webm') |
| length | number | Duration of the video in seconds |
| videoFiles | VideoFile[] | Different versions of the video file |
VideoFile
| Property | Type | Description |
|---|
| file | File | File information for the video |
| dimensions | Dimensions | Dimensions of this specific video file |
| format | string | Specific format of this video file |
| compression | string | Compression method used |
| length | number | Duration of this specific video file |
Common Interfaces
File
| Property | Type | Description |
|---|
| name | string | Name of the file |
| hash | string | Hash of the file content |
| size | number | Size of the file in bytes |
| url | string | URL where the file can be accessed |
| type | string | MIME type of the file |
| storage | string | Storage location or method |
Dimensions
| Property | Type | Description |
|---|
| width | string | Width of the resource |
| height | string | Height of the resource |
| depth | string | Depth (for 3D resources) |
| unit | string | Unit of measurement (e.g., 'px', 'cm') |
The Resource interface and its specialized types provide a comprehensive structure for representing various kinds of digital assets within the system, allowing for detailed descriptions and management of these resources.