notion-helper
Version:
A library of functions for working more easily with the Notion API
373 lines • 16.2 kB
text/typescript
/**
* Block shorthand methods – these allow you to call the createBlock() method for the properties of the block object more quickly. Import them directly into a file, or call them on NotionHelper.
* @namespace BlockShorthand
*/
/**
* Creates an audio block.
* @memberof BlockShorthand
* @param {string|Object} options - A string representing the audio URL, a file upload ID, or an options object.
* @see block.audio for full documentation
* @returns {Object|null} An audio block or null if the URL is invalid.
*/
export function audio(options: string | Object): Object | null;
/**
* Creates a bookmark block.
* @memberof BlockShorthand
* @param {string|Object} options - A string representing the URL, or an options object.
* @see block.bookmark for full documentation
* @returns {Object} a bookmark block.
*/
export function bookmark(options: string | Object): Object;
/**
* Creates a bulleted list item block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the list item content.
* @see block.bulleted_list_item for full documentation
* @returns {Object} A bulleted list item block.
*/
export function bulletedListItem(options: string | string[] | Object): Object;
/**
* Shorthand alias for bulletedListItem(). Creates a bulleted list item block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the list item content.
* @see block.bulleted_list_item for full documentation
* @returns {Object} A bulleted list item block.
*/
export function bullet(options: string | string[] | Object): Object;
/**
* Creates a callout block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the content.
* @see block.callout for full documentation
* @returns {Object} A callout block.
*/
export function callout(options: string | string[] | Object): Object;
/**
* Creates a code block.
* @memberof BlockShorthand
* @param {string|Object} options - A string representing the code content, or an options object.
* @see block.code for full documentation
* @returns {Object} A code block.
*/
export function code(options: string | Object): Object;
/**
* Creates a column list block.
* @memberof BlockShorthand
* @param {number|Array|undefined} options - The number of columns to create, an array representing column content, or undefined for an empty column list.
* @see block.column_list for full documentation
* @returns {Object} A column list block.
*/
export function columnList(options: number | any[] | undefined): Object;
/**
* Creates a column block.
* @memberof BlockShorthand
* @param {Array|string|undefined} options - An array of block content, a string for a single paragraph, or undefined for an empty column.
* @see block.column for full documentation
* @returns {Object} A column block.
*/
export function column(options: any[] | string | undefined): Object;
/**
* Creates a divider block.
* @memberof BlockShorthand
* @see block.divider for full documentation
* @returns {Object} A divider block.
*/
export function divider(): Object;
/**
* Creates an embed block.
* @memberof BlockShorthand
* @param {string|Object} options - A string representing the URL to be embedded, or an options object.
* @see block.embed for full documentation
* @returns {Object} An embed block.
*/
export function embed(options: string | Object): Object;
/**
* Creates a file block.
* @memberof BlockShorthand
* @param {string|Object} options - A string representing the file URL, a file upload ID, or an options object.
* @see block.file for full documentation
* @returns {Object|null} A file block or null if the URL is invalid.
*/
export function file(options: string | Object): Object | null;
/**
* Creates a heading_1 block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the heading content.
* @see block.heading_1 for full documentation
* @returns {Object} A heading_1 block.
*/
export function heading1(options: string | string[] | Object): Object;
/**
* Creates a heading_2 block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the heading content.
* @see block.heading_2 for full documentation
* @returns {Object} A heading_2 block.
*/
export function heading2(options: string | string[] | Object): Object;
/**
* Creates a heading_3 block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the heading content.
* @see block.heading_3 for full documentation
* @returns {Object} A heading_3 block.
*/
export function heading3(options: string | string[] | Object): Object;
/**
* Creates an image block.
* @memberof BlockShorthand
* @param {string|Object} options - A string representing the image URL, a file upload ID, or an options object.
* @see block.image for full documentation
* @returns {Object|null} An image block or null if the URL is invalid.
*/
export function image(options: string | Object): Object | null;
/**
* Creates a numbered list item block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the list item content.
* @see block.numbered_list_item for full documentation
* @returns {Object} A numbered list item block.
*/
export function numberedListItem(options: string | string[] | Object): Object;
/**
* Shorthand alias function for numberedListItem(). Creates a numbered list item block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the list item content.
* @see block.numbered_list_item for full documentation
* @returns {Object} A numbered list item block.
*/
export function num(options: string | string[] | Object): Object;
/**
* Creates a paragraph block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the paragraph content.
* @see block.paragraph for full documentation
* @returns {Object} A paragraph block.
*/
export function paragraph(options: string | string[] | Object): Object;
/**
* Creates a PDF block.
* @memberof BlockShorthand
* @param {string|Object} options - A string representing the PDF URL, a file upload ID, or an options object.
* @see block.pdf for full documentation
* @returns {Object|null} A PDF block or null if the URL is invalid.
*/
export function pdf(options: string | Object): Object | null;
/**
* Creates a quote block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the quote content.
* @see block.quote for full documentation
* @returns {Object} A quote block.
*/
export function quote(options: string | string[] | Object): Object;
/**
* Creates a table block.
* @memberof BlockShorthand
* @param {Object} options - Options for creating the table.
* @see block.table for full documentation
* @returns {Object} A table block.
*/
export function table(options: Object): Object;
/**
* Creates a table row block.
* @memberof BlockShorthand
* @param {Array<string|Array<Object>>} cells - An array of cell contents.
* @see block.table_row for full documentation
* @returns {Object} A table row block.
*/
export function tableRow(cells: Array<string | Array<Object>>): Object;
/**
* Creates a table of contents block.
* @memberof BlockShorthand
* @param {string|Object} [options="default"] - A string representing the color, or an options object.
* @see block.table_of_contents for full documentation
* @returns {Object} A table of contents block.
*/
export function tableOfContents(options?: string | Object): Object;
/**
* Creates a to-do list block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the to-do content.
* @see block.to_do for full documentation
* @returns {Object} A to-do list block.
*/
export function toDo(options: string | string[] | Object): Object;
/**
* Creates a toggle block.
* @memberof BlockShorthand
* @param {string|string[]|Object} options - A string, an array of strings, or an options object representing the toggle content.
* @see block.toggle for full documentation
* @returns {Object} A toggle block.
*/
export function toggle(options: string | string[] | Object): Object;
/**
* Creates a video block.
* @memberof BlockShorthand
* @param {string|Object} options - A string representing the video URL, a file upload ID, or an options object.
* @see block.video for full documentation
* @returns {Object|null} A video block or null if the URL is invalid.
*/
export function video(options: string | Object): Object | null;
/**
* Simple function to create standard Paragraph blocks from an array of strings without any special formatting. Each Paragraph block will contain a single Rich Text Object.
*
* @param {Array<string>} strings - an array of strings.
* @returns {Array<Object>} - array of Paragraph blocks.
*/
export function makeParagraphBlocks(strings: Array<string>): Array<Object>;
export namespace block {
namespace audio {
let supports_children: boolean;
function createBlock(options: string | Object): Object | null;
}
namespace bookmark {
let supports_children_1: boolean;
export { supports_children_1 as supports_children };
export function createBlock_1(options: string | Object): Object;
export { createBlock_1 as createBlock };
}
namespace breadcrumb {
let supports_children_2: boolean;
export { supports_children_2 as supports_children };
export function createBlock_2(): Object;
export { createBlock_2 as createBlock };
}
namespace bulleted_list_item {
let supports_children_3: boolean;
export { supports_children_3 as supports_children };
export function createBlock_3(options: string | string[] | Object): Object;
export { createBlock_3 as createBlock };
}
namespace callout {
let supports_children_4: boolean;
export { supports_children_4 as supports_children };
export function createBlock_4(options: string | string[] | Object): Object;
export { createBlock_4 as createBlock };
}
namespace code {
let supports_children_5: boolean;
export { supports_children_5 as supports_children };
export function createBlock_5(options: string | Object): Object;
export { createBlock_5 as createBlock };
}
namespace column_list {
let supports_children_6: boolean;
export { supports_children_6 as supports_children };
export function createBlock_6(options?: (number | any[] | undefined)): Object | null;
export { createBlock_6 as createBlock };
}
namespace column {
let supports_children_7: boolean;
export { supports_children_7 as supports_children };
export function createBlock_7(options?: (any[] | string | undefined)): Object;
export { createBlock_7 as createBlock };
}
namespace divider {
let supports_children_8: boolean;
export { supports_children_8 as supports_children };
export function createBlock_8(): Object;
export { createBlock_8 as createBlock };
}
namespace embed {
let supports_children_9: boolean;
export { supports_children_9 as supports_children };
export function createBlock_9(options: string | Object): Object;
export { createBlock_9 as createBlock };
}
namespace file {
let supports_children_10: boolean;
export { supports_children_10 as supports_children };
export function createBlock_10(options: string | Object): Object | null;
export { createBlock_10 as createBlock };
}
namespace heading_1 {
let supports_children_11: boolean;
export { supports_children_11 as supports_children };
export function createBlock_11(options: string | string[] | Object): Object;
export { createBlock_11 as createBlock };
}
namespace heading_2 {
let supports_children_12: boolean;
export { supports_children_12 as supports_children };
export function createBlock_12(options: string | string[] | Object): Object;
export { createBlock_12 as createBlock };
}
namespace heading_3 {
let supports_children_13: boolean;
export { supports_children_13 as supports_children };
export function createBlock_13(options: string | string[] | Object): Object;
export { createBlock_13 as createBlock };
}
namespace image {
let supports_children_14: boolean;
export { supports_children_14 as supports_children };
export function createBlock_14(options: string | Object): Object | null;
export { createBlock_14 as createBlock };
}
namespace numbered_list_item {
let supports_children_15: boolean;
export { supports_children_15 as supports_children };
export function createBlock_15(options: string | string[] | Object): Object;
export { createBlock_15 as createBlock };
}
namespace paragraph {
let supports_children_16: boolean;
export { supports_children_16 as supports_children };
export function createBlock_16(options: string | string[] | Object): Object;
export { createBlock_16 as createBlock };
}
namespace pdf {
let supports_children_17: boolean;
export { supports_children_17 as supports_children };
export function createBlock_17(options: string | Object): Object | null;
export { createBlock_17 as createBlock };
}
namespace quote {
let supports_children_18: boolean;
export { supports_children_18 as supports_children };
export function createBlock_18(options: string | string[] | Object): Object;
export { createBlock_18 as createBlock };
}
namespace table {
let supports_children_19: boolean;
export { supports_children_19 as supports_children };
export function createBlock_19(options?: {
has_column_header?: boolean | undefined;
has_row_header?: boolean | undefined;
rows?: Object[] | string[][] | undefined;
}): Object;
export { createBlock_19 as createBlock };
}
namespace table_row {
let supports_children_20: boolean;
export { supports_children_20 as supports_children };
export function createBlock_20(cells?: Array<string | Array<Object>>): Object;
export { createBlock_20 as createBlock };
}
namespace table_of_contents {
let supports_children_21: boolean;
export { supports_children_21 as supports_children };
export function createBlock_21(options?: string | Object): Object;
export { createBlock_21 as createBlock };
}
namespace to_do {
let supports_children_22: boolean;
export { supports_children_22 as supports_children };
export function createBlock_22(options: string | string[] | Object): Object;
export { createBlock_22 as createBlock };
}
namespace toggle {
let supports_children_23: boolean;
export { supports_children_23 as supports_children };
export function createBlock_23(options: string | string[] | Object): Object;
export { createBlock_23 as createBlock };
}
namespace video {
let supports_children_24: boolean;
export { supports_children_24 as supports_children };
export function createBlock_24(options: string | Object): Object | null;
export { createBlock_24 as createBlock };
}
}
//# sourceMappingURL=blocks.d.mts.map