Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 9f10702

Browse files
committed
export interfaces
1 parent 40de77a commit 9f10702

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

lib/global-modules.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import { SegmentAnalytics } from './index.d';
2+
13
declare global {
24
namespace NodeJS {
35
interface Global {
4-
analytics: any;
6+
analytics: SegmentAnalytics.AnalyticsJS;
57
}
68
}
79
interface Window {
8-
analytics: any;
10+
analytics: SegmentAnalytics.AnalyticsJS;
911
jQuery: any;
1012
Zepto: any;
1113
}

lib/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare namespace SegmentAnalytics {
1+
export declare namespace SegmentAnalytics {
22
interface SegmentOpts {
33
integrations?: any;
44
anonymousId?: string;

lib/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
import { SegmentAnalytics } from './index.d';
4+
35
/**
46
* Analytics.js
57
*
@@ -9,7 +11,7 @@
911
var Analytics = require('./analytics');
1012

1113
// Create a new `analytics` singleton.
12-
var analytics = new Analytics();
14+
var analytics: SegmentAnalytics.AnalyticsJS = new Analytics();
1315

1416
// Expose `require`.
1517
// TODO(ndhoule): Look into deprecating, we no longer need to expose it in tests

0 commit comments

Comments
 (0)