// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { BinaryRef } from "./BinaryRef";
import type { JsonValue } from "../serde_json/JsonValue";

/**
 * Metadata for a file in the workspace CRDT.
 *
 * This represents the synchronized state of a file's frontmatter properties,
 * stored in a Y.Map within the workspace document.
 *
 * ## Doc-ID Based Architecture
 *
 * Files are keyed by stable document IDs (UUIDs) rather than file paths.
 * This makes renames trivial property updates rather than delete+create operations.
 *
 * The actual filesystem path is derived from the `filename` field and the parent chain:
 * - `filename`: The file's name on disk (e.g., "my-note.md")
 * - `part_of`: Document ID of the parent (or None for root files)
 *
 * Use `WorkspaceCrdt::get_path()` to derive the full path from a doc_id.
 */
export type FileMetadata = {
/**
 * Filename on disk (e.g., "my-note.md"). Required for non-deleted files.
 * For files created before the doc-ID migration, this may be empty and
 * should be derived from the path key during migration.
 */
filename: string,
/**
 * Display title from frontmatter
 */
title: string | null,
/**
 * Document ID of parent file (e.g., "abc123-uuid"), or None for root files.
 * Note: For backward compatibility during migration, this may temporarily
 * contain absolute paths which will be converted to doc_ids.
 */
part_of: string | null,
/**
 * Document IDs of child files.
 * Note: For backward compatibility during migration, this may temporarily
 * contain relative paths which will be converted to doc_ids.
 */
contents: Array<string> | null,
/**
 * Binary attachment references
 */
attachments: Array<BinaryRef>,
/**
 * Soft deletion tombstone - if true, file is considered deleted
 */
deleted: boolean,
/**
 * Visibility/access control tags
 */
audience: Array<string> | null,
/**
 * File description from frontmatter
 */
description: string | null,
/**
 * Additional frontmatter properties not covered by other fields
 */
extra: { [key in string]?: JsonValue },
/**
 * Unix timestamp of last modification (milliseconds)
 */
modified_at: bigint, };
