alex35mil/sourcebuster-js

Require Typescript Declaration file

Opened this issue · 0 comments

Am using typescript extensively, require d.ts file

Created one on my own but was unable to add the methods, can anyone share the d.ts having methods, here is my d.ts file

declare module "sourcebuster" {
    class sbjs{
        init(prefs:Preferences);
    }


    interface Preferences{
        lifetime?:number
        session_length?:number
        timezone_offset?:number
        campaign_param?:string
        term_param?:string
        content_param?:string
        user_ip?:string
        promocode?:boolean|PromoCode
        typein_attributes?:TypeInAttributes
        domain?:string | Domain
        callback:(data:any)=>void
    }

    interface Domain{
        host:string
    }

    interface TypeInAttributes{
        source:string,
        medium:string
    }

    interface PromoCode{
        max:number,
        min:number
    }
    export = new sbjs();
}