Hiyve Components - v1.0.0
    Preparing search index...

    Props a custom block's View receives in the course player.

    interface CustomBlockViewProps<TData = unknown> {
        block: CustomBlock;
        data: TData;
        onComplete: (result?: BlockResult) => void;
        onProgress: (update: { position?: number; result?: BlockResult }) => void;
        progress?: BlockProgress;
        readOnly: boolean;
        resolveMediaUrl: (
            media: MediaRef,
            options?: { stream?: boolean },
        ) => Promise<string>;
    }

    Type Parameters

    • TData = unknown
    Index

    Properties

    The block, with its data.

    data: TData

    The block's data, migrated to the current version.

    onComplete: (result?: BlockResult) => void

    Mark the block complete, with an optional result.

    onProgress: (update: { position?: number; result?: BlockResult }) => void

    Record where the client is (position) or a partial result.

    progress?: BlockProgress

    The client's progress on this block so far.

    readOnly: boolean

    true in a provider's preview or a locked lesson: show the block, change nothing.

    resolveMediaUrl: (
        media: MediaRef,
        options?: { stream?: boolean },
    ) => Promise<string>

    A URL to load a stored file from.