notionFile
constnotionFile:object
Defined in: src/helpers/file.helpers.ts:214
Helpers that create general Notion file objects.
Use these helpers for file blocks, image blocks, audio blocks, video blocks, and file property entries.
Type Declaration
Section titled “Type Declaration”external
Section titled “external”external: (
url) =>ExternalRef=externalFile
Create an external file reference.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”ExternalRef
Example
Section titled “Example”notionFile.external('https://example.com/doc.pdf')upload
Section titled “upload”upload: (
id) =>FileUploadRef=uploadFile
Create a file-upload reference.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”FileUploadRef
Example
Section titled “Example”notionFile.upload('upload-id')Example
Section titled “Example”import { notionFile } from '@visus-io/notion-sdk-ts';
notionFile.external('https://example.com/doc.pdf')notionFile.upload('upload-id')