diskfile_content_kind.ts

What a file is, as far as picking a view for it goes — from its extension alone, since the file index says nothing about a file's type.

view source

Declarations
#

4 declarations

AUDIO_EXTENSIONS
#

diskfile_content_kind.ts view source

ReadonlySet<string>

type ReadonlySet<string>

import {AUDIO_EXTENSIONS} from '@fuzdev/zzz/diskfile_content_kind.js';

Extensions viewed as audio. Each is one the backend serves with a media type (twin of media_content_type in zzz_server's file_bytes.rs), so an <audio> element can play it from the byte route. webm is here because that's what a recording is; a .webm holding video plays as its audio track.

DiskfileContentKind
#

diskfile_content_kind.ts view source

DiskfileContentKind

type "audio" | "transcript" | "markdown" | "other"

import type {DiskfileContentKind} from '@fuzdev/zzz/diskfile_content_kind.js';

audio gets the player, transcript (a transcription's sidecar) the segment view, markdown the source beside its preview, and other the text editor.

MARKDOWN_EXTENSIONS
#

diskfile_content_kind.ts view source

ReadonlySet<string>

type ReadonlySet<string>

import {MARKDOWN_EXTENSIONS} from '@fuzdev/zzz/diskfile_content_kind.js';

Extensions viewed as markdown.

to_diskfile_content_kind
#

diskfile_content_kind.ts view source

(path: string): DiskfileContentKind import {to_diskfile_content_kind} from '@fuzdev/zzz/diskfile_content_kind.js';

The content kind of the file at path, by its extension (case-insensitive).

path

the file's path or name

type string

returns

DiskfileContentKind

Depends on
#

Imported by
#