/** * Turning parameters into a query string the API's parser reads the way we mean. * * Its own module because both the request loop and every list resource need * it, and putting it in either one would have the other importing a transport * to build a string. */ export type QueryValue = string | number | boolean | readonly string[] | readonly number[] | undefined; export type QueryParams = Readonly>; /** * Builds a query string the API's parser will read the way we mean it. * * Arrays repeat the key - `?spaceIds=a&spaceIds=b` - because that is what * Express hands to the schemas, which accept either one value or a list. * Comma-joining would arrive as a single id containing a comma and match * nothing, with no error to say why. * * Booleans are sent as `true`/`false` strings. The API parses those * explicitly, because `Boolean("false")` is `true` and a flag written that way * can never be turned off. */ export declare function encodeQuery(params?: QueryParams): string; /** * The two parameters every list shares, plus whatever the endpoint adds. * * Shared because the cursor rule is subtle enough to get wrong once per * resource: the PAGINATOR's cursor wins over the caller's. The caller's seeds * the first page - resuming from a bookmark - and the paginator supplies every * page after that. Letting the caller's win would re-read the same page * forever, which looks like an account that never ends. */ export declare function pageQuery(params: { readonly limit?: number; readonly cursor?: string; }, cursor: string | undefined, extra: QueryParams): QueryParams;