Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add moment-timezone types definition #3577

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,76 @@
/**
* Flowtype definitions for moment-timezone
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.10.0
*/

import * as moment from "moment-timezone";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's quite confusing.

declare module "moment-timezone" {
declare interface MomentZone {
name: string;
abbrs: string[];
untils: number[];
offsets: number[];
population: number;
abbr(timestamp: number): string;
offset(timestamp: number): number;
utcOffset(timestamp: number): number;
parse(timestamp: number): number;
}
declare interface MomentTimezone {
(): moment.Moment;
(timezone: string): moment.Moment;
(date: number, timezone: string): moment.Moment;
(date: number[], timezone: string): moment.Moment;
(date: string, timezone: string): moment.Moment;
(
date: string,
format: moment.MomentFormatSpecification,
timezone: string
): moment.Moment;
(
date: string,
format: moment.MomentFormatSpecification,
strict: boolean,
timezone: string
): moment.Moment;
(
date: string,
format: moment.MomentFormatSpecification,
language: string,
timezone: string
): moment.Moment;
(
date: string,
format: moment.MomentFormatSpecification,
language: string,
strict: boolean,
timezone: string
): moment.Moment;
(date: Date, timezone: string): moment.Moment;
(date: moment.Moment, timezone: string): moment.Moment;
(date: any, timezone: string): moment.Moment;
zone(timezone: string): MomentZone | null;
add(packedZoneString: string): void;
add(packedZoneString: string[]): void;
link(packedLinkString: string): void;
link(packedLinkString: string[]): void;
load(data: {
version: string,
links: string[],
zones: string[],
...
}): void;
names(): string[];
guess(ignoreCache?: boolean): string;
setDefault(timezone?: string): MomentTimezone;
}
declare interface Moment {
tz(): string | void;
tz(timezone: string, keepLocalTime?: boolean): moment.Moment;
zoneAbbr(): string;
zoneName(): string;
}
declare var tz: MomentTimezone;
declare module.exports: typeof moment;
}
@@ -0,0 +1,76 @@
/**
* Flowtype definitions for moment-timezone
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.10.0
*/

import * as moment from "moment-timezone";
declare module "moment-timezone" {
declare interface MomentZone {
name: string;
abbrs: string[];
untils: number[];
offsets: number[];
population: number;
abbr(timestamp: number): string;
offset(timestamp: number): number;
utcOffset(timestamp: number): number;
parse(timestamp: number): number;
}
declare interface MomentTimezone {
(): moment.Moment;
(timezone: string): moment.Moment;
(date: number, timezone: string): moment.Moment;
(date: number[], timezone: string): moment.Moment;
(date: string, timezone: string): moment.Moment;
(
date: string,
format: moment.MomentFormatSpecification,
timezone: string
): moment.Moment;
(
date: string,
format: moment.MomentFormatSpecification,
strict: boolean,
timezone: string
): moment.Moment;
(
date: string,
format: moment.MomentFormatSpecification,
language: string,
timezone: string
): moment.Moment;
(
date: string,
format: moment.MomentFormatSpecification,
language: string,
strict: boolean,
timezone: string
): moment.Moment;
(date: Date, timezone: string): moment.Moment;
(date: moment.Moment, timezone: string): moment.Moment;
(date: any, timezone: string): moment.Moment;
zone(timezone: string): MomentZone | null;
add(packedZoneString: string): void;
add(packedZoneString: string[]): void;
link(packedLinkString: string): void;
link(packedLinkString: string[]): void;
load(data: {
version: string,
links: string[],
zones: string[],
...
}): void;
names(): string[];
guess(ignoreCache?: boolean): string;
setDefault(timezone?: string): MomentTimezone;
}
declare interface Moment {
tz(): string | void;
tz(timezone: string, keepLocalTime?: boolean): moment.Moment;
zoneAbbr(): string;
zoneName(): string;
}
declare var tz: MomentTimezone;
declare module.exports: typeof moment;
}