Skip to content

TypeScript API / laikacms/storage / DetermineExtensionContext

Interface: DetermineExtensionContext ​

Context handed to a DetermineExtension callback when the storage is about to write a new object.

Properties ​

defaultExtension ​

ts
defaultExtension: string;

The storage's configured defaultFileExtension. Convenient for callbacks that want to fall back deterministically.


metadata? ​

ts
optional metadata?: object;

Optional metadata supplied with the create/update call. The default implementation treats metadata.extension as an authoritative hint.

extension? ​

ts
readonly optional extension?: string;

File extension to use when (de)serializing this object. Active on backends whose Capabilities.fileExtensions.supported is true. Must match a key in Capabilities.fileExtensions.supportedExtensions.

On writes: hint to the backend to use this extension's serializer. On reads: the extension the backend used to (de)serialize the object.

revisionId? ​

ts
readonly optional revisionId?: string;

Backend-specific revision identifier (e.g., GitHub commit SHA, R2 ETag, version ID). Active on backends that track per-object revisions.

Released under the MIT License.