haystack-nclient
Version:
Project Haystack Network Client
43 lines (42 loc) • 1.33 kB
TypeScript
import { HRef, HDict, HList, HGrid, HaysonDict } from 'haystack-core';
/**
* Return the id string value from the dict.
*
* If an id can't be found then return an empty string.
*
* @param dict The dict to get the id from.
* @returns The id as a string value or an empty string.
*/
export declare function getId(dict: HDict): string;
/**
* Haystack ids
*/
export type Ids = string | HRef | HDict | HGrid | string[] | HRef[] | HDict[] | HList<HRef | HDict>;
/**
* Convert the ids to an array of id strings.
*
* @param ids The ids to create the id array from.
* @returns An array of id strings.
*/
export declare function idsToArray(ids: Ids): string[];
/**
* Return a list of refs from the arguments.
*
* @param ids The ids to convert to a list.
* @returns A list of refs.
*/
export declare function toIdsList(ids: string[] | HRef[] | HList<HRef>): HList<HRef>;
/**
* Convert the dict arguments to a grid.
*
* @param dicts The dicts to convert to a grid.
* @returns A grid containing the dicts.
*/
export declare function dictsToGrid(dicts: HDict | HaysonDict | HDict[] | HaysonDict[] | HGrid | HList<HDict>): HGrid;
/**
* Convert an array of ids into an array of dicts with ids.
*
* @param ids The ids.
* @returns An array of dicts with ids.
*/
export declare function idsToDicts(ids: string[]): HDict[];