Skip to content

GetAvailablePathForAttachmentsExtendedFnParams

Options for the get available path for attachments extended function.

Import:

import type { GetAvailablePathForAttachmentsExtendedFnParams } from 'obsidian-dev-utils/obsidian/attachment-path';

Signature:

export interface GetAvailablePathForAttachmentsExtendedFnParams

Properties

PropertyTypeDescription
attachmentFileBaseNamestringA base name of the attachment.
attachmentFileExtensionstringAn extension of the attachment.
attachmentFileStats?FileStats | undefinedA stats of the attachment file.
contextAttachmentPathContextA context.
notePathOrFilenull | PathOrFileA path or file of the note.
oldAttachmentPathOrFilePathOrFileA path or file of the old attachment.
oldNotePathOrFile?PathOrFile | undefinedA path or file of the old note.
readAttachmentFileContent(() => Promise<ArrayBuffer>) | nullLazily reads the content of the attachment file.

The content is read on demand only when a consumer actually needs the bytes (e.g. a template token that embeds them). For the default templates nothing pulls the bytes, so the potentially expensive (size-proportional) readBinary never runs. Consumers that may call this more than once should memoize the first call. null when there is no attachment file to read.
shouldSkipDuplicateCheck?booleanShould the duplicate check be skipped.
shouldSkipGeneratedAttachmentFileName?booleanShould the generated attachment file name be skipped.
shouldSkipMissingAttachmentFolderCreationboolean | undefinedShould missing attachment folder creation be skipped.