TypeScript API / laikacms/assets / ResourceSchema
Variable: ResourceSchema
ts
const ResourceSchema: Union<readonly [StandardSchemaV1<{
content: {
[key: string]: any;
};
createdAt?: string;
key: string;
type: "asset";
updatedAt?: string;
version?: string;
}, {
content: {
[key: string]: any;
};
createdAt?: string;
key: string;
type: "asset";
updatedAt?: string;
version?: string;
}> & Struct<{
content: $Record<String, Any>;
createdAt: optional<String>;
key: String;
type: Literal<"asset">;
updatedAt: optional<String>;
version: optional<String>;
}>, StandardSchemaV1<{
createdAt?: string;
key: string;
type: "folder";
updatedAt?: string;
}, {
createdAt?: string;
key: string;
type: "folder";
updatedAt?: string;
}> & Struct<{
createdAt: optional<String>;
key: String;
type: Literal<"folder">;
updatedAt: optional<String>;
}>]>;Resource is the union type for the assets abstraction. It represents either an Asset (binary file) or a Folder.
This is analogous to:
- Atom (StorageObject | Folder) in the storage abstraction
- Record (Document | Unpublished | Folder) in the documents abstraction