Resolve "Implement action fetching for Alpaca" #31

Merged
clbertolini merged 12 commits from 14-implement-action-fetching-for-alpaca into main 2023-11-10 21:36:43 +00:00
Showing only changes of commit 8437515904 - Show all commits

View File

@ -99,7 +99,7 @@ export class ActionFetchOptions {
/** /**
* Represents the response of a fetch action request. * Represents the response of a fetch action request.
*/ */
export interface ActionFetchResponse { export class ActionFetchResponse {
/** /**
* An array of `Action` objects. * An array of `Action` objects.
@ -111,6 +111,17 @@ export interface ActionFetchResponse {
* Returns a promise that resolves to an `ActionFetchResponse` object. * Returns a promise that resolves to an `ActionFetchResponse` object.
*/ */
readonly fetchNextPage?: () => Promise<ActionFetchResponse>; readonly fetchNextPage?: () => Promise<ActionFetchResponse>;
/**
* Creates an instance of the Actions class.
* @constructor
* @param actions The list of actions.
* @param fetchNextPage A function that fetches the next page of actions.
*/
constructor(actions: Action[], fetchNextPage?: () => Promise<ActionFetchResponse>) {
this.actions = actions;
this.fetchNextPage = fetchNextPage;
}
} }
/** /**