From 540f570178571119d3db95768092a9b9dd1dd200 Mon Sep 17 00:00:00 2001 From: Holger Benl Date: Sun, 30 Jul 2017 18:59:53 +0200 Subject: [PATCH] fix typings --- lib/firefox_profile.d.ts | 28 ++++++---------------------- lib/profile_finder.d.ts | 11 +++++++++++ 2 files changed, 17 insertions(+), 22 deletions(-) create mode 100644 lib/profile_finder.d.ts diff --git a/lib/firefox_profile.d.ts b/lib/firefox_profile.d.ts index c8b2cab..8f9f9e3 100644 --- a/lib/firefox_profile.d.ts +++ b/lib/firefox_profile.d.ts @@ -1,3 +1,5 @@ +import ProfileFinder = require('./profile_finder'); + declare interface ConstructorOptions { profileDirectory?: string; destinationDirectory?: string; @@ -32,19 +34,6 @@ declare interface ManualProxySettings { declare type ProxySettings = NoProxySettings | SystemProxySettings | AutomaticProxySettings | ManualProxySettings; -declare class ProfileFinder { - constructor(directory?: string); - directory: string; - hasReadProfiles: boolean; - profiles: string[]; - readProfiles(cb: (err: Error | null, profiles?: string[]) => void): void; - getPath(name: string, cb: (err: Error | null, path: string | undefined) => void): string | undefined; -} - -declare namespace ProfileFinder { - function locateUserDirectory(platform?: string): string | undefined; -} - declare interface AddonDetails { id: string; name: string; @@ -54,6 +43,9 @@ declare interface AddonDetails { } declare class FirefoxProfile { + static copy(options: ConstructorOptions | string | null | undefined, cb: (err: Error | null, profile?: FirefoxProfile) => void): void; + static copyFromUserProfile(options: CopyFromUserProfileOptions, cb: (err: Error | null, profile?: FirefoxProfile) => void): void; + static Finder: typeof ProfileFinder; constructor(options?: ConstructorOptions | string); defaultPreferences: any; deleteDir(cb: () => void): void; @@ -75,12 +67,4 @@ declare class FirefoxProfile { setProxy(proxySettings: ProxySettings): void; } -declare namespace FirefoxProfile { - function copy(options: ConstructorOptions | string | null | undefined, cb: (err: Error | null, profile?: FirefoxProfile) => void): void; - function copyFromUserProfile(options: CopyFromUserProfileOptions, cb: (err: Error | null, profile?: FirefoxProfile) => void): void; - var Finder: typeof ProfileFinder; -} - -declare module "firefox-profile" { - export = FirefoxProfile; -} +export = FirefoxProfile; diff --git a/lib/profile_finder.d.ts b/lib/profile_finder.d.ts new file mode 100644 index 0000000..7ab6587 --- /dev/null +++ b/lib/profile_finder.d.ts @@ -0,0 +1,11 @@ +declare class ProfileFinder { + static locateUserDirectory(platform?: string): string | undefined; + constructor(directory?: string); + directory: string; + hasReadProfiles: boolean; + profiles: string[]; + readProfiles(cb: (err: Error | null, profiles?: string[]) => void): void; + getPath(name: string, cb: (err: Error | null, path: string | undefined) => void): string | undefined; +} + +export = ProfileFinder;