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 0.2.1 to 0.2.2

153

luxon/index.d.ts
// Type definitions for luxon 0.2
// Project: https://github.com/moment/luxon#readme
// Definitions by: Colby DeHart <https://github.com/colbydehart>
// Hyeonseok Yang <https://github.com/FourwingsY>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare module 'luxon' {
namespace luxon {
type DateTimeFormat = any;
type DateTimeFormatOptions = Intl.DateTimeFormatOptions;
type ZoneOptions = {

@@ -13,4 +16,4 @@ keepCalendarTime?: boolean;

type ToFormatOptions = {
round: boolean;
type ToFormatOptions = DateTimeFormatOptions & {
round?: boolean;
};

@@ -20,8 +23,7 @@

suppressMilliseconds?: boolean;
supressSeconds?: boolean;
suppressSeconds?: boolean;
includeOffset?: boolean;
};
type DateTimeOptions = {
zone?: string | Zone;
setZone?: boolean;
type LocaleOptions = {
locale?: string;

@@ -32,8 +34,14 @@ outputCalendar?: string;

type DateTimeJSOptions = {
type DateTimeOptions = LocaleOptions & {
zone?: string | Zone;
setZone?: boolean;
};
type DateTimeJSOptions = LocaleOptions & {
zone?: string | Zone;
};
type DateObjectUnits = {
year?: number;
month?: number;
day?: number;

@@ -50,7 +58,4 @@ ordinal?: number;

type DateObject = DateObjectUnits & {
type DateObject = DateObjectUnits & LocaleOptions & {
zone?: string | Zone;
locale?: string;
outputCalendar?: string;
numberingSystem?: string;
};

@@ -63,22 +68,22 @@

class DateTime {
static DATETIME_FULL: DateTimeFormat;
static DATETIME_FULL_WITH_SECONDS: DateTimeFormat;
static DATEIME_HUGE: DateTimeFormat;
static DATEIME_HUGE_WITH_SECONDS: DateTimeFormat;
static DATETIME_MED: DateTimeFormat;
static DATETIME_MED_WITH_SECONDS: DateTimeFormat;
static DATETIME_SHORT: DateTimeFormat;
static DATETIME_SHORT_WITH_SECONDS: DateTimeFormat;
static DATE_FULL: DateTimeFormat;
static DATE_HUGE: DateTimeFormat;
static DATE_MED: DateTimeFormat;
static DATE_SHORT: DateTimeFormat;
static TIME_24_SIMPLE: DateTimeFormat;
static TIME_24_WITH_LONG_OFFSET: DateTimeFormat;
static TIME_24_WITH_SECONDS: DateTimeFormat;
static TIME_24_WITH_SHORT_OFFSET: DateTimeFormat;
static TIME_SIMPLE: DateTimeFormat;
static TIME_WITH_LONG_OFFSET: DateTimeFormat;
static TIME_WITH_SECONDS: DateTimeFormat;
static TIME_WITH_SHORT_OFFSET: DateTimeFormat;
static DATETIME_FULL: DateTimeFormatOptions;
static DATETIME_FULL_WITH_SECONDS: DateTimeFormatOptions;
static DATEIME_HUGE: DateTimeFormatOptions;
static DATEIME_HUGE_WITH_SECONDS: DateTimeFormatOptions;
static DATETIME_MED: DateTimeFormatOptions;
static DATETIME_MED_WITH_SECONDS: DateTimeFormatOptions;
static DATETIME_SHORT: DateTimeFormatOptions;
static DATETIME_SHORT_WITH_SECONDS: DateTimeFormatOptions;
static DATE_FULL: DateTimeFormatOptions;
static DATE_HUGE: DateTimeFormatOptions;
static DATE_MED: DateTimeFormatOptions;
static DATE_SHORT: DateTimeFormatOptions;
static TIME_24_SIMPLE: DateTimeFormatOptions;
static TIME_24_WITH_LONG_OFFSET: DateTimeFormatOptions;
static TIME_24_WITH_SECONDS: DateTimeFormatOptions;
static TIME_24_WITH_SHORT_OFFSET: DateTimeFormatOptions;
static TIME_SIMPLE: DateTimeFormatOptions;
static TIME_WITH_LONG_OFFSET: DateTimeFormatOptions;
static TIME_WITH_SECONDS: DateTimeFormatOptions;
static TIME_WITH_SHORT_OFFSET: DateTimeFormatOptions;
static fromHTTP(text: string, options?: DateTimeOptions): DateTime;

@@ -106,3 +111,3 @@ static fromISO(text: string, options?: DateTimeOptions): DateTime;

options?: DateTimeOptions
): Object;
): object;
static invalid(reason: any): DateTime;

@@ -119,3 +124,3 @@ static local(

static max(...dateTimes: DateTime[]): DateTime | undefined;
static min(...dateTimes: DateTime[]): DateTime;
static min(...dateTimes: DateTime[]): DateTime | undefined;
static utc(

@@ -148,3 +153,3 @@ year?: number,

offsetNameShort: string;
ordinal: number | DateTime;
ordinal: number;
outputCalendar: string;

@@ -154,3 +159,3 @@ second: number;

weekYear: number;
weekday: string;
weekday: number;
weekdayLong: string;

@@ -170,8 +175,6 @@ weekdayShort: string;

hasSame(other: DateTime, unit: string): boolean;
minus(duration: Duration): DateTime;
minus(milliseconds: number): DateTime;
minus(durationObject: DurationObject): DateTime;
plus(duration: Duration | number | Object): DateTime;
reconfigure(properties: Object): DateTime;
resolvedLocaleOptions(options?: Object): Object;
minus(duration: Duration | number | DurationObject): DateTime;
plus(duration: Duration | number | DurationObject): DateTime;
reconfigure(properties: LocaleOptions): DateTime;
resolvedLocaleOpts(options?: ToFormatOptions): LocaleOptions;
set(values: DateObjectUnits): DateTime;

@@ -183,3 +186,3 @@ setLocale(locale: any): DateTime;

toHTTP(): string;
toISO(options?: Object): string;
toISO(options?: ISOTimeOptions): string;
toISODate(): string;

@@ -191,4 +194,4 @@ toISOTime(options?: ISOTimeOptions): string;

toLocal(): DateTime;
toLocaleParts(options?: Object): any[];
toLocaleString(options?: DateTimeFormat): string;
toLocaleParts(options?: DateTimeFormatOptions): any[];
toLocaleString(options?: DateTimeFormatOptions): string;
toObject(options?: { includeConfig?: boolean }): DateObject;

@@ -211,3 +214,3 @@ toRFC2822(): string;

type DurationObject = {
type DurationObjectUnits = {
years?: number;

@@ -223,2 +226,4 @@ months?: number;

type DurationObject = DurationObjectUnits & DurationOptions;
class Duration {

@@ -231,3 +236,3 @@ static fromISO(text: string, options?: DurationOptions): Duration;

static fromObject(
Object: DurationObject & DurationOptions
Object: DurationObject
): Duration;

@@ -250,8 +255,8 @@ static invalid(reason?: string): Duration;

get(unit: string): number;
minus(duration: Duration | number | Object): Duration;
minus(duration: Duration | number | DurationObject): Duration;
negate(): Duration;
normalize(): Duration;
plus(duration: Duration | number | Object): Duration;
plus(duration: Duration | number | DurationObject): Duration;
reconfigure(objectPattern: DurationOptions): Duration;
set(values: DurationObject): Duration;
set(values: DurationObjectUnits): Duration;
shiftTo(...units: string[]): Duration;

@@ -263,3 +268,3 @@ toFormat(format: string, options?: ToFormatOptions): string;

includeConfig?: boolean;
}): DurationObject & DurationOptions;
}): DurationObject;
toString(): string;

@@ -269,3 +274,3 @@ }

type EraLength = 'short' | 'long';
type UnitLength = EraLength & 'numeric' | '2-digit' | 'narrow';
type UnitLength = EraLength | 'numeric' | '2-digit' | 'narrow';
type UnitOptions = InfoOptions & {

@@ -286,15 +291,15 @@ numberingSystem?: string;

type Info = {
eras(length?: EraLength, options?: InfoOptions): string[];
features(): Features;
hasDST(zone: string | Zone): boolean;
meridiems(options?: InfoOptions): string[];
months(length?: UnitLength, options?: UnitOptions): string[];
monthsFormat(length?: UnitLength, options?: UnitOptions): string[];
weeksdays(length?: UnitLength, options?: UnitOptions): string[];
weekdaysFormat(
namespace Info {
function eras(length?: EraLength, options?: InfoOptions): string[];
function features(): Features;
function hasDST(zone: string | Zone): 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[];
};
}

@@ -355,3 +360,3 @@ type IntervalObject = {

): string;
toISO(options?: Object): string;
toISO(options?: ISOTimeOptions): string;
toString(): string;

@@ -361,12 +366,12 @@ union(other: Interval): Interval;

type Settings = {
defaultLocale: string;
defaultNumberingSystem: string;
defaultOutputCalendar: string;
defaultZone: Zone;
defaultZoneName: string;
now: Function;
throwOnInvalid: boolean;
resetCache(): void;
};
namespace Settings {
let defaultLocale: string;
let defaultNumberingSystem: string;
let defaultOutputCalendar: string;
const defaultZone: Zone;
let defaultZoneName: string;
let throwOnInvalid: boolean;
let now: () => number;
function resetCache(): void;
}

@@ -385,3 +390,3 @@ type ZoneOffsetOptions = {

equals(other: Zone): boolean;
static offset(ts: number): number;
offset(ts: number): number;
}

@@ -388,0 +393,0 @@ }

{
"name": "@types/luxon",
"version": "0.2.1",
"version": "0.2.2",
"description": "TypeScript definitions for luxon",

@@ -11,2 +11,7 @@ "license": "MIT",

"githubUsername": "colbydehart"
},
{
"name": "Hyeonseok Yang",
"url": "https://github.com/FourwingsY",
"githubUsername": "FourwingsY"
}

@@ -21,4 +26,4 @@ ],

"dependencies": {},
"typesPublisherContentHash": "dd460db326793ebf6c2c6fa9c9b4935c7e7d87a1e442ac0a704f8c6127679e8e",
"typeScriptVersion": "2.0"
"typesPublisherContentHash": "797a90adebfea1574d5f7d508ceb1c11fe38e9db8da57786d96006536dc92c18",
"typeScriptVersion": "2.2"
}

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

Additional Details
* Last updated: Tue, 02 Jan 2018 20:55:45 GMT
* Last updated: Wed, 03 Jan 2018 19:51:48 GMT
* Dependencies: none

@@ -17,2 +17,2 @@ * Global values: none

# Credits
These definitions were written by Colby DeHart <https://github.com/colbydehart>.
These definitions were written by Colby DeHart <https://github.com/colbydehart>, Hyeonseok Yang <https://github.com/FourwingsY>.
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