@dasch-swiss/dsp-js
Version:
JavaScript library that handles API requests to Knora
76 lines (75 loc) • 1.9 kB
TypeScript
import { IBaseDateValue } from "../type-specific-interfaces/base-date-value";
import { ReadValue } from "./read-value";
/**
* @category Internal
*/
export declare class ParseReadDateValue extends ReadValue implements IBaseDateValue {
datestring: string;
calendar: string;
startDay?: number;
startMonth?: number;
startYear: number;
startEra?: string;
endDay?: number;
endMonth?: number;
endYear: number;
endEra?: string;
}
/**
* Precision of a date.
*
* @category Model V2
*/
export declare enum Precision {
/**
* Year precision (first to last day of the year).
*/
yearPrecision = 0,
/**
* Month precision (first to last day of the month).
*/
monthPrecision = 1,
/**
* Day precision.
*/
dayPrecision = 2
}
/**
* Represents a Salsah date object with a precision information.
*
* @category Model V2
*/
export declare class KnoraDate {
readonly calendar: string;
readonly era: string;
readonly year: number;
readonly month?: number | undefined;
readonly day?: number | undefined;
private static separator;
readonly precision: Precision;
constructor(calendar: string, era: string, year: number, month?: number | undefined, day?: number | undefined);
}
/**
* Represents a period (with start date and end date).
*
* @category Model V2
*/
export declare class KnoraPeriod {
readonly start: KnoraDate;
readonly end: KnoraDate;
constructor(start: KnoraDate, end: KnoraDate);
}
/**
* @category Model V2
*/
export declare class ReadDateValue extends ReadValue {
date: KnoraDate | KnoraPeriod;
constructor(date: ParseReadDateValue);
/**
* Determines if an era is given.
* Returns "noEra" in case none is given (the given calendar date does not have an era).
*
* @param era given era, if any.
*/
private handleEra;
}