Reuse media content/info types from the js-sdk (#12308)
This commit is contained in:
@@ -25,22 +25,22 @@ import {
|
||||
FileSizeReturnArray,
|
||||
FileSizeReturnObject,
|
||||
} from "filesize";
|
||||
import { MediaEventContent } from "matrix-js-sdk/src/types";
|
||||
|
||||
import { IMediaEventContent } from "../customisations/models/IMediaEventContent";
|
||||
import { _t } from "../languageHandler";
|
||||
|
||||
/**
|
||||
* Extracts a human-readable label for the file attachment to use as
|
||||
* link text.
|
||||
*
|
||||
* @param {IMediaEventContent} content The "content" key of the matrix event.
|
||||
* @param {MediaEventContent} content The "content" key of the matrix event.
|
||||
* @param {string} fallbackText The fallback text
|
||||
* @param {boolean} withSize Whether to include size information. Default true.
|
||||
* @param {boolean} shortened Ensure the extension of the file name is visible. Default false.
|
||||
* @return {string} the human-readable link text for the attachment.
|
||||
*/
|
||||
export function presentableTextForFile(
|
||||
content: IMediaEventContent,
|
||||
content: MediaEventContent,
|
||||
fallbackText = _t("common|attachment"),
|
||||
withSize = true,
|
||||
shortened = false,
|
||||
|
||||
Reference in New Issue
Block a user