UNPKG

@gulujs/toml

Version:

TOML parser and serializer

31 lines (30 loc) 930 B
import { Converter } from './converter.js'; import { DateTimeType, TomlDate } from '../date.js'; export interface DatetimeConverterOptions { /** * Used in the `convertJsValueToString` method. */ defaultDateTimeType?: DateTimeType; /** * Used in the `convertJsValueToString` method. * Only useful when the type is `OffsetDateTime`. */ utcOffset?: number | string; } interface DateLike { valueOf(): number; } export declare class DatetimeConverter implements Converter<TomlDate> { defaultDateTimeType: DateTimeType; utcOffset?: number | string; constructor(options?: DatetimeConverterOptions); convertStringToJsValue(str: string, options: { type: DateTimeType; }): TomlDate; isJsValue(value: unknown): boolean; convertJsValueToString(value: Date | DateLike, options: { type?: DateTimeType; }): string; private isDateLike; } export {};