Skip to content

Instantly share code, notes, and snippets.

@bonnici
Created November 25, 2012 22:33
Show Gist options
  • Save bonnici/4145699 to your computer and use it in GitHub Desktop.
Save bonnici/4145699 to your computer and use it in GitHub Desktop.
TimezoneJs node definition (WIP)
declare module "timezone-js" {
export var timezone : TimezoneJs;
export var Date: {
new (timezone?: string): TimezoneJsDate;
new (time: string, timezone?: string): TimezoneJsDate;
new (year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: string, timezone?: string): TimezoneJsDate;
};
}
interface TimezoneJs {
zoneFileBasePath: string;
loadingScheme: TimezoneJsLoadingScheme;
loadingSchemes: TimezoneJsLoadingSchemes;
transport: (opts: TimezoneJsOptions) => any;
init: (opts?: TimezoneJsOptions) => any;
};
interface TimezoneJsOptions {
async?: bool;
success?: (data: string) => any;
error?: (err: Error) => any;
url?: string;
};
interface TimezoneJsLoadingScheme {
};
interface TimezoneJsLoadingSchemes {
PRELOAD_ALL: TimezoneJsLoadingScheme;
LAZY_LOAD: TimezoneJsLoadingScheme;
MANUAL_LOAD: TimezoneJsLoadingScheme;
};
interface TimezoneJsDate extends Date {
setTimezone: (timezone: string) => void;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment