listview

@nishans/core / Exports / ListView

Class: ListView#

A class to represent list view of Notion

noinheritdoc

Hierarchy#

  • View<IListView>

    ↳ ListView

Index#

Constructors#

Properties#

Methods#

Constructors#

constructor#

+ new ListView(arg: NishanArg): ListView

Parameters:#

NameType
argNishanArg

Returns: ListView

Inherited from: View

Defined in: core/src/View/ListView.ts:9

Properties#

cache#

• cache: ICache

Inherited from: View.cache

Defined in: endpoints/dist/src/Cache.d.ts:4


getConfigs#

• Protected getConfigs: () => Configs

Inherited from: View.getConfigs

Defined in: endpoints/dist/src/Cache.d.ts:15


headers#

• headers: { headers: { cookie: string ; x-notion-active-user-header: string } }

Type declaration:#

NameType
headers{ cookie: string ; x-notion-active-user-header: string }

Inherited from: View.headers

Defined in: endpoints/dist/src/Cache.d.ts:7


id#

• id: string

Inherited from: View.id

Defined in: core/src/Data.ts:33


init_cache#

• init_cache: boolean= false

Inherited from: View.init_cache

Defined in: core/src/Data.ts:35


interval#

• interval: number

Inherited from: View.interval

Defined in: endpoints/dist/src/Cache.d.ts:6


logger#

• Protected logger: Logger

Inherited from: View.logger

Defined in: core/src/Data.ts:36


shard_id#

• shard_id: number

Inherited from: View.shard_id

Defined in: core/src/Operations.ts:9


space_id#

• space_id: string

Inherited from: View.space_id

Defined in: core/src/Operations.ts:8


stack#

• stack: IOperation[]

Inherited from: View.stack

Defined in: core/src/Operations.ts:7


token#

• token: string

Inherited from: View.token

Defined in: endpoints/dist/src/Cache.d.ts:5


type#

• type: block | collection | collection_view | space | notion_user | space_view | user_root | user_settings

Inherited from: View.type

Defined in: core/src/Data.ts:34


user_id#

• user_id: string

Inherited from: View.user_id

Defined in: endpoints/dist/src/Cache.d.ts:13

Methods#

addToChildArray#

â–¸ ProtectedaddToChildArray(parent: TData, position: RepositionParams): void

Adds the passed block id in the child container array of parent

Parameters:#

NameType
parentTData
positionRepositionParams

Returns: void

created Operation and a function to update the cache and the class data

Inherited from: View

Defined in: core/src/Data.ts:86


createFilters#

â–¸ createFilters(args: TViewFilterCreateInput[]): void

Parameters:#

NameType
argsTViewFilterCreateInput[]

Returns: void

Inherited from: View

Defined in: core/src/View/View.ts:171


createSorts#

â–¸ createSorts(args: TSortCreateInput[]): void

Parameters:#

NameType
argsTSortCreateInput[]

Returns: void

Inherited from: View

Defined in: core/src/View/View.ts:84


deleteCachedData#

â–¸ ProtecteddeleteCachedData(): void

Delete the cached data using the id

Returns: void

Inherited from: View

Defined in: core/src/Data.ts:76


deleteFilter#

â–¸ deleteFilter(arg: FilterType<ISchemaFiltersMapValue>): Promise<void>

Parameters:#

NameType
argFilterType<ISchemaFiltersMapValue>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:220


deleteFilters#

â–¸ deleteFilters(args: FilterTypes<ISchemaFiltersMapValue>, multiple?: boolean): Promise<void>

Parameters:#

NameType
argsFilterTypes<ISchemaFiltersMapValue>
multiple?boolean

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:224


deleteIterate#

â–¸ ProtecteddeleteIterate<TD>(args: FilterTypes<TD>, options: IterateAndDeleteOptions<IListView>, transform: (id: string) => undefined | TD, cb?: (id: string, data: TD) => void | Promise<any>): Promise<TD[]>

