import { Source } from "./source"; import { Schema } from "./schema"; /** * Defines a relationship between two resources */ export interface Relationship { /** * The name of the related resources */ name: string; /** * The name of the identifying property in *this* resource, ie the 'foreign key' */ from: string; /** * The name of the identifying property in the *related* resource, ie the * 'primary key' */ to: string; } export interface Resource { source: Source; name: string; schema: Schema; primaryKeys: string[]; relationships: { belongsTo: Relationship[]; has: Relationship[]; }; } /** * Options to control the checking and building of a Resource object */ export interface Options { /** * If `true`, require that the input Resource object contains at least one * `primaryKey` */ requirePK: boolean; } /** * Initialize a `resource` object to ensure that it contains all required * properties. This allows Actions to avoid verbose checks and guards when a * user defines a `minimal` configuration. * * @param resource A partial resource definition. Must contain at least `name` * and `source` in any case, and at least one `primaryKey` if * `options.requirePK` is `true` * @param options Options to use when checking and building the Resource object * @return A fully defined Resource object */ export declare const initialize: (resource: Partial, options?: Partial) => Resource;