UNPKG

notion-helper

Version:

A library of functions for working more easily with the Notion API

327 lines 11.8 kB
/** * Page shorthand methods - these allow you to call the createMeta() method for the properties of the page_meta object more quickly. Import them directly into a file, or call them on NotionHelper. * @namespace PageShorthand */ /** * Creates a parent database object. Deprecated in September 2025. Will not work in databases with more than one data source. * @memberof PageShorthand * @param {string} database_id - The ID of the parent database. * @returns {Object} A parent database object. */ export function parentDatabase(database_id: string): Object; /** * Alias for parentDatabase(). Creates a parent database object. Deprecated in September 2025. Will not work in databases with more than one data source. * @memberof PageShorthand * @param {string} database_id - The ID of the parent database. * @returns {Object} A parent database object. */ export function parentDb(database_id: string): Object; /** * Creates a parent data source object. * @memberof PageShorthand * @param {string} data_source_id - The ID of the parent data source. * @returns {Object} A parent data source object. */ export function parentDataSource(data_source_id: string): Object; /** * Alias for parentDataSource(). Creates a parent data source object. * @memberof PageShorthand * @param {string} data_source_id - The ID of the parent data source. * @returns {Object} A parent data source object. */ export function parentDs(data_source_id: string): Object; /** * Creates a parent page object. * @memberof PageShorthand * @param {string} page_id - The ID of the parent page. * @returns {Object} A parent page object. */ export function parentPage(page_id: string): Object; /** * Creates a page_id object. Used for retrieving pages and page properties, updating page properties, and trashing pages. * @memberof PageShorthand * @param {string} page_id - The ID of the page to be read/updated/archived. * @returns {Object} A page_id object. */ export function pageId(page_id: string): Object; /** * Creates a block_id object. Used for all block endpoints. * @memberof PageShorthand * @param {string} block_id * @returns {Object} A block_id object. */ export function blockId(block_id: string): Object; /** * Creates a property_id object. Used for retrieving a page property item. * @memberof PageShorthand * @param {string} property_id * @returns {Object} A property_id object. */ export function propertyId(property_id: string): Object; /** * Creates a cover object. * @memberof PageShorthand * @param {string} url - The URL of the cover image. * @returns {Object} A cover object. */ export function cover(url: string): Object; /** * Creates an icon object. * @memberof PageShorthand * @param {string} url - The URL of the icon image or an emoji character. * @returns {Object} An icon object. */ export function icon(url: string): Object; /** * Property shorthand methods - these allow you to call the setProp() method for the properties of the page_props object more quickly. Import them directly into a file, or call them on NotionHelper. * @namespace PropertyShorthand */ /** * Creates a title property object. * @memberof PropertyShorthand * @param {string|string[]} value - The title content, either a string or an array of strings. * @returns {Object} A title property object. */ export function title(value: string | string[]): Object; /** * Creates a rich text property object. * @memberof PropertyShorthand * @param {string|string[]} value - The rich text content, either a string or an array of strings. * @returns {Object} A rich text property object. */ export function richText(value: string | string[]): Object; /** * Creates a checkbox property object. * @memberof PropertyShorthand * @param {boolean} value - The boolean value for the checkbox state. * @returns {Object} A checkbox property object. */ export function checkbox(value: boolean): Object; /** * Creates a date property object. * @memberof PropertyShorthand * @param {string} start - The start date in ISO 8601 format. * @param {string} [end] - The optional end date in ISO 8601 format. * @returns {Object} A date property object. */ export function date(start: string, end?: string): Object; /** * Creates an email property object. * @memberof PropertyShorthand * @param {string} value - The email address. * @returns {Object} An email property object. */ export function email(value: string): Object; /** * Creates a files property object. * @memberof PropertyShorthand * @param {(string|Array<string>|Array<{name: string, url: string})>} files - A url string, or an array of url strings, or an array of file objects. * @returns {Object} A files property object. */ export function files(files: any): Object; /** * Creates a multi-select property object. * @memberof PropertyShorthand * @param {(string|string[])} values - A single string value or an array of string values. * @returns {Object} A multi-select property object. */ export function multiSelect(values: (string | string[])): Object; /** * Creates a number property object. * @memberof PropertyShorthand * @param {number|string} value - The numeric value. A string may also be passed, and it will be converted to a number if possible. * @returns {Object} A number property object. */ export function number(value: number | string): Object; /** * Creates a people property object. * @memberof PropertyShorthand * @param {(string|string[])} people - A single person ID or an array of person IDs. * @returns {Object} A people property object. */ export function people(people: (string | string[])): Object; /** * Creates a phone number property object. * @memberof PropertyShorthand * @param {string} value - The phone number. * @returns {Object} A phone number property object. */ export function phoneNumber(value: string): Object; /** * Creates a relation property object. * @memberof PropertyShorthand * @param {(string|string[])} values - A single page ID or an array of page IDs. * @returns {Object} A relation property object. */ export function relation(values: (string | string[])): Object; /** * Creates a select property object. * @memberof PropertyShorthand * @param {string} value - The selected value. * @returns {Object} A select property object. */ export function select(value: string): Object; /** * Creates a status property object. * @memberof PropertyShorthand * @param {string} value - The status value. * @returns {Object} A status property object. */ export function status(value: string): Object; /** * Creates a URL property object. * @memberof PropertyShorthand * @param {string} value - The URL. * @returns {Object} A URL property object. */ export function url(value: string): Object; export namespace page_meta { namespace parent { let type: string; function createMeta({ id, type }: { id: string; type: string; }): Object; } namespace page { let type_1: string; export { type_1 as type }; export function createMeta_1(page_id: string): string; export { createMeta_1 as createMeta }; } namespace block { let type_2: string; export { type_2 as type }; export function createMeta_2(block_id: string): string; export { createMeta_2 as createMeta }; } namespace property { let type_3: string; export { type_3 as type }; export function createMeta_3(property_id: string): string; export { createMeta_3 as createMeta }; } namespace icon { let type_4: string; export { type_4 as type }; export function createMeta_4(value: string): Object; export { createMeta_4 as createMeta }; } namespace cover { let type_5: string; export { type_5 as type }; export function createMeta_5(value: string): Object; export { createMeta_5 as createMeta }; } } export namespace page_props { namespace title { let type_6: string; export { type_6 as type }; export function setProp(value: Object[]): Object; } namespace rich_text { let type_7: string; export { type_7 as type }; export let returns: string; export function setProp_1(value: Object[]): Object; export { setProp_1 as setProp }; } namespace checkbox { let type_8: string; export { type_8 as type }; let returns_1: string; export { returns_1 as returns }; export function setProp_2(value: boolean): Object; export { setProp_2 as setProp }; } namespace date { let type_9: string; export { type_9 as type }; let returns_2: string; export { returns_2 as returns }; export function setProp_3(start: string, end?: string): Object; export { setProp_3 as setProp }; } namespace email { let type_10: string; export { type_10 as type }; let returns_3: string; export { returns_3 as returns }; export function setProp_4(value: string): Object; export { setProp_4 as setProp }; } namespace files { let type_11: string; export { type_11 as type }; let returns_4: string; export { returns_4 as returns }; export function setProp_5(files: (string | Array<string | Array<string> | Object> | Object), fileName?: string): Object; export { setProp_5 as setProp }; } namespace multi_select { let type_12: string; export { type_12 as type }; let returns_5: string; export { returns_5 as returns }; export function setProp_6(values: (string | string[])): Object; export { setProp_6 as setProp }; } namespace number { let type_13: string; export { type_13 as type }; let returns_6: string; export { returns_6 as returns }; export function setProp_7(value: (number | string)): Object; export { setProp_7 as setProp }; } namespace people { let type_14: string; export { type_14 as type }; let returns_7: string; export { returns_7 as returns }; export function setProp_8(values: (string | Array<string | Object>)): Object; export { setProp_8 as setProp }; } namespace phone_number { let type_15: string; export { type_15 as type }; let returns_8: string; export { returns_8 as returns }; export function setProp_9(value: string): Object; export { setProp_9 as setProp }; } namespace relation { let type_16: string; export { type_16 as type }; let returns_9: string; export { returns_9 as returns }; export function setProp_10(values: (string | Array<string | Object>)): Object; export { setProp_10 as setProp }; } namespace select { let type_17: string; export { type_17 as type }; let returns_10: string; export { returns_10 as returns }; export function setProp_11(value: string): Object; export { setProp_11 as setProp }; } namespace status { let type_18: string; export { type_18 as type }; let returns_11: string; export { returns_11 as returns }; export function setProp_12(value: string): Object; export { setProp_12 as setProp }; } namespace url { let type_19: string; export { type_19 as type }; let returns_12: string; export { returns_12 as returns }; export function setProp_13(value: string): Object; export { setProp_13 as setProp }; } } //# sourceMappingURL=page-meta.d.mts.map