Files
server/shared/lib/Files/Node/INodeEntityBase.php
2026-02-10 18:46:11 -05:00

55 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace KTXF\Files\Node;
/**
* Interface for entity (file) nodes
*
* Entities are leaf nodes that contain actual file data.
* They inherit common properties from INodeBase and add file-specific properties.
*/
interface INodeEntityBase extends INodeBase {
public const JSON_TYPE = 'files.entity';
public const JSON_PROPERTY_SIZE = 'size';
public const JSON_PROPERTY_MIME = 'mime';
public const JSON_PROPERTY_FORMAT = 'format';
public const JSON_PROPERTY_ENCODING = 'encoding';
/**
* File size in bytes
*
* @since 2025.11.01
*/
public function size(): int;
/**
* MIME type of the file (e.g., 'application/pdf', 'image/png')
*
* @since 2025.11.01
*/
public function getMime(): string|null;
/**
* File format/extension (e.g., 'pdf', 'png', 'txt')
*
* @since 2025.11.01
*/
public function getFormat(): string|null;
/**
* Character encoding (e.g., 'utf-8')
*
* @since 2025.11.01
*/
public function getEncoding(): string|null;
}