import { IPageCreateInput, IPageUpdateInput, TSchemaUnitInput } from '@nishans/fabricator'; import { FilterType, FilterTypes, UpdateType, UpdateTypes } from '@nishans/traverser'; import { ICollection, IPage, ISchemaMapValue, TCollectionBlock, TSchemaUnit } from '@nishans/types'; import { ICollectionUpdateInput, INotionCoreOptions, ISchemaUnitMap } from '../'; import Page from './Block/Page'; import Data from './Data'; /** * A class to represent collection of Notion * @noInheritDoc */ declare class Collection extends Data { constructor(args: INotionCoreOptions); getCachedParentData(): TCollectionBlock; /** * Create multiple templates for the collection * @param rows Array of Objects for configuring template options */ createTemplates(rows: IPageCreateInput[]): Promise; /** * Get a single template page of the collection * @param args string id or a predicate function * @returns Template page object */ getTemplate(arg?: FilterType): Promise; getTemplates(args?: FilterTypes, multiple?: boolean): Promise; updateTemplate(arg: UpdateType>): Promise; updateTemplates(args: UpdateTypes>, multiple?: boolean): Promise; /** * Delete a single template page from the collection * @param args string id or a predicate function */ deleteTemplate(arg?: FilterType): Promise; /** * Delete multiple template pages from the collection * @param args string of ids or a predicate function * @param multiple whether multiple or single item is targeted */ deleteTemplates(args?: FilterTypes, multiple?: boolean): Promise; /** * Add rows of data to the collection block * @param rows * @returns An array of newly created page objects */ createRows(rows: IPageCreateInput[]): Promise; getRow(arg?: FilterType): Promise; getRows(args?: FilterTypes, multiple?: boolean): Promise; updateRow(arg: UpdateType>): Promise; updateRows(args: UpdateTypes>, multiple?: boolean): Promise; deleteRow(arg?: FilterType): Promise; /** * Delete multiple template pages from the collection * @param args string of ids or a predicate function * @param multiple whether multiple or single item is targeted */ deleteRows(args?: FilterTypes, multiple?: boolean): Promise; /** * Create multiple new columns in the collection schema * @param args array of Schema creation properties * @returns An array of SchemaUnit objects representing the columns */ createSchemaUnits(args: TSchemaUnitInput[]): Promise; getSchemaUnit(arg?: FilterType): Promise; /** * Return multiple columns from the collection schema * @param args schema_id string array or predicate function * @returns An array of SchemaUnit objects representing the columns */ getSchemaUnits(args?: FilterTypes, multiple?: boolean): Promise; /** * Update and return a single column from the collection schema * @param args schema_id string and schema properties tuple * @returns A SchemaUnit object representing the column */ updateSchemaUnit(arg: UpdateType>): Promise; /** * Update and return multiple columns from the collection schema * @param args schema_id string and schema properties array of tuples * @returns An array of SchemaUnit objects representing the columns */ updateSchemaUnits(args: UpdateTypes>, multiple?: boolean): Promise; /** * Delete a single column from the collection schema * @param args schema_id string or predicate function * @returns A SchemaUnit object representing the column */ deleteSchemaUnit(args?: FilterType): Promise; /** * Delete multiple columns from the collection schema * @param args schema_id string array or predicate function * @returns An array of SchemaUnit objects representing the columns */ deleteSchemaUnits(args?: FilterTypes, multiple?: boolean): Promise; } export default Collection;