fm-data-api-client
Version:
FileMaker Data API Client
37 lines (36 loc) • 1.34 kB
TypeScript
import { LocalDate, LocalDateTime, LocalTime } from '@js-joda/core';
import type { Numerish } from './Layout';
/**
* Quotes a string for use in queries.
*/
export declare const quote: (value: string) => string;
/**
* Parses a FileMaker value as a number.
*
* This utility function works the same way as FileMaker when it comes to interpret string values as numbers. An empty
* string will be interpreted as <pre>null</pre>.
*/
export declare const parseNumber: (value: Numerish) => number | null;
/**
* Parses a FileMaker value as a boolean.
*
* This function will interpret any non-zero and non-empty value as true.
*/
export declare const parseBoolean: (value: Numerish) => boolean;
/**
* Date utility for working with dates, times and time stamps.
*
* @deprecated Use <pre>js-joda</pre> or another datetime library directly.
*/
export declare class DateUtil {
private readonly dateFormatter;
private readonly timeFormatter;
private readonly timeStampFormatter;
constructor(dateFormat?: string, timeFormat?: string, timeStampFormat?: string);
parseDate(value: string): LocalDate;
parseTime(value: string): LocalTime;
parseTimeStamp(value: string): LocalDateTime;
formatDate(value: LocalDate): string;
formatTime(value: LocalTime): string;
formatTimeStamp(value: LocalDateTime): string;
}