balena-sdk
Version:
The Balena JavaScript SDK
22 lines (21 loc) • 1.03 kB
TypeScript
import type { Pine, PineOptions } from '..';
import type { Dictionary } from '../../typings/utils';
interface DependentResource {
id: number;
value: string;
}
export declare function buildDependentResource<T extends DependentResource>({ pine }: {
pine: Pine;
}, { resourceName, resourceKeyField, parentResourceName, getResourceId, }: {
resourceName: string;
resourceKeyField: keyof T & string;
parentResourceName: keyof T & string;
getResourceId: (uuidOrIdOrDict: string | number | Dictionary<unknown>) => Promise<number>;
}): {
getAll(options?: PineOptions<T>): Promise<T[]>;
getAllByParent(parentParam: string | number | Dictionary<unknown>, options?: PineOptions<T>): Promise<T[]>;
get(parentParam: string | number | Dictionary<unknown>, key: string): Promise<string | undefined>;
set(parentParam: string | number | Dictionary<unknown>, key: string, value: string): Promise<void>;
remove(parentParam: string | number | Dictionary<unknown>, key: string): Promise<void>;
};
export {};