Header menu logo Nao

Resource Type

A media / binary asset referenced by the document body. To keep the unified document small and portable, binary bytes are NOT inlined. Instead a reader extracts them to local storage (via `IResourceStore`) and records a relative `LocalPath` here; the body references the asset by `Id`. The consumer decides whether and how to load the bytes.

Record fields

Record Field Description

DurationMs

Full Usage: DurationMs

Field type: int option

Duration in milliseconds, for audio / video.

Field type: int option

Id

Full Usage: Id

Field type: ResourceId
Field type: ResourceId

Kind

Full Usage: Kind

Field type: ResourceKind
Field type: ResourceKind

LocalPath

Full Usage: LocalPath

Field type: string option

Relative path to the extracted bytes inside the document bundle (e.g. "resources/img-001.png"). `None` when only `Uri` is known.

Field type: string option

MediaType

Full Usage: MediaType

Field type: string

IANA media type, e.g. "image/png", "video/mp4", "font/woff2".

Field type: string

Metadata

Full Usage: Metadata

Field type: Map<string, string>

Free-form extra metadata (codec, alt-text source, original filename, ...).

Field type: Map<string, string>

PixelHeight

Full Usage: PixelHeight

Field type: int option

Intrinsic pixel height, for images / video.

Field type: int option

PixelWidth

Full Usage: PixelWidth

Field type: int option

Intrinsic pixel width, for images / video.

Field type: int option

Sha256

Full Usage: Sha256

Field type: string option

SHA-256 of the bytes (lower-case hex), enabling de-duplication and integrity checks.

Field type: string option

Uri

Full Usage: Uri

Field type: string option

External location, when the asset is referenced rather than extracted.

Field type: string option

Static members

Static member Description

Resource.Local(id, kind, mediaType, localPath)

Full Usage: Resource.Local(id, kind, mediaType, localPath)

Parameters:
    id : string
    kind : ResourceKind
    mediaType : string
    localPath : string

Returns: Resource

A locally-extracted resource with no extra intrinsic metadata.

id : string
kind : ResourceKind
mediaType : string
localPath : string
Returns: Resource

Type something to start searching.