Type parameters:#

Name
TD

Parameters:#

NameType
argsFilterTypes<TD>
optionsIterateAndDeleteOptions<IListView>
transform(id: string) => undefined | TD
cb?(id: string, data: TD) => void | Promise<any>

Returns: Promise<TD[]>

Inherited from: View

Defined in: core/src/Data.ts:118


deleteSort#

â–¸ deleteSort(arg: FilterTypes<ISchemaSortsMapValue>): Promise<void>

Parameters:#

NameType
argFilterTypes<ISchemaSortsMapValue>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:148


deleteSorts#

â–¸ deleteSorts(args: FilterTypes<ISchemaSortsMapValue>, multiple?: boolean): Promise<void>

Parameters:#

NameType
argsFilterTypes<ISchemaSortsMapValue>
multiple?boolean

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:152


emptyStack#

â–¸ emptyStack(): void

Returns: void

Inherited from: View

Defined in: core/src/Operations.ts:18


executeOperation#

â–¸ executeOperation(): Promise<void>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/Operations.ts:26


getCachedData#

â–¸ getCachedData(): IListView

Get the cached data using the current data id

Returns: IListView

Inherited from: View

Defined in: core/src/Data.ts:62


getCachedParentData#

â–¸ getCachedParentData(): TCollectionBlock

Returns: TCollectionBlock

Inherited from: View

Defined in: core/src/View/View.ts:54


getCollection#

â–¸ getCollection(): ICollection

Returns: ICollection

Inherited from: View

Defined in: core/src/View/View.ts:48


getIterate#

â–¸ ProtectedgetIterate<RD, C>(args: FilterTypes<RD>, options: IterateAndGetOptions<IListView, C>, transform: (id: string) => undefined | RD, cb?: (id: string, data: RD, container: C) => any): Promise<C>

Type parameters:#

Name
RD
C

Parameters:#

NameType
argsFilterTypes<RD>
optionsIterateAndGetOptions<IListView, C>
transform(id: string) => undefined | RD
cb?(id: string, data: RD, container: C) => any

Returns: Promise<C>

Inherited from: View

Defined in: core/src/Data.ts:138


getLastEditedProps#

â–¸ ProtectedgetLastEditedProps(): object

Returns: object

NameType
last_edited_by_idstring
last_edited_by_tablestring
last_edited_timenumber

Inherited from: View

Defined in: core/src/Data.ts:48


getProps#

â–¸ getProps(): object

Returns: object

NameType
cacheICache
intervalnumber
loggerLogger
shard_idnumber
space_idstring
stackIOperation[]
tokenstring
user_idstring

Inherited from: View

Defined in: core/src/Data.ts:148


initializeCache#

â–¸ initializeCache(): Promise<void>

Returns: Promise<void>

Inherited from: View

Defined in: endpoints/dist/src/Cache.d.ts:22


initializeCacheForSpecificData#

â–¸ initializeCacheForSpecificData(id: string, type: block | collection | collection_view | space | notion_user | space_view | user_root | user_settings): Promise<void>

Parameters:#

NameType
idstring
typeblock | collection | collection_view | space | notion_user | space_view | user_root | user_settings

Returns: Promise<void>

Inherited from: View

Defined in: endpoints/dist/src/Cache.d.ts:25


initializeCacheForThisData#

â–¸ ProtectedinitializeCacheForThisData(): Promise<void>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/Data.ts:111


printStack#

â–¸ printStack(): void

Returns: void

Inherited from: View

Defined in: core/src/Operations.ts:22


reposition#

â–¸ reposition(arg: RepositionParams): void

Parameters:#

NameType
argRepositionParams

Returns: void

Inherited from: View

Defined in: core/src/View/View.ts:58


returnNonCachedData#

â–¸ returnNonCachedData(ids: UpdateCacheManuallyParam): UpdateCacheManuallyParam

Parameters:#

NameType
idsUpdateCacheManuallyParam

Returns: UpdateCacheManuallyParam

Inherited from: View

Defined in: endpoints/dist/src/Cache.d.ts:21


saveToCache#

â–¸ saveToCache(recordMap: Partial<RecordMap>): void

Save the passed recordMap to cache

Parameters:#

NameTypeDescription
recordMapPartial<RecordMap>RecordMap map to save to cache

Returns: void

Inherited from: View

Defined in: endpoints/dist/src/Cache.d.ts:20


update#

â–¸ update(param: TViewCreateInput): ITView

Update the current view

Parameters:#

NameType
paramTViewCreateInput

Returns: ITView

Inherited from: View

Defined in: core/src/View/View.ts:67


updateCacheIfNotPresent#

â–¸ updateCacheIfNotPresent(arg: UpdateCacheManuallyParam): Promise<void>

Parameters:#

NameType
argUpdateCacheManuallyParam

Returns: Promise<void>

Inherited from: View

Defined in: endpoints/dist/src/Cache.d.ts:24


updateCacheLocally#

â–¸ updateCacheLocally(arg: Partial<IListView>, keys: readonly (id | name | type | format | alive | version | parent_id | parent_table | query2)[], appendToStack?: boolean): void

Update the cache of the data using only the passed keys

Parameters:#

NameTypeDescription
argPartial<IListView>
keysreadonly (id | name | type | format | alive | version | parent_id | parent_table | query2)[]
appendToStack?boolean-

Returns: void

Inherited from: View

Defined in: core/src/Data.ts:95


updateCacheManually#

â–¸ updateCacheManually(arg: string | UpdateCacheManuallyParam): Promise<void>

Parameters:#

NameType
argstring | UpdateCacheManuallyParam

Returns: Promise<void>

Inherited from: View

Defined in: endpoints/dist/src/Cache.d.ts:23


updateCachedData#

â–¸ updateCachedData(): Promise<void>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/Data.ts:69


updateFilter#

â–¸ updateFilter(arg: UpdateType<ISchemaFiltersMapValue, TViewFilterUpdateInput>): Promise<void>

Parameters:#

NameType
argUpdateType<ISchemaFiltersMapValue, TViewFilterUpdateInput>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:184


updateFilters#

â–¸ updateFilters(args: UpdateTypes<ISchemaFiltersMapValue, TViewFilterUpdateInput>, multiple?: boolean): Promise<void>

Parameters:#

NameType
argsUpdateTypes<ISchemaFiltersMapValue, TViewFilterUpdateInput>
multiple?boolean

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:188


updateFormatPositionProperties#

â–¸ updateFormatPositionProperties(args: UpdateTypes<ISchemaFormatMapValue, number>, multiple?: boolean): Promise<void>

Parameters:#

NameType
argsUpdateTypes<ISchemaFormatMapValue, number>
multiple?boolean

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:311


updateFormatPositionProperty#

â–¸ updateFormatPositionProperty(arg: UpdateType<ISchemaFormatMapValue, number>): Promise<void>

Parameters:#

NameType
argUpdateType<ISchemaFormatMapValue, number>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:307


updateFormatProperties#

â–¸ updateFormatProperties(args: UpdateTypes<ISchemaFormatMapValue, Partial<{ position: number ; visible: boolean ; width: number }>>, multiple?: boolean): Promise<void>

Parameters:#

NameType
argsUpdateTypes<ISchemaFormatMapValue, Partial<{ position: number ; visible: boolean ; width: number }>>
multiple?boolean

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:345


updateFormatProperty#

â–¸ updateFormatProperty(arg: UpdateType<ISchemaFormatMapValue, Partial<{ position: number ; visible: boolean ; width: number }>>): Promise<void>

Parameters:#

NameType
argUpdateType<ISchemaFormatMapValue, Partial<{ position: number ; visible: boolean ; width: number }>>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:341


updateFormatVisibilityProperties#

â–¸ updateFormatVisibilityProperties(args: UpdateTypes<ISchemaFormatMapValue, boolean>, multiple?: boolean): Promise<void>

Parameters:#

NameType
argsUpdateTypes<ISchemaFormatMapValue, boolean>
multiple?boolean

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:251


updateFormatVisibilityProperty#

â–¸ updateFormatVisibilityProperty(arg: UpdateType<ISchemaFormatMapValue, boolean>): Promise<void>

Parameters:#

NameType
argUpdateType<ISchemaFormatMapValue, boolean>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:247


updateFormatWidthProperties#

â–¸ updateFormatWidthProperties(args: UpdateTypes<ISchemaFormatMapValue, number>, multiple?: boolean): Promise<void>

Parameters:#

NameType
argsUpdateTypes<ISchemaFormatMapValue, number>
multiple?boolean

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:281


updateFormatWidthProperty#

â–¸ updateFormatWidthProperty(arg: UpdateType<ISchemaFormatMapValue, number>): Promise<void>

Parameters:#

NameType
argUpdateType<ISchemaFormatMapValue, number>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:277


updateIterate#

â–¸ ProtectedupdateIterate<TD, RD, C>(args: UpdateTypes<TD, RD>, options: IterateAndUpdateOptions<IListView, C>, transform: (id: string) => undefined | TD, cb?: (id: string, data: TD, updated\_data: RD, container: C) => any): Promise<C>

Type parameters:#

NameDefault
TD-
RD-
Cany

Parameters:#

NameType
argsUpdateTypes<TD, RD>
optionsIterateAndUpdateOptions<IListView, C>
transform(id: string) => undefined | TD
cb?(id: string, data: TD, updated\_data: RD, container: C) => any

Returns: Promise<C>

Inherited from: View

Defined in: core/src/Data.ts:128


updateLastEditedProps#

â–¸ ProtectedupdateLastEditedProps(data?: INotionUser | IText | ITodo | IHeader | ISubHeader | ISubSubHeader | IBulletedList | INumberedList | IToggle | IQuote | IDivider | ICallout | IPage | ICollectionView | ICollectionViewPage | ILinkToPage | IVideo | IAudio | IImage | IWebBookmark | ICode | IFile | ITOC | IEquation | IBreadcrumb | IFactory | IEmbed | ITweet | ICodepen | IMaps | IFigma | IDrive | IGist | IColumnList | IColumn | ICollection | ITableView | IListView | IBoardView | IGalleryView | ICalendarView | ITimelineView | ISpace | ISpaceView | IUserRoot | IUserSettings): void

Parameters:#

NameType
data?INotionUser | IText | ITodo | IHeader | ISubHeader | ISubSubHeader | IBulletedList | INumberedList | IToggle | IQuote | IDivider | ICallout | IPage | ICollectionView | ICollectionViewPage | ILinkToPage | IVideo | IAudio | IImage | IWebBookmark | ICode | IFile | ITOC | IEquation | IBreadcrumb | IFactory | IEmbed | ITweet | ICodepen | IMaps | IFigma | IDrive | IGist | IColumnList | IColumn | ICollection | ITableView | IListView | IBoardView | IGalleryView | ICalendarView | ITimelineView | ISpace | ISpaceView | IUserRoot | IUserSettings

Returns: void

Inherited from: View

Defined in: core/src/Data.ts:52


updateSort#

â–¸ updateSort(arg: UpdateType<ISchemaSortsMapValue, TSortUpdateInput>): Promise<void>

Parameters:#

NameType
argUpdateType<ISchemaSortsMapValue, TSortUpdateInput>

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:112


updateSorts#

â–¸ updateSorts(args: UpdateTypes<ISchemaSortsMapValue, TSortUpdateInput>, multiple?: boolean): Promise<void>

Parameters:#

NameType
argsUpdateTypes<ISchemaSortsMapValue, TSortUpdateInput>
multiple?boolean

Returns: Promise<void>

Inherited from: View

Defined in: core/src/View/View.ts:116