@jd-data-limited/easy-fm
Version:
easy-fm is a Node.js module that allows you to interact with a [FileMaker database stored](https://www.claris.com/filemaker/) on a [FileMaker server](https://www.claris.com/filemaker/server/). This module interacts with your server using the [FileMaker
37 lines (36 loc) • 2.22 kB
TypeScript
import { type extraBodyOptions } from '../types.js';
import { RecordBase } from './recordBase.js';
import { PortalRecord } from './portalRecord.js';
import { Portal } from './portal.js';
import { type LayoutInterface } from '../layouts/layoutInterface.js';
import { type LayoutRecordBase } from './layoutRecordBase.js';
import { type ApiPortalData, type ApiRowDataDef } from '../models/apiResults.js';
import { type LayoutBase } from '../layouts/layoutBase.js';
import { type Field, type FieldValue } from './field.js';
export declare class LayoutRecord<LAYOUT extends LayoutInterface> extends RecordBase<LAYOUT['fields']> implements LayoutRecordBase {
portals: LAYOUT['portals'];
private readonly portalsToInclude;
constructor(layout: LayoutBase, recordId: number | string, modId?: string | number, fieldData?: Record<string, string | number>, portalData?: ApiPortalData | null, portalsToInclude?: Array<keyof LAYOUT['portals']>);
get portalsArray(): Array<Portal<any>>;
/**
* Asynchronously commits the changes made to the current record.
* @param {extraBodyOptions} extraBody - The options for the extra body elements.
* @returns {Promise<this>} - A promise that resolves with the modified object.
* @throws {FMError} - If an error occurs during the commit process.
*/
commit(extraBody?: extraBodyOptions): Promise<this>;
protected processPortalData(portalData: ApiPortalData): void;
/**
* Re-fetches the current record from the database server.
* Throws an error if commit() has not been called.
*
* @return {Promise<this>} A Promise that resolves to this RecordBase instance if the record is successfully retrieved.
* @throws {Error} If commit() has not been called.
* @throws {FMError} If the retrieval fails.
*/
get(): Promise<this>;
duplicate(): Promise<LayoutRecord<LAYOUT>>;
delete(): Promise<void>;
fieldsToObject(filter?: (a: Field<FieldValue>) => boolean): Omit<ApiRowDataDef, 'portalData'>;
toObject(filter?: (a: Field<FieldValue>) => any, portalFilter?: (a: Portal<any>) => any, portalRowFilter?: (a: PortalRecord<any>) => any, portalFieldFilter?: (a: Field<FieldValue>) => any): ApiRowDataDef;
}