Skip to content

Commit

Permalink
Merge pull request #93 from hbenl/fix-typings
Browse files Browse the repository at this point in the history
fix typings.
  • Loading branch information
saadtazi authored Jul 31, 2017
2 parents 5c4a98f + 540f570 commit 7f4d958
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
28 changes: 6 additions & 22 deletions lib/firefox_profile.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import ProfileFinder = require('./profile_finder');

declare interface ConstructorOptions {
profileDirectory?: string;
destinationDirectory?: string;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
11 changes: 11 additions & 0 deletions lib/profile_finder.d.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 7f4d958

Please sign in to comment.