@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
47 lines (45 loc) • 2.02 kB
TypeScript
import type { ClonableMixin } from "../core/Clonable.js";
import type { JSONSupport } from "../core/JSONSupport.js";
import type { TimeUnit } from "../core/units.js";
export interface TimeIntervalProperties extends Partial<Pick<TimeInterval, "unit" | "value">> {}
/**
* TimeInterval is a class that describes a length of time in one of ten temporal
* units such as seconds, days, or years. TimeInterval is referenced by many classes,
* such as [TimeInfo](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TimeInfo/), which is referenced by time-aware
* layers and the [TimeSlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/) widget.
*
* @since 4.31
* @see [TimeExtent](https://developers.arcgis.com/javascript/latest/references/core/time/TimeExtent/)
*/
export default class TimeInterval extends TimeIntervalSuperclass {
constructor(properties?: TimeIntervalProperties);
/**
* Temporal units.
*
* @default "milliseconds"
* @example
* const featureLayer = new FeatureLayer({
* url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Earthquakes_Since1970/MapServer/0"
* });
* featureLayer.load().then(function(){
* const interval = featureLayer.timeInfo.interval;
* console.log("The layer's time interval is ", interval.value, interval.unit);
* });
*/
unit: TimeUnit;
/**
* The numerical value of the time extent. The fraction part of a number (if any) will be ignored.
*
* @default 0
* @example
* const featureLayer = new FeatureLayer({
* url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Earthquakes_Since1970/MapServer/0"
* });
* featureLayer.load().then(function(){
* const interval = featureLayer.timeInfo.interval;
* console.log("The layer's time interval is ", interval.value, " ", interval.unit);
* });
*/
accessor value: number;
}
declare const TimeIntervalSuperclass: typeof JSONSupport & typeof ClonableMixin