eas-cli
Version:
EAS command line tool
34 lines (33 loc) • 2.42 kB
TypeScript
import { EASUpdateAction, EASUpdateContext } from '../../eas-update/utils';
import { UpdateBranchBasicInfoFragment } from '../../graphql/generated';
import { Connection, Edge, QueryParams } from '../../utils/relay';
/**
* Select a branch for the project.
*
* @constructor
* @param {function} options.filterPredicate - A predicate to filter the branches that are shown to the user. It takes a branchInfo object as a parameter and returns a boolean.
* @param {string} options.printedType - The type of branch printed to the user. Defaults to 'branch'.
* @param {number} options.pageSize - The number of branches to show per page. Defaults to 100.
* @param {function} options.beforeEachFilterQuery Optional. If a filter predicate was specified, this callback function will be called before each query.
* @args externalQueryParams The query params for the pagination.
* @args totalNodesFetched The total number of nodes fetched so far.
* @args dataset The dataset so far.
* @param {function} options.afterEachFilterQuery Optional. If a filter predicate was specified, this callback function will be called after each query.
* @args externalQueryParams The query params for the pagination.
* @args totalNodesFetched The total number of nodes fetched so far.
* @args dataset The dataset so far.
* @args willFetchAgain If the query will fetch again to get a complete page.
*/
export declare class SelectBranch implements EASUpdateAction<UpdateBranchBasicInfoFragment | null> {
private readonly options;
constructor(options?: {
filterPredicate?: (branchInfo: UpdateBranchBasicInfoFragment) => boolean;
printedType?: string;
pageSize?: number;
beforeEachFilterQuery?: (externalQueryParams: QueryParams, totalNodesFetched: number, dataset: Edge<UpdateBranchBasicInfoFragment>[]) => void;
afterEachFilterQuery?: (externalQueryParams: QueryParams, totalNodesFetched: number, dataset: Edge<UpdateBranchBasicInfoFragment>[], willFetchAgain: boolean) => void;
});
queryAsync(ctx: EASUpdateContext, queryParams: QueryParams): Promise<Connection<UpdateBranchBasicInfoFragment>>;
filterQueryAsync(ctx: EASUpdateContext, queryParams: QueryParams, filterPredicate: (branchInfo: UpdateBranchBasicInfoFragment) => boolean): Promise<Connection<UpdateBranchBasicInfoFragment>>;
runAsync(ctx: EASUpdateContext): Promise<UpdateBranchBasicInfoFragment | null>;
}