Skip to content

GetAttachmentFilePathParams

Options for the getAttachmentFilePath function.

Import:

import type { GetAttachmentFilePathParams } from '@mnaoumov/obsidian-lib/attachment-path';

Signature:

export interface GetAttachmentFilePathParams

Properties

PropertyTypeDescription
appAppAn Obsidian application instance.
contextAttachmentPathContextA context.
notePathOrFilePathOrFileA path of the note.
oldAttachmentPathOrFilePathOrFileA path of the attachment.
oldNotePathOrFile?PathOrFile | undefinedA path of the old note.
shouldSkipDuplicateCheckbooleanShould the duplicate check be skipped.
shouldSkipGeneratedAttachmentFileName?boolean | undefinedShould the generated attachment file name be skipped, keeping the attachment's own name.

Only Custom Attachment Location's resolver generates a name, so only it reads this flag. A caller that keeps just the folder of the answer should set it: the folder does not depend on the generated name, and generating one can walk every link of the note.

Links to this page: