@wppconnect/wa-js
Version:
WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web
56 lines (55 loc) • 1.97 kB
TypeScript
/*!
* Copyright 2026 WPPConnect Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface GetMessagesFromRowIdOptions {
/**
* The minimum rowId (exclusive) to start fetching messages from
*/
minRowId: number;
/**
* Maximum number of messages to return
* @default 1000
* Use -1 to get all available messages (use with caution on large datasets)
*/
limit?: number;
}
/**
* Get messages from IndexedDB 'model-storage' database starting from a specific rowId
*
* This function queries the IndexedDB database directly using the rowId index,
* retrieving messages with rowId greater than the specified value.
* It's useful for pagination or fetching messages in chronological order.
*
* @example
* ```javascript
* // Get 1000 messages after rowId 999960610
* const messages = await WPP.indexdb.getMessagesFromRowId({ minRowId: 999960610 });
*
* // Get 500 messages after rowId 999960610
* const messages = await WPP.indexdb.getMessagesFromRowId({
* minRowId: 999960610,
* limit: 500
* });
*
* // Get all available messages after rowId (use with caution)
* const messages = await WPP.indexdb.getMessagesFromRowId({
* minRowId: 999960610,
* limit: -1
* });
* ```
* @category IndexedDB
* @return Promise that resolves to an array of message objects from IndexedDB
*/
export declare function getMessagesFromRowId(options: GetMessagesFromRowIdOptions): Promise<any[]>;