Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/luxon

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/luxon - npm Package Compare versions

Comparing version 1.10.1 to 1.10.2

863

luxon/index.d.ts

@@ -11,457 +11,472 @@ // Type definitions for luxon 1.10

declare module 'luxon' {
namespace luxon {
type DateTimeFormatOptions = Intl.DateTimeFormatOptions;
export type DateTimeFormatOptions = Intl.DateTimeFormatOptions;
type ZoneOptions = {
keepLocalTime?: boolean;
/**
* @deprecated since 0.2.12. Use keepLocalTime instead
*/
keepCalendarTime?: boolean;
};
export interface ZoneOptions {
keepLocalTime?: boolean;
/**
* @deprecated since 0.2.12. Use keepLocalTime instead
*/
keepCalendarTime?: boolean;
}
type ToFormatOptions = DateTimeFormatOptions & {
round?: boolean;
};
export type ToRelativeUnit =
| "year"
| "quarter"
| "month"
| "week"
| "day"
| "hour"
| "minute"
| "second";
type ToRelativeOptions = {
/** The DateTime to use as the basis to which this time is compared. Defaults to now. */
base?: DateTime;
locale?: string;
style?: 'long' | 'short' | 'narrow';
/** If omitted, the method will pick the unit. */
unit?: 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
/** Defaults to `true`. */
round?: boolean;
/**
* Padding in milliseconds. This allows you to round up the result if it fits inside the threshold.
* Don't use in combination with {round: false} because the decimal output will include the padding.
* Defaults to 0.
*/
padding?: number;
/** The Intl system may choose not to honor this */
numberingSystem?: string;
};
export interface ToRelativeOptions {
/** The DateTime to use as the basis to which this time is compared. Defaults to now. */
base?: DateTime;
locale?: string;
style?: "long" | "short" | "narrow";
/** If omitted, the method will pick the unit. */
unit?: ToRelativeUnit;
/** Defaults to `true`. */
round?: boolean;
/**
* Padding in milliseconds. This allows you to round up the result if it fits inside the threshold.
* Don't use in combination with {round: false} because the decimal output will include the padding.
* Defaults to 0.
*/
padding?: number;
/** The Intl system may choose not to honor this */
numberingSystem?: string;
}
type ToRelativeCalendarOptions = {
/** The DateTime to use as the basis to which this time is compared. Defaults to now. */
base?: DateTime;
locale?: string;
/** If omitted, the method will pick the unit. */
unit?: 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
/** The Intl system may choose not to honor this. */
numberingSystem?: string;
};
export interface ToRelativeCalendarOptions {
/** The DateTime to use as the basis to which this time is compared. Defaults to now. */
base?: DateTime;
locale?: string;
/** If omitted, the method will pick the unit. */
unit?: ToRelativeUnit;
/** The Intl system may choose not to honor this. */
numberingSystem?: string;
}
type ToSQLOptions = {
includeOffset?: boolean;
includeZone?: boolean;
};
export interface ToSQLOptions {
includeOffset?: boolean;
includeZone?: boolean;
}
type ISOTimeOptions = {
suppressMilliseconds?: boolean;
suppressSeconds?: boolean;
includeOffset?: boolean;
};
export interface ToISOTimeOptions {
suppressMilliseconds?: boolean;
suppressSeconds?: boolean;
includeOffset?: boolean;
}
type LocaleOptions = {
locale?: string;
outputCalendar?: string;
numberingSystem?: string;
};
// alias for backwards compatibility
export type ISOTimeOptions = ToISOTimeOptions;
type DateTimeOptions = LocaleOptions & {
zone?: string | Zone;
setZone?: boolean;
};
export interface LocaleOptions {
locale?: string;
outputCalendar?: string;
numberingSystem?: string;
}
type DateTimeJSOptions = LocaleOptions & {
zone?: string | Zone;
};
export interface DateTimeOptions extends LocaleOptions {
zone?: string | Zone;
setZone?: boolean;
}
type DateObjectUnits = {
year?: number;
month?: number;
day?: number;
ordinal?: number;
weekYear?: number;
weekNumber?: number;
weekday?: number;
hour?: number;
minute?: number;
second?: number;
millisecond?: number;
};
export interface DateTimeJSOptions extends LocaleOptions {
zone?: string | Zone;
}
type DateObject = DateObjectUnits & LocaleOptions & {
zone?: string | Zone;
};
export interface DateObjectUnits {
year?: number;
month?: number;
day?: number;
ordinal?: number;
weekYear?: number;
weekNumber?: number;
weekday?: number;
hour?: number;
minute?: number;
second?: number;
millisecond?: number;
}
type DiffOptions = {
conversionAccuracy?: string;
};
export interface DateObject extends DateObjectUnits, LocaleOptions {
zone?: string | Zone;
}
type ExplainedFormat = {
input: string;
tokens: Array<{ literal: boolean, val: string }>,
regex?: RegExp;
rawMatches?: RegExpMatchArray | null;
matches?: {[k: string]: any};
result?: {[k: string]: any} | null;
zone?: Zone | null;
invalidReason?: string;
};
export interface DiffOptions {
conversionAccuracy?: string;
}
class DateTime {
static readonly DATETIME_FULL: DateTimeFormatOptions;
static readonly DATETIME_FULL_WITH_SECONDS: DateTimeFormatOptions;
static readonly DATETIME_HUGE: DateTimeFormatOptions;
static readonly DATETIME_HUGE_WITH_SECONDS: DateTimeFormatOptions;
static readonly DATETIME_MED: DateTimeFormatOptions;
static readonly DATETIME_MED_WITH_SECONDS: DateTimeFormatOptions;
static readonly DATETIME_SHORT: DateTimeFormatOptions;
static readonly DATETIME_SHORT_WITH_SECONDS: DateTimeFormatOptions;
static readonly DATE_FULL: DateTimeFormatOptions;
static readonly DATE_HUGE: DateTimeFormatOptions;
static readonly DATE_MED: DateTimeFormatOptions;
static readonly DATE_SHORT: DateTimeFormatOptions;
static readonly TIME_24_SIMPLE: DateTimeFormatOptions;
static readonly TIME_24_WITH_LONG_OFFSET: DateTimeFormatOptions;
static readonly TIME_24_WITH_SECONDS: DateTimeFormatOptions;
static readonly TIME_24_WITH_SHORT_OFFSET: DateTimeFormatOptions;
static readonly TIME_SIMPLE: DateTimeFormatOptions;
static readonly TIME_WITH_LONG_OFFSET: DateTimeFormatOptions;
static readonly TIME_WITH_SECONDS: DateTimeFormatOptions;
static readonly TIME_WITH_SHORT_OFFSET: DateTimeFormatOptions;
static fromHTTP(text: string, options?: DateTimeOptions): DateTime;
static fromISO(text: string, options?: DateTimeOptions): DateTime;
static fromJSDate(
date: Date,
options?: DateTimeJSOptions
): DateTime;
static fromMillis(ms: number, options?: DateTimeOptions): DateTime;
static fromObject(obj: DateObject): DateTime;
static fromRFC2822(
text: string,
options?: DateTimeOptions
): DateTime;
static fromSeconds(seconds: number, options?: DateTimeOptions): DateTime;
static fromSQL(text: string, options?: DateTimeOptions): DateTime;
static fromFormat(
text: string,
format: string,
opts?: DateTimeOptions
): DateTime;
static fromFormatExplain(
text: string,
format: string,
opts?: DateTimeOptions
): ExplainedFormat;
/**
* @deprecated since 0.3.0. Use fromFormat instead
*/
static fromString(
text: string,
format: string,
options?: DateTimeOptions
): DateTime;
/**
* @deprecated 0.3.0. Use fromFormatExplain instead
*/
static fromStringExplain(
text: string,
format: string,
options?: DateTimeOptions
): ExplainedFormat;
static invalid(reason: any): DateTime;
static local(
year?: number,
month?: number,
day?: number,
hour?: number,
minute?: number,
second?: number,
millisecond?: number
): DateTime;
static max(): undefined;
static max(...dateTimes: DateTime[]): DateTime;
static min(): undefined;
static min(...dateTimes: DateTime[]): DateTime;
static utc(
year?: number,
month?: number,
day?: number,
hour?: number,
minute?: number,
second?: number,
millisecond?: number
): DateTime;
day: number;
daysInMonth: number;
daysInYear: number;
hour: number;
invalidReason: string;
isInDST: boolean;
isInLeapYear: boolean;
isOffsetFixed: boolean;
isValid: boolean;
locale: string;
millisecond: number;
minute: number;
month: number;
monthLong: string;
monthShort: string;
numberingSystem: string;
offset: number;
offsetNameLong: string;
offsetNameShort: string;
ordinal: number;
outputCalendar: string;
quarter: number;
second: number;
weekNumber: number;
weekYear: number;
weekday: number;
weekdayLong: string;
weekdayShort: string;
weeksInWeekYear: number;
year: number;
zoneName: string;
zone: Zone;
diff(
other: DateTime,
unit?: DurationUnit | DurationUnit[],
options?: DiffOptions
): Duration;
diffNow(unit?: DurationUnit | DurationUnit[], options?: DiffOptions): Duration;
endOf(unit: DurationUnit): DateTime;
equals(other: DateTime): boolean;
get(unit: keyof DateTime): number;
hasSame(other: DateTime, unit: DurationUnit): boolean;
minus(duration: Duration | number | DurationObject): DateTime;
plus(duration: Duration | number | DurationObject): DateTime;
reconfigure(properties: LocaleOptions): DateTime;
resolvedLocaleOpts(options?: ToFormatOptions): LocaleOptions;
set(values: DateObjectUnits): DateTime;
setLocale(locale: any): DateTime;
setZone(zone: string | Zone, options?: ZoneOptions): DateTime;
startOf(unit: DurationUnit): DateTime;
toBSON(): Date;
toFormat(format: string, options?: ToFormatOptions): string;
toHTTP(): string;
toISO(options?: ISOTimeOptions): string;
toISODate(): string;
toISOTime(options?: ISOTimeOptions): string;
toISOWeekDate(): string;
toJSDate(): Date;
toJSON(): string;
toLocal(): DateTime;
toLocaleParts(options?: DateTimeFormatOptions): any[];
toLocaleString(options?: DateTimeFormatOptions): string;
toMillis(): number;
toMillis(): number;
toObject(options?: { includeConfig?: boolean }): DateObject;
toRelative(options?: ToRelativeOptions): string | null;
toRelativeCalendar(options?: ToRelativeCalendarOptions): string | null;
toRFC2822(): string;
toSeconds(): number;
toSQL(options?: ToSQLOptions): string;
toSQLDate(): string;
toSQLTime(options?: ToSQLOptions): string;
toString(): string;
toUTC(offset?: number, options?: ZoneOptions): DateTime;
until(other: DateTime): Interval;
valueOf(): number;
}
export interface ExplainedFormat {
input: string;
tokens: Array<{ literal: boolean; val: string }>;
regex?: RegExp;
rawMatches?: RegExpMatchArray | null;
matches?: { [k: string]: any };
result?: { [k: string]: any } | null;
zone?: Zone | null;
invalidReason?: string;
}
type DurationOptions = {
locale?: string;
numberingSystem?: string;
conversionAccuracy?: string;
};
export class DateTime {
static readonly DATETIME_FULL: DateTimeFormatOptions;
static readonly DATETIME_FULL_WITH_SECONDS: DateTimeFormatOptions;
static readonly DATETIME_HUGE: DateTimeFormatOptions;
static readonly DATETIME_HUGE_WITH_SECONDS: DateTimeFormatOptions;
static readonly DATETIME_MED: DateTimeFormatOptions;
static readonly DATETIME_MED_WITH_SECONDS: DateTimeFormatOptions;
static readonly DATETIME_SHORT: DateTimeFormatOptions;
static readonly DATETIME_SHORT_WITH_SECONDS: DateTimeFormatOptions;
static readonly DATE_FULL: DateTimeFormatOptions;
static readonly DATE_HUGE: DateTimeFormatOptions;
static readonly DATE_MED: DateTimeFormatOptions;
static readonly DATE_SHORT: DateTimeFormatOptions;
static readonly TIME_24_SIMPLE: DateTimeFormatOptions;
static readonly TIME_24_WITH_LONG_OFFSET: DateTimeFormatOptions;
static readonly TIME_24_WITH_SECONDS: DateTimeFormatOptions;
static readonly TIME_24_WITH_SHORT_OFFSET: DateTimeFormatOptions;
static readonly TIME_SIMPLE: DateTimeFormatOptions;
static readonly TIME_WITH_LONG_OFFSET: DateTimeFormatOptions;
static readonly TIME_WITH_SECONDS: DateTimeFormatOptions;
static readonly TIME_WITH_SHORT_OFFSET: DateTimeFormatOptions;
static fromHTTP(text: string, options?: DateTimeOptions): DateTime;
static fromISO(text: string, options?: DateTimeOptions): DateTime;
static fromJSDate(date: Date, options?: DateTimeJSOptions): DateTime;
static fromMillis(ms: number, options?: DateTimeOptions): DateTime;
static fromObject(obj: DateObject): DateTime;
static fromRFC2822(text: string, options?: DateTimeOptions): DateTime;
static fromSeconds(seconds: number, options?: DateTimeOptions): DateTime;
static fromSQL(text: string, options?: DateTimeOptions): DateTime;
static fromFormat(
text: string,
format: string,
opts?: DateTimeOptions
): DateTime;
static fromFormatExplain(
text: string,
format: string,
opts?: DateTimeOptions
): ExplainedFormat;
/**
* @deprecated since 0.3.0. Use fromFormat instead
*/
static fromString(
text: string,
format: string,
options?: DateTimeOptions
): DateTime;
/**
* @deprecated 0.3.0. Use fromFormatExplain instead
*/
static fromStringExplain(
text: string,
format: string,
options?: DateTimeOptions
): ExplainedFormat;
static invalid(reason: any): DateTime;
static isDateTime(o: any): o is DateTime;
static local(
year?: number,
month?: number,
day?: number,
hour?: number,
minute?: number,
second?: number,
millisecond?: number
): DateTime;
static max(): undefined;
static max(...dateTimes: DateTime[]): DateTime;
static min(): undefined;
static min(...dateTimes: DateTime[]): DateTime;
static utc(
year?: number,
month?: number,
day?: number,
hour?: number,
minute?: number,
second?: number,
millisecond?: number
): DateTime;
day: number;
daysInMonth: number;
daysInYear: number;
hour: number;
invalidReason: string | null;
invalidExplanation: string | null;
isInDST: boolean;
isInLeapYear: boolean;
isOffsetFixed: boolean;
isValid: boolean;
locale: string;
millisecond: number;
minute: number;
month: number;
monthLong: string;
monthShort: string;
numberingSystem: string;
offset: number;
offsetNameLong: string;
offsetNameShort: string;
ordinal: number;
outputCalendar: string;
quarter: number;
second: number;
weekNumber: number;
weekYear: number;
weekday: number;
weekdayLong: string;
weekdayShort: string;
weeksInWeekYear: number;
year: number;
zoneName: string;
zone: Zone;
diff(
other: DateTime,
unit?: DurationUnit | DurationUnit[],
options?: DiffOptions
): Duration;
diffNow(
unit?: DurationUnit | DurationUnit[],
options?: DiffOptions
): Duration;
endOf(unit: DurationUnit): DateTime;
equals(other: DateTime): boolean;
get(unit: keyof DateTime): number;
hasSame(other: DateTime, unit: DurationUnit): boolean;
minus(duration: Duration | number | DurationObject): DateTime;
plus(duration: Duration | number | DurationObject): DateTime;
reconfigure(properties: LocaleOptions): DateTime;
resolvedLocaleOpts(
options?: DateTimeFormatOptions
): Intl.ResolvedDateTimeFormatOptions;
set(values: DateObjectUnits): DateTime;
setLocale(locale: string): DateTime;
setZone(zone: string | Zone, options?: ZoneOptions): DateTime;
startOf(unit: DurationUnit): DateTime;
toBSON(): Date;
toFormat(format: string, options?: DateTimeFormatOptions): string;
toHTTP(): string;
toISO(options?: ToISOTimeOptions): string;
toISODate(): string;
toISOTime(options?: ToISOTimeOptions): string;
toISOWeekDate(): string;
toJSDate(): Date;
toJSON(): string;
toLocal(): DateTime;
toLocaleParts(options?: LocaleOptions & DateTimeFormatOptions): any[];
toLocaleString(options?: LocaleOptions & DateTimeFormatOptions): string;
toMillis(): number;
toObject(options?: { includeConfig?: boolean }): DateObject;
toRelative(options?: ToRelativeOptions): string | null;
toRelativeCalendar(options?: ToRelativeCalendarOptions): string | null;
toRFC2822(): string;
toSeconds(): number;
toSQL(options?: ToSQLOptions): string;
toSQLDate(): string;
toSQLTime(options?: ToSQLOptions): string;
toString(): string;
toUTC(offset?: number, options?: ZoneOptions): DateTime;
until(other: DateTime): Interval;
valueOf(): number;
}
type DurationObjectUnits = {
years?: number;
months?: number;
weeks?: number;
days?: number;
hours?: number;
minutes?: number;
seconds?: number;
milliseconds?: number;
};
export interface DurationOptions {
locale?: string;
numberingSystem?: string;
conversionAccuracy?: string;
}
type DurationObject = DurationObjectUnits & DurationOptions;
export interface DurationObjectUnits {
year?: number;
years?: number;
quarter?: number;
quarters?: number;
month?: number;
months?: number;
week?: number;
weeks?: number;
day?: number;
days?: number;
hour?: number;
hours?: number;
minute?: number;
minutes?: number;
second?: number;
seconds?: number;
millisecond?: number;
milliseconds?: number;
}
type DurationUnit = 'year' | 'years' | 'quarter' | 'quarters' | 'month' | 'months' | 'week' | 'weeks' | 'day' | 'days'
| 'hour' | 'hours' | 'minute' | 'minutes' | 'second' | 'seconds' | 'millisecond' | 'milliseconds';
export interface DurationObject extends DurationObjectUnits, DurationOptions {}
class Duration {
static fromISO(text: string, options?: DurationOptions): Duration;
static fromMillis(
count: number,
options?: DurationOptions
): Duration;
static fromObject(
Object: DurationObject
): Duration;
static invalid(reason?: string): Duration;
days: number;
hours: number;
invalidReason: string;
isValid: boolean;
locale: string;
milliseconds: number;
minutes: number;
months: number;
numberingSystem: string;
quarters: number;
seconds: number;
weeks: number;
years: number;
as(unit: DurationUnit): number;
equals(other: Duration): boolean;
get(unit: DurationUnit): number;
minus(duration: Duration | number | DurationObject): Duration;
negate(): Duration;
normalize(): Duration;
plus(duration: Duration | number | DurationObject): Duration;
reconfigure(objectPattern: DurationOptions): Duration;
set(values: DurationObjectUnits): Duration;
shiftTo(...units: DurationUnit[]): Duration;
toFormat(format: string, options?: ToFormatOptions): string;
toISO(): string;
toJSON(): string;
toObject(options?: {
includeConfig?: boolean;
}): DurationObject;
toString(): string;
valueOf(): number;
}
export type DurationUnit = keyof DurationObjectUnits;
type EraLength = 'short' | 'long';
type UnitLength = EraLength | 'numeric' | '2-digit' | 'narrow';
type UnitOptions = InfoOptions & {
numberingSystem?: string;
outputCalendar?: string;
};
export interface DurationToFormatOptions extends DateTimeFormatOptions {
floor?: boolean;
round?: boolean;
}
type InfoOptions = {
locale?: string;
};
export class Duration {
static fromISO(text: string, options?: DurationOptions): Duration;
static fromMillis(count: number, options?: DurationOptions): Duration;
static fromObject(Object: DurationObject): Duration;
static invalid(reason?: string): Duration;
static isDuration(o: any): o is Duration;
days: number;
hours: number;
invalidReason: string | null;
invalidExplanation: string | null;
isValid: boolean;
locale: string;
milliseconds: number;
minutes: number;
months: number;
numberingSystem: string;
quarters: number;
seconds: number;
weeks: number;
years: number;
as(unit: DurationUnit): number;
equals(other: Duration): boolean;
get(unit: DurationUnit): number;
minus(duration: Duration | number | DurationObject): Duration;
negate(): Duration;
normalize(): Duration;
plus(duration: Duration | number | DurationObject): Duration;
reconfigure(objectPattern: DurationOptions): Duration;
set(values: DurationObjectUnits): Duration;
shiftTo(...units: DurationUnit[]): Duration;
toFormat(format: string, options?: DurationToFormatOptions): string;
toISO(): string;
toJSON(): string;
toObject(options?: { includeConfig?: boolean }): DurationObject;
toString(): string;
valueOf(): number;
}
type Features = {
intl: boolean;
intlTokens: boolean;
zones: boolean;
};
export type EraLength = "short" | "long";
export type UnitLength = EraLength | "numeric" | "2-digit" | "narrow";
export interface UnitOptions extends InfoOptions {
numberingSystem?: string;
outputCalendar?: string;
}
namespace Info {
function eras(length?: EraLength, options?: InfoOptions): string[];
function features(): Features;
function hasDST(zone: string | Zone): boolean;
function isValidIANAZone(zone: string): boolean;
function meridiems(options?: InfoOptions): string[];
function months(length?: UnitLength, options?: UnitOptions): string[];
function monthsFormat(length?: UnitLength, options?: UnitOptions): string[];
function weekdays(length?: UnitLength, options?: UnitOptions): string[];
function weekdaysFormat(
length?: UnitLength,
options?: UnitOptions
): string[];
}
export interface InfoOptions {
locale?: string;
}
type IntervalObject = {
start?: DateTime;
end?: DateTime;
};
export interface Features {
intl: boolean;
intlTokens: boolean;
zones: boolean;
}
class Interval {
static after(
start: DateTime | DateObject | Date,
duration: Duration | number | DurationObject
): Interval;
static before(
end: DateTime | DateObject | Date,
duration: Duration | number | DurationObject
): Interval;
static fromDateTimes(
start: DateTime | DateObject | Date,
end: DateTime | DateObject | Date
): Interval;
static fromISO(string: string, options?: DateTimeOptions): Interval;
static invalid(reason?: string): Interval;
static merge(intervals: Interval[]): Interval[];
static xor(intervals: Interval[]): Interval[];
end: DateTime;
invalidReason: string;
isValid: boolean;
start: DateTime;
abutsEnd(other: Interval): boolean;
abutsStart(other: Interval): boolean;
contains(dateTime: DateTime): boolean;
count(unit?: DurationUnit): number;
difference(...intervals: Interval[]): Interval[];
divideEqually(numberOfParts?: number): Interval[];
engulfs(other: Interval): boolean;
equals(other: Interval): boolean;
hasSame(unit: DurationUnit): boolean;
intersection(other: Interval): Interval;
isAfter(dateTime: DateTime): boolean;
isBefore(dateTime: DateTime): boolean;
isEmpty(): boolean;
length(unit?: DurationUnit): number;
overlaps(other: Interval): boolean;
set(values: IntervalObject): Interval;
splitAt(...dateTimes: DateTime[]): Interval[];
splitBy(duration: Duration | DurationObject | number): Interval[];
toDuration(
unit: DurationUnit | DurationUnit[],
options?: DiffOptions
): Duration;
toFormat(
dateFormat: string,
options?: {
seperator?: string;
}
): string;
toISO(options?: ISOTimeOptions): string;
toString(): string;
union(other: Interval): Interval;
mapEndpoints(cb: (d: DateTime) => DateTime): Interval;
}
export namespace Info {
function eras(length?: EraLength, options?: InfoOptions): string[];
function features(): Features;
function hasDST(zone: string | Zone): boolean;
function isValidIANAZone(zone: string): boolean;
function normalizeZone(input?: number | string | Zone): Zone;
function meridiems(options?: InfoOptions): string[];
function months(length?: UnitLength, options?: UnitOptions): string[];
function monthsFormat(length?: UnitLength, options?: UnitOptions): string[];
function weekdays(length?: UnitLength, options?: UnitOptions): string[];
function weekdaysFormat(
length?: UnitLength,
options?: UnitOptions
): string[];
}
namespace Settings {
let defaultLocale: string;
let defaultNumberingSystem: string;
let defaultOutputCalendar: string;
const defaultZone: Zone;
let defaultZoneName: string;
let throwOnInvalid: boolean;
let now: () => number;
function resetCaches(): void;
export interface IntervalObject {
start?: DateTime;
end?: DateTime;
}
export class Interval {
static after(
start: DateTime | DateObject | Date,
duration: Duration | number | DurationObject
): Interval;
static before(
end: DateTime | DateObject | Date,
duration: Duration | number | DurationObject
): Interval;
static fromDateTimes(
start: DateTime | DateObject | Date,
end: DateTime | DateObject | Date
): Interval;
static fromISO(string: string, options?: DateTimeOptions): Interval;
static invalid(reason?: string): Interval;
static isInterval(o: any): o is Interval;
static merge(intervals: Interval[]): Interval[];
static xor(intervals: Interval[]): Interval[];
end: DateTime;
invalidReason: string | null;
invalidExplanation: string | null;
isValid: boolean;
start: DateTime;
abutsEnd(other: Interval): boolean;
abutsStart(other: Interval): boolean;
contains(dateTime: DateTime): boolean;
count(unit?: DurationUnit): number;
difference(...intervals: Interval[]): Interval[];
divideEqually(numberOfParts?: number): Interval[];
engulfs(other: Interval): boolean;
equals(other: Interval): boolean;
hasSame(unit: DurationUnit): boolean;
intersection(other: Interval): Interval;
isAfter(dateTime: DateTime): boolean;
isBefore(dateTime: DateTime): boolean;
isEmpty(): boolean;
length(unit?: DurationUnit): number;
overlaps(other: Interval): boolean;
set(values: IntervalObject): Interval;
splitAt(...dateTimes: DateTime[]): Interval[];
splitBy(duration: Duration | DurationObject | number): Interval[];
toDuration(
unit: DurationUnit | DurationUnit[],
options?: DiffOptions
): Duration;
toFormat(
dateFormat: string,
options?: {
separator?: string;
}
): string;
toISO(options?: ToISOTimeOptions): string;
toString(): string;
union(other: Interval): Interval;
mapEndpoints(cb: (d: DateTime) => DateTime): Interval;
}
type ZoneOffsetOptions = {
format?: 'short' | 'long';
localeCode?: string;
};
export namespace Settings {
let defaultLocale: string;
let defaultNumberingSystem: string;
let defaultOutputCalendar: string;
const defaultZone: Zone;
let defaultZoneName: string;
let throwOnInvalid: boolean;
function now(): number;
function resetCaches(): void;
}
class Zone {
static offsetName(ts: number, options?: ZoneOffsetOptions): string;
static isValid: boolean;
static name: string;
static type: string;
static universal: boolean;
equals(other: Zone): boolean;
offset(ts: number): number;
}
export interface ZoneOffsetOptions {
format?: "short" | "long";
localeCode?: string;
}
class IANAZone extends Zone {
constructor(ianaString: string);
}
}
export class Zone {
static offsetName(ts: number, options?: ZoneOffsetOptions): string;
static isValid: boolean;
static name: string;
static type: string;
static universal: boolean;
equals(other: Zone): boolean;
offset(ts: number): number;
}
export = luxon;
export class IANAZone extends Zone {
constructor(ianaString: string);
}
{
"name": "@types/luxon",
"version": "1.10.1",
"version": "1.10.2",
"description": "TypeScript definitions for luxon",

@@ -41,4 +41,4 @@ "license": "MIT",

"dependencies": {},
"typesPublisherContentHash": "67db6c41d58155df1abf60e4ce8a913a187d3635e67ddab93338e648a35e523b",
"typesPublisherContentHash": "1a98382c3e231c626e56d19f3b4272d58b72c9396b790e3ebf8e572c29373521",
"typeScriptVersion": "2.2"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Tue, 22 Jan 2019 18:30:40 GMT
* Last updated: Wed, 23 Jan 2019 18:15:27 GMT
* Dependencies: none

@@ -14,0 +14,0 @@ * Global values: none

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc